From 17934f761e1161597b96a9a37bb134aee43f17f4 Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Tue, 31 Oct 2023 02:12:39 +0100 Subject: [PATCH] [Temp] Revert "Upgrade XGS saibcm-modules to 8.4 (#16246)" This reverts commit 2c0f4e57d77ec553baa634e1de8c1150f7d36dd6. --- platform/broadcom/sai-modules.mk | 2 +- .../broadcom/saibcm-modules/debian/changelog | 6 - .../debian/opennsl-modules.install | 6 +- .../broadcom/saibcm-modules/include/ibde.h | 18 - .../broadcom/saibcm-modules/include/kcom.h | 16 - .../saibcm-modules/include/soc/devids.h | 101 +- .../broadcom/saibcm-modules/make/Make.config | 2 + .../broadcom/saibcm-modules/make/Make.kernlib | 12 + .../broadcom/saibcm-modules/make/Make.lib | 17 +- .../broadcom/saibcm-modules/make/Make.subdirs | 18 +- .../saibcm-modules/make/Makefile.linux-gts | 7 +- .../make/Makefile.linux-iproc_64 | 1 + .../saibcm-modules/make/Makefile.linux-kernel | 9 + .../make/Makefile.linux-kernel-2_6 | 9 + .../make/Makefile.linux-kernel-3_6 | 9 + .../make/Makefile.linux-kernel-4_4 | 10 + .../make/Makefile.linux-kmodule | 86 +- .../saibcm-modules/make/Makefile.linux-xlr | 7 +- .../broadcom/saibcm-modules/sdklt/Makefile | 40 +- .../bcm56780_a0/bcm56780_a0_pdma_attach.c | 2 +- .../bcm56880_a0/bcm56880_a0_pdma_attach.c | 2 +- .../bcm56890_a0/bcm56890_a0_pdma_attach.c | 38 - .../bcm56990_a0/bcm56990_a0_pdma_attach.c | 2 +- .../bcm56990_b0/bcm56990_b0_pdma_attach.c | 2 +- .../bcm56995_a0_pdma_attach.c} | 8 +- .../bcm56996_a0/bcm56996_a0_pdma_attach.c | 2 +- .../bcm56996_b0/bcm56996_b0_pdma_attach.c | 2 +- .../bcm56998_a0/bcm56998_a0_pdma_attach.c | 2 +- .../bcm56999_a0/bcm56999_a0_pdma_attach.c | 38 - .../bcm78900_b0/bcm78900_b0_pdma_attach.c | 38 - .../bcmcnet/hmi/cmicd/bcmcnet_cmicd_pdma_hw.c | 56 +- .../hmi/cmicd/bcmcnet_cmicd_pdma_rxtx.c | 221 ++- .../bcmcnet/hmi/cmicr/bcmcnet_cmicr_pdma_hw.c | 667 --------- .../hmi/cmicr/bcmcnet_cmicr_pdma_rxtx.c | 1187 ----------------- .../bcmcnet/hmi/cmicx/bcmcnet_cmicx_pdma_hw.c | 50 +- .../hmi/cmicx/bcmcnet_cmicx_pdma_rxtx.c | 229 ++-- .../bcmcnet/include/bcmcnet/bcmcnet_cmicd.h | 2 +- .../bcmcnet/include/bcmcnet/bcmcnet_cmicr.h | 199 --- .../include/bcmcnet/bcmcnet_cmicr_acc.h | 791 ----------- .../bcmcnet/include/bcmcnet/bcmcnet_cmicx.h | 2 +- .../bcmcnet/include/bcmcnet/bcmcnet_core.h | 32 +- .../bcmcnet/include/bcmcnet/bcmcnet_dev.h | 2 +- .../include/bcmcnet/bcmcnet_internal.h | 2 +- .../bcmcnet/include/bcmcnet/bcmcnet_rxtx.h | 27 +- .../bcmcnet/include/bcmcnet/bcmcnet_types.h | 8 +- .../sdklt/bcmcnet/main/bcmcnet_core.c | 52 +- .../sdklt/bcmcnet/main/bcmcnet_dev.c | 50 +- .../sdklt/bcmcnet/main/bcmcnet_rxtx.c | 41 +- .../bcmdrd/include/bcmdrd/bcmdrd_devlist.h | 246 +--- .../sdklt/bcmdrd/include/bcmdrd_config.h | 96 +- .../bcmdrd/include/bcmdrd_config_chips.h | 482 +------ .../bcmlrd/include/bcmlrd/bcmlrd_variant.h | 40 - .../include/bcmlrd/chip/bcmlrd_chip_variant.h | 48 - .../bcmltd/include/bcmltd/bcmltd_variant.h | 64 - .../include/bcmltd/chip/bcmltd_chip_variant.h | 42 - .../include/bcmltd/chip/bcmltd_variant_defs.h | 28 - .../bcm56080_a0/bcm56080_a0_ltd_variant_def.h | 37 - .../bcm56780_a0/bcm56780_a0_ltd_variant_def.h | 37 - .../bcm56780_a0_cna_1_2_13_ltd_variant_def.h | 37 - .../bcm56780_a0_dna_2_9_5_0_ltd_variant_def.h | 37 - ...bcm56780_a0_hna_1_2_10_0_ltd_variant_def.h | 37 - .../bcm56880_a0/bcm56880_a0_ltd_variant_def.h | 37 - .../bcm56880_a0_cna_1_2_13_ltd_variant_def.h | 37 - ...bcm56880_a0_dna_4_11_4_0_ltd_variant_def.h | 37 - ...bcm56880_a0_hna_1_2_10_0_ltd_variant_def.h | 37 - .../utcfg/bcm56880_a0_utcfg_ltd_variant_def.h | 37 - .../utlrd/bcm56880_a0_utlrd_ltd_variant_def.h | 37 - .../utltm/bcm56880_a0_utltm_ltd_variant_def.h | 37 - .../bcm56890_a0/bcm56890_a0_ltd_variant_def.h | 37 - ...bcm56890_a0_dna_4_0_17_0_ltd_variant_def.h | 37 - .../bcm56990_a0/bcm56990_a0_ltd_variant_def.h | 37 - .../bcm56990_b0/bcm56990_b0_ltd_variant_def.h | 37 - .../bcm56996_a0/bcm56996_a0_ltd_variant_def.h | 37 - .../bcm56996_b0/bcm56996_b0_ltd_variant_def.h | 37 - .../bcm56998_a0/bcm56998_a0_ltd_variant_def.h | 37 - .../bcm56999_a0/bcm56999_a0_ltd_variant_def.h | 37 - .../bcm78900_b0/bcm78900_b0_ltd_variant_def.h | 37 - .../bcm56080_a0_ltd_variant_entry.h | 40 - .../bcm56780_a0_ltd_variant_entry.h | 40 - ...bcm56780_a0_cna_1_2_13_ltd_variant_entry.h | 40 - ...cm56780_a0_dna_2_9_5_0_ltd_variant_entry.h | 40 - ...m56780_a0_hna_1_2_10_0_ltd_variant_entry.h | 40 - .../bcm56880_a0_ltd_variant_entry.h | 40 - ...bcm56880_a0_cna_1_2_13_ltd_variant_entry.h | 40 - ...m56880_a0_dna_4_11_4_0_ltd_variant_entry.h | 40 - ...m56880_a0_hna_1_2_10_0_ltd_variant_entry.h | 40 - .../bcm56880_a0_utcfg_ltd_variant_entry.h | 40 - .../bcm56880_a0_utlrd_ltd_variant_entry.h | 40 - .../bcm56880_a0_utltm_ltd_variant_entry.h | 40 - .../bcm56890_a0_ltd_variant_entry.h | 40 - ...m56890_a0_dna_4_0_17_0_ltd_variant_entry.h | 40 - .../bcm56990_a0_ltd_variant_entry.h | 40 - .../bcm56990_b0_ltd_variant_entry.h | 40 - .../bcm56996_a0_ltd_variant_entry.h | 40 - .../bcm56996_b0_ltd_variant_entry.h | 40 - .../bcm56998_a0_ltd_variant_entry.h | 40 - .../bcm56999_a0_ltd_variant_entry.h | 40 - .../bcm78900_b0_ltd_variant_entry.h | 40 - .../saibcm-modules/sdklt/linux/bde/Kbuild | 8 +- .../saibcm-modules/sdklt/linux/bde/Makefile | 9 +- .../saibcm-modules/sdklt/linux/bde/ngbde.h | 9 +- .../sdklt/linux/bde/ngbde_dma.c | 26 +- .../sdklt/linux/bde/ngbde_iio.c | 2 +- .../sdklt/linux/bde/ngbde_intr.c | 19 +- .../sdklt/linux/bde/ngbde_ioctl.c | 10 +- .../sdklt/linux/bde/ngbde_iproc_probe.c | 4 +- .../sdklt/linux/bde/ngbde_kapi.c | 2 +- .../sdklt/linux/bde/ngbde_main.c | 4 +- .../sdklt/linux/bde/ngbde_paxb.c | 2 +- .../sdklt/linux/bde/ngbde_pci_probe.c | 6 +- .../sdklt/linux/bde/ngbde_pgmem.c | 6 +- .../sdklt/linux/bde/ngbde_pio.c | 2 +- .../sdklt/linux/bde/ngbde_procfs.c | 23 +- .../sdklt/linux/bde/ngbde_swdev.c | 2 +- .../sdklt/linux/include/lkm/lkm.h | 17 +- .../sdklt/linux/include/lkm/ngbde_ioctl.h | 9 +- .../sdklt/linux/include/lkm/ngbde_kapi.h | 2 +- .../sdklt/linux/include/lkm/ngedk_ioctl.h | 24 +- .../sdklt/linux/include/lkm/ngknet_dev.h | 29 +- .../sdklt/linux/include/lkm/ngknet_ioctl.h | 2 +- .../sdklt/linux/include/lkm/ngknet_kapi.h | 379 ------ .../saibcm-modules/sdklt/linux/knet/Kbuild | 13 +- .../saibcm-modules/sdklt/linux/knet/Makefile | 37 +- .../linux/knet/include/bcmcnet/bcmcnet_buff.h | 1 + .../knet/include/bcmcnet/bcmcnet_cmicd.h | 1 + .../knet/include/bcmcnet/bcmcnet_cmicx.h | 1 + .../linux/knet/include/bcmcnet/bcmcnet_core.h | 1 + .../linux/knet/include/bcmcnet/bcmcnet_dep.h | 1 + .../linux/knet/include/bcmcnet/bcmcnet_dev.h | 1 + .../knet/include/bcmcnet/bcmcnet_internal.h | 1 + .../linux/knet/include/bcmcnet/bcmcnet_rxtx.h | 1 + .../knet/include/bcmcnet/bcmcnet_types.h | 1 + .../sdklt/linux/knet/ngknet_buff.c | 151 +-- .../sdklt/linux/knet/ngknet_buff.h | 6 +- .../sdklt/linux/knet/ngknet_callback.c | 99 +- .../sdklt/linux/knet/ngknet_callback.h | 358 ++++- .../sdklt/linux/knet/ngknet_dep.h | 7 +- .../sdklt/linux/knet/ngknet_extra.c | 22 +- .../sdklt/linux/knet/ngknet_extra.h | 2 +- .../sdklt/linux/knet/ngknet_linux.c | 16 +- .../sdklt/linux/knet/ngknet_linux.h | 120 +- .../sdklt/linux/knet/ngknet_main.c | 350 ++--- .../sdklt/linux/knet/ngknet_main.h | 62 +- .../sdklt/linux/knet/ngknet_procfs.c | 166 ++- .../sdklt/linux/knet/ngknet_procfs.h | 2 +- .../sdklt/linux/knet/ngknet_ptp.c | 53 +- .../sdklt/linux/knet/ngknet_ptp.h | 2 +- .../saibcm-modules/sdklt/linux/knetcb/Kbuild | 37 +- .../sdklt/linux/knetcb/Makefile | 11 +- .../sdklt/linux/knetcb/ngknetcb_main.c | 101 +- .../sdklt/linux/knetcb/psample-cb.c | 173 +-- .../sdklt/linux/knetcb/psample-cb.h | 7 +- .../broadcom/saibcm-modules/sdklt/make/lkm.mk | 2 +- .../sdklt/shr/include/shr/shr_error.h | 2 +- .../systems/bde/linux/include/linux-bde.h | 3 - .../systems/bde/linux/kernel/Makefile | 64 +- .../bde/linux/kernel/linux-kernel-bde.c | 364 ++--- .../systems/bde/linux/kernel/linux_dma.c | 24 +- .../bde/linux/user/kernel/linux-user-bde.c | 62 - .../linux/kernel/modules/bcm-knet/Makefile | 57 +- .../linux/kernel/modules/bcm-knet/bcm-knet.c | 573 +++----- .../linux/kernel/modules/include/bcm-knet.h | 3 +- .../linux/kernel/modules/include/lkm.h | 2 +- .../linux/kernel/modules/knet-cb/Makefile | 53 +- .../linux/kernel/modules/knet-cb/knet-cb.c | 26 +- .../linux/kernel/modules/knet-cb/psample-cb.c | 33 +- .../linux/kernel/modules/knet-cb/psample-cb.h | 2 +- .../linux/kernel/modules/shared/gmodule.c | 10 +- .../linux/kernel/modules/shared/ksal.c | 6 +- .../systems/linux/user/common/Makefile | 3 +- .../systems/linux/user/gts/Makefile | 2 +- .../systems/linux/user/xlr/Makefile | 2 +- 172 files changed, 1966 insertions(+), 8520 deletions(-) delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56890_a0/bcm56890_a0_pdma_attach.c rename platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/{bcm56080_a0/bcm56080_a0_pdma_attach.c => bcm56995_a0/bcm56995_a0_pdma_attach.c} (81%) delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56999_a0/bcm56999_a0_pdma_attach.c delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm78900_b0/bcm78900_b0_pdma_attach.c delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicr/bcmcnet_cmicr_pdma_hw.c delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicr/bcmcnet_cmicr_pdma_rxtx.c delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicr.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicr_acc.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmlrd/include/bcmlrd/bcmlrd_variant.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmlrd/include/bcmlrd/chip/bcmlrd_chip_variant.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/bcmltd_variant.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/chip/bcmltd_chip_variant.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/chip/bcmltd_variant_defs.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56080_a0/bcm56080_a0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/bcm56780_a0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/cna_1_2_13/bcm56780_a0_cna_1_2_13_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/dna_2_9_5_0/bcm56780_a0_dna_2_9_5_0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/hna_1_2_10_0/bcm56780_a0_hna_1_2_10_0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/bcm56880_a0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/cna_1_2_13/bcm56880_a0_cna_1_2_13_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/dna_4_11_4_0/bcm56880_a0_dna_4_11_4_0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/hna_1_2_10_0/bcm56880_a0_hna_1_2_10_0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/utcfg/bcm56880_a0_utcfg_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/utlrd/bcm56880_a0_utlrd_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/utltm/bcm56880_a0_utltm_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56890_a0/bcm56890_a0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56890_a0/dna_4_0_17_0/bcm56890_a0_dna_4_0_17_0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56990_a0/bcm56990_a0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56990_b0/bcm56990_b0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56996_a0/bcm56996_a0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56996_b0/bcm56996_b0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56998_a0/bcm56998_a0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56999_a0/bcm56999_a0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm78900_b0/bcm78900_b0_ltd_variant_def.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56080_a0/bcm56080_a0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/bcm56780_a0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/cna_1_2_13/bcm56780_a0_cna_1_2_13_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/dna_2_9_5_0/bcm56780_a0_dna_2_9_5_0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/hna_1_2_10_0/bcm56780_a0_hna_1_2_10_0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/bcm56880_a0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/cna_1_2_13/bcm56880_a0_cna_1_2_13_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/dna_4_11_4_0/bcm56880_a0_dna_4_11_4_0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/hna_1_2_10_0/bcm56880_a0_hna_1_2_10_0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/utcfg/bcm56880_a0_utcfg_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/utlrd/bcm56880_a0_utlrd_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/utltm/bcm56880_a0_utltm_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56890_a0/bcm56890_a0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56890_a0/dna_4_0_17_0/bcm56890_a0_dna_4_0_17_0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56990_a0/bcm56990_a0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56990_b0/bcm56990_b0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56996_a0/bcm56996_a0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56996_b0/bcm56996_b0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56998_a0/bcm56998_a0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56999_a0/bcm56999_a0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm78900_b0/bcm78900_b0_ltd_variant_entry.h delete mode 100644 platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_kapi.h create mode 120000 platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_buff.h create mode 120000 platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_cmicd.h create mode 120000 platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_cmicx.h create mode 120000 platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_core.h create mode 120000 platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_dep.h create mode 120000 platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_dev.h create mode 120000 platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_internal.h create mode 120000 platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_rxtx.h create mode 120000 platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_types.h mode change 100755 => 100644 platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.c mode change 100755 => 100644 platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.h mode change 100755 => 100644 platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/bcm-knet.c diff --git a/platform/broadcom/sai-modules.mk b/platform/broadcom/sai-modules.mk index dce19b6227c6..5aa7792064cb 100644 --- a/platform/broadcom/sai-modules.mk +++ b/platform/broadcom/sai-modules.mk @@ -1,6 +1,6 @@ # Broadcom SAI modules -BRCM_OPENNSL_KERNEL_VERSION = 8.4.0.2 +BRCM_OPENNSL_KERNEL_VERSION = 7.1.0.0 BRCM_OPENNSL_KERNEL = opennsl-modules_$(BRCM_OPENNSL_KERNEL_VERSION)_amd64.deb $(BRCM_OPENNSL_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/saibcm-modules diff --git a/platform/broadcom/saibcm-modules/debian/changelog b/platform/broadcom/saibcm-modules/debian/changelog index 9233f775a806..daa78471c6b2 100644 --- a/platform/broadcom/saibcm-modules/debian/changelog +++ b/platform/broadcom/saibcm-modules/debian/changelog @@ -1,9 +1,3 @@ -opennsl (8.4.0.2) unstable; urgency=medium - - * Update to Broadcom SAI 8.4.0.2 - - -- Ziting Guo Tue, Sep 5 02:25:03 2023 +0000 - opennsl (7.1.0.0) unstable; urgency=medium * Update to Broadcom SAI 7.1.0.0. diff --git a/platform/broadcom/saibcm-modules/debian/opennsl-modules.install b/platform/broadcom/saibcm-modules/debian/opennsl-modules.install index 1bd3f6d744ff..7d9d7b192cda 100644 --- a/platform/broadcom/saibcm-modules/debian/opennsl-modules.install +++ b/platform/broadcom/saibcm-modules/debian/opennsl-modules.install @@ -3,6 +3,6 @@ systems/linux/user/x86-smp_generic_64-2_6/linux-kernel-bde.ko lib/modules/5.10.0 systems/linux/user/x86-smp_generic_64-2_6/linux-user-bde.ko lib/modules/5.10.0-23-2-amd64/extra systems/linux/user/x86-smp_generic_64-2_6/linux-knet-cb.ko lib/modules/5.10.0-23-2-amd64/extra systemd/opennsl-modules.service lib/systemd/system -sdklt/build/bde/linux_ngbde.ko lib/modules/5.10.0-23-2-amd64/extra -sdklt/build/knet/linux_ngknet.ko lib/modules/5.10.0-23-2-amd64/extra -sdklt/build/knetcb/linux_ngknetcb.ko lib/modules/5.10.0-23-2-amd64/extra +sdklt/linux/bde/linux_ngbde.ko lib/modules/5.10.0-23-2-amd64/extra +sdklt/linux/knet/linux_ngknet.ko lib/modules/5.10.0-23-2-amd64/extra +sdklt/linux/knetcb/linux_ngknetcb.ko lib/modules/5.10.0-23-2-amd64/extra diff --git a/platform/broadcom/saibcm-modules/include/ibde.h b/platform/broadcom/saibcm-modules/include/ibde.h index 12f507ea6fd2..d71d487f03e5 100644 --- a/platform/broadcom/saibcm-modules/include/ibde.h +++ b/platform/broadcom/saibcm-modules/include/ibde.h @@ -88,7 +88,6 @@ typedef struct ibde_s { #define BDE_AXI_DEV_TYPE SAL_AXI_DEV_TYPE /* AXI device */ #define BDE_EMMI_DEV_TYPE SAL_EMMI_DEV_TYPE /* EMMI device */ #define BDE_COMPOSITE_DEV_TYPE SAL_COMPOSITE_DEV_TYPE /* Composite device, composed of sub-devices with buses */ -#define BDE_SUB_DEV_TYPE SAL_SUB_DEV_TYPE /* A sub-device (with a bus) of a composite device */ #define BDE_USER_DEV_TYPE SAL_USER_DEV_TYPE /* The user implements his own method of access to the device */ #define BDE_DEV_BUS_ALT SAL_DEV_BUS_ALT /* Alternate Access */ #define BDE_DEV_BUS_MSI SAL_DEV_BUS_MSI /* Message-signaled interrupts */ @@ -187,23 +186,6 @@ typedef struct ibde_s { uint64 (*read64)(int d, uint32 addr); void (*write64)(int d, uint32 addr, uint64 data); - /* - * Probe for new devices. - * - * This function will normally be called implicitly by the BDE - * initialization function, but it may be called at a later time - * by the application to detect removed or added devices. - * - * Existing devices are not affected by this operation. - * - * If a device has been hot-swapped, then it will be assigned the - * same resources as before the hot-swap. - * - * Return value: - * 0: Device probe completed successfully. - * -1: An error happened during device probe. - */ - int (*probe)(void); } ibde_t; diff --git a/platform/broadcom/saibcm-modules/include/kcom.h b/platform/broadcom/saibcm-modules/include/kcom.h index 341ddd0f70d2..4771033c6b04 100644 --- a/platform/broadcom/saibcm-modules/include/kcom.h +++ b/platform/broadcom/saibcm-modules/include/kcom.h @@ -72,7 +72,6 @@ #define KCOM_M_DBGPKT_GET 42 /* Get debug packet function info */ #define KCOM_M_WB_CLEANUP 51 /* Clean up for warmbooting */ #define KCOM_M_CLOCK_CMD 52 /* Clock Commands */ -#define KCOM_M_PCIE_LINK_STATUS 53 /* PCIe link status */ #define KCOM_VERSION 13 /* Protocol version */ @@ -368,7 +367,6 @@ typedef struct kcom_msg_version_s { #define KSYNC_M_HW_TS_DISABLE 3 #define KSYNC_M_MTP_TS_UPDATE_ENABLE 4 #define KSYNC_M_MTP_TS_UPDATE_DISABLE 5 -#define KSYNC_M_DNX_JR2DEVS_SYS_CONFIG 6 typedef struct kcom_clock_info_s { uint8 cmd; @@ -434,7 +432,6 @@ typedef struct kcom_msg_hw_init_s { uint32 udh_size; uint32 oamp_punted; uint8 no_skip_udh_check; - uint8 oam_dm_tod_exist; uint8 system_headers_mode; uint8 udh_enable; /* @@ -484,18 +481,6 @@ typedef struct kcom_msg_wb_cleanup_s { uint32 flags; } kcom_msg_wb_cleanup_t; -/* PCIE Link status */ -#define PCIE_LINK_STATUS_UP 0x0 -#define PCIE_LINK_STATUS_DOWN 0x1 - -/* - * Update PCIe link status. - */ -typedef struct kcom_msg_pcie_link_status_s { - kcom_msg_hdr_t hdr; - int pcie_link_status; -} kcom_msg_pcie_link_status_t; - /* * Create new system network interface. The network interface will * be associated with the specified switch unit number. @@ -621,7 +606,6 @@ typedef union kcom_msg_s { kcom_msg_dbg_pkt_get_t dbg_pkt_get; kcom_msg_wb_cleanup_t wb_cleanup; kcom_msg_clock_cmd_t clock_cmd; - kcom_msg_pcie_link_status_t pcie_link_status; } kcom_msg_t; /* diff --git a/platform/broadcom/saibcm-modules/include/soc/devids.h b/platform/broadcom/saibcm-modules/include/soc/devids.h index edbdef32b285..8a67d385d930 100644 --- a/platform/broadcom/saibcm-modules/include/soc/devids.h +++ b/platform/broadcom/saibcm-modules/include/soc/devids.h @@ -25,7 +25,7 @@ * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* - * Copyright: (c) 2022 Broadcom. + * Copyright: (c) 2021 Broadcom. * All Rights Reserved. */ @@ -1386,6 +1386,10 @@ #define BCM56768_A0_REV_ID 1 #define BCM56768_B0_REV_ID 0x11 +#define BCM56068_DEVICE_ID 0xb068 +#define BCM56068_A0_REV_ID 1 +#define BCM56068_B0_REV_ID 0x11 + #define BCM56068_DEVICE_ID 0xb068 #define BCM56068_A0_REV_ID 1 #define BCM56068_B0_REV_ID 0x11 @@ -1528,9 +1532,6 @@ #define BCM53549_DEVICE_ID 0x8549 #define BCM53549_A0_REV_ID 1 -#define BCM53642_DEVICE_ID 0x8642 -#define BCM53642_A0_REV_ID 1 - #define BCM5665_DEVICE_ID 0x5665 #define BCM5665_A0_REV_ID 1 #define BCM5665_B0_REV_ID 0x11 @@ -1548,6 +1549,8 @@ #define BROADCOM_PHYID_HIGH 0x0040 +#define GEDI_DEVICE_ID 0xa100 +#define GEDI_REV_ID 0x0001 #define ARAD_DEVICE_ID 0x8650 #define ARAD_A0_REV_ID 0x0000 #define ARAD_B0_REV_ID 0x0011 @@ -1577,7 +1580,6 @@ #define BCM88956_A1_REV_ID 0x0002 #define DNXC_A0_REV_ID 0x0001 #define DNXC_A1_REV_ID 0x0002 -#define DNXC_A2_REV_ID 0x0003 #define DNXC_B0_REV_ID 0x0011 #define DNXC_B1_REV_ID 0x0012 #define DNXC_DEVID_FAMILY_MASK 0xfff0 @@ -1599,42 +1601,6 @@ #define BCM8879D_DEVICE_ID 0x879D #define BCM8879E_DEVICE_ID 0x879E #define BCM8879F_DEVICE_ID 0x879F -#ifdef BCM_DNXF3_SUPPORT -#define BCM88910_DEVICE_ID 0x8910 -#define BCM88910_A0_REV_ID DNXC_A0_REV_ID -#define BCM88911_DEVICE_ID 0x8911 -#define BCM88912_DEVICE_ID 0x8912 -#define BCM88913_DEVICE_ID 0x8913 -#define BCM88914_DEVICE_ID 0x8914 -#define BCM88915_DEVICE_ID 0x8915 -#define BCM88916_DEVICE_ID 0x8916 -#define BCM88917_DEVICE_ID 0x8917 -#define BCM88918_DEVICE_ID 0x8918 -#define BCM88919_DEVICE_ID 0x8919 -#define BCM8891A_DEVICE_ID 0x891A -#define BCM8891B_DEVICE_ID 0x891B -#define BCM8891C_DEVICE_ID 0x891C -#define BCM8891D_DEVICE_ID 0x891D -#define BCM8891E_DEVICE_ID 0x891E -#define BCM8891F_DEVICE_ID 0x891F -#define BCM88920_DEVICE_ID 0x8920 -#define BCM88920_A0_REV_ID DNXC_A0_REV_ID -#define BCM88921_DEVICE_ID 0x8921 -#define BCM88922_DEVICE_ID 0x8922 -#define BCM88923_DEVICE_ID 0x8923 -#define BCM88924_DEVICE_ID 0x8924 -#define BCM88925_DEVICE_ID 0x8925 -#define BCM88926_DEVICE_ID 0x8926 -#define BCM88927_DEVICE_ID 0x8927 -#define BCM88928_DEVICE_ID 0x8928 -#define BCM88929_DEVICE_ID 0x8929 -#define BCM8892A_DEVICE_ID 0x892A -#define BCM8892B_DEVICE_ID 0x892B -#define BCM8892C_DEVICE_ID 0x892C -#define BCM8892D_DEVICE_ID 0x892D -#define BCM8892E_DEVICE_ID 0x892E -#define BCM8892F_DEVICE_ID 0x892F -#endif #define ARADPLUS_DEVICE_ID 0x8660 #define ARADPLUS_A0_REV_ID 0x0001 #define BCM88660_DEVICE_ID ARADPLUS_DEVICE_ID @@ -1840,11 +1806,9 @@ #define J2P_DEVICE_ID 0x8850 #define J2P_A0_REV_ID DNXC_A0_REV_ID #define J2P_A1_REV_ID DNXC_A1_REV_ID -#define J2P_A2_REV_ID DNXC_A2_REV_ID #define BCM88850_DEVICE_ID J2P_DEVICE_ID #define BCM88850_A0_REV_ID J2P_A0_REV_ID #define BCM88850_A1_REV_ID J2P_A1_REV_ID -#define BCM88850_A2_REV_ID J2P_A2_REV_ID #define BCM88851_DEVICE_ID 0x8851 #define BCM88852_DEVICE_ID 0x8852 #define BCM88853_DEVICE_ID 0x8853 @@ -1878,10 +1842,6 @@ #define BCM8884E_DEVICE_ID 0x884E #define BCM8884F_DEVICE_ID 0x884F -#define J2X_DEVICE_ID 0x8830 -#define J2X_A0_REV_ID DNXC_A0_REV_ID -#define BCM88830_DEVICE_ID J2X_DEVICE_ID -#define BCM88830_A0_REV_ID J2X_A0_REV_ID #define BCM88831_DEVICE_ID 0x8831 #define BCM88832_DEVICE_ID 0x8832 #define BCM88833_DEVICE_ID 0x8833 @@ -1898,16 +1858,6 @@ #define BCM8883E_DEVICE_ID 0x883E #define BCM8883F_DEVICE_ID 0x883F -#ifdef BCM_DNX3_SUPPORT -#define JERICHO3_DEVICE_ID 0x8860 -#define JERICHO3_A0_REV_ID DNXC_A0_REV_ID -#define BCM88860_DEVICE_ID JERICHO3_DEVICE_ID -#define BCM88860_A0_REV_ID JERICHO3_A0_REV_ID -#define Q4_DEVICE_ID 0x8870 -#define Q4_A0_REV_ID DNXC_A0_REV_ID -#define BCM88870_DEVICE_ID Q4_DEVICE_ID -#define BCM88870_A0_REV_ID Q4_A0_REV_ID -#endif #define Q2A_DEVICE_ID 0x8480 #define Q2A_A0_REV_ID DNXC_A0_REV_ID @@ -2046,10 +1996,14 @@ #define BCM88952_A0_REV_ID 0x0001 #define BCM88952_A1_REV_ID 0x0002 -#define PLX9056_DEVICE_ID 0x9056 +#define PCP_PCI_VENDOR_ID 0x1172 +#define PCP_PCI_DEVICE_ID 0x4 -#define BCM56890_DEVICE_ID 0xb890 -#define BCM56890_A0_REV_ID 0x0001 +#define ACP_PCI_VENDOR_ID 0x10ee +#define ACP_PCI_DEVICE_ID 0x7011 +#define ACP_PCI_REV_ID 0x0001 + +#define PLX9056_DEVICE_ID 0x9056 #define BCM56880_DEVICE_ID 0xb880 #define BCM56880_A0_REV_ID 0x0001 @@ -2090,8 +2044,9 @@ #define BCM56991_B0_REV_ID 0x0011 #define BCM56992_DEVICE_ID 0xb992 #define BCM56992_B0_REV_ID 0x0011 -#define BCM56993_DEVICE_ID 0xb993 -#define BCM56993_B0_REV_ID 0x0011 + +#define BCM56995_DEVICE_ID 0xb995 +#define BCM56995_A0_REV_ID 0x0001 #define BCM56996_DEVICE_ID 0xb996 #define BCM56996_A0_REV_ID 0x0001 @@ -2109,25 +2064,5 @@ #define BCM56998_DEVICE_ID 0xb998 #define BCM56998_A0_REV_ID 0x0001 -#define BCM56999_DEVICE_ID 0xb999 -#define BCM56999_A0_REV_ID 0x0001 -#define BCM56999_B0_REV_ID 0x0011 -#define BCM56995_DEVICE_ID 0xb995 -#define BCM56995_A0_REV_ID 0x0001 -#define BCM56995_B0_REV_ID 0x0011 - -#define BCM78900_DEVICE_ID 0xf900 -#define BCM78900_B0_REV_ID 0x0011 - -#define BCM56080_DEVICE_ID 0xb080 -#define BCM56080_A0_REV_ID 0x0001 -#define BCM56081_DEVICE_ID 0xb081 -#define BCM56081_A0_REV_ID 0x0001 -#define BCM56082_DEVICE_ID 0xb082 -#define BCM56082_A0_REV_ID 0x0001 -#define BCM56083_DEVICE_ID 0xb083 -#define BCM56083_A0_REV_ID 0x0001 -#define BCM56084_DEVICE_ID 0xb084 -#define BCM56084_A0_REV_ID 0x0001 - #endif + diff --git a/platform/broadcom/saibcm-modules/make/Make.config b/platform/broadcom/saibcm-modules/make/Make.config index 9a881329e669..01869634e295 100644 --- a/platform/broadcom/saibcm-modules/make/Make.config +++ b/platform/broadcom/saibcm-modules/make/Make.config @@ -119,12 +119,14 @@ else # ifeq "$(HOSTTYPE)" "Windows2000PC" ifndef SDKBUILD SDKBUILD :=build endif + ifdef SDK_OUTDIR BLDROOT = ${SDK_OUTDIR}/${SDKBUILD}/$(if ${BLDCONFIG},${BLDCONFIG}/)${target}${all_suffix}${bldroot_suffix} export DEST_DIR := ${SDK_OUTDIR}/${SDKBUILD}$(if ${BLDCONFIG},/${BLDCONFIG})$(DEST_DIR_SUFFIX) else BLDROOT = ${SDK}/${SDKBUILD}/$(if ${BLDCONFIG},${BLDCONFIG}/)${target}${all_suffix}${bldroot_suffix} endif + endif # ifeq "$(HOSTTYPE)" "Windows2000PC" # This is needed because we cannot include Make.vxworks before Make.config diff --git a/platform/broadcom/saibcm-modules/make/Make.kernlib b/platform/broadcom/saibcm-modules/make/Make.kernlib index 56752beca3b6..94801acd4a69 100644 --- a/platform/broadcom/saibcm-modules/make/Make.kernlib +++ b/platform/broadcom/saibcm-modules/make/Make.kernlib @@ -36,6 +36,17 @@ targetlibsoname = ${lib}.so.${SHAREDLIBVER} targetlibrealname = ${targetlibsoname} targetlibso = ${LIBDIR}/${targetlibrealname} +ifeq ($(TOOLS),Borland) + +LIBSUFFIX=lib + +${LIBDIR}/%.lib: ${BORLAND_BOBJS} + $(RM) $@ + $(FOREACH) -subdir "$(LIBDIR)" \ + "tlib $@ $(foreach obj, $(BORLAND_LOBJS), +-$(obj))" + +else # !Borland + LIBSUFFIX=a ${LIBDIR}/%.a: ${BOBJS} @@ -49,6 +60,7 @@ ifeq ($(targetbase),unix) $(CC) -shared -Wl,-soname,${targetlibsoname} -o ${targetlibso} ${BOBJS} -lc endif endif # LINUX_MAKE_SHARED_LIB # +endif # !Borland targetlib = ${LIBDIR}/${lib}.${LIBSUFFIX} diff --git a/platform/broadcom/saibcm-modules/make/Make.lib b/platform/broadcom/saibcm-modules/make/Make.lib index a4f19aad9321..ac81cc134f6d 100644 --- a/platform/broadcom/saibcm-modules/make/Make.lib +++ b/platform/broadcom/saibcm-modules/make/Make.lib @@ -43,6 +43,17 @@ ifeq ($(FAST),1) endif endif +ifeq ($(TOOLS),Borland) + +LIBSUFFIX=lib + +${LIBDIR}/%.lib: ${BORLAND_BOBJS} + $(RM) $@ + $(FOREACH) -subdir "$(LIBDIR)" \ + "tlib $@ $(foreach obj, $(BORLAND_LOBJS), +-$(obj))" + +else # !Borland + ifeq ($(LINUX_MAKE_SHARED_LIB),1) LIBSUFFIX=so.${SHAREDLIBVER} else @@ -65,6 +76,8 @@ else $(AR) ${ARFLAGS} $@ $(sort ${BOBJS}) endif +endif # !Borland + install:: all @@ -76,7 +89,3 @@ endif $Q$(RM) ${targetlib} distclean:: clean - -ifeq ($(DNX_FAST_MODE),1) --include $(SDK)/tools/dnx/make/lib.mk -endif diff --git a/platform/broadcom/saibcm-modules/make/Make.subdirs b/platform/broadcom/saibcm-modules/make/Make.subdirs index 4016cb83202d..374d817d212d 100644 --- a/platform/broadcom/saibcm-modules/make/Make.subdirs +++ b/platform/broadcom/saibcm-modules/make/Make.subdirs @@ -38,18 +38,18 @@ ifdef QUIET endif ${subdirs}:: - $Q$(MAKE) -C $@ kernel_version=$(kernel_version) LINUX_MAKE_SHARED_LIB=${LINUX_MAKE_SHARED_LIB} SHAREDLIBVER=${SHAREDLIBVER} ${CLEAN_SUBDIRS} + $Q$(MAKE) -C $@ kernel_version=$(kernel_version) LINUX_MAKE_SHARED_LIB=${LINUX_MAKE_SHARED_LIB} SHAREDLIBVER=${SHAREDLIBVER} +ifeq "$(HOSTTYPE)" "Windows2000PC" clean clean_d install distclean:: ifdef QUIET @$(ECHO) Subdirectory $@ for ${subdirs} endif - $(MAKE) clean_subdirs CLEAN_SUBDIRS=$@ - -clean_subdirs: ${subdirs} - -.PHONY: clean_subdirs - -ifeq ($(DNX_FAST_MODE),1) --include $(SDK)/tools/dnx/make/subdirs.mk + $Q$(FOREACH) "$(subdirs)" "${MAKE} -C ## $@" +else +clean clean_d install distclean:: +ifdef QUIET + @$(ECHO) Subdirectory $@ for ${subdirs} +endif + @(for name in $(subdirs); do $(MAKE) -C $$name $@; done) endif diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-gts b/platform/broadcom/saibcm-modules/make/Makefile.linux-gts index 293feaf979d6..609b49c2094a 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-gts +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-gts @@ -45,7 +45,7 @@ #endif # some basic path variables for tools and kernel source, etc # -XLR_TOOLS_BASE ?= /projects/ntsw-tools/linux/xlr-510 +XLR_TOOLS_BASE = /projects/ntsw-tools/linux/xlr-54 TOOLCHAIN_DIR = $(XLR_TOOLS_BASE)/buildroot/host/usr KERNDIR = $(XLR_TOOLS_BASE)/kernel/linux # Target machine for EDK-Host defconfig @@ -112,9 +112,6 @@ ifeq "$(shell expr `echo $(CROSS_GCC_VER) | cut -f1 -d.` \== 10)" "1" CFLAGS += -Wno-error=uninitialized CFLAGS += -Wno-error=format-overflow CFLAGS += -fcommon -ifeq "$(shell expr `echo $(CROSS_GCC_VER) | cut -f2 -d.` \== 2)" "1" - CFLAGS += -Wno-zero-length-bounds -endif endif endif # Compiler-specific CFLAGS @@ -203,3 +200,5 @@ ifneq ($(targetplat),user) BCM_CFLAGS = -Wall include ${SDK}/make/Makefile.linux-kernel-2_6 endif + + diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc_64 b/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc_64 index ac7915be93ee..bfb6cd48dda8 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc_64 +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc_64 @@ -93,6 +93,7 @@ ifeq "$(shell expr `echo $(CROSS_GCC_VER) | cut -f1 -d.` \>= 9)" "1" CFLAGS += -Wno-address-of-packed-member endif ifeq "$(shell expr `echo $(CROSS_GCC_VER) | cut -f1 -d.` \== 10)" "1" + #There might be a bug in GCC10 that cannot detect initialization correctly. CFLAGS += -Wno-error=uninitialized CFLAGS += -Wno-error=format-overflow CFLAGS += -fcommon diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel index 34663445b8a3..ccb0c30d2acc 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel @@ -112,3 +112,12 @@ endif ifdef DEBUG_PEDANTIC DEBUG_PEDANTIC = FALSE endif + +# +# DEPEND is used as a command to generate the list of dependencies. +# The format of the output must be +# "file.o : file.c a/b/c.h d/e/f.h ...", +# if it is on multiple lines, each line must end in a backslash. +# The output MUST be on standard out. +# +DEPEND = ${CC} -M $(CFLAGS) $< diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-2_6 b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-2_6 index c0e8f084e9f0..431bf808f044 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-2_6 +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-2_6 @@ -153,3 +153,12 @@ endif ifdef DEBUG_PEDANTIC DEBUG_PEDANTIC = FALSE endif + +# +# DEPEND is used as a command to generate the list of dependencies. +# The format of the output must be +# "file.o : file.c a/b/c.h d/e/f.h ...", +# if it is on multiple lines, each line must end in a backslash. +# The output MUST be on standard out. +# +DEPEND = ${CC} -M $(CFLAGS) $< diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-3_6 b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-3_6 index a454ea16bad8..528522ec4bd3 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-3_6 +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-3_6 @@ -148,3 +148,12 @@ endif ifdef DEBUG_PEDANTIC DEBUG_PEDANTIC = FALSE endif + +# +# DEPEND is used as a command to generate the list of dependencies. +# The format of the output must be +# "file.o : file.c a/b/c.h d/e/f.h ...", +# if it is on multiple lines, each line must end in a backslash. +# The output MUST be on standard out. +# +DEPEND = ${CC} -M $(CFLAGS) $< diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-4_4 b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-4_4 index 6fcb9a9d1590..c02fc0edd89b 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-4_4 +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-4_4 @@ -156,3 +156,13 @@ endif ifdef DEBUG_PEDANTIC DEBUG_PEDANTIC = FALSE endif + +# +# DEPEND is used as a command to generate the list of dependencies. +# The format of the output must be +# "file.o : file.c a/b/c.h d/e/f.h ...", +# if it is on multiple lines, each line must end in a backslash. +# The output MUST be on standard out. +# +DEPEND = ${CC} -M $(CFLAGS) $< + diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-kmodule b/platform/broadcom/saibcm-modules/make/Makefile.linux-kmodule index d3a41f3824b0..46caf00f20b5 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-kmodule +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-kmodule @@ -41,69 +41,22 @@ MODULE := $(MOD_NAME).o KMODULE := $(MOD_NAME).ko -obj-m := $(MODULE) +PRE_COMPILED_OBJ := obj_$(MOD_NAME).o -SAVE_CFLAGS := ${CFLAGS} +obj-m := $(MODULE) +$(MOD_NAME)-y := $(MODULE_SYM) $(PRE_COMPILED_OBJ) -ifeq (1,$(NO_PRECOMPILED_MODULE)) -# { -# -# When compiling the module within the kernel environment, we get plenty of warnings -# of pointer-to-int and the other way round. So, we need to silence them. -# Apart from that, we need a search path on the kernel's 'include' and the various -# SDK 'include' directories. -# It is not clear why they need to be repeated in EXTRA_CFLAGS (probably because -# of the compilation cycle which is done within the SDK environment). -# -ccflags-y := \ - -Wno-pointer-to-int-cast \ - -Wno-int-to-pointer-cast \ - -I$(KERNDIR)/include \ - -I$(SDK)/include \ - -I$(SDK)/systems/bde/linux/include \ - -I$(SDK)/systems/bde/shared/include \ - -I$(SDK)/systems/linux/kernel/modules/include -include $(SDK)/make/Make.config -# -# For compilation of all module files on linux environment, make sure -# all CFLAGS are passed to the module. This was not required when a -# 'precompiled' object was used since it automatically got all these flags. -# -ccflags-y += $(KFLAGS) -ccflags-y += $(CFLAGS) -# -# Reach here if this makefile is invoked -# from systems\bde\linux\kernel (module name: linux-kernel-bde.ko). -# from systems\bde\linux\user\kernel (module name: linux-user.ko) -# from systems/linux/kernel/modules/bcm-knet (module name: linux-bcm-knet) -# from systems/linux/kernel/modules/knet-cb (module name: linux-knet-cb) -$(MOD_NAME)-y := $(MOD_OBJS) -# -# If, for any reason, the definition of CROSS_COMPILE was erased, then -# set it, again. -# -ifeq ($(CROSS_COMPILE),) -CROSS_COMPILE = /tools/bin/ -endif -export CROSS_COMPILE -# } -else -# { -PRE_COMPILED_OBJ := obj_$(MOD_NAME).o -$(MOD_NAME)-y := $(MODULE_SYM) $(PRE_COMPILED_OBJ) ifeq (,$(CROSS_COMPILE)) + export CROSS_COMPILE + endif +SAVE_CFLAGS := ${CFLAGS} + include $(SDK)/make/Make.config -# } -endif -# -# Note that PWD will get two values, in the process of making the module, -# one for the current directory within 'build' and one for the 'base' of the kernel. -# PWD := $(shell pwd) ifneq ($(ARCH),) @@ -114,10 +67,10 @@ endif # Provide an option in case kernel was built in separate directory KERNBLDDIR ?= $(KERNDIR) -# + # Standard SDK include path for building source files that export # kernel symbols. -# + override EXTRA_CFLAGS = -I${SDK}/include -I${SDK}/systems/linux/kernel/modules/include -I${SDK}/systems/bde/linux/include # # If, for any reason, the definition of LD was erased, then @@ -126,27 +79,12 @@ override EXTRA_CFLAGS = -I${SDK}/include -I${SDK}/systems/linux/kernel/modules/i ifeq ($(LD),) LD = $(CROSS_COMPILE)ld endif -ifeq (1,$(NO_PRECOMPILED_MODULE)) -# { -$(KMODULE): - rm -f *.o *.ko .*.cmd *.sig *.P - rm -fr .tmp_versions - if [ ! -f $(KERNBLDDIR)/NO_SUPRESS ]; then echo "# suppress warning" > .$(PRE_COMPILED_OBJ).cmd; fi - # - # This make creates the module's object. It, somehow, runs two cycls, one in SDK environment - # and one in the kernel's directory. - # - $(MAKE) -C $(KERNBLDDIR) CROSS_COMPILE=$(CROSS_COMPILE) LD=$(LD) M=$(PWD) modules - if [ ! -f Module.symvers ]; then echo "old kernel (pre-2.6.17)" > Module.symvers; fi - cp -f $(KMODULE) $(LIBDIR) -# } -else -# { + # The precopiled object needs a dummy command file to avoid warnings # from the Kbuild scripts (modpost stage). # Kernels before 2.6.17 do not support external module symbols files, # so we create a dummy to prevent build failures. -# + $(KMODULE): rm -f *.o *.ko .*.cmd rm -fr .tmp_versions @@ -156,8 +94,6 @@ $(KMODULE): if [ ! -f Module.symvers ]; then echo "old kernel (pre-2.6.17)" > Module.symvers; fi cp -f $(KMODULE) $(LIBDIR) rm -f $(PRE_COMPILED_OBJ)_shipped -# } -endif EXTRA_CFLAGS = $(CFLAGS) CFLAGS := ${SAVE_CFLAGS} diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-xlr b/platform/broadcom/saibcm-modules/make/Makefile.linux-xlr index 293feaf979d6..609b49c2094a 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-xlr +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-xlr @@ -45,7 +45,7 @@ #endif # some basic path variables for tools and kernel source, etc # -XLR_TOOLS_BASE ?= /projects/ntsw-tools/linux/xlr-510 +XLR_TOOLS_BASE = /projects/ntsw-tools/linux/xlr-54 TOOLCHAIN_DIR = $(XLR_TOOLS_BASE)/buildroot/host/usr KERNDIR = $(XLR_TOOLS_BASE)/kernel/linux # Target machine for EDK-Host defconfig @@ -112,9 +112,6 @@ ifeq "$(shell expr `echo $(CROSS_GCC_VER) | cut -f1 -d.` \== 10)" "1" CFLAGS += -Wno-error=uninitialized CFLAGS += -Wno-error=format-overflow CFLAGS += -fcommon -ifeq "$(shell expr `echo $(CROSS_GCC_VER) | cut -f2 -d.` \== 2)" "1" - CFLAGS += -Wno-zero-length-bounds -endif endif endif # Compiler-specific CFLAGS @@ -203,3 +200,5 @@ ifneq ($(targetplat),user) BCM_CFLAGS = -Wall include ${SDK}/make/Makefile.linux-kernel-2_6 endif + + diff --git a/platform/broadcom/saibcm-modules/sdklt/Makefile b/platform/broadcom/saibcm-modules/sdklt/Makefile index e0084d260925..1ce04c788a32 100644 --- a/platform/broadcom/saibcm-modules/sdklt/Makefile +++ b/platform/broadcom/saibcm-modules/sdklt/Makefile @@ -1,5 +1,5 @@ # -# $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. +# $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. # The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. # # This program is free software; you can redistribute it and/or @@ -14,8 +14,6 @@ # A copy of the GNU General Public License version 2 (GPLv2) can # be found in the LICENSES folder.$ # -# Makefile for building Linux GPL kernel modules for SDKLT. -# help: @echo '' @@ -28,7 +26,6 @@ help: @echo 'Supported make variables:' @echo 'KDIR - Linux kernel source directory (mandatory)' @echo 'CROSS_COPILE - Cross-compiler prefix (optional)' - @echo 'OUTPUT_DIR - Output directory (build/ by default)' @echo '' @echo 'Examples:' @echo 'make -s KDIR=$$KERNEL/linux kmod' @@ -47,42 +44,27 @@ export CROSS_COMPILE override SDK := $(CURDIR) -ifeq (,$(OUTPUT_DIR)) -OUTPUT_DIR := $(CURDIR)/build -endif - -BDE_BLDDIR := $(OUTPUT_DIR)/bde -KNET_BLDDIR := $(OUTPUT_DIR)/knet -KNETCB_BLDDIR := $(OUTPUT_DIR)/knetcb - -LKM_CFLAGS += -UNGKNET_NETIF_MAX -DNGKNET_NETIF_MAX=1056 -UNGKNET_FILTER_MAX -DNGKNET_FILTER_MAX=1025 -export LKM_CFLAGS - kmod: bde knet knetcb bde: $(MAKE) -C $(SDK)/linux/bde SDK=$(SDK) \ - LKM_BLDDIR=$(BDE_BLDDIR) $(TARGET) - ln -sf $(BDE_BLDDIR)/*.ko $(OUTPUT_DIR) + $(TARGET) + ln -sf $(SDK)/linux/bde/*.ko knet: bde $(MAKE) -C $(SDK)/linux/knet SDK=$(SDK) \ - KBUILD_EXTRA_SYMBOLS=$(BDE_BLDDIR)/Module.symvers \ - LKM_BLDDIR=$(KNET_BLDDIR) $(TARGET) - ln -sf $(KNET_BLDDIR)/*.ko $(OUTPUT_DIR) + KBUILD_EXTRA_SYMBOLS=$(SDK)/linux/bde/Module.symvers \ + $(TARGET) + ln -sf $(SDK)/linux/knet/*.ko knetcb: knet $(MAKE) -C $(SDK)/linux/knetcb SDK=$(SDK) \ - KBUILD_EXTRA_SYMBOLS=$(KNET_BLDDIR)/Module.symvers \ - KBUILD_EXTRA_SYMBOLS+=$(PSAMPLE_SYMVERS) \ - LKM_BLDDIR=$(KNETCB_BLDDIR) $(TARGET) - ln -sf $(KNETCB_BLDDIR)/*.ko $(OUTPUT_DIR) + KBUILD_EXTRA_SYMBOLS=$(SDK)/linux/knet/Module.symvers \ + $(TARGET) + ln -sf $(SDK)/linux/knetcb/*.ko clean: $(MAKE) kmod TARGET=clean - rm -f $(OUTPUT_DIR)/*.ko - -distclean: - rm -rf $(OUTPUT_DIR) + rm -f *.ko -.PHONY: help kmod bde knet knetcb clean distclean +.PHONY: help kmod bde knet knetcb $(PSAMPLE) clean diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56780_a0/bcm56780_a0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56780_a0/bcm56780_a0_pdma_attach.c index 4edd614c2a07..dfdb504d87c6 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56780_a0/bcm56780_a0_pdma_attach.c +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56780_a0/bcm56780_a0_pdma_attach.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56880_a0/bcm56880_a0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56880_a0/bcm56880_a0_pdma_attach.c index d803f27827a2..9dc9195cc209 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56880_a0/bcm56880_a0_pdma_attach.c +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56880_a0/bcm56880_a0_pdma_attach.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56890_a0/bcm56890_a0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56890_a0/bcm56890_a0_pdma_attach.c deleted file mode 100644 index f5297b1bcfcc..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56890_a0/bcm56890_a0_pdma_attach.c +++ /dev/null @@ -1,38 +0,0 @@ -/*! \file bcm56890_a0_pdma_attach.c - * - * Initialize PDMA driver resources. - * - */ -/* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - */ - -#include -#include -#include - -int -bcm56890_a0_cnet_pdma_attach(struct pdma_dev *dev) -{ - return bcmcnet_cmicx_pdma_driver_attach(dev); -} - -int -bcm56890_a0_cnet_pdma_detach(struct pdma_dev *dev) -{ - return bcmcnet_cmicx_pdma_driver_detach(dev); -} - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56990_a0/bcm56990_a0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56990_a0/bcm56990_a0_pdma_attach.c index 4e7626a2b414..2e02369c958b 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56990_a0/bcm56990_a0_pdma_attach.c +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56990_a0/bcm56990_a0_pdma_attach.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56990_b0/bcm56990_b0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56990_b0/bcm56990_b0_pdma_attach.c index 95b1b3adb601..1acf4b41bffd 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56990_b0/bcm56990_b0_pdma_attach.c +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56990_b0/bcm56990_b0_pdma_attach.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56080_a0/bcm56080_a0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56995_a0/bcm56995_a0_pdma_attach.c similarity index 81% rename from platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56080_a0/bcm56080_a0_pdma_attach.c rename to platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56995_a0/bcm56995_a0_pdma_attach.c index 7b71dd745ca6..08419f1d3a1e 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56080_a0/bcm56080_a0_pdma_attach.c +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56995_a0/bcm56995_a0_pdma_attach.c @@ -1,10 +1,10 @@ -/*! \file bcm56080_a0_pdma_attach.c +/*! \file bcm56995_a0_pdma_attach.c * * Initialize PDMA driver resources. * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -25,13 +25,13 @@ #include int -bcm56080_a0_cnet_pdma_attach(struct pdma_dev *dev) +bcm56995_a0_cnet_pdma_attach(struct pdma_dev *dev) { return bcmcnet_cmicx_pdma_driver_attach(dev); } int -bcm56080_a0_cnet_pdma_detach(struct pdma_dev *dev) +bcm56995_a0_cnet_pdma_detach(struct pdma_dev *dev) { return bcmcnet_cmicx_pdma_driver_detach(dev); } diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56996_a0/bcm56996_a0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56996_a0/bcm56996_a0_pdma_attach.c index 1ec4e3a9f414..2fca51ce9788 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56996_a0/bcm56996_a0_pdma_attach.c +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56996_a0/bcm56996_a0_pdma_attach.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56996_b0/bcm56996_b0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56996_b0/bcm56996_b0_pdma_attach.c index c881a7a37266..06e22a8a28a0 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56996_b0/bcm56996_b0_pdma_attach.c +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56996_b0/bcm56996_b0_pdma_attach.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56998_a0/bcm56998_a0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56998_a0/bcm56998_a0_pdma_attach.c index 47b83a495538..1c5e0b2846a5 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56998_a0/bcm56998_a0_pdma_attach.c +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56998_a0/bcm56998_a0_pdma_attach.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56999_a0/bcm56999_a0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56999_a0/bcm56999_a0_pdma_attach.c deleted file mode 100644 index 2aee042564f3..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56999_a0/bcm56999_a0_pdma_attach.c +++ /dev/null @@ -1,38 +0,0 @@ -/*! \file bcm56999_a0_pdma_attach.c - * - * Initialize PDMA driver resources. - * - */ -/* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - */ - -#include -#include -#include - -int -bcm56999_a0_cnet_pdma_attach(struct pdma_dev *dev) -{ - return bcmcnet_cmicx_pdma_driver_attach(dev); -} - -int -bcm56999_a0_cnet_pdma_detach(struct pdma_dev *dev) -{ - return bcmcnet_cmicx_pdma_driver_detach(dev); -} - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm78900_b0/bcm78900_b0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm78900_b0/bcm78900_b0_pdma_attach.c deleted file mode 100644 index e09f04d9b44f..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm78900_b0/bcm78900_b0_pdma_attach.c +++ /dev/null @@ -1,38 +0,0 @@ -/*! \file bcm78900_b0_pdma_attach.c - * - * Initialize PDMA driver resources. - * - */ -/* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - */ - -#include -#include -#include - -int -bcm78900_b0_cnet_pdma_attach(struct pdma_dev *dev) -{ - return bcmcnet_cmicr_pdma_driver_attach(dev); -} - -int -bcm78900_b0_cnet_pdma_detach(struct pdma_dev *dev) -{ - return bcmcnet_cmicr_pdma_driver_detach(dev); -} - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicd/bcmcnet_cmicd_pdma_hw.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicd/bcmcnet_cmicd_pdma_hw.c index b887a2b829a7..e1eac2488497 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicd/bcmcnet_cmicd_pdma_hw.c +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicd/bcmcnet_cmicd_pdma_hw.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -59,13 +59,7 @@ cmicd_pdma_intr_enable(struct pdma_hw *hw, int cmc, int chan, uint32_t mask) { uint32_t reg = CMICD_IRQ_STAT(cmc); - if (hw->dev->mode == DEV_MODE_UNET || hw->dev->mode == DEV_MODE_VNET) { - hw->dev->intr_unmask(hw->dev, cmc, chan, 0, 0); - return; - } - - hw->dev->ctrl.grp[cmc].irq_mask |= mask; - hw->dev->intr_unmask(hw->dev, cmc, chan, reg, 0); + hw->dev->intr_unmask(hw->dev, cmc, chan, reg, mask); } /*! @@ -76,13 +70,7 @@ cmicd_pdma_intr_disable(struct pdma_hw *hw, int cmc, int chan, uint32_t mask) { uint32_t reg = CMICD_IRQ_STAT(cmc); - if (hw->dev->mode == DEV_MODE_UNET || hw->dev->mode == DEV_MODE_VNET) { - hw->dev->intr_mask(hw->dev, cmc, chan, 0, 0); - return; - } - - hw->dev->ctrl.grp[cmc].irq_mask &= ~mask; - hw->dev->intr_mask(hw->dev, cmc, chan, reg, 0); + hw->dev->intr_mask(hw->dev, cmc, chan, reg, mask); } /*! @@ -461,61 +449,61 @@ cmicd_pdma_chan_reg_dump(struct pdma_hw *hw, int chan) que = chan % CMICD_PDMA_CMC_CHAN; hw->hdls.reg_rd32(hw, CMICD_PDMA_CTRL(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_CH%d_DMA_CTRL: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_CH%d_DMA_CTRL: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICD_PDMA_DESC(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_DESC%d: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_DESC%d: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICD_PDMA_CURR_DESC(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_CH%d_DMA_CURR_DESC: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_CH%d_DMA_CURR_DESC: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICD_PDMA_DESC_HALT(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_DESC_HALT_ADDR: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_DESC_HALT_ADDR: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICD_PDMA_COS_RX0(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_CH%d_COS_CTRL_RX_0: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_CH%d_COS_CTRL_RX_0: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICD_PDMA_COS_RX1(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_CH%d_COS_CTRL_RX_1: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_CH%d_COS_CTRL_RX_1: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICD_PDMA_COS_MASK0(grp), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_PROGRAMMABLE_COS_MASK0: 0x%08x\n", grp, val); + CNET_PR("CMIC_CMC%d_PROGRAMMABLE_COS_MASK0: 0x%08x\n", grp, val); hw->hdls.reg_rd32(hw, CMICD_PDMA_COS_MASK1(grp), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_PROGRAMMABLE_COS_MASK1: 0x%08x\n", grp, val); + CNET_PR("CMIC_CMC%d_PROGRAMMABLE_COS_MASK1: 0x%08x\n", grp, val); hw->hdls.reg_rd32(hw, CMICD_PDMA_INTR_COAL(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_INTR_COAL: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_INTR_COAL: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICD_PDMA_RBUF_THRE(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_CH%d_RXBUF_THRESHOLD_CONFIG: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_CH%d_RXBUF_THRESHOLD_CONFIG: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICD_PDMA_STAT(grp), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_STAT: 0x%08x\n", grp, val); + CNET_PR("CMIC_CMC%d_DMA_STAT: 0x%08x\n", grp, val); hw->hdls.reg_rd32(hw, CMICD_PDMA_STAT_HI(grp), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_STAT_HI: 0x%08x\n", grp, val); + CNET_PR("CMIC_CMC%d_DMA_STAT_HI: 0x%08x\n", grp, val); hw->hdls.reg_rd32(hw, CMICD_PDMA_STAT_CLR(grp), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_STAT_CLR: 0x%08x\n", grp, val); + CNET_PR("CMIC_CMC%d_DMA_STAT_CLR: 0x%08x\n", grp, val); hw->hdls.reg_rd32(hw, CMICD_PDMA_COUNT_RX(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_PKT_COUNT_CH%d_RXPKT: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_PKT_COUNT_CH%d_RXPKT: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICD_PDMA_COUNT_TX(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_PKT_COUNT_CH%d_TXPKT: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_PKT_COUNT_CH%d_TXPKT: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICD_IRQ_STAT(grp), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_IRQ_STAT0: 0x%08x\n", grp, val); + CNET_PR("CMIC_CMC%d_IRQ_STAT0: 0x%08x\n", grp, val); hw->hdls.reg_rd32(hw, CMICD_IRQ_PCI_MASK(grp), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_PCIE_IRQ_MASK0: 0x%08x\n", grp, val); + CNET_PR("CMIC_CMC%d_PCIE_IRQ_MASK0: 0x%08x\n", grp, val); hw->hdls.reg_rd32(hw, CMICD_DEV_REV_ID, &val); - CNET_INFO(hw->unit, "CMIC_DEV_REV_ID: 0x%08x\n", val); + CNET_PR("CMIC_DEV_REV_ID: 0x%08x\n", val); hw->hdls.reg_rd32(hw, CMICD_CMICM_REV_ID, &val); - CNET_INFO(hw->unit, "CMIC_CMICM_REV_ID: 0x%08x\n", val); + CNET_PR("CMIC_CMICM_REV_ID: 0x%08x\n", val); return SHR_E_NONE; } diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicd/bcmcnet_cmicd_pdma_rxtx.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicd/bcmcnet_cmicd_pdma_rxtx.c index e78e3ae26668..711a037510dc 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicd/bcmcnet_cmicd_pdma_rxtx.c +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicd/bcmcnet_cmicd_pdma_rxtx.c @@ -38,7 +38,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -70,8 +70,6 @@ cmicd_rx_desc_config(struct cmicd_rx_desc *rd, uint32_t addr, uint32_t len) rd->md.status = 0; rd->ctrl = CMICD_DESC_CTRL_CNTLD_INTR | CMICD_DESC_CTRL_CHAIN | CMICD_DESC_CTRL_LEN(len); - - MEMORY_BARRIER; } /*! @@ -84,8 +82,6 @@ cmicd_tx_desc_config(struct cmicd_tx_desc *td, uint32_t addr, uint32_t len, uint td->md.status = 0; td->ctrl = CMICD_DESC_CTRL_CNTLD_INTR | CMICD_DESC_CTRL_CHAIN | CMICD_DESC_CTRL_FLAGS(flags) | CMICD_DESC_CTRL_LEN(len); - - MEMORY_BARRIER; } /*! @@ -98,8 +94,6 @@ cmicd_rx_rldesc_config(struct cmicd_rx_desc *rd, uint32_t addr) rd->md.status = 0; rd->ctrl = CMICD_DESC_CTRL_CNTLD_INTR | CMICD_DESC_CTRL_CHAIN | CMICD_DESC_CTRL_RELOAD; - - MEMORY_BARRIER; } /*! @@ -112,8 +106,6 @@ cmicd_tx_rldesc_config(struct cmicd_tx_desc *td, uint32_t addr) td->md.status = 0; td->ctrl = CMICD_DESC_CTRL_CNTLD_INTR | CMICD_DESC_CTRL_CHAIN | CMICD_DESC_CTRL_RELOAD; - - MEMORY_BARRIER; } /*! @@ -127,8 +119,6 @@ cmicd_rx_desc_chain(struct cmicd_rx_desc *rd, int chain) } else { rd->ctrl &= ~CMICD_DESC_CTRL_CHAIN; } - - MEMORY_BARRIER; } /*! @@ -142,8 +132,6 @@ cmicd_tx_desc_chain(struct cmicd_tx_desc *td, int chain) } else { td->ctrl &= ~CMICD_DESC_CTRL_CHAIN; } - - MEMORY_BARRIER; } /*! @@ -153,7 +141,9 @@ static inline int cmicd_pdma_rx_ring_unused(struct pdma_rx_queue *rxq) { /* Leave one descriptor unused so as not to halt */ - return (rxq->nb_desc + rxq->curr - rxq->halt - 1) % rxq->nb_desc; + return rxq->curr > rxq->halt ? + rxq->curr - rxq->halt - 1 : + rxq->nb_desc + rxq->curr - rxq->halt - 1; } /*! @@ -163,7 +153,9 @@ static inline int cmicd_pdma_tx_ring_unused(struct pdma_tx_queue *txq) { /* Leave one descriptor unused so as not to halt */ - return (txq->nb_desc + txq->dirt - txq->curr - 1) % txq->nb_desc; + return txq->dirt > txq->curr ? + txq->dirt - txq->curr - 1 : + txq->nb_desc + txq->dirt - txq->curr - 1; } /*! @@ -199,9 +191,9 @@ cmicd_pdma_rx_desc_init(struct pdma_hw *hw, struct pdma_rx_queue *rxq) cmicd_rx_rldesc_config(&ring[di], rxq->ring_addr); rxq->curr = 0; - rxq->halt = rxq->nb_desc - 1; + rxq->halt = rxq->state & PDMA_RX_BATCH_REFILL ? 0 : rxq->nb_desc; - rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicd_rx_desc) * rxq->halt; + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicd_rx_desc) * di; hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); hw->hdls.chan_setup(hw, rxq->chan_id, rxq->ring_addr); @@ -215,7 +207,7 @@ cmicd_pdma_rx_desc_init(struct pdma_hw *hw, struct pdma_rx_queue *rxq) cmicd_rx_desc_config(&ring[di], 0, 0); } - CNET_ERROR(hw->unit, "RX: Failed to allocate memory\n"); + CNET_PR("RX: Failed to allocate mem\n"); return SHR_E_MEMORY; } @@ -362,22 +354,26 @@ cmicd_pdma_rx_ring_refill(struct pdma_hw *hw, struct pdma_rx_queue *rxq) int unused = cmicd_pdma_rx_ring_unused(rxq); dma_addr_t addr; uint32_t halt; + int retry; int rv; for (halt = rxq->halt; halt < rxq->halt + unused; halt++) { - if (ring[halt % rxq->nb_desc].addr) { - continue; - } pbuf = &rxq->pbuf[halt % rxq->nb_desc]; /* Allocate a new pktbuf */ if (!bm->rx_buf_avail(dev, rxq, pbuf)) { - rv = bm->rx_buf_alloc(dev, rxq, pbuf); - if (SHR_FAILURE(rv)) { + retry = 5000000; + do { + rv = bm->rx_buf_alloc(dev, rxq, pbuf); + if (SHR_SUCCESS(rv)) { + break; + } rxq->stats.nomems++; + sal_usleep(1); + } while (retry--); + if (retry <= 0) { + CNET_PR("Fatal error: Rx buffer has not been allocated for 5 seconds\n"); rxq->halt = halt % rxq->nb_desc; - CNET_ERROR(hw->unit, "Can not alloc RX buffer, %d DCBs not filled\n", - cmicd_pdma_rx_ring_unused(rxq)); - break; + return rv; } } /* Setup the new descriptor */ @@ -387,11 +383,10 @@ cmicd_pdma_rx_ring_refill(struct pdma_hw *hw, struct pdma_rx_queue *rxq) cmicd_rx_desc_chain(&ring[halt % rxq->nb_desc], 0); } } - rxq->halt = halt % rxq->nb_desc; - /* Move forward */ sal_spinlock_lock(rxq->lock); - if (!(rxq->status & PDMA_RX_QUEUE_XOFF)) { + rxq->halt = halt % rxq->nb_desc; + if (!(rxq->state & PDMA_RX_QUEUE_XOFF)) { /* Descriptor cherry pick */ rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicd_rx_desc) * rxq->halt; hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); @@ -427,20 +422,18 @@ cmicd_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budg curr = rxq->curr; while (CMICD_DESC_STAT_DONE(ring[curr].md.status)) { - if (done == budget) { + if (dev->mode == DEV_MODE_VNET && rxq->state & PDMA_RX_QUEUE_XOFF) { break; } - - /* Move forward */ - if (!(rxq->state & PDMA_RX_BATCH_REFILL)) { - sal_spinlock_lock(rxq->lock); - if (!(rxq->status & PDMA_RX_QUEUE_XOFF)) { - /* Descriptor cherry pick */ - rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicd_rx_desc) * curr; - hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); - rxq->halt = curr; - } - sal_spinlock_unlock(rxq->lock); + if (!(rxq->state & PDMA_RX_BATCH_REFILL) && + !(rxq->state & PDMA_RX_QUEUE_XOFF)) { + /* Descriptor cherry pick */ + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicd_rx_desc) * curr; + hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); + rxq->halt = curr; + } + if (done == budget) { + break; } /* Get the current pktbuf to process */ @@ -449,11 +442,8 @@ cmicd_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budg len = CMICD_DESC_STAT_LEN(stat); pkh = bm->rx_buf_get(dev, rxq, pbuf, len); if (!pkh) { - CNET_ERROR(hw->unit, "RX buffer build failed, retry ...\n"); rxq->stats.nomems++; - /* Set busy state to retry */ - rxq->state |= PDMA_RX_QUEUE_BUSY; - return budget; + return SHR_E_MEMORY; } /* Setup packet header */ @@ -499,33 +489,24 @@ cmicd_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budg /* Setup the new descriptor */ if (!(rxq->state & PDMA_RX_BATCH_REFILL)) { if (!bm->rx_buf_avail(dev, rxq, pbuf)) { - retry = 0; - while (1) { + retry = 5000000; + do { rv = bm->rx_buf_alloc(dev, rxq, pbuf); if (SHR_SUCCESS(rv)) { break; } rxq->stats.nomems++; - if (dev->mode == DEV_MODE_UNET || dev->mode == DEV_MODE_VNET) { - if (retry++ < 5000000) { - sal_usleep(1); - continue; - } - CNET_ERROR(hw->unit, "Fatal error: can not alloc RX buffer\n"); - } - rxq->state |= PDMA_RX_BATCH_REFILL; - rxq->free_thresh = 1; - cmicd_rx_desc_config(&ring[curr], 0, 0); - CNET_ERROR(hw->unit, "RX buffer alloc failed, try batch refilling later\n"); - break; + sal_usleep(1); + } while (retry--); + if (retry <= 0) { + CNET_PR("Fatal error: Rx buffer has not been allocated for 5 seconds\n"); + return done; } } - if (pbuf->dma) { - bm->rx_buf_dma(dev, rxq, pbuf, &addr); - cmicd_rx_desc_config(&ring[curr], addr, rxq->buf_size); - if (dev->flags & PDMA_CHAIN_MODE && curr == rxq->nb_desc - 1) { - cmicd_rx_desc_chain(&ring[curr], 0); - } + bm->rx_buf_dma(dev, rxq, pbuf, &addr); + cmicd_rx_desc_config(&ring[curr], addr, rxq->buf_size); + if (dev->flags & PDMA_CHAIN_MODE && curr == rxq->nb_desc - 1) { + cmicd_rx_desc_chain(&ring[curr], 0); } } else { cmicd_rx_desc_config(&ring[curr], 0, 0); @@ -533,6 +514,7 @@ cmicd_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budg /* Notify HNET to process if needed */ if (dev->mode == DEV_MODE_VNET) { + MEMORY_BARRIER; if (ring[(curr + rxq->nb_desc - 1) % rxq->nb_desc].md.status) { dev->xnet_wake(dev); } @@ -541,7 +523,7 @@ cmicd_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budg /* Update the indicators */ if (!(rxq->state & PDMA_RX_BATCH_REFILL) && rxq->halt != curr) { sal_spinlock_lock(rxq->lock); - if (!(rxq->status & PDMA_RX_QUEUE_XOFF)) { + if (!(rxq->state & PDMA_RX_QUEUE_XOFF)) { /* Descriptor cherry pick */ rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicd_rx_desc) * curr; hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); @@ -557,12 +539,10 @@ cmicd_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budg /* Restart DMA if in chain mode */ if (dev->flags & PDMA_CHAIN_MODE) { - sal_spinlock_lock(rxq->lock); - if (curr == 0 && !(rxq->status & PDMA_RX_QUEUE_XOFF)) { + if (curr == 0 && !(rxq->state & PDMA_RX_QUEUE_XOFF)) { hw->hdls.chan_stop(hw, rxq->chan_id); hw->hdls.chan_start(hw, rxq->chan_id); } - sal_spinlock_unlock(rxq->lock); } } @@ -577,10 +557,12 @@ cmicd_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budg if (rxq->state & PDMA_RX_BATCH_REFILL && cmicd_pdma_rx_ring_unused(rxq) >= (int)rxq->free_thresh) { cmicd_pdma_rx_ring_refill(hw, rxq); - /* If no one filled, return budget and keep polling */ - if (cmicd_pdma_rx_ring_unused(rxq) == (int)(rxq->nb_desc - 1)) { - rxq->state |= PDMA_RX_QUEUE_BUSY; - return budget; + } + + /* Notify the other side to process */ + if (dev->mode == DEV_MODE_VNET || dev->mode == DEV_MODE_HNET) { + if (done) { + dev->xnet_wake(dev); } } @@ -687,24 +669,16 @@ cmicd_pdma_tx_ring_clean(struct pdma_hw *hw, struct pdma_tx_queue *txq, int budg sal_spinlock_unlock(txq->lock); } - /* Set busy state to avoid HW checking */ - if (done == budget) { - txq->state |= PDMA_TX_QUEUE_BUSY; - } - /* Resume Tx if any */ sal_spinlock_lock(txq->lock); - if (txq->status & PDMA_TX_QUEUE_XOFF && cmicd_pdma_tx_ring_unused(txq)) { - txq->status &= ~PDMA_TX_QUEUE_XOFF; - if (dev->suspended) { - sal_spinlock_unlock(txq->lock); - return done; - } + if (txq->state & PDMA_TX_QUEUE_XOFF && + txq->state & PDMA_TX_QUEUE_ACTIVE && + cmicd_pdma_tx_ring_unused(txq)) { + txq->state &= ~PDMA_TX_QUEUE_XOFF; + sal_spinlock_unlock(txq->lock); if (dev->tx_resume) { dev->tx_resume(dev, txq->queue_id); - } - sal_spinlock_unlock(txq->lock); - if (!dev->tx_resume && !(txq->state & PDMA_TX_QUEUE_POLL)) { + } else if (!(txq->state & PDMA_TX_QUEUE_POLL)) { sal_sem_give(txq->sem); } return done; @@ -724,14 +698,14 @@ cmicd_pdma_rx_ring_dump(struct pdma_hw *hw, struct pdma_rx_queue *rxq) struct cmicd_rx_desc *rd; uint32_t di; - CNET_INFO(hw->unit, "RX: queue=%d, chan=%d, curr=%d, halt=%d, halt@%p\n", - rxq->queue_id, rxq->chan_id, rxq->curr, rxq->halt, (void *)&ring[rxq->halt]); - CNET_INFO(hw->unit, "----------------------------------------------------------------\n"); + CNET_PR("\nRX: queue=%d, chan=%d, curr=%d, halt=%d, halt@%p\n", + rxq->queue_id, rxq->chan_id, rxq->curr, rxq->halt, (void *)&ring[rxq->halt]); + CNET_PR("----------------------------------------------------------------\n"); for (di = 0; di < rxq->nb_desc + 1; di++) { rd = &ring[di]; - CNET_INFO(hw->unit, "DESC[%03d]: (%p)->%08x %08x ... %08x\n", - di, (void *)(unsigned long)(rxq->ring_addr + di * CMICD_PDMA_DCB_SIZE), - rd->addr, rd->ctrl, rd->md.status); + CNET_PR("DESC[%03d]: (%p)->%08x %08x ... %08x\n", + di, (void *)(unsigned long)(rxq->ring_addr + di * CMICD_PDMA_DCB_SIZE), + rd->addr, rd->ctrl, rd->md.status); } return SHR_E_NONE; @@ -747,14 +721,14 @@ cmicd_pdma_tx_ring_dump(struct pdma_hw *hw, struct pdma_tx_queue *txq) struct cmicd_tx_desc *td; uint32_t di; - CNET_INFO(hw->unit, "TX: queue=%d, chan=%d, curr=%d, dirt=%d, halt@%p\n", - txq->queue_id, txq->chan_id, txq->curr, txq->dirt, (void *)&ring[txq->curr]); - CNET_INFO(hw->unit, "----------------------------------------------------------------\n"); + CNET_PR("\nTX: queue=%d, chan=%d, curr=%d, dirt=%d, halt@%p\n", + txq->queue_id, txq->chan_id, txq->curr, txq->dirt, (void *)&ring[txq->curr]); + CNET_PR("----------------------------------------------------------------\n"); for (di = 0; di < txq->nb_desc + 1; di++) { td = &ring[di]; - CNET_INFO(hw->unit, "DESC[%03d]: (%p)->%08x %08x ... %08x\n", - di, (void *)(unsigned long)(txq->ring_addr + di * CMICD_PDMA_DCB_SIZE), - td->addr, td->ctrl, td->md.status); + CNET_PR("DESC[%03d]: (%p)->%08x %08x ... %08x\n", + di, (void *)(unsigned long)(txq->ring_addr + di * CMICD_PDMA_DCB_SIZE), + td->addr, td->ctrl, td->md.status); } return SHR_E_NONE; @@ -797,31 +771,18 @@ cmicd_pdma_tx_vring_fetch(struct pdma_hw *hw, struct pdma_tx_queue *txq, static inline int cmicd_pdma_tx_ring_check(struct pdma_hw *hw, struct pdma_tx_queue *txq) { - struct pdma_dev *dev = hw->dev; - - if (dev->suspended) { - txq->stats.xoffs++; - if (dev->tx_suspend) { - dev->tx_suspend(dev, txq->queue_id); - return SHR_E_BUSY; - } - if (!(txq->state & PDMA_TX_QUEUE_POLL)) { - return SHR_E_BUSY; - } - } - if (cmicd_pdma_tx_ring_unused(txq)) { return SHR_E_NONE; } sal_spinlock_lock(txq->lock); if (!cmicd_pdma_tx_ring_unused(txq)) { - txq->status |= PDMA_TX_QUEUE_XOFF; + txq->state |= PDMA_TX_QUEUE_XOFF; txq->stats.xoffs++; - if (dev->tx_suspend) { - dev->tx_suspend(dev, txq->queue_id); - } sal_spinlock_unlock(txq->lock); + if (hw->dev->tx_suspend) { + hw->dev->tx_suspend(hw->dev, txq->queue_id); + } return SHR_E_BUSY; } sal_spinlock_unlock(txq->lock); @@ -857,7 +818,7 @@ cmicd_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) } else { rv = sal_sem_take(txq->sem, BCMCNET_TX_RSRC_WAIT_USEC); if (rv == -1) { - CNET_ERROR(hw->unit, "Timeout waiting for Tx resources\n"); + CNET_PR("Timeout waiting for Tx resources\n"); return SHR_E_TIMEOUT; } } @@ -872,7 +833,7 @@ cmicd_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) } } else { /* Abort Tx if a fatal error happened */ - if (txq->status & PDMA_TX_QUEUE_XOFF) { + if (txq->state & PDMA_TX_QUEUE_XOFF) { sal_sem_give(txq->sem); return SHR_E_RESOURCE; } @@ -887,7 +848,6 @@ cmicd_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) sal_spinlock_unlock(txq->mutex); return SHR_E_EMPTY; } - txq->state |= PDMA_TX_QUEUE_BUSY; } else { pbuf->adj = 0; pkh = bm->tx_buf_get(dev, txq, pbuf, buf); @@ -898,7 +858,7 @@ cmicd_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) } else { sal_sem_give(txq->sem); } - return SHR_E_RESOURCE; + return SHR_E_NONE; } bm->tx_buf_dma(dev, txq, pbuf, &addr); flags |= pkh->attrs & PDMA_TX_HIGIG_PKT ? CMICD_DESC_TX_HIGIG_PKT : 0; @@ -912,6 +872,7 @@ cmicd_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) /* Notify HNET to process if needed */ if (dev->mode == DEV_MODE_VNET) { + MEMORY_BARRIER; if (!CMICD_DESC_CTRL_LEN(ring[(curr + txq->nb_desc - 1) % txq->nb_desc].ctrl)) { dev->xnet_wake(dev); } @@ -931,8 +892,8 @@ cmicd_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) } sal_usleep(1); } while (retry--); - if (retry < 0) { - CNET_ERROR(hw->unit, "Last Tx could not get done in given time\n"); + if (retry <= 0) { + CNET_PR("Last Tx could not be done in given time\n"); } } sal_spinlock_lock(txq->lock); @@ -958,7 +919,7 @@ cmicd_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) /* Clean up ring if in polling mode */ if (txq->state & PDMA_TX_QUEUE_POLL && cmicd_pdma_tx_ring_unused(txq) <= (int)txq->free_thresh) { - cmicd_pdma_tx_ring_clean(hw, txq, dev->ctrl.budget); + cmicd_pdma_tx_ring_clean(hw, txq, txq->nb_desc - txq->free_thresh); } /* Suspend Tx if no resource */ @@ -971,15 +932,15 @@ cmicd_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) if (txq->state & PDMA_TX_QUEUE_POLL) { /* In polling mode, must wait till the ring is available */ do { - cmicd_pdma_tx_ring_clean(hw, txq, dev->ctrl.budget); - if (!(txq->status & PDMA_TX_QUEUE_XOFF) || + cmicd_pdma_tx_ring_clean(hw, txq, txq->free_thresh); + if (!(txq->state & PDMA_TX_QUEUE_XOFF) || !(txq->state & PDMA_TX_QUEUE_ACTIVE)) { break; } sal_usleep(1); } while (retry--); - if (retry < 0) { - CNET_ERROR(hw->unit, "Fatal error: Tx ring is full, packets can not been transmitted\n"); + if (retry <= 0) { + CNET_PR("Fatal error: Tx ring is full, packets have not been transmitted for 5 seconds\n"); if (!dev->tx_suspend) { sal_sem_give(txq->sem); return SHR_E_RESOURCE; @@ -1009,7 +970,7 @@ static int cmicd_pdma_rx_suspend(struct pdma_hw *hw, struct pdma_rx_queue *rxq) { sal_spinlock_lock(rxq->lock); - rxq->status |= PDMA_RX_QUEUE_XOFF; + rxq->state |= PDMA_RX_QUEUE_XOFF; if (hw->dev->flags & PDMA_CHAIN_MODE) { hw->hdls.chan_stop(hw, rxq->chan_id); } @@ -1025,7 +986,7 @@ static int cmicd_pdma_rx_resume(struct pdma_hw *hw, struct pdma_rx_queue *rxq) { sal_spinlock_lock(rxq->lock); - if (!(rxq->status & PDMA_RX_QUEUE_XOFF)) { + if (!(rxq->state & PDMA_RX_QUEUE_XOFF)) { sal_spinlock_unlock(rxq->lock); return SHR_E_NONE; } @@ -1041,7 +1002,7 @@ cmicd_pdma_rx_resume(struct pdma_hw *hw, struct pdma_rx_queue *rxq) rxq->curr = 0; hw->hdls.chan_start(hw, rxq->chan_id); } - rxq->status &= ~PDMA_RX_QUEUE_XOFF; + rxq->state &= ~PDMA_RX_QUEUE_XOFF; sal_spinlock_unlock(rxq->lock); return SHR_E_NONE; diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicr/bcmcnet_cmicr_pdma_hw.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicr/bcmcnet_cmicr_pdma_hw.c deleted file mode 100644 index 99f1d7276cfc..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicr/bcmcnet_cmicr_pdma_hw.c +++ /dev/null @@ -1,667 +0,0 @@ -/*! \file bcmcnet_cmicr_pdma_hw.c - * - * Utility routines for handling BCMCNET hardware (CMICr). - * - */ -/* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - */ - -#include -#include -#include -#include - -/*! - * Read 32-bit register - */ -static inline void -cmicr_pdma_reg_read32(struct pdma_hw *hw, uint32_t addr, uint32_t *data) -{ - if (hw->dev->dev_read32) { - hw->dev->dev_read32(hw->dev, addr, data); - } else { - DEV_READ32(&hw->dev->ctrl, addr, data); - } -} - -/*! - * Write 32-bit register - */ -static inline void -cmicr_pdma_reg_write32(struct pdma_hw *hw, uint32_t addr, uint32_t data) -{ - if (hw->dev->dev_write32) { - hw->dev->dev_write32(hw->dev, addr, data); - } else { - DEV_WRITE32(&hw->dev->ctrl, addr, data); - } -} - -/*! - * Enable interrupt for a channel - */ -static inline void -cmicr_pdma_intr_enable(struct pdma_hw *hw, int cmc, int chan) -{ - uint32_t reg, val; - - if (hw->dev->mode == DEV_MODE_UNET || hw->dev->mode == DEV_MODE_VNET) { - hw->dev->intr_unmask(hw->dev, cmc, chan, 0, 0); - return; - } - - if ((cmc == 0) || (cmc == 1 && chan < 8)) { - reg = PAXB_PDMA_IRQ_ENAB_SET0; - } else { - reg = PAXB_PDMA_IRQ_ENAB_SET1; - } - - val = 1 << chan; - if (cmc == 0) { - val <<= CMICR_IRQ_MASK_SHIFT; - } else if (cmc == 1 && chan < 8) { - val <<= CMICR_IRQ_MASK_SHIFT + CMICR_PDMA_CMC_CHAN; - } else { - val >>= CMICR_IRQ_MASK_SHIFT; - } - - hw->dev->intr_unmask(hw->dev, cmc, chan, reg & 0xfff, val); -} - -/*! - * Disable interrupt for a channel - */ -static inline void -cmicr_pdma_intr_disable(struct pdma_hw *hw, int cmc, int chan) -{ - uint32_t reg, val; - - if (hw->dev->mode == DEV_MODE_UNET || hw->dev->mode == DEV_MODE_VNET) { - hw->dev->intr_mask(hw->dev, cmc, chan, 0, 0); - return; - } - - if ((cmc == 0) || (cmc == 1 && chan < 8)) { - reg = PAXB_PDMA_IRQ_ENAB_CLR0; - } else { - reg = PAXB_PDMA_IRQ_ENAB_CLR1; - } - - val = 1 << chan; - if (cmc == 0) { - val <<= CMICR_IRQ_MASK_SHIFT; - } else if (cmc == 1 && chan < 8) { - val <<= CMICR_IRQ_MASK_SHIFT + CMICR_PDMA_CMC_CHAN; - } else { - val >>= CMICR_IRQ_MASK_SHIFT; - } - - hw->dev->intr_mask(hw->dev, cmc, chan, reg & 0xfff, val); -} - -/*! - * Initialize HW - */ -static int -cmicr_pdma_hw_init(struct pdma_hw *hw) -{ - dev_mode_t mode = DEV_MODE_MAX; - CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr_t val_header_size; - - /* Temporarily upgrade work mode to get HW information in VNET mode. */ - if (hw->dev->mode == DEV_MODE_VNET) { - mode = DEV_MODE_VNET; - hw->dev->mode = DEV_MODE_UNET; - } - - hw->info.name = CMICR_DEV_NAME; - hw->info.dev_id = hw->dev->dev_id; - hw->info.num_cmcs = CMICR_PDMA_CMC_MAX; - hw->info.cmc_chans = CMICR_PDMA_CMC_CHAN; - hw->info.num_chans = CMICR_PDMA_CMC_MAX * CMICR_PDMA_CMC_CHAN; - hw->info.rx_dcb_size = CMICR_PDMA_DCB_SIZE; - hw->info.tx_dcb_size = CMICR_PDMA_DCB_SIZE; - hw->hdls.reg_rd32(hw, CMICR_EP_TO_CPU_HEADER_SIZE, - &CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr_GET(val_header_size)); - hw->info.rx_ph_size = CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr_EP_TO_CPU_HEADER_SIZEf_GET(val_header_size) * 8; - hw->info.tx_ph_size = CMICR_TX_PKT_HDR_SIZE; - - /* Restore work mode to VNET. */ - if (mode == DEV_MODE_VNET) { - hw->dev->mode = DEV_MODE_VNET; - } - - return SHR_E_NONE; -} - -/*! - * Configure HW - */ -static int -cmicr_pdma_hw_config(struct pdma_hw *hw) -{ - struct dev_ctrl *ctrl = &hw->dev->ctrl; - struct pdma_rx_queue *rxq = NULL; - struct pdma_tx_queue *txq = NULL; - uint32_t que_ctrl; - int grp, que; - uint32_t qi; - int ip_if_hdr_endian = 0; - CMIC_CMC_PKTDMA_CTRLr_t pktdma_ctrl; - CMIC_CMC_PKTDMA_INTR_ENABLEr_t pktdma_intr_enable; - CMIC_CMC_PKTDMA_INTR_CLRr_t pktdma_intr_clr; - CMIC_TOP_CONFIGr_t cmic_config; - - CMIC_CMC_PKTDMA_INTR_ENABLEr_CLR(pktdma_intr_enable); - CMIC_CMC_PKTDMA_INTR_ENABLEr_DESC_CONTROLLED_INTR_ENABLEf_SET(pktdma_intr_enable, 1); - - CMIC_CMC_PKTDMA_INTR_CLRr_CLR(pktdma_intr_clr); - CMIC_CMC_PKTDMA_INTR_CLRr_DESC_DONE_INTR_CLRf_SET(pktdma_intr_clr, 1); - CMIC_CMC_PKTDMA_INTR_CLRr_DESC_CONTROLLED_INTR_CLRf_SET(pktdma_intr_clr, 1); - CMIC_CMC_PKTDMA_INTR_CLRr_INTR_COALESCING_INTR_CLRf_SET(pktdma_intr_clr, 1); - CMIC_CMC_PKTDMA_INTR_CLRr_DYN_RCNFG_ERR_CLRf_SET(pktdma_intr_clr, 1); - - for (qi = 0; qi < ctrl->nb_rxq; qi++) { - rxq = (struct pdma_rx_queue *)ctrl->rx_queue[qi]; - grp = rxq->group_id; - que = rxq->chan_id % CMICR_PDMA_CMC_CHAN; - que_ctrl = ctrl->grp[grp].que_ctrl[que]; - - hw->hdls.reg_wr32(hw, CMICR_PDMA_INTR_CLR(grp, que), - CMIC_CMC_PKTDMA_INTR_CLRr_GET(pktdma_intr_clr)); - CMIC_CMC_PKTDMA_CTRLr_CLR(pktdma_ctrl); - if (que_ctrl & PDMA_PKT_BYTE_SWAP) { - CMIC_CMC_PKTDMA_CTRLr_PKTDMA_ENDIANESSf_SET(pktdma_ctrl, 1); - } - if (que_ctrl & PDMA_OTH_BYTE_SWAP) { - CMIC_CMC_PKTDMA_CTRLr_DESC_ENDIANESSf_SET(pktdma_ctrl, 1); - } - if (que_ctrl & PDMA_HDR_BYTE_SWAP) { - CMIC_CMC_PKTDMA_CTRLr_HEADER_ENDIANESSf_SET(pktdma_ctrl, 1); - } - if (!(hw->dev->flags & PDMA_CHAIN_MODE)) { - CMIC_CMC_PKTDMA_CTRLr_ENABLE_CONTINUOUS_DMAf_SET(pktdma_ctrl, 1); - } - CMIC_CMC_PKTDMA_CTRLr_CONTIGUOUS_DESCRIPTORSf_SET(pktdma_ctrl, 1); - CMIC_CMC_PKTDMA_CTRLr_DESC_DONE_INTR_MODEf_SET(pktdma_ctrl, 1); - - hw->hdls.reg_wr32(hw, CMICR_PDMA_CTRL(grp, que), - CMIC_CMC_PKTDMA_CTRLr_GET(pktdma_ctrl)); - hw->hdls.reg_wr32(hw, CMICR_PDMA_INTR_ENAB(grp, que), - CMIC_CMC_PKTDMA_INTR_ENABLEr_GET(pktdma_intr_enable)); - } - - for (qi = 0; qi < ctrl->nb_txq; qi++) { - txq = (struct pdma_tx_queue *)ctrl->tx_queue[qi]; - grp = txq->group_id; - que = txq->chan_id % CMICR_PDMA_CMC_CHAN; - que_ctrl = ctrl->grp[grp].que_ctrl[que]; - - hw->hdls.reg_wr32(hw, CMICR_PDMA_INTR_CLR(grp, que), - CMIC_CMC_PKTDMA_INTR_CLRr_GET(pktdma_intr_clr)); - CMIC_CMC_PKTDMA_CTRLr_CLR(pktdma_ctrl); - if (que_ctrl & PDMA_PKT_BYTE_SWAP) { - CMIC_CMC_PKTDMA_CTRLr_PKTDMA_ENDIANESSf_SET(pktdma_ctrl, 1); - CMIC_CMC_PKTDMA_CTRLr_HEADER_ENDIANESSf_SET(pktdma_ctrl, 1); - ip_if_hdr_endian = 1; - } - if (que_ctrl & PDMA_OTH_BYTE_SWAP) { - CMIC_CMC_PKTDMA_CTRLr_DESC_ENDIANESSf_SET(pktdma_ctrl, 1); - } - if (que_ctrl & PDMA_HDR_BYTE_SWAP) { - ip_if_hdr_endian = 1; - } - if (!(hw->dev->flags & PDMA_CHAIN_MODE)) { - CMIC_CMC_PKTDMA_CTRLr_ENABLE_CONTINUOUS_DMAf_SET(pktdma_ctrl, 1); - } - CMIC_CMC_PKTDMA_CTRLr_CONTIGUOUS_DESCRIPTORSf_SET(pktdma_ctrl, 1); - CMIC_CMC_PKTDMA_CTRLr_DESC_DONE_INTR_MODEf_SET(pktdma_ctrl, 1); - CMIC_CMC_PKTDMA_CTRLr_DIRECTIONf_SET(pktdma_ctrl, 1); - - hw->hdls.reg_wr32(hw, CMICR_PDMA_CTRL(grp, que), - CMIC_CMC_PKTDMA_CTRLr_GET(pktdma_ctrl)); - hw->hdls.reg_wr32(hw, CMICR_PDMA_INTR_ENAB(grp, que), - CMIC_CMC_PKTDMA_INTR_ENABLEr_GET(pktdma_intr_enable)); - } - - hw->hdls.reg_rd32(hw, - CMICR_TOP_CONFIG, &CMIC_TOP_CONFIGr_GET(cmic_config)); - CMIC_TOP_CONFIGr_IP_INTERFACE_HEADER_ENDIANESSf_SET(cmic_config, - ip_if_hdr_endian); - hw->hdls.reg_wr32(hw, - CMICR_TOP_CONFIG, CMIC_TOP_CONFIGr_GET(cmic_config)); - - return SHR_E_NONE; -} - -/*! - * Reset HW - */ -static int -cmicr_pdma_hw_reset(struct pdma_hw *hw) -{ - int gi, qi; - - for (gi = 0; gi < hw->dev->num_groups; gi++) { - if (!hw->dev->ctrl.grp[gi].attached) { - continue; - } - for (qi = 0; qi < CMICR_PDMA_CMC_CHAN; qi++) { - if (1 << qi & hw->dev->ctrl.grp[gi].bm_rxq || - 1 << qi & hw->dev->ctrl.grp[gi].bm_txq) { - hw->hdls.reg_wr32(hw, CMICR_PDMA_CTRL(gi, qi), 0); - } - } - } - - return SHR_E_NONE; -} - -/*! - * Start a channel - */ -static int -cmicr_pdma_chan_start(struct pdma_hw *hw, int chan) -{ - CMIC_CMC_PKTDMA_CTRLr_t pktdma_ctrl; - int grp, que; - - grp = chan / CMICR_PDMA_CMC_CHAN; - que = chan % CMICR_PDMA_CMC_CHAN; - - hw->hdls.reg_rd32(hw, CMICR_PDMA_CTRL(grp, que), - &CMIC_CMC_PKTDMA_CTRLr_GET(pktdma_ctrl)); - CMIC_CMC_PKTDMA_CTRLr_DMA_ENf_SET(pktdma_ctrl, 1); - hw->hdls.reg_wr32(hw, CMICR_PDMA_CTRL(grp, que), - CMIC_CMC_PKTDMA_CTRLr_GET(pktdma_ctrl)); - - MEMORY_BARRIER; - - return SHR_E_NONE; -} - -/*! - * Stop a channel - */ -static int -cmicr_pdma_chan_stop(struct pdma_hw *hw, int chan) -{ - CMIC_CMC_PKTDMA_CTRLr_t pktdma_ctrl; - CMIC_CMC_PKTDMA_INTR_ENABLEr_t pktdma_intr_enable; - CMIC_CMC_PKTDMA_INTR_CLRr_t pktdma_intr_clr; - CMIC_CMC_PKTDMA_STATr_t pktdma_stat; - int grp, que; - int retry = CMICR_HW_RETRY_TIMES; - - grp = chan / CMICR_PDMA_CMC_CHAN; - que = chan % CMICR_PDMA_CMC_CHAN; - - hw->hdls.reg_rd32(hw, CMICR_PDMA_STAT(grp, que), - &CMIC_CMC_PKTDMA_STATr_GET(pktdma_stat)); - - if (CMIC_CMC_PKTDMA_STATr_CHAIN_DONEf_GET(pktdma_stat)) { - hw->hdls.reg_rd32(hw, CMICR_PDMA_CTRL(grp, que), - &CMIC_CMC_PKTDMA_CTRLr_GET(pktdma_ctrl)); - CMIC_CMC_PKTDMA_CTRLr_DMA_ENf_SET(pktdma_ctrl, 0); - hw->hdls.reg_wr32(hw, CMICR_PDMA_CTRL(grp, que), - CMIC_CMC_PKTDMA_CTRLr_GET(pktdma_ctrl)); - return SHR_E_NONE; - } - - /* if chain done is 0, abort */ - hw->hdls.reg_rd32(hw, CMICR_PDMA_CTRL(grp, que), - &CMIC_CMC_PKTDMA_CTRLr_GET(pktdma_ctrl)); - CMIC_CMC_PKTDMA_CTRLr_DMA_ENf_SET(pktdma_ctrl, 1); - CMIC_CMC_PKTDMA_CTRLr_ABORT_DMAf_SET(pktdma_ctrl, 1); - hw->hdls.reg_wr32(hw, CMICR_PDMA_CTRL(grp, que), - CMIC_CMC_PKTDMA_CTRLr_GET(pktdma_ctrl)); - - MEMORY_BARRIER; - - do { - hw->hdls.reg_rd32(hw, CMICR_PDMA_STAT(grp, que), - &CMIC_CMC_PKTDMA_STATr_GET(pktdma_stat)); - } while (!CMIC_CMC_PKTDMA_STATr_CHAIN_DONEf_GET(pktdma_stat) && (--retry > 0)); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_CTRL(grp, que), - &CMIC_CMC_PKTDMA_CTRLr_GET(pktdma_ctrl)); - CMIC_CMC_PKTDMA_CTRLr_DMA_ENf_SET(pktdma_ctrl, 0); - CMIC_CMC_PKTDMA_CTRLr_ABORT_DMAf_SET(pktdma_ctrl, 0); - hw->hdls.reg_wr32(hw, CMICR_PDMA_CTRL(grp, que), - CMIC_CMC_PKTDMA_CTRLr_GET(pktdma_ctrl)); - - MEMORY_BARRIER; - - CMIC_CMC_PKTDMA_INTR_ENABLEr_CLR(pktdma_intr_enable); - hw->hdls.reg_wr32(hw, CMICR_PDMA_INTR_ENAB(grp, que), - CMIC_CMC_PKTDMA_INTR_ENABLEr_GET(pktdma_intr_enable)); - - MEMORY_BARRIER; - - CMIC_CMC_PKTDMA_INTR_CLRr_CLR(pktdma_intr_clr); - CMIC_CMC_PKTDMA_INTR_CLRr_DESC_DONE_INTR_CLRf_SET(pktdma_intr_clr, 1); - CMIC_CMC_PKTDMA_INTR_CLRr_DESC_CONTROLLED_INTR_CLRf_SET(pktdma_intr_clr, 1); - CMIC_CMC_PKTDMA_INTR_CLRr_INTR_COALESCING_INTR_CLRf_SET(pktdma_intr_clr, 1); - CMIC_CMC_PKTDMA_INTR_CLRr_DYN_RCNFG_ERR_CLRf_SET(pktdma_intr_clr, 1); - hw->hdls.reg_wr32(hw, CMICR_PDMA_INTR_CLR(grp, que), - CMIC_CMC_PKTDMA_INTR_CLRr_GET(pktdma_intr_clr)); - - MEMORY_BARRIER; - - return SHR_E_NONE; -} - -/*! - * Setup a channel - */ -static int -cmicr_pdma_chan_setup(struct pdma_hw *hw, int chan, uint64_t addr) -{ - int grp, que; - - grp = chan / CMICR_PDMA_CMC_CHAN; - que = chan % CMICR_PDMA_CMC_CHAN; - - hw->hdls.reg_wr32(hw, CMICR_PDMA_DESC_LO(grp, que), addr); - hw->hdls.reg_wr32(hw, CMICR_PDMA_DESC_HI(grp, que), DMA_TO_BUS_HI(addr >> 32)); - - MEMORY_BARRIER; - - return SHR_E_NONE; -} - -/*! - * Set halt point for a channel - */ -static int -cmicr_pdma_chan_goto(struct pdma_hw *hw, int chan, uint64_t addr) -{ - int grp, que; - - grp = chan / CMICR_PDMA_CMC_CHAN; - que = chan % CMICR_PDMA_CMC_CHAN; - - hw->hdls.reg_wr32(hw, CMICR_PDMA_DESC_HALT_LO(grp, que), addr); - hw->hdls.reg_wr32(hw, CMICR_PDMA_DESC_HALT_HI(grp, que), DMA_TO_BUS_HI(addr >> 32)); - - MEMORY_BARRIER; - - return SHR_E_NONE; -} - -/*! - * Clear a channel - */ -static int -cmicr_pdma_chan_clear(struct pdma_hw *hw, int chan) -{ - CMIC_CMC_PKTDMA_INTR_CLRr_t pktdma_intr_clr; - int grp, que; - - grp = chan / CMICR_PDMA_CMC_CHAN; - que = chan % CMICR_PDMA_CMC_CHAN; - - CMIC_CMC_PKTDMA_INTR_CLRr_CLR(pktdma_intr_clr); - CMIC_CMC_PKTDMA_INTR_CLRr_DESC_CONTROLLED_INTR_CLRf_SET(pktdma_intr_clr, 1); - hw->hdls.reg_wr32(hw, CMICR_PDMA_INTR_CLR(grp, que), - CMIC_CMC_PKTDMA_INTR_CLRr_GET(pktdma_intr_clr)); - - MEMORY_BARRIER; - - return SHR_E_NONE; -} - -/*! - * Get interrupt number for a channel - */ -static int -cmicr_pdma_chan_intr_num_get(struct pdma_hw *hw, int chan) -{ - int grp, que; - const int irq_map[CMICR_PDMA_CMC_MAX][CMICR_PDMA_CMC_CHAN] = - {{CMICR_IRQ_CMC0_PKTDMA_CH0_INTR, CMICR_IRQ_CMC0_PKTDMA_CH1_INTR, - CMICR_IRQ_CMC0_PKTDMA_CH2_INTR, CMICR_IRQ_CMC0_PKTDMA_CH3_INTR, - CMICR_IRQ_CMC0_PKTDMA_CH4_INTR, CMICR_IRQ_CMC0_PKTDMA_CH5_INTR, - CMICR_IRQ_CMC0_PKTDMA_CH6_INTR, CMICR_IRQ_CMC0_PKTDMA_CH7_INTR, - CMICR_IRQ_CMC0_PKTDMA_CH8_INTR, CMICR_IRQ_CMC0_PKTDMA_CH9_INTR, - CMICR_IRQ_CMC0_PKTDMA_CH10_INTR, CMICR_IRQ_CMC0_PKTDMA_CH11_INTR, - CMICR_IRQ_CMC0_PKTDMA_CH12_INTR, CMICR_IRQ_CMC0_PKTDMA_CH13_INTR, - CMICR_IRQ_CMC0_PKTDMA_CH14_INTR, CMICR_IRQ_CMC0_PKTDMA_CH15_INTR}, - {CMICR_IRQ_CMC1_PKTDMA_CH0_INTR, CMICR_IRQ_CMC1_PKTDMA_CH1_INTR, - CMICR_IRQ_CMC1_PKTDMA_CH2_INTR, CMICR_IRQ_CMC1_PKTDMA_CH3_INTR, - CMICR_IRQ_CMC1_PKTDMA_CH4_INTR, CMICR_IRQ_CMC1_PKTDMA_CH5_INTR, - CMICR_IRQ_CMC1_PKTDMA_CH6_INTR, CMICR_IRQ_CMC1_PKTDMA_CH7_INTR, - CMICR_IRQ_CMC1_PKTDMA_CH8_INTR, CMICR_IRQ_CMC1_PKTDMA_CH9_INTR, - CMICR_IRQ_CMC1_PKTDMA_CH10_INTR, CMICR_IRQ_CMC1_PKTDMA_CH11_INTR, - CMICR_IRQ_CMC1_PKTDMA_CH12_INTR, CMICR_IRQ_CMC1_PKTDMA_CH13_INTR, - CMICR_IRQ_CMC1_PKTDMA_CH14_INTR, CMICR_IRQ_CMC1_PKTDMA_CH15_INTR}}; - - grp = chan / CMICR_PDMA_CMC_CHAN; - que = chan % CMICR_PDMA_CMC_CHAN; - - if (grp < 0 || grp >= CMICR_PDMA_CMC_MAX) { - return -1; - } - - return irq_map[grp][que]; -} - -/*! - * Enable interrupt for a channel - */ -static int -cmicr_pdma_chan_intr_enable(struct pdma_hw *hw, int chan) -{ - int grp, que; - - grp = chan / CMICR_PDMA_CMC_CHAN; - que = chan % CMICR_PDMA_CMC_CHAN; - - hw->dev->ctrl.grp[grp].irq_mask |= (1 << que); - cmicr_pdma_intr_enable(hw, grp, que); - - return SHR_E_NONE; -} - -/*! - * Disable interrupt for a channel - */ -static int -cmicr_pdma_chan_intr_disable(struct pdma_hw *hw, int chan) -{ - int grp, que; - - grp = chan / CMICR_PDMA_CMC_CHAN; - que = chan % CMICR_PDMA_CMC_CHAN; - - hw->dev->ctrl.grp[grp].irq_mask &= ~(1 << que); - cmicr_pdma_intr_disable(hw, grp, que); - - return SHR_E_NONE; -} - -/*! - * Query interrupt status for a channel - * - * In group mode (interrupt processing per CMC), need to query each channel's - * interrupt status. - * - */ -static int -cmicr_pdma_chan_intr_query(struct pdma_hw *hw, int chan) -{ - CMIC_CMC_PKTDMA_INTRr_t pktdma_intr; - int grp, que; - - grp = chan / CMICR_PDMA_CMC_CHAN; - que = chan % CMICR_PDMA_CMC_CHAN; - - hw->hdls.reg_rd32(hw, CMICR_PDMA_INTR_STAT(grp, que), - &CMIC_CMC_PKTDMA_INTRr_GET(pktdma_intr)); - - return CMIC_CMC_PKTDMA_INTRr_DESC_CONTROLLED_INTRf_GET(pktdma_intr); -} - -/*! - * Check interrupt validity for a channel - * - * In group mode (interrupt processing per CMC), need to check each channel's - * interrupt validity based on its interrupt mask. - * - */ -static int -cmicr_pdma_chan_intr_check(struct pdma_hw *hw, int chan) -{ - int grp, que; - - grp = chan / CMICR_PDMA_CMC_CHAN; - que = chan % CMICR_PDMA_CMC_CHAN; - - if (!(hw->dev->ctrl.grp[grp].irq_mask & (1 << que))) { - return 0; - } - - return cmicr_pdma_chan_intr_query(hw, chan); -} - -/*! - * Coalesce interrupt for a channel - */ -static int -cmicr_pdma_chan_intr_coalesce(struct pdma_hw *hw, int chan, int count, int timer) -{ - CMIC_CMC_PKTDMA_INTR_COALr_t pktdma_intr_col; - int grp, que; - - grp = chan / CMICR_PDMA_CMC_CHAN; - que = chan % CMICR_PDMA_CMC_CHAN; - - CMIC_CMC_PKTDMA_INTR_COALr_CLR(pktdma_intr_col); - CMIC_CMC_PKTDMA_INTR_COALr_ENABLEf_SET(pktdma_intr_col, 1); - CMIC_CMC_PKTDMA_INTR_COALr_COUNTf_SET(pktdma_intr_col, count); - CMIC_CMC_PKTDMA_INTR_COALr_TIMERf_SET(pktdma_intr_col, timer); - hw->hdls.reg_wr32(hw, CMICR_PDMA_INTR_COAL(grp, que), - CMIC_CMC_PKTDMA_INTR_COALr_GET(pktdma_intr_col)); - - return SHR_E_NONE; -} - -/*! - * Dump registers for a channel - */ -static int -cmicr_pdma_chan_reg_dump(struct pdma_hw *hw, int chan) -{ - uint32_t val; - int grp, que; - - grp = chan / CMICR_PDMA_CMC_CHAN; - que = chan % CMICR_PDMA_CMC_CHAN; - - hw->hdls.reg_rd32(hw, CMICR_PDMA_CTRL(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_CTRL: 0x%08x\n", grp, que, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_DESC_LO(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_DESC_LO: 0x%08x\n", grp, que, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_DESC_HI(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_DESC_HI: 0x%08x\n", grp, que, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_CURR_DESC_LO(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_CURR_DESC_LO: 0x%08x\n", grp, que, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_CURR_DESC_HI(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_CURR_DESC_HI: 0x%08x\n", grp, que, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_DESC_HALT_LO(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_DESC_HALT_ADDR_LO: 0x%08x\n", grp, que, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_DESC_HALT_HI(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_DESC_HALT_ADDR_HI: 0x%08x\n", grp, que, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_COS_CTRL_RX0(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_COS_CTRL_RX_0: 0x%08x\n", grp, que, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_COS_CTRL_RX1(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_COS_CTRL_RX_1: 0x%08x\n", grp, que, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_INTR_COAL(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_INTR_COAL: 0x%08x\n", grp, que, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_RBUF_THRE(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_RXBUF_THRESHOLD_CONFIG: 0x%08x\n", grp, que, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_STAT(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_STAT: 0x%08x\n", grp, que, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_COUNT_RX(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_PKT_COUNT_RXPKT: 0x%08x\n", grp, que, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_COUNT_TX(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_PKT_COUNT_TXPKT: 0x%08x\n", grp, que, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_COUNT_RX_DROP(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_PKT_COUNT_RXPKT_DROP: 0x%08x\n", grp, que, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_INTR_ENAB(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_INTR_ENAB: 0x%08x\n", grp, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_INTR_STAT(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_INTR_STAT: 0x%08x\n", grp, val); - - hw->hdls.reg_rd32(hw, CMICR_PDMA_INTR_CLR(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_INTR_CLR: 0x%08x\n", grp, val); - - val = hw->dev->ctrl.grp[grp].irq_mask; - CNET_INFO(hw->unit, "CMIC_CMC%d_IRQ_ENAB: 0x%08x\n", grp, val); - - hw->hdls.reg_rd32(hw, CMICR_EP_TO_CPU_HEADER_SIZE, &val); - CNET_INFO(hw->unit, "CMIC_EP_TO_CPU_HEADER_SIZE: 0x%08x\n", val); - - return SHR_E_NONE; -} - -/*! - * Initialize function pointers - */ -int -bcmcnet_cmicr_pdma_hw_hdls_init(struct pdma_hw *hw) -{ - if (!hw) { - return SHR_E_PARAM; - } - - hw->hdls.reg_rd32 = cmicr_pdma_reg_read32; - hw->hdls.reg_wr32 = cmicr_pdma_reg_write32; - hw->hdls.hw_init = cmicr_pdma_hw_init; - hw->hdls.hw_config = cmicr_pdma_hw_config; - hw->hdls.hw_reset = cmicr_pdma_hw_reset; - hw->hdls.chan_start = cmicr_pdma_chan_start; - hw->hdls.chan_stop = cmicr_pdma_chan_stop; - hw->hdls.chan_setup = cmicr_pdma_chan_setup; - hw->hdls.chan_goto = cmicr_pdma_chan_goto; - hw->hdls.chan_clear = cmicr_pdma_chan_clear; - hw->hdls.chan_intr_num_get = cmicr_pdma_chan_intr_num_get; - hw->hdls.chan_intr_enable = cmicr_pdma_chan_intr_enable; - hw->hdls.chan_intr_disable = cmicr_pdma_chan_intr_disable; - hw->hdls.chan_intr_query = cmicr_pdma_chan_intr_query; - hw->hdls.chan_intr_check = cmicr_pdma_chan_intr_check; - hw->hdls.chan_intr_coalesce = cmicr_pdma_chan_intr_coalesce; - hw->hdls.chan_reg_dump = cmicr_pdma_chan_reg_dump; - - return SHR_E_NONE; -} diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicr/bcmcnet_cmicr_pdma_rxtx.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicr/bcmcnet_cmicr_pdma_rxtx.c deleted file mode 100644 index 381b9e208446..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicr/bcmcnet_cmicr_pdma_rxtx.c +++ /dev/null @@ -1,1187 +0,0 @@ -/*! \file bcmcnet_cmicr_pdma_rxtx.c - * - * Utility routines for BCMCNET hardware (CMICr) specific Rx/Tx. - * - * Here are the CMIC specific Rx/Tx routines including DCBs resource allocation - * and clean up, DCBs configuration, Rx buffers allocation, Tx buffers release, - * Rx/Tx packets processing, etc. - * They are shared among all the modes (UNET, KNET, VNET, HNET) and in both of - * user space and kernel space. - * - * The driver uses a ring of DCBs per DMA channel based on Continuous DMA mode. - * The beginning is written to register pointing to the physical address of the - * start of the ring. The ring size is maintained by the driver. A HALT DCB - * physical address is written to DMA register timely to indicate how many DCBs - * can be handled by HW. - * - * When a packet is received, an interrupt is triggered. The handler will go - * through the Rx DCB ring to process the current completed DCB and every - * subsequent DCBs until no one is left. The received packet is processed and - * passed up to the high level SW. After that, a new buffer is allocated and - * the DCB is updated for receiving a new packet. A new HALT DCB is selected - * and its physical address is written to DMA register. - * - * When a packet is transmitted, the driver starts where it left off last time - * in the Tx DCB ring, updates the DCB and writes its physical address to DMA - * register so as to start DMA. Once the transmitting is finished, the handler - * is informed to clean up the buffer based on the work mode. In KNET or HNET - * mode, an interrupt will be triggered. Polling mode is used in CNET or VNET - * mode, the buffers will be cleaned up when the number of dirty DCBs reaches - * a pre-defined threshold. - * - * In VNET and HNET modes, DCB updating between virtual ring and real ring and - * a IOCTL based notification mechanism are involved. The hypervisor in kernel - * emulates the DMA HW behaviors to update DCBs in virtual network and inform - * the handler something happened. Likewise, the hypervisor updates itself real - * DCB ring from the virtual ring to start DMA for transmitting a packet once a - * notification is received from the virtual network. - * - */ -/* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - */ - -#include -#include -#include -#include -#include - -#define RX_DCB_CTRL_WORD (2) -#define RX_DCB_STATUS_WORD (3) -#define RX_DCB_STATUS_GET(_rd_) (RX_DCB_GET((_rd_), RX_DCB_STATUS_WORD)) -#define RX_DCB_STATUS_SET(_rd_, _val_) (RX_DCB_SET((_rd_), RX_DCB_STATUS_WORD, (_val_))) -#define RX_DCB_CTRL_SET(_rd_, _val_) (RX_DCB_SET((_rd_), RX_DCB_CTRL_WORD, (_val_))) - -#define TX_DCB_CTRL_WORD (2) -#define TX_DCB_STATUS_WORD (3) -#define TX_DCB_STATUS_GET(_td_) (TX_DCB_GET((_td_), TX_DCB_STATUS_WORD)) -#define TX_DCB_STATUS_SET(_td_, _val_) (TX_DCB_SET((_td_), TX_DCB_STATUS_WORD, (_val_))) -#define TX_DCB_CTRL_SET(_td_, _val_) (TX_DCB_SET((_td_), TX_DCB_CTRL_WORD, (_val_))) - -/*! - * Configure Rx descriptor - */ -static inline void -cmicr_rx_desc_config(volatile RX_DCB_t *rd, uint64_t addr, uint32_t len) -{ - uint32_t remain; - - /* word 0, 1 : addr */ - RX_DCB_ADDR_LOf_SET(*rd, addr); - RX_DCB_ADDR_HIf_SET(*rd, DMA_TO_BUS_HI(addr >> 32)); - - /* word 2: ctrl */ - remain = RX_DCB_DESC_REMAINf_GET(*rd); - RX_DCB_CTRL_SET(*rd, 0); - RX_DCB_DESC_REMAINf_SET(*rd, remain); - RX_DCB_DESC_CTRL_INTRf_SET(*rd, 1); - RX_DCB_CHAINf_SET(*rd, 1); - RX_DCB_BYTE_COUNTf_SET(*rd, len); - - /* word 3: status */ - RX_DCB_STATUS_SET(*rd, 0); - - MEMORY_BARRIER; -} - -/*! - * Configure Tx descriptor - */ -static inline void -cmicr_tx_desc_config(volatile TX_DCB_t *td, uint64_t addr, uint32_t len, uint16_t flags) -{ - uint32_t remain; - - /* word 0,1 : addr */ - TX_DCB_ADDR_LOf_SET(*td, addr); - TX_DCB_ADDR_HIf_SET(*td, DMA_TO_BUS_HI(addr >> 32)); - - /* word 2: ctrl */ - remain = TX_DCB_DESC_REMAINf_GET(*td); - TX_DCB_CTRL_SET(*td, 0); - TX_DCB_DESC_REMAINf_SET(*td, remain); - TX_DCB_DESC_CTRL_INTRf_SET(*td, 1); - TX_DCB_CHAINf_SET(*td, 1); - TX_DCB_BYTE_COUNTf_SET(*td, len); - if (flags & PDMA_TX_HIGIG_PKT) { - TX_DCB_HGf_SET(*td, 1); - } - if (flags & PDMA_TX_PURGE_PKT) { - TX_DCB_PURGEf_SET(*td, 1); - } - - /* word 3: status */ - TX_DCB_STATUS_SET(*td, 0); - - MEMORY_BARRIER; -} - -/*! - * Configure Rx reload descriptor - */ -static inline void -cmicr_rx_rldesc_config(volatile RX_DCB_t *rd, uint64_t addr) -{ - /* word 0,1 : addr */ - RX_DCB_ADDR_LOf_SET(*rd, addr); - RX_DCB_ADDR_HIf_SET(*rd, DMA_TO_BUS_HI(addr >> 32)); - - /* word 2: ctrl */ - RX_DCB_CTRL_SET(*rd, 0); - RX_DCB_DESC_CTRL_INTRf_SET(*rd, 1); - RX_DCB_CHAINf_SET(*rd, 1); - RX_DCB_RELOADf_SET(*rd, 1); - - /* word 3: status */ - RX_DCB_STATUS_SET(*rd, 0); - - MEMORY_BARRIER; -} - -/*! - * Configure Tx reload descriptor - */ -static inline void -cmicr_tx_rldesc_config(volatile TX_DCB_t *td, uint64_t addr) -{ - /* word 0, 1 : addr */ - TX_DCB_ADDR_LOf_SET(*td, addr); - TX_DCB_ADDR_HIf_SET(*td, DMA_TO_BUS_HI(addr >> 32)); - - /* word 2: ctrl */ - TX_DCB_CTRL_SET(*td, 0); - TX_DCB_DESC_CTRL_INTRf_SET(*td, 1); - TX_DCB_CHAINf_SET(*td, 1); - TX_DCB_RELOADf_SET(*td, 1); - - /* word 3: status */ - TX_DCB_STATUS_SET(*td, 0); - - MEMORY_BARRIER; -} - -/*! - * Chain Rx descriptor - */ -static inline void -cmicr_rx_desc_chain(volatile RX_DCB_t *rd, int chain) -{ - if (chain) { - RX_DCB_CHAINf_SET(*rd, 1); - } else { - RX_DCB_CHAINf_SET(*rd, 0); - } - - MEMORY_BARRIER; -} - -/*! - * Chain Tx descriptor - */ -static inline void -cmicr_tx_desc_chain(volatile TX_DCB_t *td, int chain) -{ - if (chain) { - TX_DCB_CHAINf_SET(*td, 1); - } else { - TX_DCB_CHAINf_SET(*td, 0); - } - - MEMORY_BARRIER; -} - -/*! - * Set Rx descriptor remain - */ -static inline void -cmicr_rx_desc_remain(volatile RX_DCB_t *rd, uint32_t rm) -{ - RX_DCB_DESC_REMAINf_SET(*rd, rm); - - MEMORY_BARRIER; -} - -/*! - * Set Tx descriptor remain - */ -static inline void -cmicr_tx_desc_remain(volatile TX_DCB_t *td, uint32_t rm) -{ - TX_DCB_DESC_REMAINf_SET(*td, rm); - - MEMORY_BARRIER; -} - -/*! - * Get unused descriptors in a Rx ring - */ -static inline int -cmicr_pdma_rx_ring_unused(struct pdma_rx_queue *rxq) -{ - /* Leave one descriptor unused so as not to halt */ - return (rxq->nb_desc + rxq->curr - rxq->halt - 1) % rxq->nb_desc; -} - -/*! - * Get unused descriptors in a Tx ring - */ -static inline int -cmicr_pdma_tx_ring_unused(struct pdma_tx_queue *txq) -{ - /* Leave one descriptor unused so as not to halt */ - return (txq->nb_desc + txq->dirt - txq->curr - 1) % txq->nb_desc; -} - -/*! - * Initialize Rx descriptors - */ -static int -cmicr_pdma_rx_desc_init(struct pdma_hw *hw, struct pdma_rx_queue *rxq) -{ - struct pdma_dev *dev = hw->dev; - struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; - volatile RX_DCB_t *ring = (volatile RX_DCB_t *)rxq->ring; - dma_addr_t addr; - uint32_t di, rm; - int rv; - - for (di = 0; di < rxq->nb_desc; di++) { - if (!rxq->pbuf[di].dma) { - /* Allocate pktbuf for ring entry */ - rv = bm->rx_buf_alloc(dev, rxq, &rxq->pbuf[di]); - if (SHR_FAILURE(rv)) { - goto cleanup; - } - } - /* Config receive descriptor ring */ - bm->rx_buf_dma(dev, rxq, &rxq->pbuf[di], &addr); - cmicr_rx_desc_config(&ring[di], addr, rxq->buf_size); - rm = (rxq->nb_desc - di) >= CMICR_DESC_REMAIN_MAX ? - CMICR_DESC_REMAIN_MAX : rxq->nb_desc - di; - cmicr_rx_desc_remain(&ring[di], rm); - if (hw->dev->flags & PDMA_CHAIN_MODE && di == rxq->nb_desc - 1) { - cmicr_rx_desc_chain(&ring[di], 0); - } - } - /* Config the last descriptor in the ring as reload descriptor */ - cmicr_rx_rldesc_config(&ring[di], rxq->ring_addr); - - rxq->curr = 0; - rxq->halt = rxq->nb_desc - 1; - - rxq->halt_addr = rxq->ring_addr + sizeof(RX_DCB_t) * rxq->halt; - hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); - hw->hdls.chan_setup(hw, rxq->chan_id, rxq->ring_addr); - - return SHR_E_NONE; - -cleanup: - for (di = 0; di < rxq->nb_desc; di++) { - if (rxq->pbuf[di].dma) { - bm->rx_buf_free(dev, rxq, &rxq->pbuf[di]); - } - cmicr_rx_desc_config(&ring[di], 0, 0); - } - - CNET_ERROR(hw->unit, "RX: Failed to allocate memory\n"); - - return SHR_E_MEMORY; -} - -/*! - * Cleanup Rx descriptors - */ -static int -cmicr_pdma_rx_desc_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq) -{ - struct pdma_dev *dev = hw->dev; - struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; - volatile RX_DCB_t *ring = (volatile RX_DCB_t *)rxq->ring; - uint32_t di; - - /* Go through all the descriptors and free pktbuf */ - for (di = 0; di < rxq->nb_desc; di++) { - if (rxq->pbuf[di].dma) { - bm->rx_buf_free(dev, rxq, &rxq->pbuf[di]); - } - cmicr_rx_desc_config(&ring[di], 0, 0); - } - - rxq->curr = 0; - rxq->halt = 0; - - return SHR_E_NONE; -} - -/*! - * Initialize Tx descriptors - */ -static int -cmicr_pdma_tx_desc_init(struct pdma_hw *hw, struct pdma_tx_queue *txq) -{ - struct pdma_dev *dev = hw->dev; - struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; - volatile TX_DCB_t *ring = (volatile TX_DCB_t *)txq->ring; - uint32_t di, rm; - - for (di = 0; di < txq->nb_desc; di++) { - if (txq->pbuf[di].dma) { - bm->tx_buf_free(dev, txq, &txq->pbuf[di]); - } - /* Config transmit descriptor ring */ - cmicr_tx_desc_config(&ring[di], 0, 0, 0); - rm = (txq->nb_desc - di) >= CMICR_DESC_REMAIN_MAX ? - CMICR_DESC_REMAIN_MAX : txq->nb_desc - di; - cmicr_tx_desc_remain(&ring[di], rm); - if (hw->dev->flags & PDMA_CHAIN_MODE) { - cmicr_tx_desc_chain(&ring[di], 0); - } - } - /* Config the last descriptor in the ring as reload descriptor */ - cmicr_tx_rldesc_config(&ring[di], txq->ring_addr); - - txq->curr = 0; - txq->dirt = 0; - txq->halt = 0; - - txq->halt_addr = txq->ring_addr; - hw->hdls.chan_goto(hw, txq->chan_id, txq->halt_addr); - hw->hdls.chan_setup(hw, txq->chan_id, txq->ring_addr); - - return SHR_E_NONE; -} - -/*! - * Cleanup Tx descriptors - */ -static int -cmicr_pdma_tx_desc_clean(struct pdma_hw *hw, struct pdma_tx_queue *txq) -{ - struct pdma_dev *dev = hw->dev; - struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; - volatile TX_DCB_t *ring = (volatile TX_DCB_t *)txq->ring; - uint32_t di; - - /* Go through all the descriptors and free pktbuf */ - for (di = 0; di < txq->nb_desc; di++) { - if (txq->pbuf[di].dma) { - bm->tx_buf_free(dev, txq, &txq->pbuf[di]); - } - cmicr_tx_desc_config(&ring[di], 0, 0, 0); - } - - txq->curr = 0; - txq->dirt = 0; - txq->halt = 0; - - return SHR_E_NONE; -} - -/*! - * Process Rx vring - */ -static int -cmicr_pdma_rx_vring_process(struct pdma_hw *hw, struct pdma_rx_queue *rxq, - struct pdma_rx_buf *pbuf) -{ - struct pdma_dev *dev = hw->dev; - volatile RX_DCB_t *ring = (volatile RX_DCB_t *)rxq->ring; - struct pdma_rx_queue *vrxq = NULL; - volatile RX_DCB_t *vring = NULL; - struct pkt_hdr *pkh = &pbuf->pkb->pkh; - uint64_t buf_addr; - - vrxq = (struct pdma_rx_queue *)dev->ctrl.vnet_rxq[rxq->queue_id]; - vring = (volatile RX_DCB_t *)vrxq->ring; - if (!vring) { - rxq->stats.dropped++; - return SHR_E_UNAVAIL; - } - - if (RX_DCB_DONEf_GET(vring[vrxq->curr])) { - dev->xnet_wake(dev); - return SHR_E_BUSY; - } - - /* Copy descriptor and packet to vring */ - buf_addr = BUS_TO_DMA_HI(RX_DCB_ADDR_HIf_GET(vring[vrxq->curr])); - buf_addr = buf_addr << 32 | RX_DCB_ADDR_LOf_GET(vring[vrxq->curr]); - sal_memcpy(dev->sys_p2v(dev, buf_addr), &pbuf->pkb->data, - pkh->meta_len + pkh->data_len); - RX_DCB_STATUS_SET(vring[vrxq->curr], RX_DCB_STATUS_GET(ring[rxq->curr])); - - MEMORY_BARRIER; - - /* Notify VNET to process if needed */ - if (!RX_DCB_STATUS_GET(vring[(vrxq->curr + vrxq->nb_desc - 1) % vrxq->nb_desc])) { - dev->xnet_wake(dev); - } - vrxq->curr = (vrxq->curr + 1) % vrxq->nb_desc; - - return SHR_E_NONE; -} - -/*! - * Refill Rx ring - */ -static int -cmicr_pdma_rx_ring_refill(struct pdma_hw *hw, struct pdma_rx_queue *rxq) -{ - struct pdma_dev *dev = hw->dev; - struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; - volatile RX_DCB_t *ring = (volatile RX_DCB_t *)rxq->ring; - struct pdma_rx_buf *pbuf = NULL; - int unused = cmicr_pdma_rx_ring_unused(rxq); - dma_addr_t addr; - uint32_t halt; - int rv; - - for (halt = rxq->halt; halt < rxq->halt + unused; halt++) { - if (RX_DCB_ADDR_LOf_GET(ring[halt % rxq->nb_desc])) { - continue; - } - pbuf = &rxq->pbuf[halt % rxq->nb_desc]; - /* Allocate a new pktbuf */ - if (!bm->rx_buf_avail(dev, rxq, pbuf)) { - rv = bm->rx_buf_alloc(dev, rxq, pbuf); - if (SHR_FAILURE(rv)) { - rxq->stats.nomems++; - rxq->halt = halt % rxq->nb_desc; - CNET_ERROR(hw->unit, "Can not alloc RX buffer, %d DCBs not filled\n", - cmicr_pdma_rx_ring_unused(rxq)); - break; - } - } - /* Setup the new descriptor */ - bm->rx_buf_dma(dev, rxq, pbuf, &addr); - cmicr_rx_desc_config(&ring[halt % rxq->nb_desc], addr, rxq->buf_size); - if (dev->flags & PDMA_CHAIN_MODE && halt % rxq->nb_desc == rxq->nb_desc - 1) { - cmicr_rx_desc_chain(&ring[halt % rxq->nb_desc], 0); - } - } - rxq->halt = halt % rxq->nb_desc; - - /* Move forward */ - sal_spinlock_lock(rxq->lock); - if (!(rxq->status & PDMA_RX_QUEUE_XOFF)) { - /* Descriptor cherry pick */ - rxq->halt_addr = rxq->ring_addr + sizeof(RX_DCB_t) * rxq->halt; - hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); - } - sal_spinlock_unlock(rxq->lock); - - return SHR_E_NONE; -} - -/*! - * \brief Clean Rx ring - * - * \param [in] hw HW structure point. - * \param [in] rxq Rx queue structure point. - * \param [in] budget Polling budget. - * - * \retval SHR_E_NONE No errors. - * \retval SHR_E_XXXX Operation failed. - */ -static int -cmicr_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budget) -{ - struct pdma_dev *dev = hw->dev; - struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; - volatile RX_DCB_t *ring = (volatile RX_DCB_t *)rxq->ring; - struct pdma_rx_buf *pbuf = NULL; - struct pkt_hdr *pkh = NULL; - dma_addr_t addr; - uint32_t curr; - int len, done = 0; - int retry; - int rv; - - curr = rxq->curr; - while (RX_DCB_DONEf_GET(ring[curr])) { - if (done == budget) { - break; - } - - /* Move forward */ - if (!(rxq->state & PDMA_RX_BATCH_REFILL)) { - sal_spinlock_lock(rxq->lock); - if (!(rxq->status & PDMA_RX_QUEUE_XOFF)) { - /* Descriptor cherry pick */ - rxq->halt_addr = rxq->ring_addr + sizeof(RX_DCB_t) * curr; - hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); - rxq->halt = curr; - } - sal_spinlock_unlock(rxq->lock); - } - - /* Get the current pktbuf to process */ - pbuf = &rxq->pbuf[curr]; - len = RX_DCB_BYTES_TRANSFERREDf_GET(ring[curr]); - pkh = bm->rx_buf_get(dev, rxq, pbuf, len); - if (!pkh) { - CNET_ERROR(hw->unit, "RX buffer build failed, retry ...\n"); - rxq->stats.nomems++; - /* Set busy state to retry */ - rxq->state |= PDMA_RX_QUEUE_BUSY; - return budget; - } - - /* Setup packet header */ - pkh->data_len = len - hw->info.rx_ph_size; - pkh->meta_len = hw->info.rx_ph_size; - pkh->queue_id = rxq->queue_id; - - /* Send up the packet */ - rv = dev->pkt_recv(dev, rxq->queue_id, (void *)pbuf->skb); - if (SHR_FAILURE(rv)) { - if (dev->mode == DEV_MODE_HNET && pkh->attrs & PDMA_RX_TO_VNET) { - rv = cmicr_pdma_rx_vring_process(hw, rxq, pbuf); - if (SHR_FAILURE(rv) && rv == SHR_E_BUSY) { - rxq->state |= PDMA_RX_QUEUE_BUSY; - return done; - } - } else { - rxq->stats.dropped++; - } - bm->rx_buf_put(dev, rxq, pbuf, len); - } - - /* Count the packets/bytes */ - rxq->stats.packets++; - rxq->stats.bytes += len; - - /* Count the errors if any */ - if (RX_DCB_ERRORf_GET(ring[curr])) { - rxq->stats.errors++; - } - - /* Setup the new descriptor */ - if (!(rxq->state & PDMA_RX_BATCH_REFILL)) { - if (!bm->rx_buf_avail(dev, rxq, pbuf)) { - retry = 0; - while (1) { - rv = bm->rx_buf_alloc(dev, rxq, pbuf); - if (SHR_SUCCESS(rv)) { - break; - } - rxq->stats.nomems++; - if (dev->mode == DEV_MODE_UNET || dev->mode == DEV_MODE_VNET) { - if (retry++ < 5000000) { - sal_usleep(1); - continue; - } - CNET_ERROR(hw->unit, "Fatal error: can not alloc RX buffer\n"); - } - rxq->state |= PDMA_RX_BATCH_REFILL; - rxq->free_thresh = 1; - cmicr_rx_desc_config(&ring[curr], 0, 0); - CNET_ERROR(hw->unit, "RX buffer alloc failed, try batch refilling later\n"); - break; - } - } - if (pbuf->dma) { - bm->rx_buf_dma(dev, rxq, pbuf, &addr); - cmicr_rx_desc_config(&ring[curr], addr, rxq->buf_size); - if (dev->flags & PDMA_CHAIN_MODE && curr == rxq->nb_desc - 1) { - cmicr_rx_desc_chain(&ring[curr], 0); - } - } - } else { - cmicr_rx_desc_config(&ring[curr], 0, 0); - } - - /* Notify HNET to process if needed */ - if (dev->mode == DEV_MODE_VNET) { - if (RX_DCB_STATUS_GET(ring[(curr + rxq->nb_desc - 1) % rxq->nb_desc])) { - dev->xnet_wake(dev); - } - } - - /* Update the indicators */ - if (!(rxq->state & PDMA_RX_BATCH_REFILL) && rxq->halt != curr) { - sal_spinlock_lock(rxq->lock); - if (!(rxq->status & PDMA_RX_QUEUE_XOFF)) { - /* Descriptor cherry pick */ - rxq->halt_addr = rxq->ring_addr + sizeof(RX_DCB_t) * curr; - hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); - rxq->halt = curr; - } - curr = (curr + 1) % rxq->nb_desc; - sal_spinlock_unlock(rxq->lock); - } else { - curr = (curr + 1) % rxq->nb_desc; - } - rxq->curr = curr; - done++; - - /* Restart DMA if in chain mode */ - if (dev->flags & PDMA_CHAIN_MODE) { - sal_spinlock_lock(rxq->lock); - if (curr == 0 && !(rxq->status & PDMA_RX_QUEUE_XOFF)) { - hw->hdls.chan_stop(hw, rxq->chan_id); - hw->hdls.chan_start(hw, rxq->chan_id); - } - sal_spinlock_unlock(rxq->lock); - } - } - - /* One more poll for chain done in chain mode */ - if (dev->flags & PDMA_CHAIN_MODE) { - if (curr == rxq->nb_desc - 1 && done) { - done = budget; - } - } - - /* In batching mode, replenish all the unused descriptors */ - if (rxq->state & PDMA_RX_BATCH_REFILL && - cmicr_pdma_rx_ring_unused(rxq) >= (int)rxq->free_thresh) { - cmicr_pdma_rx_ring_refill(hw, rxq); - /* If no one filled, return budget and keep polling */ - if (cmicr_pdma_rx_ring_unused(rxq) == (int)(rxq->nb_desc - 1)) { - rxq->state |= PDMA_RX_QUEUE_BUSY; - return budget; - } - } - - return done; -} - -/*! - * Process Tx vring - */ -static int -cmicr_pdma_tx_vring_process(struct pdma_hw *hw, struct pdma_tx_queue *txq, - struct pdma_tx_buf *pbuf) -{ - struct pdma_dev *dev = hw->dev; - volatile TX_DCB_t *ring = (volatile TX_DCB_t *)txq->ring; - struct pdma_tx_queue *vtxq = NULL; - volatile TX_DCB_t *vring = NULL; - - vtxq = (struct pdma_tx_queue *)dev->ctrl.vnet_txq[txq->queue_id]; - vring = (volatile TX_DCB_t *)vtxq->ring; - if (!vring) { - return SHR_E_UNAVAIL; - } - - /* Update vring descriptor */ - TX_DCB_STATUS_SET(vring[vtxq->dirt], TX_DCB_STATUS_GET(ring[txq->dirt])); - pbuf->dma = 0; - - MEMORY_BARRIER; - - /* Notify VNET to process if needed */ - if (!TX_DCB_STATUS_GET(vring[(vtxq->dirt + vtxq->nb_desc - 1) % vtxq->nb_desc])) { - dev->xnet_wake(dev); - } - vtxq->dirt = (vtxq->dirt + 1) % vtxq->nb_desc; - - return SHR_E_NONE; -} - -/*! - * \brief Clean Tx ring - * - * \param [in] hw HW structure point. - * \param [in] txq Tx queue structure point. - * \param [in] budget Polling budget. - * - * \retval SHR_E_NONE No errors. - * \retval SHR_E_XXXX Operation failed. - */ -static int -cmicr_pdma_tx_ring_clean(struct pdma_hw *hw, struct pdma_tx_queue *txq, int budget) -{ - struct pdma_dev *dev = hw->dev; - struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; - volatile TX_DCB_t *ring = (volatile TX_DCB_t *)txq->ring; - uint32_t dirt, curr; - int done = 0; - - dirt = txq->dirt; - while (txq->pbuf[dirt].dma) { - if (!TX_DCB_STATUS_GET(ring[dirt])) { - break; - } - if (done == budget) { - break; - } - - if (dev->mode == DEV_MODE_HNET && !txq->pbuf[dirt].skb) { - cmicr_pdma_tx_vring_process(hw, txq, &txq->pbuf[dirt]); - } else { - /* Free the done pktbuf */ - bm->tx_buf_free(dev, txq, &txq->pbuf[dirt]); - } - - cmicr_tx_desc_config(&ring[dirt], 0, 0, 0); - - /* Update the indicators */ - dirt = (dirt + 1) % txq->nb_desc; - txq->dirt = dirt; - done++; - - /* Restart DMA if in chain mode */ - if (dev->flags & PDMA_CHAIN_MODE) { - sal_spinlock_lock(txq->lock); - curr = txq->curr; - if (dirt == txq->halt && dirt != curr) { - hw->hdls.chan_stop(hw, txq->chan_id); - cmicr_tx_desc_chain(&ring[(curr + txq->nb_desc - 1) % txq->nb_desc], 0); - hw->hdls.chan_setup(hw, txq->chan_id, - txq->ring_addr + sizeof(TX_DCB_t) * txq->halt); - hw->hdls.chan_start(hw, txq->chan_id); - txq->halt = curr; - } - sal_spinlock_unlock(txq->lock); - } - } - - /* One more poll for chain done in chain mode */ - if (dev->flags & PDMA_CHAIN_MODE) { - sal_spinlock_lock(txq->lock); - if (dirt != txq->halt) { - done = budget; - } - sal_spinlock_unlock(txq->lock); - } - - /* Set busy state to avoid HW checking */ - if (done == budget) { - txq->state |= PDMA_TX_QUEUE_BUSY; - } - - /* Resume Tx if any */ - sal_spinlock_lock(txq->lock); - if (txq->status & PDMA_TX_QUEUE_XOFF && cmicr_pdma_tx_ring_unused(txq)) { - txq->status &= ~PDMA_TX_QUEUE_XOFF; - if (dev->suspended) { - sal_spinlock_unlock(txq->lock); - return done; - } - if (dev->tx_resume) { - dev->tx_resume(dev, txq->queue_id); - } - sal_spinlock_unlock(txq->lock); - if (!dev->tx_resume && !(txq->state & PDMA_TX_QUEUE_POLL)) { - sal_sem_give(txq->sem); - } - return done; - } - sal_spinlock_unlock(txq->lock); - - return done; -} - -/*! - * Dump Rx ring - */ -static int -cmicr_pdma_rx_ring_dump(struct pdma_hw *hw, struct pdma_rx_queue *rxq) -{ - volatile RX_DCB_t *ring = (volatile RX_DCB_t *)rxq->ring; - volatile RX_DCB_t *rd; - uint32_t di; - - CNET_INFO(hw->unit, "RX: queue=%d, chan=%d, curr=%d, halt=%d, halt@%p\n", - rxq->queue_id, rxq->chan_id, rxq->curr, rxq->halt, (void *)&ring[rxq->halt]); - CNET_INFO(hw->unit, "----------------------------------------------------------------\n"); - for (di = 0; di < rxq->nb_desc + 1; di++) { - rd = &ring[di]; - CNET_INFO(hw->unit, "DESC[%03d]: (%p)->%08x %08x %08x %08x\n", - di, (void *)(unsigned long)(rxq->ring_addr + di * CMICR_PDMA_DCB_SIZE), - RX_DCB_GET(*rd, 0), RX_DCB_GET(*rd, 1), - RX_DCB_GET(*rd, 2), RX_DCB_GET(*rd, 3)); - } - - return SHR_E_NONE; -} - -/*! - * Dump Tx ring - */ -static int -cmicr_pdma_tx_ring_dump(struct pdma_hw *hw, struct pdma_tx_queue *txq) -{ - volatile TX_DCB_t *ring = (volatile TX_DCB_t *)txq->ring; - volatile TX_DCB_t *td; - uint32_t di; - - CNET_INFO(hw->unit, "TX: queue=%d, chan=%d, curr=%d, dirt=%d, halt@%p\n", - txq->queue_id, txq->chan_id, txq->curr, txq->dirt, (void *)&ring[txq->curr]); - CNET_INFO(hw->unit, "----------------------------------------------------------------\n"); - for (di = 0; di < txq->nb_desc + 1; di++) { - td = &ring[di]; - CNET_INFO(hw->unit, "DESC[%03d]: (%p)->%08x %08x %08x %08x\n", - di, (void *)(unsigned long)(txq->ring_addr + di * CMICR_PDMA_DCB_SIZE), - TX_DCB_GET(*td, 0), TX_DCB_GET(*td, 1), - TX_DCB_GET(*td, 2), TX_DCB_GET(*td, 3)); - } - - return SHR_E_NONE; -} - -/*! - * Fetch Tx vring - */ -static int -cmicr_pdma_tx_vring_fetch(struct pdma_hw *hw, struct pdma_tx_queue *txq, - struct pdma_tx_buf *pbuf) -{ - struct pdma_dev *dev = hw->dev; - volatile TX_DCB_t *ring = (volatile TX_DCB_t *)txq->ring; - struct pdma_tx_queue *vtxq = NULL; - volatile TX_DCB_t *vring = NULL; - uint32_t rm; - - vtxq = (struct pdma_tx_queue *)dev->ctrl.vnet_txq[txq->queue_id]; - vring = (volatile TX_DCB_t *)vtxq->ring; - if (!vring || !TX_DCB_BYTE_COUNTf_GET(vring[vtxq->curr])) { - return SHR_E_UNAVAIL; - } - - /* Fetch vring descriptor */ - rm = TX_DCB_DESC_REMAINf_GET(ring[txq->curr]); - TX_DCB_SET(ring[txq->curr], 0, TX_DCB_GET(vring[vtxq->curr], 0)); - TX_DCB_SET(ring[txq->curr], 1, TX_DCB_GET(vring[vtxq->curr], 1)); - TX_DCB_SET(ring[txq->curr], 2, TX_DCB_GET(vring[vtxq->curr], 2)); - TX_DCB_SET(ring[txq->curr], 3, TX_DCB_GET(vring[vtxq->curr], 3)); - TX_DCB_DESC_REMAINf_SET(ring[txq->curr], rm); - TX_DCB_BYTE_COUNTf_SET(vring[vtxq->curr], 0); - - MEMORY_BARRIER; - - pbuf->dma = TX_DCB_ADDR_LOf_GET(vring[vtxq->curr]); - pbuf->len = TX_DCB_BYTE_COUNTf_GET(ring[txq->curr]); - vtxq->curr = (vtxq->curr + 1) % vtxq->nb_desc; - - return SHR_E_NONE; -} - -/*! - * Check Tx ring - */ -static inline int -cmicr_pdma_tx_ring_check(struct pdma_hw *hw, struct pdma_tx_queue *txq) -{ - struct pdma_dev *dev = hw->dev; - - if (dev->suspended) { - txq->stats.xoffs++; - if (dev->tx_suspend) { - dev->tx_suspend(dev, txq->queue_id); - return SHR_E_BUSY; - } - if (!(txq->state & PDMA_TX_QUEUE_POLL)) { - return SHR_E_BUSY; - } - } - - if (cmicr_pdma_tx_ring_unused(txq)) { - return SHR_E_NONE; - } - - sal_spinlock_lock(txq->lock); - if (!cmicr_pdma_tx_ring_unused(txq)) { - txq->status |= PDMA_TX_QUEUE_XOFF; - txq->stats.xoffs++; - if (dev->tx_suspend) { - dev->tx_suspend(dev, txq->queue_id); - } - sal_spinlock_unlock(txq->lock); - return SHR_E_BUSY; - } - sal_spinlock_unlock(txq->lock); - - return SHR_E_NONE; -} - -/*! - * \brief Start packet transmission - * - * \param [in] hw HW structure point. - * \param [in] txq Tx queue structure point. - * \param [in] buf Tx packet buffer. - * - * \retval SHR_E_NONE No errors. - * \retval SHR_E_XXXX Operation failed. - */ -static int -cmicr_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) -{ - struct pdma_dev *dev = hw->dev; - struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; - volatile TX_DCB_t *ring = (volatile TX_DCB_t *)txq->ring; - struct pdma_tx_buf *pbuf = NULL; - struct pkt_hdr *pkh = NULL; - dma_addr_t addr; - uint32_t curr; - int retry = 5000000; - int rv; - - if (dev->tx_suspend) { - sal_spinlock_lock(txq->mutex); - } else { - rv = sal_sem_take(txq->sem, BCMCNET_TX_RSRC_WAIT_USEC); - if (rv == -1) { - CNET_ERROR(hw->unit, "Timeout waiting for Tx resources\n"); - return SHR_E_TIMEOUT; - } - } - - /* Check Tx resource */ - if (dev->tx_suspend) { - /* Suspend Tx if no resource */ - rv = cmicr_pdma_tx_ring_check(hw, txq); - if (SHR_FAILURE(rv)) { - sal_spinlock_unlock(txq->mutex); - return rv; - } - } else { - /* Abort Tx if a fatal error happened */ - if (txq->status & PDMA_TX_QUEUE_XOFF) { - sal_sem_give(txq->sem); - return SHR_E_RESOURCE; - } - } - - /* Setup the new descriptor */ - curr = txq->curr; - pbuf = &txq->pbuf[curr]; - if (dev->mode == DEV_MODE_HNET && !buf) { - rv = cmicr_pdma_tx_vring_fetch(hw, txq, pbuf); - if (SHR_FAILURE(rv)) { - sal_spinlock_unlock(txq->mutex); - return SHR_E_EMPTY; - } - txq->state |= PDMA_TX_QUEUE_BUSY; - } else { - pbuf->adj = 1; - pkh = bm->tx_buf_get(dev, txq, pbuf, buf); - if (!pkh) { - txq->stats.dropped++; - if (dev->tx_suspend) { - sal_spinlock_unlock(txq->mutex); - } else { - sal_sem_give(txq->sem); - } - return SHR_E_RESOURCE; - } - bm->tx_buf_dma(dev, txq, pbuf, &addr); - cmicr_tx_desc_config(&ring[curr], addr, pbuf->len, pkh->attrs); - } - - /* Notify HNET to process if needed */ - if (dev->mode == DEV_MODE_VNET) { - if (!TX_DCB_BYTE_COUNTf_GET(ring[(curr + txq->nb_desc - 1) % txq->nb_desc])) { - dev->xnet_wake(dev); - } - } - - /* Update the indicators */ - curr = (curr + 1) % txq->nb_desc; - txq->curr = curr; - - /* Start DMA if in chain mode */ - if (dev->flags & PDMA_CHAIN_MODE) { - if (txq->state & PDMA_TX_QUEUE_POLL) { - do { - rv = cmicr_pdma_tx_ring_clean(hw, txq, txq->nb_desc - 1); - if (rv != (int)txq->nb_desc - 1) { - break; - } - sal_usleep(1); - } while (retry--); - if (retry < 0) { - CNET_ERROR(hw->unit, "Last Tx could not get done in given time\n"); - } - } - sal_spinlock_lock(txq->lock); - if (txq->dirt == txq->halt && txq->dirt != curr) { - hw->hdls.chan_stop(hw, txq->chan_id); - cmicr_tx_desc_chain(&ring[(curr + txq->nb_desc - 1) % txq->nb_desc], 0); - hw->hdls.chan_setup(hw, txq->chan_id, - txq->ring_addr + sizeof(TX_DCB_t) * txq->halt); - hw->hdls.chan_start(hw, txq->chan_id); - txq->halt = curr; - } - sal_spinlock_unlock(txq->lock); - } - - /* Kick off DMA */ - txq->halt_addr = txq->ring_addr + sizeof(TX_DCB_t) * curr; - hw->hdls.chan_goto(hw, txq->chan_id, txq->halt_addr); - - /* Count the packets/bytes */ - txq->stats.packets++; - txq->stats.bytes += pbuf->len; - - /* Clean up ring if in polling mode */ - if (txq->state & PDMA_TX_QUEUE_POLL && - cmicr_pdma_tx_ring_unused(txq) <= (int)txq->free_thresh) { - cmicr_pdma_tx_ring_clean(hw, txq, dev->ctrl.budget); - } - - /* Suspend Tx if no resource */ - rv = cmicr_pdma_tx_ring_check(hw, txq); - if (SHR_FAILURE(rv)) { - if (dev->mode == DEV_MODE_VNET) { - dev->xnet_wake(dev); - } - - if (txq->state & PDMA_TX_QUEUE_POLL) { - /* In polling mode, must wait till the ring is available */ - do { - cmicr_pdma_tx_ring_clean(hw, txq, dev->ctrl.budget); - if (!(txq->status & PDMA_TX_QUEUE_XOFF) || - !(txq->state & PDMA_TX_QUEUE_ACTIVE)) { - break; - } - sal_usleep(1); - } while (retry--); - if (retry < 0) { - CNET_ERROR(hw->unit, "Fatal error: Tx ring is full, packets can not been transmitted\n"); - if (!dev->tx_suspend) { - sal_sem_give(txq->sem); - return SHR_E_RESOURCE; - } - } - } else { - /* In interrupt mode, the handle thread will wake up Tx */ - if (!dev->tx_suspend) { - return SHR_E_NONE; - } - } - } - - if (dev->tx_suspend) { - sal_spinlock_unlock(txq->mutex); - } else { - sal_sem_give(txq->sem); - } - - return SHR_E_NONE; -} - -/*! - * Suspend Rx queue - */ -static int -cmicr_pdma_rx_suspend(struct pdma_hw *hw, struct pdma_rx_queue *rxq) -{ - sal_spinlock_lock(rxq->lock); - rxq->status |= PDMA_RX_QUEUE_XOFF; - if (hw->dev->flags & PDMA_CHAIN_MODE) { - hw->hdls.chan_stop(hw, rxq->chan_id); - } - sal_spinlock_unlock(rxq->lock); - - return SHR_E_NONE; -} - -/*! - * Resume Rx queue - */ -static int -cmicr_pdma_rx_resume(struct pdma_hw *hw, struct pdma_rx_queue *rxq) -{ - sal_spinlock_lock(rxq->lock); - if (!(rxq->status & PDMA_RX_QUEUE_XOFF)) { - sal_spinlock_unlock(rxq->lock); - return SHR_E_NONE; - } - if (rxq->state & PDMA_RX_BATCH_REFILL) { - rxq->halt_addr = rxq->ring_addr + sizeof(RX_DCB_t) * rxq->halt; - hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); - } else if (rxq->halt == rxq->curr || (rxq->halt == rxq->nb_desc && rxq->curr == 0)) { - rxq->halt = (rxq->curr + 1) % rxq->nb_desc; - rxq->halt_addr = rxq->ring_addr + sizeof(RX_DCB_t) * rxq->halt; - hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); - } - if (hw->dev->flags & PDMA_CHAIN_MODE) { - rxq->curr = 0; - hw->hdls.chan_start(hw, rxq->chan_id); - } - rxq->status &= ~PDMA_RX_QUEUE_XOFF; - sal_spinlock_unlock(rxq->lock); - - return SHR_E_NONE; -} - -/*! - * Initialize function pointers - */ -int -bcmcnet_cmicr_pdma_desc_ops_init(struct pdma_hw *hw) -{ - if (!hw) { - return SHR_E_PARAM; - } - - hw->dops.rx_desc_init = cmicr_pdma_rx_desc_init; - hw->dops.rx_desc_clean = cmicr_pdma_rx_desc_clean; - hw->dops.rx_ring_clean = cmicr_pdma_rx_ring_clean; - hw->dops.rx_ring_dump = cmicr_pdma_rx_ring_dump; - hw->dops.rx_suspend = cmicr_pdma_rx_suspend; - hw->dops.rx_resume = cmicr_pdma_rx_resume; - hw->dops.tx_desc_init = cmicr_pdma_tx_desc_init; - hw->dops.tx_desc_clean = cmicr_pdma_tx_desc_clean; - hw->dops.tx_ring_clean = cmicr_pdma_tx_ring_clean; - hw->dops.tx_ring_dump = cmicr_pdma_tx_ring_dump; - hw->dops.pkt_xmit = cmicr_pdma_pkt_xmit; - - return SHR_E_NONE; -} - -/*! - * Attach device driver - */ -int -bcmcnet_cmicr_pdma_driver_attach(struct pdma_dev *dev) -{ - struct pdma_hw *hw = NULL; - - /* Allocate memory for HW data */ - hw = sal_alloc(sizeof(*hw), "bcmcnetPdmaHw"); - if (!hw) { - return SHR_E_MEMORY; - } - sal_memset(hw, 0, sizeof(*hw)); - hw->unit = dev->unit; - hw->dev = dev; - dev->ctrl.hw = hw; - - bcmcnet_cmicr_pdma_hw_hdls_init(hw); - bcmcnet_cmicr_pdma_desc_ops_init(hw); - - return SHR_E_NONE; -} - -/*! - * Detach device driver - */ -int -bcmcnet_cmicr_pdma_driver_detach(struct pdma_dev *dev) -{ - if (dev->ctrl.hw) { - sal_free(dev->ctrl.hw); - } - dev->ctrl.hw = NULL; - - return SHR_E_NONE; -} diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicx/bcmcnet_cmicx_pdma_hw.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicx/bcmcnet_cmicx_pdma_hw.c index f43dc9a3ed65..471e65f70682 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicx/bcmcnet_cmicx_pdma_hw.c +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicx/bcmcnet_cmicx_pdma_hw.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -59,11 +59,6 @@ cmicx_pdma_intr_enable(struct pdma_hw *hw, int cmc, int chan, uint32_t mask) { uint32_t reg, irq_mask; - if (hw->dev->mode == DEV_MODE_UNET || hw->dev->mode == DEV_MODE_VNET) { - hw->dev->intr_unmask(hw->dev, cmc, chan, 0, 0); - return; - } - hw->dev->ctrl.grp[cmc].irq_mask |= mask; irq_mask = hw->dev->ctrl.grp[cmc].irq_mask; if (cmc == 0) { @@ -90,11 +85,6 @@ cmicx_pdma_intr_disable(struct pdma_hw *hw, int cmc, int chan, uint32_t mask) { uint32_t reg, irq_mask; - if (hw->dev->mode == DEV_MODE_UNET || hw->dev->mode == DEV_MODE_VNET) { - hw->dev->intr_mask(hw->dev, cmc, chan, 0, 0); - return; - } - hw->dev->ctrl.grp[cmc].irq_mask &= ~mask; irq_mask = hw->dev->ctrl.grp[cmc].irq_mask; if (cmc == 0) { @@ -490,61 +480,61 @@ cmicx_pdma_chan_reg_dump(struct pdma_hw *hw, int chan) que = chan % CMICX_PDMA_CMC_CHAN; hw->hdls.reg_rd32(hw, CMICX_PDMA_CTRL(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_CTRL: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_CTRL: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_DESC_LO(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_DESC_LO: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_DESC_LO: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_DESC_HI(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_DESC_HI: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_DESC_HI: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_CURR_DESC_LO(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_CURR_DESC_LO: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_CURR_DESC_LO: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_CURR_DESC_HI(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_CURR_DESC_HI: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_CURR_DESC_HI: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_DESC_HALT_LO(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_DESC_HALT_ADDR_LO: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_DESC_HALT_ADDR_LO: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_DESC_HALT_HI(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_DESC_HALT_ADDR_HI: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_DESC_HALT_ADDR_HI: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_COS_CTRL_RX0(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_COS_CTRL_RX_0: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_COS_CTRL_RX_0: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_COS_CTRL_RX1(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_COS_CTRL_RX_1: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_COS_CTRL_RX_1: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_INTR_COAL(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_INTR_COAL: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_INTR_COAL: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_RBUF_THRE(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_RXBUF_THRESHOLD_CONFIG: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_RXBUF_THRESHOLD_CONFIG: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_STAT(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_STAT: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_STAT: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_COUNT_RX(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_PKT_COUNT_RXPKT: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_PKT_COUNT_RXPKT: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_COUNT_TX(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_PKT_COUNT_TXPKT: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_PKT_COUNT_TXPKT: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_COUNT_RX_DROP(grp, que), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_DMA_CH%d_PKT_COUNT_RXPKT_DROP: 0x%08x\n", grp, que, val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_PKT_COUNT_RXPKT_DROP: 0x%08x\n", grp, que, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_IRQ_STAT(grp), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_IRQ_STAT: 0x%08x\n", grp, val); + CNET_PR("CMIC_CMC%d_IRQ_STAT: 0x%08x\n", grp, val); hw->hdls.reg_rd32(hw, CMICX_PDMA_IRQ_STAT_CLR(grp), &val); - CNET_INFO(hw->unit, "CMIC_CMC%d_IRQ_STAT_CLR: 0x%08x\n", grp, val); + CNET_PR("CMIC_CMC%d_IRQ_STAT_CLR: 0x%08x\n", grp, val); val = hw->dev->ctrl.grp[grp].irq_mask; - CNET_INFO(hw->unit, "CMIC_CMC%d_IRQ_ENAB: 0x%08x\n", grp, val); + CNET_PR("CMIC_CMC%d_IRQ_ENAB: 0x%08x\n", grp, val); hw->hdls.reg_rd32(hw, CMICX_EP_TO_CPU_HEADER_SIZE, &val); - CNET_INFO(hw->unit, "CMIC_EP_TO_CPU_HEADER_SIZE: 0x%08x\n", val); + CNET_PR("CMIC_EP_TO_CPU_HEADER_SIZE: 0x%08x\n", val); return SHR_E_NONE; } diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicx/bcmcnet_cmicx_pdma_rxtx.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicx/bcmcnet_cmicx_pdma_rxtx.c index 0eaf26890e43..9ea7489b5471 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicx/bcmcnet_cmicx_pdma_rxtx.c +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicx/bcmcnet_cmicx_pdma_rxtx.c @@ -38,7 +38,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -76,8 +76,6 @@ cmicx_rx_desc_config(struct cmicx_rx_desc *rd, uint64_t addr, uint32_t len) ctrl |= CMICX_DESC_CTRL_CNTLD_INTR | CMICX_DESC_CTRL_CHAIN | CMICX_DESC_CTRL_LEN(len); rd->ctrl = ctrl; - - MEMORY_BARRIER; } /*! @@ -96,8 +94,6 @@ cmicx_tx_desc_config(struct cmicx_tx_desc *td, uint64_t addr, uint32_t len, uint ctrl |= CMICX_DESC_CTRL_CNTLD_INTR | CMICX_DESC_CTRL_CHAIN | CMICX_DESC_CTRL_FLAGS(flags) | CMICX_DESC_CTRL_LEN(len); td->ctrl = ctrl; - - MEMORY_BARRIER; } /*! @@ -111,8 +107,6 @@ cmicx_rx_rldesc_config(struct cmicx_rx_desc *rd, uint64_t addr) rd->status = 0; rd->ctrl = CMICX_DESC_CTRL_CNTLD_INTR | CMICX_DESC_CTRL_CHAIN | CMICX_DESC_CTRL_RELOAD; - - MEMORY_BARRIER; } /*! @@ -126,8 +120,6 @@ cmicx_tx_rldesc_config(struct cmicx_tx_desc *td, uint64_t addr) td->status = 0; td->ctrl = CMICX_DESC_CTRL_CNTLD_INTR | CMICX_DESC_CTRL_CHAIN | CMICX_DESC_CTRL_RELOAD; - - MEMORY_BARRIER; } /*! @@ -141,8 +133,6 @@ cmicx_rx_desc_chain(struct cmicx_rx_desc *rd, int chain) } else { rd->ctrl &= ~CMICX_DESC_CTRL_CHAIN; } - - MEMORY_BARRIER; } /*! @@ -156,8 +146,6 @@ cmicx_tx_desc_chain(struct cmicx_tx_desc *td, int chain) } else { td->ctrl &= ~CMICX_DESC_CTRL_CHAIN; } - - MEMORY_BARRIER; } /*! @@ -168,8 +156,6 @@ cmicx_rx_desc_remain(struct cmicx_rx_desc *rd, uint32_t rm) { rd->ctrl &= ~CMICX_DESC_CTRL_REMAIN(0xf); rd->ctrl |= CMICX_DESC_CTRL_REMAIN(rm); - - MEMORY_BARRIER; } /*! @@ -180,8 +166,6 @@ cmicx_tx_desc_remain(struct cmicx_tx_desc *td, uint32_t rm) { td->ctrl &= ~CMICX_DESC_CTRL_REMAIN(0xf); td->ctrl |= CMICX_DESC_CTRL_REMAIN(rm); - - MEMORY_BARRIER; } /*! @@ -191,7 +175,9 @@ static inline int cmicx_pdma_rx_ring_unused(struct pdma_rx_queue *rxq) { /* Leave one descriptor unused so as not to halt */ - return (rxq->nb_desc + rxq->curr - rxq->halt - 1) % rxq->nb_desc; + return rxq->curr > rxq->halt ? + rxq->curr - rxq->halt - 1 : + rxq->nb_desc + rxq->curr - rxq->halt - 1; } /*! @@ -201,7 +187,9 @@ static inline int cmicx_pdma_tx_ring_unused(struct pdma_tx_queue *txq) { /* Leave one descriptor unused so as not to halt */ - return (txq->nb_desc + txq->dirt - txq->curr - 1) % txq->nb_desc; + return txq->dirt > txq->curr ? + txq->dirt - txq->curr - 1 : + txq->nb_desc + txq->dirt - txq->curr - 1; } /*! @@ -239,9 +227,9 @@ cmicx_pdma_rx_desc_init(struct pdma_hw *hw, struct pdma_rx_queue *rxq) cmicx_rx_rldesc_config(&ring[di], rxq->ring_addr); rxq->curr = 0; - rxq->halt = rxq->nb_desc - 1; + rxq->halt = rxq->state & PDMA_RX_BATCH_REFILL ? 0 : rxq->nb_desc; - rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicx_rx_desc) * rxq->halt; + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicx_rx_desc) * di; hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); hw->hdls.chan_setup(hw, rxq->chan_id, rxq->ring_addr); @@ -255,7 +243,7 @@ cmicx_pdma_rx_desc_init(struct pdma_hw *hw, struct pdma_rx_queue *rxq) cmicx_rx_desc_config(&ring[di], 0, 0); } - CNET_ERROR(hw->unit, "RX: Failed to allocate memory\n"); + CNET_PR("RX: Failed to allocate mem\n"); return SHR_E_MEMORY; } @@ -406,22 +394,26 @@ cmicx_pdma_rx_ring_refill(struct pdma_hw *hw, struct pdma_rx_queue *rxq) int unused = cmicx_pdma_rx_ring_unused(rxq); dma_addr_t addr; uint32_t halt; + int retry; int rv; for (halt = rxq->halt; halt < rxq->halt + unused; halt++) { - if (ring[halt % rxq->nb_desc].addr_lo) { - continue; - } pbuf = &rxq->pbuf[halt % rxq->nb_desc]; /* Allocate a new pktbuf */ if (!bm->rx_buf_avail(dev, rxq, pbuf)) { - rv = bm->rx_buf_alloc(dev, rxq, pbuf); - if (SHR_FAILURE(rv)) { + retry = 5000000; + do { + rv = bm->rx_buf_alloc(dev, rxq, pbuf); + if (SHR_SUCCESS(rv)) { + break; + } rxq->stats.nomems++; + sal_usleep(1); + } while (retry--); + if (retry <= 0) { + CNET_PR("Fatal error: Rx buffer has not been allocated for 5 seconds\n"); rxq->halt = halt % rxq->nb_desc; - CNET_ERROR(hw->unit, "Can not alloc RX buffer, %d DCBs not filled\n", - cmicx_pdma_rx_ring_unused(rxq)); - break; + return rv; } } /* Setup the new descriptor */ @@ -431,11 +423,10 @@ cmicx_pdma_rx_ring_refill(struct pdma_hw *hw, struct pdma_rx_queue *rxq) cmicx_rx_desc_chain(&ring[halt % rxq->nb_desc], 0); } } - rxq->halt = halt % rxq->nb_desc; - /* Move forward */ sal_spinlock_lock(rxq->lock); - if (!(rxq->status & PDMA_RX_QUEUE_XOFF)) { + rxq->halt = halt % rxq->nb_desc; + if (!(rxq->state & PDMA_RX_QUEUE_XOFF)) { /* Descriptor cherry pick */ rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicx_rx_desc) * rxq->halt; hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); @@ -471,20 +462,18 @@ cmicx_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budg curr = rxq->curr; while (CMICX_DESC_STAT_DONE(ring[curr].status)) { - if (done == budget) { + if (dev->mode == DEV_MODE_VNET && rxq->state & PDMA_RX_QUEUE_XOFF) { break; } - - /* Move forward */ - if (!(rxq->state & PDMA_RX_BATCH_REFILL)) { - sal_spinlock_lock(rxq->lock); - if (!(rxq->status & PDMA_RX_QUEUE_XOFF)) { - /* Descriptor cherry pick */ - rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicx_rx_desc) * curr; - hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); - rxq->halt = curr; - } - sal_spinlock_unlock(rxq->lock); + if (!(rxq->state & PDMA_RX_BATCH_REFILL) && + !(rxq->state & PDMA_RX_QUEUE_XOFF)) { + /* Descriptor cherry pick */ + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicx_rx_desc) * curr; + hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); + rxq->halt = curr; + } + if (done == budget) { + break; } /* Get the current pktbuf to process */ @@ -493,11 +482,8 @@ cmicx_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budg len = CMICX_DESC_STAT_LEN(stat); pkh = bm->rx_buf_get(dev, rxq, pbuf, len); if (!pkh) { - CNET_ERROR(hw->unit, "RX buffer build failed, retry ...\n"); rxq->stats.nomems++; - /* Set busy state to retry */ - rxq->state |= PDMA_RX_QUEUE_BUSY; - return budget; + return SHR_E_MEMORY; } /* Setup packet header */ @@ -539,33 +525,24 @@ cmicx_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budg /* Setup the new descriptor */ if (!(rxq->state & PDMA_RX_BATCH_REFILL)) { if (!bm->rx_buf_avail(dev, rxq, pbuf)) { - retry = 0; - while (1) { + retry = 5000000; + do { rv = bm->rx_buf_alloc(dev, rxq, pbuf); if (SHR_SUCCESS(rv)) { break; } rxq->stats.nomems++; - if (dev->mode == DEV_MODE_UNET || dev->mode == DEV_MODE_VNET) { - if (retry++ < 5000000) { - sal_usleep(1); - continue; - } - CNET_ERROR(hw->unit, "Fatal error: can not alloc RX buffer\n"); - } - rxq->state |= PDMA_RX_BATCH_REFILL; - rxq->free_thresh = 1; - cmicx_rx_desc_config(&ring[curr], 0, 0); - CNET_ERROR(hw->unit, "RX buffer alloc failed, try batch refilling later\n"); - break; + sal_usleep(1); + } while (retry--); + if (retry <= 0) { + CNET_PR("Fatal error: Rx buffer has not been allocated for 5 seconds\n"); + return done; } } - if (pbuf->dma) { - bm->rx_buf_dma(dev, rxq, pbuf, &addr); - cmicx_rx_desc_config(&ring[curr], addr, rxq->buf_size); - if (dev->flags & PDMA_CHAIN_MODE && curr == rxq->nb_desc - 1) { - cmicx_rx_desc_chain(&ring[curr], 0); - } + bm->rx_buf_dma(dev, rxq, pbuf, &addr); + cmicx_rx_desc_config(&ring[curr], addr, rxq->buf_size); + if (dev->flags & PDMA_CHAIN_MODE && curr == rxq->nb_desc - 1) { + cmicx_rx_desc_chain(&ring[curr], 0); } } else { cmicx_rx_desc_config(&ring[curr], 0, 0); @@ -573,6 +550,7 @@ cmicx_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budg /* Notify HNET to process if needed */ if (dev->mode == DEV_MODE_VNET) { + MEMORY_BARRIER; if (ring[(curr + rxq->nb_desc - 1) % rxq->nb_desc].status) { dev->xnet_wake(dev); } @@ -581,7 +559,7 @@ cmicx_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budg /* Update the indicators */ if (!(rxq->state & PDMA_RX_BATCH_REFILL) && rxq->halt != curr) { sal_spinlock_lock(rxq->lock); - if (!(rxq->status & PDMA_RX_QUEUE_XOFF)) { + if (!(rxq->state & PDMA_RX_QUEUE_XOFF)) { /* Descriptor cherry pick */ rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicx_rx_desc) * curr; hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); @@ -597,12 +575,10 @@ cmicx_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budg /* Restart DMA if in chain mode */ if (dev->flags & PDMA_CHAIN_MODE) { - sal_spinlock_lock(rxq->lock); - if (curr == 0 && !(rxq->status & PDMA_RX_QUEUE_XOFF)) { + if (curr == 0 && !(rxq->state & PDMA_RX_QUEUE_XOFF)) { hw->hdls.chan_stop(hw, rxq->chan_id); hw->hdls.chan_start(hw, rxq->chan_id); } - sal_spinlock_unlock(rxq->lock); } } @@ -617,10 +593,12 @@ cmicx_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budg if (rxq->state & PDMA_RX_BATCH_REFILL && cmicx_pdma_rx_ring_unused(rxq) >= (int)rxq->free_thresh) { cmicx_pdma_rx_ring_refill(hw, rxq); - /* If no one filled, return budget and keep polling */ - if (cmicx_pdma_rx_ring_unused(rxq) == (int)(rxq->nb_desc - 1)) { - rxq->state |= PDMA_RX_QUEUE_BUSY; - return budget; + } + + /* Notify the other side to process */ + if (dev->mode == DEV_MODE_VNET || dev->mode == DEV_MODE_HNET) { + if (done) { + dev->xnet_wake(dev); } } @@ -727,24 +705,16 @@ cmicx_pdma_tx_ring_clean(struct pdma_hw *hw, struct pdma_tx_queue *txq, int budg sal_spinlock_unlock(txq->lock); } - /* Set busy state to avoid HW checking */ - if (done == budget) { - txq->state |= PDMA_TX_QUEUE_BUSY; - } - /* Resume Tx if any */ sal_spinlock_lock(txq->lock); - if (txq->status & PDMA_TX_QUEUE_XOFF && cmicx_pdma_tx_ring_unused(txq)) { - txq->status &= ~PDMA_TX_QUEUE_XOFF; - if (dev->suspended) { - sal_spinlock_unlock(txq->lock); - return done; - } + if (txq->state & PDMA_TX_QUEUE_XOFF && + txq->state & PDMA_TX_QUEUE_ACTIVE && + cmicx_pdma_tx_ring_unused(txq)) { + txq->state &= ~PDMA_TX_QUEUE_XOFF; + sal_spinlock_unlock(txq->lock); if (dev->tx_resume) { dev->tx_resume(dev, txq->queue_id); - } - sal_spinlock_unlock(txq->lock); - if (!dev->tx_resume && !(txq->state & PDMA_TX_QUEUE_POLL)) { + } else if (!(txq->state & PDMA_TX_QUEUE_POLL)) { sal_sem_give(txq->sem); } return done; @@ -764,14 +734,14 @@ cmicx_pdma_rx_ring_dump(struct pdma_hw *hw, struct pdma_rx_queue *rxq) struct cmicx_rx_desc *rd; uint32_t di; - CNET_INFO(hw->unit, "RX: queue=%d, chan=%d, curr=%d, halt=%d, halt@%p\n", - rxq->queue_id, rxq->chan_id, rxq->curr, rxq->halt, (void *)&ring[rxq->halt]); - CNET_INFO(hw->unit, "----------------------------------------------------------------\n"); + CNET_PR("\nRX: queue=%d, chan=%d, curr=%d, halt=%d, halt@%p\n", + rxq->queue_id, rxq->chan_id, rxq->curr, rxq->halt, (void *)&ring[rxq->halt]); + CNET_PR("----------------------------------------------------------------\n"); for (di = 0; di < rxq->nb_desc + 1; di++) { rd = &ring[di]; - CNET_INFO(hw->unit, "DESC[%03d]: (%p)->%08x %08x %08x %08x\n", - di, (void *)(unsigned long)(rxq->ring_addr + di * CMICX_PDMA_DCB_SIZE), - rd->addr_lo, rd->addr_hi, rd->ctrl, rd->status); + CNET_PR("DESC[%03d]: (%p)->%08x %08x %08x %08x\n", + di, (void *)(unsigned long)(rxq->ring_addr + di * CMICX_PDMA_DCB_SIZE), + rd->addr_lo, rd->addr_hi, rd->ctrl, rd->status); } return SHR_E_NONE; @@ -787,14 +757,14 @@ cmicx_pdma_tx_ring_dump(struct pdma_hw *hw, struct pdma_tx_queue *txq) struct cmicx_tx_desc *td; uint32_t di; - CNET_INFO(hw->unit, "TX: queue=%d, chan=%d, curr=%d, dirt=%d, halt@%p\n", - txq->queue_id, txq->chan_id, txq->curr, txq->dirt, (void *)&ring[txq->curr]); - CNET_INFO(hw->unit, "----------------------------------------------------------------\n"); + CNET_PR("\nTX: queue=%d, chan=%d, curr=%d, dirt=%d, halt@%p\n", + txq->queue_id, txq->chan_id, txq->curr, txq->dirt, (void *)&ring[txq->curr]); + CNET_PR("----------------------------------------------------------------\n"); for (di = 0; di < txq->nb_desc + 1; di++) { td = &ring[di]; - CNET_INFO(hw->unit, "DESC[%03d]: (%p)->%08x %08x %08x %08x\n", - di, (void *)(unsigned long)(txq->ring_addr + di * CMICX_PDMA_DCB_SIZE), - td->addr_lo, td->addr_hi, td->ctrl, td->status); + CNET_PR("DESC[%03d]: (%p)->%08x %08x %08x %08x\n", + di, (void *)(unsigned long)(txq->ring_addr + di * CMICX_PDMA_DCB_SIZE), + td->addr_lo, td->addr_hi, td->ctrl, td->status); } return SHR_E_NONE; @@ -811,7 +781,6 @@ cmicx_pdma_tx_vring_fetch(struct pdma_hw *hw, struct pdma_tx_queue *txq, struct cmicx_tx_desc *ring = (struct cmicx_tx_desc *)txq->ring; struct pdma_tx_queue *vtxq = NULL; struct cmicx_tx_desc *vring = NULL; - uint32_t rm; vtxq = (struct pdma_tx_queue *)dev->ctrl.vnet_txq[txq->queue_id]; vring = (struct cmicx_tx_desc *)vtxq->ring; @@ -820,10 +789,7 @@ cmicx_pdma_tx_vring_fetch(struct pdma_hw *hw, struct pdma_tx_queue *txq, } /* Fetch vring descriptor */ - rm = ring[txq->curr].ctrl & CMICX_DESC_CTRL_REMAIN(0xf); sal_memcpy(&ring[txq->curr], &vring[vtxq->curr], sizeof(struct cmicx_tx_desc)); - ring[txq->curr].ctrl &= ~CMICX_DESC_CTRL_REMAIN(0xf); - ring[txq->curr].ctrl |= rm; vring[vtxq->curr].ctrl &= ~CMICX_DESC_CTRL_LEN(-1); MEMORY_BARRIER; @@ -841,31 +807,18 @@ cmicx_pdma_tx_vring_fetch(struct pdma_hw *hw, struct pdma_tx_queue *txq, static inline int cmicx_pdma_tx_ring_check(struct pdma_hw *hw, struct pdma_tx_queue *txq) { - struct pdma_dev *dev = hw->dev; - - if (dev->suspended) { - txq->stats.xoffs++; - if (dev->tx_suspend) { - dev->tx_suspend(dev, txq->queue_id); - return SHR_E_BUSY; - } - if (!(txq->state & PDMA_TX_QUEUE_POLL)) { - return SHR_E_BUSY; - } - } - if (cmicx_pdma_tx_ring_unused(txq)) { return SHR_E_NONE; } sal_spinlock_lock(txq->lock); if (!cmicx_pdma_tx_ring_unused(txq)) { - txq->status |= PDMA_TX_QUEUE_XOFF; + txq->state |= PDMA_TX_QUEUE_XOFF; txq->stats.xoffs++; - if (dev->tx_suspend) { - dev->tx_suspend(dev, txq->queue_id); - } sal_spinlock_unlock(txq->lock); + if (hw->dev->tx_suspend) { + hw->dev->tx_suspend(hw->dev, txq->queue_id); + } return SHR_E_BUSY; } sal_spinlock_unlock(txq->lock); @@ -901,7 +854,7 @@ cmicx_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) } else { rv = sal_sem_take(txq->sem, BCMCNET_TX_RSRC_WAIT_USEC); if (rv == -1) { - CNET_ERROR(hw->unit, "Timeout waiting for Tx resources\n"); + CNET_PR("Timeout waiting for Tx resources\n"); return SHR_E_TIMEOUT; } } @@ -916,7 +869,7 @@ cmicx_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) } } else { /* Abort Tx if a fatal error happened */ - if (txq->status & PDMA_TX_QUEUE_XOFF) { + if (txq->state & PDMA_TX_QUEUE_XOFF) { sal_sem_give(txq->sem); return SHR_E_RESOURCE; } @@ -931,7 +884,6 @@ cmicx_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) sal_spinlock_unlock(txq->mutex); return SHR_E_EMPTY; } - txq->state |= PDMA_TX_QUEUE_BUSY; } else { pbuf->adj = 1; pkh = bm->tx_buf_get(dev, txq, pbuf, buf); @@ -942,7 +894,7 @@ cmicx_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) } else { sal_sem_give(txq->sem); } - return SHR_E_RESOURCE; + return SHR_E_NONE; } bm->tx_buf_dma(dev, txq, pbuf, &addr); flags |= pkh->attrs & PDMA_TX_HIGIG_PKT ? CMICX_DESC_TX_HIGIG_PKT : 0; @@ -952,6 +904,7 @@ cmicx_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) /* Notify HNET to process if needed */ if (dev->mode == DEV_MODE_VNET) { + MEMORY_BARRIER; if (!CMICX_DESC_CTRL_LEN(ring[(curr + txq->nb_desc - 1) % txq->nb_desc].ctrl)) { dev->xnet_wake(dev); } @@ -971,8 +924,8 @@ cmicx_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) } sal_usleep(1); } while (retry--); - if (retry < 0) { - CNET_ERROR(hw->unit, "Last Tx could not get done in given time\n"); + if (retry <= 0) { + CNET_PR("Last Tx could not be done in given time\n"); } } sal_spinlock_lock(txq->lock); @@ -998,7 +951,7 @@ cmicx_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) /* Clean up ring if in polling mode */ if (txq->state & PDMA_TX_QUEUE_POLL && cmicx_pdma_tx_ring_unused(txq) <= (int)txq->free_thresh) { - cmicx_pdma_tx_ring_clean(hw, txq, dev->ctrl.budget); + cmicx_pdma_tx_ring_clean(hw, txq, txq->nb_desc - txq->free_thresh); } /* Suspend Tx if no resource */ @@ -1011,15 +964,15 @@ cmicx_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) if (txq->state & PDMA_TX_QUEUE_POLL) { /* In polling mode, must wait till the ring is available */ do { - cmicx_pdma_tx_ring_clean(hw, txq, dev->ctrl.budget); - if (!(txq->status & PDMA_TX_QUEUE_XOFF) || + cmicx_pdma_tx_ring_clean(hw, txq, txq->free_thresh); + if (!(txq->state & PDMA_TX_QUEUE_XOFF) || !(txq->state & PDMA_TX_QUEUE_ACTIVE)) { break; } sal_usleep(1); } while (retry--); - if (retry < 0) { - CNET_ERROR(hw->unit, "Fatal error: Tx ring is full, packets can not been transmitted\n"); + if (retry <= 0) { + CNET_PR("Fatal error: Tx ring is full, packets have not been transmitted for 5 seconds\n"); if (!dev->tx_suspend) { sal_sem_give(txq->sem); return SHR_E_RESOURCE; @@ -1049,7 +1002,7 @@ static int cmicx_pdma_rx_suspend(struct pdma_hw *hw, struct pdma_rx_queue *rxq) { sal_spinlock_lock(rxq->lock); - rxq->status |= PDMA_RX_QUEUE_XOFF; + rxq->state |= PDMA_RX_QUEUE_XOFF; if (hw->dev->flags & PDMA_CHAIN_MODE) { hw->hdls.chan_stop(hw, rxq->chan_id); } @@ -1065,7 +1018,7 @@ static int cmicx_pdma_rx_resume(struct pdma_hw *hw, struct pdma_rx_queue *rxq) { sal_spinlock_lock(rxq->lock); - if (!(rxq->status & PDMA_RX_QUEUE_XOFF)) { + if (!(rxq->state & PDMA_RX_QUEUE_XOFF)) { sal_spinlock_unlock(rxq->lock); return SHR_E_NONE; } @@ -1081,7 +1034,7 @@ cmicx_pdma_rx_resume(struct pdma_hw *hw, struct pdma_rx_queue *rxq) rxq->curr = 0; hw->hdls.chan_start(hw, rxq->chan_id); } - rxq->status &= ~PDMA_RX_QUEUE_XOFF; + rxq->state &= ~PDMA_RX_QUEUE_XOFF; sal_spinlock_unlock(rxq->lock); return SHR_E_NONE; diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicd.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicd.h index 1811ca44c33c..3e6ccd035c0f 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicd.h +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicd.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicr.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicr.h deleted file mode 100644 index 6f74d7fb1895..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicr.h +++ /dev/null @@ -1,199 +0,0 @@ -/*! \file bcmcnet_cmicr.h - * - * CMICr registers and descriptors definitions. - * - */ -/* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - */ - -#ifndef BCMCNET_CMICR_H -#define BCMCNET_CMICR_H - -#include - -/*! - * \name CMICR PDMA HW definitions - */ -/*! \{ */ -/*! CMICR CMC number */ -#define CMICR_PDMA_CMC_MAX 2 -/*! CMICR CMC PDMA channels */ -#define CMICR_PDMA_CMC_CHAN 16 -/*! CMICR PDMA DCB size */ -#define CMICR_PDMA_DCB_SIZE RX_DCB_SIZE -/*! \} */ - -/*! - * \name CMICR PCIe device address definitions - */ -/*! \{ */ -/*! CMICR PCIE offset */ -#define CMICR_PCIE_SO_OFFSET 0x10000000 -/*! Higher DMA address to bus address */ -#define DMA_TO_BUS_HI(dma) ((dma) | CMICR_PCIE_SO_OFFSET) -/*! Higher bus address to DMA address */ -#define BUS_TO_DMA_HI(bus) ((bus) & ~CMICR_PCIE_SO_OFFSET) -/*! \} */ - - -/*! \} */ -/*! - * \name CMICR PDMA register address - */ -/*! \{ */ -/*! Base address */ -#define CMICR_GRP_BASE(g) (0x00000000 + 0x2000 * g) -/*! Control register address */ -#define CMICR_PDMA_CTRL(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_CTRLr_OFFSET + q * 0x80) -/*! Descriptor Address Lower register address */ -#define CMICR_PDMA_DESC_LO(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_DESC_ADDR_LOr_OFFSET + q * 0x80) -/*! Descriptor Address Higher register address */ -#define CMICR_PDMA_DESC_HI(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_DESC_ADDR_HIr_OFFSET + q * 0x80) -/*! Descriptor Halt Address Lower register address */ -#define CMICR_PDMA_DESC_HALT_LO(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_DESC_HALT_ADDR_LOr_OFFSET + q * 0x80) -/*! Descriptor Halt Address Higher register address */ -#define CMICR_PDMA_DESC_HALT_HI(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_DESC_HALT_ADDR_HIr_OFFSET + q * 0x80) -/*! Status register address */ -#define CMICR_PDMA_STAT(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_STATr_OFFSET + q * 0x80) -/*! Interrupt status register address */ -#define CMICR_PDMA_INTR_STAT(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_INTRr_OFFSET + q * 0x80) -/*! Interrupt enable register address */ -#define CMICR_PDMA_INTR_ENAB(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_INTR_ENABLEr_OFFSET + q * 0x80) -/*! Interrupt clear register address */ -#define CMICR_PDMA_INTR_CLR(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_INTR_CLRr_OFFSET + q * 0x80) -/*! COS Control Rx0 register address */ -#define CMICR_PDMA_COS_CTRL_RX0(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_COS_CTRL_RX_0r_OFFSET + q * 0x80) -/*! COS Control Rx1 register address */ -#define CMICR_PDMA_COS_CTRL_RX1(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_COS_CTRL_RX_1r_OFFSET + q * 0x80) -/*! Interrupt Coalesce register address */ -#define CMICR_PDMA_INTR_COAL(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_INTR_COALr_OFFSET + q * 0x80) -/*! Current Descriptor Address Lower register address */ -#define CMICR_PDMA_CURR_DESC_LO(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_CURR_DESC_LOr_OFFSET + q * 0x80) -/*! Current Descriptor Address Higher register address */ -#define CMICR_PDMA_CURR_DESC_HI(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_CURR_DESC_HIr_OFFSET + q * 0x80) -/*! Rx Buffer Threshhold register address */ -#define CMICR_PDMA_RBUF_THRE(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIGr_OFFSET + q * 0x80) -/*! Debug Control register address */ -#define CMICR_PDMA_DEBUG_CTRL(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_DEBUG_CONTROLr_OFFSET + q * 0x80) -/*! Debug State Machine Status register address */ -#define CMICR_PDMA_DEBUG_SM_STAT(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_DEBUG_SM_STATUSr_OFFSET + q * 0x80) -/*! Debug Status register address */ -#define CMICR_PDMA_DEBUG_STAT(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_DEBUG_STATUSr_OFFSET + q * 0x80) -/*! Rx Packet Count register address */ -#define CMICR_PDMA_COUNT_RX(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_PKT_COUNT_RXPKTr_OFFSET + q * 0x80) -/*! Tx Packet Count register address */ -#define CMICR_PDMA_COUNT_TX(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_PKT_COUNT_TXPKTr_OFFSET + q * 0x80) -/*! Dropped Rx Packet Count register address */ -#define CMICR_PDMA_COUNT_RX_DROP(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_PKT_COUNT_RXPKT_DROPr_OFFSET + q * 0x80) -/*! Requested Descriptor Count register address */ -#define CMICR_PDMA_DESC_CNT_REQ(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_DESC_COUNT_REQr_OFFSET + q * 0x80) -/*! Received Descriptor Count register address */ -#define CMICR_PDMA_DESC_CNT_RX(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_DESC_COUNT_RXr_OFFSET + q * 0x80) -/*! Updated Descriptor Count register address */ -#define CMICR_PDMA_DESC_CNT_STAT(g, q) (CMICR_GRP_BASE(g) + CMIC_CMC_PKTDMA_DESC_COUNT_STATUS_WRr_OFFSET + q * 0x80) -/*! EP_TO_CPU Header Size register address */ -#define CMICR_EP_TO_CPU_HEADER_SIZE CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr_OFFSET -/*! Top config register address */ -#define CMICR_TOP_CONFIG CMIC_TOP_CONFIGr_OFFSET -/*! iProc interrupt enable set register address0 */ -#define PAXB_PDMA_IRQ_ENAB_SET0 PAXB_0_INTC_SET_INTR_ENABLE_REG5r_OFFSET -/*! iProc interrupt enable set register address1 */ -#define PAXB_PDMA_IRQ_ENAB_SET1 PAXB_0_INTC_SET_INTR_ENABLE_REG6r_OFFSET -/*! iProc interrupt enable clear register address0 */ -#define PAXB_PDMA_IRQ_ENAB_CLR0 PAXB_0_INTC_CLEAR_INTR_ENABLE_REG5r_OFFSET -/*! iProc interrupt enable clear register address1 */ -#define PAXB_PDMA_IRQ_ENAB_CLR1 PAXB_0_INTC_CLEAR_INTR_ENABLE_REG6r_OFFSET -/*! \} */ - -/*! - * \name Interrupt status & clear register definitions - */ -/*! \{ */ -/*! Interrupt mask shift */ -#define CMICR_IRQ_MASK_SHIFT 8 -/*! \} */ - -/*! 32-bit register read */ -#define DEV_READ32(_c, _a, _p) \ - do { \ - if ((_c)->dev->mode != DEV_MODE_VNET) { \ - *(_p) = ((volatile uint32_t *)(_c)->hw_addr)[(_a) / 4]; \ - } \ - } while (0) - -/*! 32-bit register write */ -#define DEV_WRITE32(_c, _a, _v) \ - do { \ - if ((_c)->dev->mode != DEV_MODE_VNET) { \ - ((volatile uint32_t *)(_c)->hw_addr)[(_a) / 4] = (_v); \ - } \ - } while (0) - -/*! Tx packet header size */ -#define CMICR_TX_PKT_HDR_SIZE 16 - -/*! HW access retry times */ -#define CMICR_HW_RETRY_TIMES 100000 - -/*! Max remaining descriptors */ -#define CMICR_DESC_REMAIN_MAX 8 - -/*! - * \brief Initialize HW handles. - * - * \param [in] hw HW structure point. - * - * \retval SHR_E_NONE No errors. - * \retval SHR_E_XXXX Operation failed. - */ -extern int -bcmcnet_cmicr_pdma_hw_hdls_init(struct pdma_hw *hw); - -/*! - * \brief Initialize descriptor operations. - * - * \param [in] hw HW structure point. - * - * \retval SHR_E_NONE No errors. - * \retval SHR_E_XXXX Operation failed. - */ -extern int -bcmcnet_cmicr_pdma_desc_ops_init(struct pdma_hw *hw); - -/*! - * \brief Attach device driver. - * - * \param [in] dev Device structure point. - * - * \retval SHR_E_NONE No errors. - * \retval SHR_E_XXXX Operation failed. - */ -extern int -bcmcnet_cmicr_pdma_driver_attach(struct pdma_dev *dev); - -/*! - * \brief Detach device driver. - * - * \param [in] dev Device structure point. - * - * \retval SHR_E_NONE No errors. - * \retval SHR_E_XXXX Operation failed. - */ -extern int -bcmcnet_cmicr_pdma_driver_detach(struct pdma_dev *dev); - -#endif /* BCMCNET_CMICR_H */ diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicr_acc.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicr_acc.h deleted file mode 100644 index 9bd736d5694d..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicr_acc.h +++ /dev/null @@ -1,791 +0,0 @@ -/*! \file bcmcnet_cmicr_acc.h - * - * CMICr PDMA registers and descriptors access macros extracted from: - * bcmbd/include/bcmbd/bcmbd_cmicr_acc.h - * bcmbd/include/bcmbd/bcmbd_cmicr_intr.h - * - */ -/* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - */ - -#ifndef BCMCNET_CMICR_ACC_H -#define BCMCNET_CMICR_ACC_H - -#define IPROC_IRQ_BASE5 (5 * 32) -#define IPROC_IRQ_BASE6 (6 * 32) -#define CMICR_IRQ_CMC0_PKTDMA_CH0_INTR (IPROC_IRQ_BASE5 + 8) -#define CMICR_IRQ_CMC0_PKTDMA_CH1_INTR (IPROC_IRQ_BASE5 + 9) -#define CMICR_IRQ_CMC0_PKTDMA_CH2_INTR (IPROC_IRQ_BASE5 + 10) -#define CMICR_IRQ_CMC0_PKTDMA_CH3_INTR (IPROC_IRQ_BASE5 + 11) -#define CMICR_IRQ_CMC0_PKTDMA_CH4_INTR (IPROC_IRQ_BASE5 + 12) -#define CMICR_IRQ_CMC0_PKTDMA_CH5_INTR (IPROC_IRQ_BASE5 + 13) -#define CMICR_IRQ_CMC0_PKTDMA_CH6_INTR (IPROC_IRQ_BASE5 + 14) -#define CMICR_IRQ_CMC0_PKTDMA_CH7_INTR (IPROC_IRQ_BASE5 + 15) -#define CMICR_IRQ_CMC0_PKTDMA_CH8_INTR (IPROC_IRQ_BASE5 + 16) -#define CMICR_IRQ_CMC0_PKTDMA_CH9_INTR (IPROC_IRQ_BASE5 + 17) -#define CMICR_IRQ_CMC0_PKTDMA_CH10_INTR (IPROC_IRQ_BASE5 + 18) -#define CMICR_IRQ_CMC0_PKTDMA_CH11_INTR (IPROC_IRQ_BASE5 + 19) -#define CMICR_IRQ_CMC0_PKTDMA_CH12_INTR (IPROC_IRQ_BASE5 + 20) -#define CMICR_IRQ_CMC0_PKTDMA_CH13_INTR (IPROC_IRQ_BASE5 + 21) -#define CMICR_IRQ_CMC0_PKTDMA_CH14_INTR (IPROC_IRQ_BASE5 + 22) -#define CMICR_IRQ_CMC0_PKTDMA_CH15_INTR (IPROC_IRQ_BASE5 + 23) -#define CMICR_IRQ_CMC1_PKTDMA_CH0_INTR (IPROC_IRQ_BASE5 + 24) -#define CMICR_IRQ_CMC1_PKTDMA_CH1_INTR (IPROC_IRQ_BASE5 + 25) -#define CMICR_IRQ_CMC1_PKTDMA_CH2_INTR (IPROC_IRQ_BASE5 + 26) -#define CMICR_IRQ_CMC1_PKTDMA_CH3_INTR (IPROC_IRQ_BASE5 + 27) -#define CMICR_IRQ_CMC1_PKTDMA_CH4_INTR (IPROC_IRQ_BASE5 + 28) -#define CMICR_IRQ_CMC1_PKTDMA_CH5_INTR (IPROC_IRQ_BASE5 + 29) -#define CMICR_IRQ_CMC1_PKTDMA_CH6_INTR (IPROC_IRQ_BASE5 + 30) -#define CMICR_IRQ_CMC1_PKTDMA_CH7_INTR (IPROC_IRQ_BASE5 + 31) -#define CMICR_IRQ_CMC1_PKTDMA_CH8_INTR (IPROC_IRQ_BASE6 + 0) -#define CMICR_IRQ_CMC1_PKTDMA_CH9_INTR (IPROC_IRQ_BASE6 + 1) -#define CMICR_IRQ_CMC1_PKTDMA_CH10_INTR (IPROC_IRQ_BASE6 + 2) -#define CMICR_IRQ_CMC1_PKTDMA_CH11_INTR (IPROC_IRQ_BASE6 + 3) -#define CMICR_IRQ_CMC1_PKTDMA_CH12_INTR (IPROC_IRQ_BASE6 + 4) -#define CMICR_IRQ_CMC1_PKTDMA_CH13_INTR (IPROC_IRQ_BASE6 + 5) -#define CMICR_IRQ_CMC1_PKTDMA_CH14_INTR (IPROC_IRQ_BASE6 + 6) -#define CMICR_IRQ_CMC1_PKTDMA_CH15_INTR (IPROC_IRQ_BASE6 + 7) - -#define PAXB_0_INTC_SET_INTR_ENABLE_REG5r_OFFSET 0x0292d114 -#define PAXB_0_INTC_SET_INTR_ENABLE_REG6r_OFFSET 0x0292d118 -#define PAXB_0_INTC_CLEAR_INTR_ENABLE_REG5r_OFFSET 0x0292d13c -#define PAXB_0_INTC_CLEAR_INTR_ENABLE_REG6r_OFFSET 0x0292d140 - -/* - * This structure should be used to declare and program CMIC_TOP_CONFIG. - * - */ -typedef union CMIC_TOP_CONFIGr_s { - uint32_t v[1]; - uint32_t cmic_top_config[1]; - uint32_t _cmic_top_config; -} CMIC_TOP_CONFIGr_t; - -#define CMIC_TOP_CONFIGr_CLR(r) (r).cmic_top_config[0] = 0 -#define CMIC_TOP_CONFIGr_SET(r,d) (r).cmic_top_config[0] = d -#define CMIC_TOP_CONFIGr_GET(r) (r).cmic_top_config[0] -#define CMIC_TOP_CONFIGr_OFFSET 0x0000000c -#define CMIC_TOP_CONFIGr_IP_2_EP_LOOPBACK_ENABLEf_GET(r) ((((r).cmic_top_config[0]) >> 1) & 0x1) -#define CMIC_TOP_CONFIGr_IP_2_EP_LOOPBACK_ENABLEf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 1)) | ((((uint32_t)f) & 0x1) << 1)) -#define CMIC_TOP_CONFIGr_CMC0_CLK_ENf_GET(r) ((((r).cmic_top_config[0]) >> 2) & 0x1) -#define CMIC_TOP_CONFIGr_CMC0_CLK_ENf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 2)) | ((((uint32_t)f) & 0x1) << 2)) -#define CMIC_TOP_CONFIGr_CMC1_CLK_ENf_GET(r) ((((r).cmic_top_config[0]) >> 3) & 0x1) -#define CMIC_TOP_CONFIGr_CMC1_CLK_ENf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 3)) | ((((uint32_t)f) & 0x1) << 3)) -#define CMIC_TOP_CONFIGr_COMMON_POOL_CLK_ENf_GET(r) ((((r).cmic_top_config[0]) >> 4) & 0x1) -#define CMIC_TOP_CONFIGr_COMMON_POOL_CLK_ENf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 4)) | ((((uint32_t)f) & 0x1) << 4)) -#define CMIC_TOP_CONFIGr_RPE_CLK_ENf_GET(r) ((((r).cmic_top_config[0]) >> 5) & 0x1) -#define CMIC_TOP_CONFIGr_RPE_CLK_ENf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 5)) | ((((uint32_t)f) & 0x1) << 5)) -#define CMIC_TOP_CONFIGr_IP_INTERFACE_PAYLOAD_ENDIANESSf_GET(r) ((((r).cmic_top_config[0]) >> 6) & 0x1) -#define CMIC_TOP_CONFIGr_IP_INTERFACE_PAYLOAD_ENDIANESSf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 6)) | ((((uint32_t)f) & 0x1) << 6)) -#define CMIC_TOP_CONFIGr_IP_INTERFACE_HEADER_ENDIANESSf_GET(r) ((((r).cmic_top_config[0]) >> 7) & 0x1) -#define CMIC_TOP_CONFIGr_IP_INTERFACE_HEADER_ENDIANESSf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 7)) | ((((uint32_t)f) & 0x1) << 7)) -#define CMIC_TOP_CONFIGr_EP_INTERFACE_PAYLOAD_ENDIANESSf_GET(r) ((((r).cmic_top_config[0]) >> 8) & 0x1) -#define CMIC_TOP_CONFIGr_EP_INTERFACE_PAYLOAD_ENDIANESSf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 8)) | ((((uint32_t)f) & 0x1) << 8)) -#define CMIC_TOP_CONFIGr_EP_INTERFACE_HEADER_ENDIANESSf_GET(r) ((((r).cmic_top_config[0]) >> 9) & 0x1) -#define CMIC_TOP_CONFIGr_EP_INTERFACE_HEADER_ENDIANESSf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 9)) | ((((uint32_t)f) & 0x1) << 9)) -#define CMIC_TOP_CONFIGr_CLEAR_ON_READ_ENABLEf_GET(r) ((((r).cmic_top_config[0]) >> 10) & 0x1) -#define CMIC_TOP_CONFIGr_CLEAR_ON_READ_ENABLEf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 10)) | ((((uint32_t)f) & 0x1) << 10)) -#define CMIC_TOP_CONFIGr_SATURATE_ENABLEf_GET(r) ((((r).cmic_top_config[0]) >> 11) & 0x1) -#define CMIC_TOP_CONFIGr_SATURATE_ENABLEf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 11)) | ((((uint32_t)f) & 0x1) << 11)) -#define CMIC_TOP_CONFIGr_CLEAR_CMC0_COUNTERSf_GET(r) ((((r).cmic_top_config[0]) >> 12) & 0x1) -#define CMIC_TOP_CONFIGr_CLEAR_CMC0_COUNTERSf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 12)) | ((((uint32_t)f) & 0x1) << 12)) -#define CMIC_TOP_CONFIGr_CLEAR_CMC1_COUNTERSf_GET(r) ((((r).cmic_top_config[0]) >> 13) & 0x1) -#define CMIC_TOP_CONFIGr_CLEAR_CMC1_COUNTERSf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 13)) | ((((uint32_t)f) & 0x1) << 13)) -#define CMIC_TOP_CONFIGr_CLEAR_RPE_COUNTERSf_GET(r) ((((r).cmic_top_config[0]) >> 14) & 0x1) -#define CMIC_TOP_CONFIGr_CLEAR_RPE_COUNTERSf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 14)) | ((((uint32_t)f) & 0x1) << 14)) -#define CMIC_TOP_CONFIGr_CLEAR_TOP_COUNTERSf_GET(r) ((((r).cmic_top_config[0]) >> 15) & 0x1) -#define CMIC_TOP_CONFIGr_CLEAR_TOP_COUNTERSf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 15)) | ((((uint32_t)f) & 0x1) << 15)) -#define CMIC_TOP_CONFIGr_RPE_PIPE_MAPf_GET(r) ((((r).cmic_top_config[0]) >> 16) & 0x1) -#define CMIC_TOP_CONFIGr_RPE_PIPE_MAPf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 16)) | ((((uint32_t)f) & 0x1) << 16)) -#define CMIC_TOP_CONFIGr_SBUS_RING_ARB_CUT_THROUGH_MODE_ENABLEf_GET(r) ((((r).cmic_top_config[0]) >> 17) & 0x1) -#define CMIC_TOP_CONFIGr_SBUS_RING_ARB_CUT_THROUGH_MODE_ENABLEf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 17)) | ((((uint32_t)f) & 0x1) << 17)) -#define CMIC_TOP_CONFIGr_IP_ARB_QUANTA_SELf_GET(r) ((((r).cmic_top_config[0]) >> 18) & 0x3) -#define CMIC_TOP_CONFIGr_IP_ARB_QUANTA_SELf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x3 << 18)) | ((((uint32_t)f) & 0x3) << 18)) -#define CMIC_TOP_CONFIGr_ENABLE_CMIC_RST_AFTER_SW_IF_PURGEf_GET(r) ((((r).cmic_top_config[0]) >> 20) & 0x1) -#define CMIC_TOP_CONFIGr_ENABLE_CMIC_RST_AFTER_SW_IF_PURGEf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 20)) | ((((uint32_t)f) & 0x1) << 20)) -#define CMIC_TOP_CONFIGr_COS_MASK_OVERRIDEf_GET(r) ((((r).cmic_top_config[0]) >> 21) & 0x1) -#define CMIC_TOP_CONFIGr_COS_MASK_OVERRIDEf_SET(r,f) (r).cmic_top_config[0]=(((r).cmic_top_config[0] & ~((uint32_t)0x1 << 21)) | ((((uint32_t)f) & 0x1) << 21)) -#define READ_CMIC_TOP_CONFIGr(u,r) BCMDRD_DEV_READ32(u,CMIC_TOP_CONFIGr_OFFSET,r._cmic_top_config) -#define WRITE_CMIC_TOP_CONFIGr(u,r) BCMDRD_DEV_WRITE32(u,CMIC_TOP_CONFIGr_OFFSET,r._cmic_top_config) - -/* - * This structure should be used to declare and program CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZE. - * - */ -typedef union CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr_s { - uint32_t v[1]; - uint32_t cmic_top_status_ep_to_cpu_header_size[1]; - uint32_t _cmic_top_status_ep_to_cpu_header_size; -} CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr_t; - -#define CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr_CLR(r) (r).cmic_top_status_ep_to_cpu_header_size[0] = 0 -#define CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr_SET(r,d) (r).cmic_top_status_ep_to_cpu_header_size[0] = d -#define CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr_GET(r) (r).cmic_top_status_ep_to_cpu_header_size[0] -#define CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr_OFFSET 0x00000004 -#define CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr_EP_TO_CPU_HEADER_SIZEf_GET(r) (((r).cmic_top_status_ep_to_cpu_header_size[0]) & 0xf) -#define CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr_EP_TO_CPU_HEADER_SIZEf_SET(r,f) (r).cmic_top_status_ep_to_cpu_header_size[0]=(((r).cmic_top_status_ep_to_cpu_header_size[0] & ~((uint32_t)0xf)) | (((uint32_t)f) & 0xf)) -#define READ_CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr(u,r) BCMDRD_DEV_READ32(u,CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr_OFFSET,r._cmic_top_status_ep_to_cpu_header_size) -#define WRITE_CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr(u,r) BCMDRD_DEV_WRITE32(u,CMIC_TOP_STATUS_EP_TO_CPU_HEADER_SIZEr_OFFSET,r._cmic_top_status_ep_to_cpu_header_size) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_COS_CTRL_RX_0. - * - */ -typedef union CMIC_CMC_PKTDMA_COS_CTRL_RX_0r_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_cos_ctrl_rx_0[1]; - uint32_t _cmic_cmc_pktdma_cos_ctrl_rx_0; -} CMIC_CMC_PKTDMA_COS_CTRL_RX_0r_t; - -#define CMIC_CMC_PKTDMA_COS_CTRL_RX_0r_CLR(r) (r).cmic_cmc_pktdma_cos_ctrl_rx_0[0] = 0 -#define CMIC_CMC_PKTDMA_COS_CTRL_RX_0r_SET(r,d) (r).cmic_cmc_pktdma_cos_ctrl_rx_0[0] = d -#define CMIC_CMC_PKTDMA_COS_CTRL_RX_0r_GET(r) (r).cmic_cmc_pktdma_cos_ctrl_rx_0[0] -#define CMIC_CMC_PKTDMA_COS_CTRL_RX_0r_OFFSET 0x00003124 -#define CMIC_CMC_PKTDMA_COS_CTRL_RX_0r_COS_BMPf_GET(r) ((r).cmic_cmc_pktdma_cos_ctrl_rx_0[0]) -#define CMIC_CMC_PKTDMA_COS_CTRL_RX_0r_COS_BMPf_SET(r,f) (r).cmic_cmc_pktdma_cos_ctrl_rx_0[0]=((uint32_t)f) -#define READ_CMIC_CMC_PKTDMA_COS_CTRL_RX_0r(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_COS_CTRL_RX_0r_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_cos_ctrl_rx_0) -#define WRITE_CMIC_CMC_PKTDMA_COS_CTRL_RX_0r(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_COS_CTRL_RX_0r_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_cos_ctrl_rx_0) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_COS_CTRL_RX_1. - * - */ -typedef union CMIC_CMC_PKTDMA_COS_CTRL_RX_1r_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_cos_ctrl_rx_1[1]; - uint32_t _cmic_cmc_pktdma_cos_ctrl_rx_1; -} CMIC_CMC_PKTDMA_COS_CTRL_RX_1r_t; - -#define CMIC_CMC_PKTDMA_COS_CTRL_RX_1r_CLR(r) (r).cmic_cmc_pktdma_cos_ctrl_rx_1[0] = 0 -#define CMIC_CMC_PKTDMA_COS_CTRL_RX_1r_SET(r,d) (r).cmic_cmc_pktdma_cos_ctrl_rx_1[0] = d -#define CMIC_CMC_PKTDMA_COS_CTRL_RX_1r_GET(r) (r).cmic_cmc_pktdma_cos_ctrl_rx_1[0] -#define CMIC_CMC_PKTDMA_COS_CTRL_RX_1r_OFFSET 0x00003128 -#define CMIC_CMC_PKTDMA_COS_CTRL_RX_1r_COS_BMPf_GET(r) ((r).cmic_cmc_pktdma_cos_ctrl_rx_1[0]) -#define CMIC_CMC_PKTDMA_COS_CTRL_RX_1r_COS_BMPf_SET(r,f) (r).cmic_cmc_pktdma_cos_ctrl_rx_1[0]=((uint32_t)f) -#define READ_CMIC_CMC_PKTDMA_COS_CTRL_RX_1r(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_COS_CTRL_RX_1r_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_cos_ctrl_rx_1) -#define WRITE_CMIC_CMC_PKTDMA_COS_CTRL_RX_1r(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_COS_CTRL_RX_1r_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_cos_ctrl_rx_1) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_CTRL. - * - */ -typedef union CMIC_CMC_PKTDMA_CTRLr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_ctrl[1]; - uint32_t _cmic_cmc_pktdma_ctrl; -} CMIC_CMC_PKTDMA_CTRLr_t; - -#define CMIC_CMC_PKTDMA_CTRLr_CLR(r) (r).cmic_cmc_pktdma_ctrl[0] = 0 -#define CMIC_CMC_PKTDMA_CTRLr_SET(r,d) (r).cmic_cmc_pktdma_ctrl[0] = d -#define CMIC_CMC_PKTDMA_CTRLr_GET(r) (r).cmic_cmc_pktdma_ctrl[0] -#define CMIC_CMC_PKTDMA_CTRLr_OFFSET 0x00003100 -#define CMIC_CMC_PKTDMA_CTRLr_DIRECTIONf_GET(r) (((r).cmic_cmc_pktdma_ctrl[0]) & 0x1) -#define CMIC_CMC_PKTDMA_CTRLr_DIRECTIONf_SET(r,f) (r).cmic_cmc_pktdma_ctrl[0]=(((r).cmic_cmc_pktdma_ctrl[0] & ~((uint32_t)0x1)) | (((uint32_t)f) & 0x1)) -#define CMIC_CMC_PKTDMA_CTRLr_DMA_ENf_GET(r) ((((r).cmic_cmc_pktdma_ctrl[0]) >> 1) & 0x1) -#define CMIC_CMC_PKTDMA_CTRLr_DMA_ENf_SET(r,f) (r).cmic_cmc_pktdma_ctrl[0]=(((r).cmic_cmc_pktdma_ctrl[0] & ~((uint32_t)0x1 << 1)) | ((((uint32_t)f) & 0x1) << 1)) -#define CMIC_CMC_PKTDMA_CTRLr_ABORT_DMAf_GET(r) ((((r).cmic_cmc_pktdma_ctrl[0]) >> 2) & 0x1) -#define CMIC_CMC_PKTDMA_CTRLr_ABORT_DMAf_SET(r,f) (r).cmic_cmc_pktdma_ctrl[0]=(((r).cmic_cmc_pktdma_ctrl[0] & ~((uint32_t)0x1 << 2)) | ((((uint32_t)f) & 0x1) << 2)) -#define CMIC_CMC_PKTDMA_CTRLr_PKTDMA_ENDIANESSf_GET(r) ((((r).cmic_cmc_pktdma_ctrl[0]) >> 3) & 0x1) -#define CMIC_CMC_PKTDMA_CTRLr_PKTDMA_ENDIANESSf_SET(r,f) (r).cmic_cmc_pktdma_ctrl[0]=(((r).cmic_cmc_pktdma_ctrl[0] & ~((uint32_t)0x1 << 3)) | ((((uint32_t)f) & 0x1) << 3)) -#define CMIC_CMC_PKTDMA_CTRLr_DESC_ENDIANESSf_GET(r) ((((r).cmic_cmc_pktdma_ctrl[0]) >> 4) & 0x1) -#define CMIC_CMC_PKTDMA_CTRLr_DESC_ENDIANESSf_SET(r,f) (r).cmic_cmc_pktdma_ctrl[0]=(((r).cmic_cmc_pktdma_ctrl[0] & ~((uint32_t)0x1 << 4)) | ((((uint32_t)f) & 0x1) << 4)) -#define CMIC_CMC_PKTDMA_CTRLr_DROP_RX_PKT_ON_CHAIN_ENDf_GET(r) ((((r).cmic_cmc_pktdma_ctrl[0]) >> 5) & 0x1) -#define CMIC_CMC_PKTDMA_CTRLr_DROP_RX_PKT_ON_CHAIN_ENDf_SET(r,f) (r).cmic_cmc_pktdma_ctrl[0]=(((r).cmic_cmc_pktdma_ctrl[0] & ~((uint32_t)0x1 << 5)) | ((((uint32_t)f) & 0x1) << 5)) -#define CMIC_CMC_PKTDMA_CTRLr_RLD_STS_UPD_DISf_GET(r) ((((r).cmic_cmc_pktdma_ctrl[0]) >> 6) & 0x1) -#define CMIC_CMC_PKTDMA_CTRLr_RLD_STS_UPD_DISf_SET(r,f) (r).cmic_cmc_pktdma_ctrl[0]=(((r).cmic_cmc_pktdma_ctrl[0] & ~((uint32_t)0x1 << 6)) | ((((uint32_t)f) & 0x1) << 6)) -#define CMIC_CMC_PKTDMA_CTRLr_DESC_DONE_INTR_MODEf_GET(r) ((((r).cmic_cmc_pktdma_ctrl[0]) >> 7) & 0x1) -#define CMIC_CMC_PKTDMA_CTRLr_DESC_DONE_INTR_MODEf_SET(r,f) (r).cmic_cmc_pktdma_ctrl[0]=(((r).cmic_cmc_pktdma_ctrl[0] & ~((uint32_t)0x1 << 7)) | ((((uint32_t)f) & 0x1) << 7)) -#define CMIC_CMC_PKTDMA_CTRLr_ENABLE_CONTINUOUS_DMAf_GET(r) ((((r).cmic_cmc_pktdma_ctrl[0]) >> 8) & 0x1) -#define CMIC_CMC_PKTDMA_CTRLr_ENABLE_CONTINUOUS_DMAf_SET(r,f) (r).cmic_cmc_pktdma_ctrl[0]=(((r).cmic_cmc_pktdma_ctrl[0] & ~((uint32_t)0x1 << 8)) | ((((uint32_t)f) & 0x1) << 8)) -#define CMIC_CMC_PKTDMA_CTRLr_CONTIGUOUS_DESCRIPTORSf_GET(r) ((((r).cmic_cmc_pktdma_ctrl[0]) >> 9) & 0x1) -#define CMIC_CMC_PKTDMA_CTRLr_CONTIGUOUS_DESCRIPTORSf_SET(r,f) (r).cmic_cmc_pktdma_ctrl[0]=(((r).cmic_cmc_pktdma_ctrl[0] & ~((uint32_t)0x1 << 9)) | ((((uint32_t)f) & 0x1) << 9)) -#define CMIC_CMC_PKTDMA_CTRLr_HEADER_ENDIANESSf_GET(r) ((((r).cmic_cmc_pktdma_ctrl[0]) >> 12) & 0x1) -#define CMIC_CMC_PKTDMA_CTRLr_HEADER_ENDIANESSf_SET(r,f) (r).cmic_cmc_pktdma_ctrl[0]=(((r).cmic_cmc_pktdma_ctrl[0] & ~((uint32_t)0x1 << 12)) | ((((uint32_t)f) & 0x1) << 12)) -#define CMIC_CMC_PKTDMA_CTRLr_DISABLE_ABORT_ON_ERRORf_GET(r) ((((r).cmic_cmc_pktdma_ctrl[0]) >> 13) & 0x1) -#define CMIC_CMC_PKTDMA_CTRLr_DISABLE_ABORT_ON_ERRORf_SET(r,f) (r).cmic_cmc_pktdma_ctrl[0]=(((r).cmic_cmc_pktdma_ctrl[0] & ~((uint32_t)0x1 << 13)) | ((((uint32_t)f) & 0x1) << 13)) -#define CMIC_CMC_PKTDMA_CTRLr_PIPE_MAPf_GET(r) ((((r).cmic_cmc_pktdma_ctrl[0]) >> 14) & 0x1) -#define CMIC_CMC_PKTDMA_CTRLr_PIPE_MAPf_SET(r,f) (r).cmic_cmc_pktdma_ctrl[0]=(((r).cmic_cmc_pktdma_ctrl[0] & ~((uint32_t)0x1 << 14)) | ((((uint32_t)f) & 0x1) << 14)) -#define CMIC_CMC_PKTDMA_CTRLr_DISABLE_DESC_OTDSTD_READf_GET(r) ((((r).cmic_cmc_pktdma_ctrl[0]) >> 15) & 0x1) -#define CMIC_CMC_PKTDMA_CTRLr_DISABLE_DESC_OTDSTD_READf_SET(r,f) (r).cmic_cmc_pktdma_ctrl[0]=(((r).cmic_cmc_pktdma_ctrl[0] & ~((uint32_t)0x1 << 15)) | ((((uint32_t)f) & 0x1) << 15)) -#define READ_CMIC_CMC_PKTDMA_CTRLr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_CTRLr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_ctrl) -#define WRITE_CMIC_CMC_PKTDMA_CTRLr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_CTRLr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_ctrl) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_CURR_DESC_HI. - * - */ -typedef union CMIC_CMC_PKTDMA_CURR_DESC_HIr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_curr_desc_hi[1]; - uint32_t _cmic_cmc_pktdma_curr_desc_hi; -} CMIC_CMC_PKTDMA_CURR_DESC_HIr_t; - -#define CMIC_CMC_PKTDMA_CURR_DESC_HIr_CLR(r) (r).cmic_cmc_pktdma_curr_desc_hi[0] = 0 -#define CMIC_CMC_PKTDMA_CURR_DESC_HIr_SET(r,d) (r).cmic_cmc_pktdma_curr_desc_hi[0] = d -#define CMIC_CMC_PKTDMA_CURR_DESC_HIr_GET(r) (r).cmic_cmc_pktdma_curr_desc_hi[0] -#define CMIC_CMC_PKTDMA_CURR_DESC_HIr_OFFSET 0x00003134 -#define CMIC_CMC_PKTDMA_CURR_DESC_HIr_ADDRf_GET(r) ((r).cmic_cmc_pktdma_curr_desc_hi[0]) -#define CMIC_CMC_PKTDMA_CURR_DESC_HIr_ADDRf_SET(r,f) (r).cmic_cmc_pktdma_curr_desc_hi[0]=((uint32_t)f) -#define READ_CMIC_CMC_PKTDMA_CURR_DESC_HIr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_CURR_DESC_HIr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_curr_desc_hi) -#define WRITE_CMIC_CMC_PKTDMA_CURR_DESC_HIr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_CURR_DESC_HIr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_curr_desc_hi) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_CURR_DESC_LO. - * - */ -typedef union CMIC_CMC_PKTDMA_CURR_DESC_LOr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_curr_desc_lo[1]; - uint32_t _cmic_cmc_pktdma_curr_desc_lo; -} CMIC_CMC_PKTDMA_CURR_DESC_LOr_t; - -#define CMIC_CMC_PKTDMA_CURR_DESC_LOr_CLR(r) (r).cmic_cmc_pktdma_curr_desc_lo[0] = 0 -#define CMIC_CMC_PKTDMA_CURR_DESC_LOr_SET(r,d) (r).cmic_cmc_pktdma_curr_desc_lo[0] = d -#define CMIC_CMC_PKTDMA_CURR_DESC_LOr_GET(r) (r).cmic_cmc_pktdma_curr_desc_lo[0] -#define CMIC_CMC_PKTDMA_CURR_DESC_LOr_OFFSET 0x00003130 -#define CMIC_CMC_PKTDMA_CURR_DESC_LOr_ADDRf_GET(r) ((r).cmic_cmc_pktdma_curr_desc_lo[0]) -#define CMIC_CMC_PKTDMA_CURR_DESC_LOr_ADDRf_SET(r,f) (r).cmic_cmc_pktdma_curr_desc_lo[0]=((uint32_t)f) -#define READ_CMIC_CMC_PKTDMA_CURR_DESC_LOr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_CURR_DESC_LOr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_curr_desc_lo) -#define WRITE_CMIC_CMC_PKTDMA_CURR_DESC_LOr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_CURR_DESC_LOr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_curr_desc_lo) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_DEBUG_CONTROL. - * - */ -typedef union CMIC_CMC_PKTDMA_DEBUG_CONTROLr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_debug_control[1]; - uint32_t _cmic_cmc_pktdma_debug_control; -} CMIC_CMC_PKTDMA_DEBUG_CONTROLr_t; - -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_CLR(r) (r).cmic_cmc_pktdma_debug_control[0] = 0 -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_SET(r,d) (r).cmic_cmc_pktdma_debug_control[0] = d -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_GET(r) (r).cmic_cmc_pktdma_debug_control[0] -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_OFFSET 0x0000313c -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_DESC_PENDING_SER_Q_SIZEf_GET(r) (((r).cmic_cmc_pktdma_debug_control[0]) & 0x7) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_DESC_PENDING_SER_Q_SIZEf_SET(r,f) (r).cmic_cmc_pktdma_debug_control[0]=(((r).cmic_cmc_pktdma_debug_control[0] & ~((uint32_t)0x7)) | (((uint32_t)f) & 0x7)) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_DESC_PENDING_WRITE_Q_SIZEf_GET(r) ((((r).cmic_cmc_pktdma_debug_control[0]) >> 3) & 0x7) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_DESC_PENDING_WRITE_Q_SIZEf_SET(r,f) (r).cmic_cmc_pktdma_debug_control[0]=(((r).cmic_cmc_pktdma_debug_control[0] & ~((uint32_t)0x7 << 3)) | ((((uint32_t)f) & 0x7) << 3)) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_FLUSH_DESC_Qf_GET(r) ((((r).cmic_cmc_pktdma_debug_control[0]) >> 6) & 0x1) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_FLUSH_DESC_Qf_SET(r,f) (r).cmic_cmc_pktdma_debug_control[0]=(((r).cmic_cmc_pktdma_debug_control[0] & ~((uint32_t)0x1 << 6)) | ((((uint32_t)f) & 0x1) << 6)) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_RESET_OUTSTANDING_CNTf_GET(r) ((((r).cmic_cmc_pktdma_debug_control[0]) >> 7) & 0x1) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_RESET_OUTSTANDING_CNTf_SET(r,f) (r).cmic_cmc_pktdma_debug_control[0]=(((r).cmic_cmc_pktdma_debug_control[0] & ~((uint32_t)0x1 << 7)) | ((((uint32_t)f) & 0x1) << 7)) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_SM_SELECTf_GET(r) ((((r).cmic_cmc_pktdma_debug_control[0]) >> 8) & 0x3) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_SM_SELECTf_SET(r,f) (r).cmic_cmc_pktdma_debug_control[0]=(((r).cmic_cmc_pktdma_debug_control[0] & ~((uint32_t)0x3 << 8)) | ((((uint32_t)f) & 0x3) << 8)) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_RESET_DESC_READ_SM_IDLEf_GET(r) ((((r).cmic_cmc_pktdma_debug_control[0]) >> 10) & 0x1) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_RESET_DESC_READ_SM_IDLEf_SET(r,f) (r).cmic_cmc_pktdma_debug_control[0]=(((r).cmic_cmc_pktdma_debug_control[0] & ~((uint32_t)0x1 << 10)) | ((((uint32_t)f) & 0x1) << 10)) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_RESET_MEM_RDWR_SM_IDLEf_GET(r) ((((r).cmic_cmc_pktdma_debug_control[0]) >> 11) & 0x1) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_RESET_MEM_RDWR_SM_IDLEf_SET(r,f) (r).cmic_cmc_pktdma_debug_control[0]=(((r).cmic_cmc_pktdma_debug_control[0] & ~((uint32_t)0x1 << 11)) | ((((uint32_t)f) & 0x1) << 11)) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_RESET_DESC_STATUS_WR_SM_IDLEf_GET(r) ((((r).cmic_cmc_pktdma_debug_control[0]) >> 12) & 0x1) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_RESET_DESC_STATUS_WR_SM_IDLEf_SET(r,f) (r).cmic_cmc_pktdma_debug_control[0]=(((r).cmic_cmc_pktdma_debug_control[0] & ~((uint32_t)0x1 << 12)) | ((((uint32_t)f) & 0x1) << 12)) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_RESET_DYN_RCNFG_SM_IDLEf_GET(r) ((((r).cmic_cmc_pktdma_debug_control[0]) >> 13) & 0x1) -#define CMIC_CMC_PKTDMA_DEBUG_CONTROLr_RESET_DYN_RCNFG_SM_IDLEf_SET(r,f) (r).cmic_cmc_pktdma_debug_control[0]=(((r).cmic_cmc_pktdma_debug_control[0] & ~((uint32_t)0x1 << 13)) | ((((uint32_t)f) & 0x1) << 13)) -#define READ_CMIC_CMC_PKTDMA_DEBUG_CONTROLr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_DEBUG_CONTROLr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_debug_control) -#define WRITE_CMIC_CMC_PKTDMA_DEBUG_CONTROLr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_DEBUG_CONTROLr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_debug_control) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_DEBUG_SM_STATUS. - * - */ -typedef union CMIC_CMC_PKTDMA_DEBUG_SM_STATUSr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_debug_sm_status[1]; - uint32_t _cmic_cmc_pktdma_debug_sm_status; -} CMIC_CMC_PKTDMA_DEBUG_SM_STATUSr_t; - -#define CMIC_CMC_PKTDMA_DEBUG_SM_STATUSr_CLR(r) (r).cmic_cmc_pktdma_debug_sm_status[0] = 0 -#define CMIC_CMC_PKTDMA_DEBUG_SM_STATUSr_SET(r,d) (r).cmic_cmc_pktdma_debug_sm_status[0] = d -#define CMIC_CMC_PKTDMA_DEBUG_SM_STATUSr_GET(r) (r).cmic_cmc_pktdma_debug_sm_status[0] -#define CMIC_CMC_PKTDMA_DEBUG_SM_STATUSr_OFFSET 0x00003140 -#define CMIC_CMC_PKTDMA_DEBUG_SM_STATUSr_STATEf_GET(r) ((r).cmic_cmc_pktdma_debug_sm_status[0]) -#define CMIC_CMC_PKTDMA_DEBUG_SM_STATUSr_STATEf_SET(r,f) (r).cmic_cmc_pktdma_debug_sm_status[0]=((uint32_t)f) -#define READ_CMIC_CMC_PKTDMA_DEBUG_SM_STATUSr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_DEBUG_SM_STATUSr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_debug_sm_status) -#define WRITE_CMIC_CMC_PKTDMA_DEBUG_SM_STATUSr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_DEBUG_SM_STATUSr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_debug_sm_status) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_DEBUG_STATUS. - * - */ -typedef union CMIC_CMC_PKTDMA_DEBUG_STATUSr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_debug_status[1]; - uint32_t _cmic_cmc_pktdma_debug_status; -} CMIC_CMC_PKTDMA_DEBUG_STATUSr_t; - -#define CMIC_CMC_PKTDMA_DEBUG_STATUSr_CLR(r) (r).cmic_cmc_pktdma_debug_status[0] = 0 -#define CMIC_CMC_PKTDMA_DEBUG_STATUSr_SET(r,d) (r).cmic_cmc_pktdma_debug_status[0] = d -#define CMIC_CMC_PKTDMA_DEBUG_STATUSr_GET(r) (r).cmic_cmc_pktdma_debug_status[0] -#define CMIC_CMC_PKTDMA_DEBUG_STATUSr_OFFSET 0x00003144 -#define CMIC_CMC_PKTDMA_DEBUG_STATUSr_DESC_PENDING_SER_Q_SIZE_NUM_ENTRIESf_GET(r) (((r).cmic_cmc_pktdma_debug_status[0]) & 0x3f) -#define CMIC_CMC_PKTDMA_DEBUG_STATUSr_DESC_PENDING_SER_Q_SIZE_NUM_ENTRIESf_SET(r,f) (r).cmic_cmc_pktdma_debug_status[0]=(((r).cmic_cmc_pktdma_debug_status[0] & ~((uint32_t)0x3f)) | (((uint32_t)f) & 0x3f)) -#define CMIC_CMC_PKTDMA_DEBUG_STATUSr_DESC_PENDING_WRITE_Q_NUM_ENTRIESf_GET(r) ((((r).cmic_cmc_pktdma_debug_status[0]) >> 6) & 0x7f) -#define CMIC_CMC_PKTDMA_DEBUG_STATUSr_DESC_PENDING_WRITE_Q_NUM_ENTRIESf_SET(r,f) (r).cmic_cmc_pktdma_debug_status[0]=(((r).cmic_cmc_pktdma_debug_status[0] & ~((uint32_t)0x7f << 6)) | ((((uint32_t)f) & 0x7f) << 6)) -#define CMIC_CMC_PKTDMA_DEBUG_STATUSr_NUM_TXPKTBUF_CELL_USEDf_GET(r) ((((r).cmic_cmc_pktdma_debug_status[0]) >> 13) & 0x7f) -#define CMIC_CMC_PKTDMA_DEBUG_STATUSr_NUM_TXPKTBUF_CELL_USEDf_SET(r,f) (r).cmic_cmc_pktdma_debug_status[0]=(((r).cmic_cmc_pktdma_debug_status[0] & ~((uint32_t)0x7f << 13)) | ((((uint32_t)f) & 0x7f) << 13)) -#define CMIC_CMC_PKTDMA_DEBUG_STATUSr_DESC_READ_OUTSTD_CNTf_GET(r) ((((r).cmic_cmc_pktdma_debug_status[0]) >> 20) & 0x1f) -#define CMIC_CMC_PKTDMA_DEBUG_STATUSr_DESC_READ_OUTSTD_CNTf_SET(r,f) (r).cmic_cmc_pktdma_debug_status[0]=(((r).cmic_cmc_pktdma_debug_status[0] & ~((uint32_t)0x1f << 20)) | ((((uint32_t)f) & 0x1f) << 20)) -#define READ_CMIC_CMC_PKTDMA_DEBUG_STATUSr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_DEBUG_STATUSr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_debug_status) -#define WRITE_CMIC_CMC_PKTDMA_DEBUG_STATUSr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_DEBUG_STATUSr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_debug_status) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_DESC_ADDR_HI. - * - */ -typedef union CMIC_CMC_PKTDMA_DESC_ADDR_HIr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_desc_addr_hi[1]; - uint32_t _cmic_cmc_pktdma_desc_addr_hi; -} CMIC_CMC_PKTDMA_DESC_ADDR_HIr_t; - -#define CMIC_CMC_PKTDMA_DESC_ADDR_HIr_CLR(r) (r).cmic_cmc_pktdma_desc_addr_hi[0] = 0 -#define CMIC_CMC_PKTDMA_DESC_ADDR_HIr_SET(r,d) (r).cmic_cmc_pktdma_desc_addr_hi[0] = d -#define CMIC_CMC_PKTDMA_DESC_ADDR_HIr_GET(r) (r).cmic_cmc_pktdma_desc_addr_hi[0] -#define CMIC_CMC_PKTDMA_DESC_ADDR_HIr_OFFSET 0x00003108 -#define CMIC_CMC_PKTDMA_DESC_ADDR_HIr_ADDRf_GET(r) ((r).cmic_cmc_pktdma_desc_addr_hi[0]) -#define CMIC_CMC_PKTDMA_DESC_ADDR_HIr_ADDRf_SET(r,f) (r).cmic_cmc_pktdma_desc_addr_hi[0]=((uint32_t)f) -#define READ_CMIC_CMC_PKTDMA_DESC_ADDR_HIr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_DESC_ADDR_HIr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_desc_addr_hi) -#define WRITE_CMIC_CMC_PKTDMA_DESC_ADDR_HIr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_DESC_ADDR_HIr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_desc_addr_hi) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_DESC_ADDR_LO. - * - */ -typedef union CMIC_CMC_PKTDMA_DESC_ADDR_LOr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_desc_addr_lo[1]; - uint32_t _cmic_cmc_pktdma_desc_addr_lo; -} CMIC_CMC_PKTDMA_DESC_ADDR_LOr_t; - -#define CMIC_CMC_PKTDMA_DESC_ADDR_LOr_CLR(r) (r).cmic_cmc_pktdma_desc_addr_lo[0] = 0 -#define CMIC_CMC_PKTDMA_DESC_ADDR_LOr_SET(r,d) (r).cmic_cmc_pktdma_desc_addr_lo[0] = d -#define CMIC_CMC_PKTDMA_DESC_ADDR_LOr_GET(r) (r).cmic_cmc_pktdma_desc_addr_lo[0] -#define CMIC_CMC_PKTDMA_DESC_ADDR_LOr_OFFSET 0x00003104 -#define CMIC_CMC_PKTDMA_DESC_ADDR_LOr_ADDRf_GET(r) ((r).cmic_cmc_pktdma_desc_addr_lo[0]) -#define CMIC_CMC_PKTDMA_DESC_ADDR_LOr_ADDRf_SET(r,f) (r).cmic_cmc_pktdma_desc_addr_lo[0]=((uint32_t)f) -#define READ_CMIC_CMC_PKTDMA_DESC_ADDR_LOr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_DESC_ADDR_LOr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_desc_addr_lo) -#define WRITE_CMIC_CMC_PKTDMA_DESC_ADDR_LOr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_DESC_ADDR_LOr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_desc_addr_lo) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_DESC_COUNT_REQ. - * - */ -typedef union CMIC_CMC_PKTDMA_DESC_COUNT_REQr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_desc_count_req[1]; - uint32_t _cmic_cmc_pktdma_desc_count_req; -} CMIC_CMC_PKTDMA_DESC_COUNT_REQr_t; - -#define CMIC_CMC_PKTDMA_DESC_COUNT_REQr_CLR(r) (r).cmic_cmc_pktdma_desc_count_req[0] = 0 -#define CMIC_CMC_PKTDMA_DESC_COUNT_REQr_SET(r,d) (r).cmic_cmc_pktdma_desc_count_req[0] = d -#define CMIC_CMC_PKTDMA_DESC_COUNT_REQr_GET(r) (r).cmic_cmc_pktdma_desc_count_req[0] -#define CMIC_CMC_PKTDMA_DESC_COUNT_REQr_OFFSET 0x00003154 -#define CMIC_CMC_PKTDMA_DESC_COUNT_REQr_COUNTf_GET(r) ((r).cmic_cmc_pktdma_desc_count_req[0]) -#define CMIC_CMC_PKTDMA_DESC_COUNT_REQr_COUNTf_SET(r,f) (r).cmic_cmc_pktdma_desc_count_req[0]=((uint32_t)f) -#define READ_CMIC_CMC_PKTDMA_DESC_COUNT_REQr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_DESC_COUNT_REQr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_desc_count_req) -#define WRITE_CMIC_CMC_PKTDMA_DESC_COUNT_REQr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_DESC_COUNT_REQr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_desc_count_req) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_DESC_COUNT_RX. - * - */ -typedef union CMIC_CMC_PKTDMA_DESC_COUNT_RXr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_desc_count_rx[1]; - uint32_t _cmic_cmc_pktdma_desc_count_rx; -} CMIC_CMC_PKTDMA_DESC_COUNT_RXr_t; - -#define CMIC_CMC_PKTDMA_DESC_COUNT_RXr_CLR(r) (r).cmic_cmc_pktdma_desc_count_rx[0] = 0 -#define CMIC_CMC_PKTDMA_DESC_COUNT_RXr_SET(r,d) (r).cmic_cmc_pktdma_desc_count_rx[0] = d -#define CMIC_CMC_PKTDMA_DESC_COUNT_RXr_GET(r) (r).cmic_cmc_pktdma_desc_count_rx[0] -#define CMIC_CMC_PKTDMA_DESC_COUNT_RXr_OFFSET 0x00003158 -#define CMIC_CMC_PKTDMA_DESC_COUNT_RXr_COUNTf_GET(r) ((r).cmic_cmc_pktdma_desc_count_rx[0]) -#define CMIC_CMC_PKTDMA_DESC_COUNT_RXr_COUNTf_SET(r,f) (r).cmic_cmc_pktdma_desc_count_rx[0]=((uint32_t)f) -#define READ_CMIC_CMC_PKTDMA_DESC_COUNT_RXr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_DESC_COUNT_RXr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_desc_count_rx) -#define WRITE_CMIC_CMC_PKTDMA_DESC_COUNT_RXr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_DESC_COUNT_RXr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_desc_count_rx) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_DESC_COUNT_STATUS_WR. - * - */ -typedef union CMIC_CMC_PKTDMA_DESC_COUNT_STATUS_WRr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_desc_count_status_wr[1]; - uint32_t _cmic_cmc_pktdma_desc_count_status_wr; -} CMIC_CMC_PKTDMA_DESC_COUNT_STATUS_WRr_t; - -#define CMIC_CMC_PKTDMA_DESC_COUNT_STATUS_WRr_CLR(r) (r).cmic_cmc_pktdma_desc_count_status_wr[0] = 0 -#define CMIC_CMC_PKTDMA_DESC_COUNT_STATUS_WRr_SET(r,d) (r).cmic_cmc_pktdma_desc_count_status_wr[0] = d -#define CMIC_CMC_PKTDMA_DESC_COUNT_STATUS_WRr_GET(r) (r).cmic_cmc_pktdma_desc_count_status_wr[0] -#define CMIC_CMC_PKTDMA_DESC_COUNT_STATUS_WRr_OFFSET 0x0000315c -#define CMIC_CMC_PKTDMA_DESC_COUNT_STATUS_WRr_COUNTf_GET(r) ((r).cmic_cmc_pktdma_desc_count_status_wr[0]) -#define CMIC_CMC_PKTDMA_DESC_COUNT_STATUS_WRr_COUNTf_SET(r,f) (r).cmic_cmc_pktdma_desc_count_status_wr[0]=((uint32_t)f) -#define READ_CMIC_CMC_PKTDMA_DESC_COUNT_STATUS_WRr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_DESC_COUNT_STATUS_WRr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_desc_count_status_wr) -#define WRITE_CMIC_CMC_PKTDMA_DESC_COUNT_STATUS_WRr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_DESC_COUNT_STATUS_WRr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_desc_count_status_wr) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_DESC_HALT_ADDR_HI. - * - */ -typedef union CMIC_CMC_PKTDMA_DESC_HALT_ADDR_HIr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_desc_halt_addr_hi[1]; - uint32_t _cmic_cmc_pktdma_desc_halt_addr_hi; -} CMIC_CMC_PKTDMA_DESC_HALT_ADDR_HIr_t; - -#define CMIC_CMC_PKTDMA_DESC_HALT_ADDR_HIr_CLR(r) (r).cmic_cmc_pktdma_desc_halt_addr_hi[0] = 0 -#define CMIC_CMC_PKTDMA_DESC_HALT_ADDR_HIr_SET(r,d) (r).cmic_cmc_pktdma_desc_halt_addr_hi[0] = d -#define CMIC_CMC_PKTDMA_DESC_HALT_ADDR_HIr_GET(r) (r).cmic_cmc_pktdma_desc_halt_addr_hi[0] -#define CMIC_CMC_PKTDMA_DESC_HALT_ADDR_HIr_OFFSET 0x00003110 -#define CMIC_CMC_PKTDMA_DESC_HALT_ADDR_HIr_ADDRf_GET(r) ((r).cmic_cmc_pktdma_desc_halt_addr_hi[0]) -#define CMIC_CMC_PKTDMA_DESC_HALT_ADDR_HIr_ADDRf_SET(r,f) (r).cmic_cmc_pktdma_desc_halt_addr_hi[0]=((uint32_t)f) -#define READ_CMIC_CMC_PKTDMA_DESC_HALT_ADDR_HIr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_DESC_HALT_ADDR_HIr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_desc_halt_addr_hi) -#define WRITE_CMIC_CMC_PKTDMA_DESC_HALT_ADDR_HIr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_DESC_HALT_ADDR_HIr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_desc_halt_addr_hi) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_DESC_HALT_ADDR_LO. - * - */ -typedef union CMIC_CMC_PKTDMA_DESC_HALT_ADDR_LOr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_desc_halt_addr_lo[1]; - uint32_t _cmic_cmc_pktdma_desc_halt_addr_lo; -} CMIC_CMC_PKTDMA_DESC_HALT_ADDR_LOr_t; - -#define CMIC_CMC_PKTDMA_DESC_HALT_ADDR_LOr_CLR(r) (r).cmic_cmc_pktdma_desc_halt_addr_lo[0] = 0 -#define CMIC_CMC_PKTDMA_DESC_HALT_ADDR_LOr_SET(r,d) (r).cmic_cmc_pktdma_desc_halt_addr_lo[0] = d -#define CMIC_CMC_PKTDMA_DESC_HALT_ADDR_LOr_GET(r) (r).cmic_cmc_pktdma_desc_halt_addr_lo[0] -#define CMIC_CMC_PKTDMA_DESC_HALT_ADDR_LOr_OFFSET 0x0000310c -#define CMIC_CMC_PKTDMA_DESC_HALT_ADDR_LOr_ADDRf_GET(r) ((r).cmic_cmc_pktdma_desc_halt_addr_lo[0]) -#define CMIC_CMC_PKTDMA_DESC_HALT_ADDR_LOr_ADDRf_SET(r,f) (r).cmic_cmc_pktdma_desc_halt_addr_lo[0]=((uint32_t)f) -#define READ_CMIC_CMC_PKTDMA_DESC_HALT_ADDR_LOr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_DESC_HALT_ADDR_LOr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_desc_halt_addr_lo) -#define WRITE_CMIC_CMC_PKTDMA_DESC_HALT_ADDR_LOr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_DESC_HALT_ADDR_LOr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_desc_halt_addr_lo) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_INTR. - * - */ -typedef union CMIC_CMC_PKTDMA_INTRr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_intr[1]; - uint32_t _cmic_cmc_pktdma_intr; -} CMIC_CMC_PKTDMA_INTRr_t; - -#define CMIC_CMC_PKTDMA_INTRr_CLR(r) (r).cmic_cmc_pktdma_intr[0] = 0 -#define CMIC_CMC_PKTDMA_INTRr_SET(r,d) (r).cmic_cmc_pktdma_intr[0] = d -#define CMIC_CMC_PKTDMA_INTRr_GET(r) (r).cmic_cmc_pktdma_intr[0] -#define CMIC_CMC_PKTDMA_INTRr_OFFSET 0x00003118 -#define CMIC_CMC_PKTDMA_INTRr_CHAIN_DONE_INTRf_GET(r) (((r).cmic_cmc_pktdma_intr[0]) & 0x1) -#define CMIC_CMC_PKTDMA_INTRr_CHAIN_DONE_INTRf_SET(r,f) (r).cmic_cmc_pktdma_intr[0]=(((r).cmic_cmc_pktdma_intr[0] & ~((uint32_t)0x1)) | (((uint32_t)f) & 0x1)) -#define CMIC_CMC_PKTDMA_INTRr_DESC_DONE_INTRf_GET(r) ((((r).cmic_cmc_pktdma_intr[0]) >> 1) & 0x1) -#define CMIC_CMC_PKTDMA_INTRr_DESC_DONE_INTRf_SET(r,f) (r).cmic_cmc_pktdma_intr[0]=(((r).cmic_cmc_pktdma_intr[0] & ~((uint32_t)0x1 << 1)) | ((((uint32_t)f) & 0x1) << 1)) -#define CMIC_CMC_PKTDMA_INTRr_DESC_CONTROLLED_INTRf_GET(r) ((((r).cmic_cmc_pktdma_intr[0]) >> 2) & 0x1) -#define CMIC_CMC_PKTDMA_INTRr_DESC_CONTROLLED_INTRf_SET(r,f) (r).cmic_cmc_pktdma_intr[0]=(((r).cmic_cmc_pktdma_intr[0] & ~((uint32_t)0x1 << 2)) | ((((uint32_t)f) & 0x1) << 2)) -#define CMIC_CMC_PKTDMA_INTRr_INTR_COALESCING_INTRf_GET(r) ((((r).cmic_cmc_pktdma_intr[0]) >> 3) & 0x1) -#define CMIC_CMC_PKTDMA_INTRr_INTR_COALESCING_INTRf_SET(r,f) (r).cmic_cmc_pktdma_intr[0]=(((r).cmic_cmc_pktdma_intr[0] & ~((uint32_t)0x1 << 3)) | ((((uint32_t)f) & 0x1) << 3)) -#define READ_CMIC_CMC_PKTDMA_INTRr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_INTRr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_intr) -#define WRITE_CMIC_CMC_PKTDMA_INTRr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_INTRr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_intr) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_INTR_CLR. - * - */ -typedef union CMIC_CMC_PKTDMA_INTR_CLRr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_intr_clr[1]; - uint32_t _cmic_cmc_pktdma_intr_clr; -} CMIC_CMC_PKTDMA_INTR_CLRr_t; - -#define CMIC_CMC_PKTDMA_INTR_CLRr_CLR(r) (r).cmic_cmc_pktdma_intr_clr[0] = 0 -#define CMIC_CMC_PKTDMA_INTR_CLRr_SET(r,d) (r).cmic_cmc_pktdma_intr_clr[0] = d -#define CMIC_CMC_PKTDMA_INTR_CLRr_GET(r) (r).cmic_cmc_pktdma_intr_clr[0] -#define CMIC_CMC_PKTDMA_INTR_CLRr_OFFSET 0x00003120 -#define CMIC_CMC_PKTDMA_INTR_CLRr_DESC_DONE_INTR_CLRf_GET(r) ((((r).cmic_cmc_pktdma_intr_clr[0]) >> 1) & 0x1) -#define CMIC_CMC_PKTDMA_INTR_CLRr_DESC_DONE_INTR_CLRf_SET(r,f) (r).cmic_cmc_pktdma_intr_clr[0]=(((r).cmic_cmc_pktdma_intr_clr[0] & ~((uint32_t)0x1 << 1)) | ((((uint32_t)f) & 0x1) << 1)) -#define CMIC_CMC_PKTDMA_INTR_CLRr_DESC_CONTROLLED_INTR_CLRf_GET(r) ((((r).cmic_cmc_pktdma_intr_clr[0]) >> 2) & 0x1) -#define CMIC_CMC_PKTDMA_INTR_CLRr_DESC_CONTROLLED_INTR_CLRf_SET(r,f) (r).cmic_cmc_pktdma_intr_clr[0]=(((r).cmic_cmc_pktdma_intr_clr[0] & ~((uint32_t)0x1 << 2)) | ((((uint32_t)f) & 0x1) << 2)) -#define CMIC_CMC_PKTDMA_INTR_CLRr_INTR_COALESCING_INTR_CLRf_GET(r) ((((r).cmic_cmc_pktdma_intr_clr[0]) >> 3) & 0x1) -#define CMIC_CMC_PKTDMA_INTR_CLRr_INTR_COALESCING_INTR_CLRf_SET(r,f) (r).cmic_cmc_pktdma_intr_clr[0]=(((r).cmic_cmc_pktdma_intr_clr[0] & ~((uint32_t)0x1 << 3)) | ((((uint32_t)f) & 0x1) << 3)) -#define CMIC_CMC_PKTDMA_INTR_CLRr_DYN_RCNFG_ERR_CLRf_GET(r) ((((r).cmic_cmc_pktdma_intr_clr[0]) >> 4) & 0x1) -#define CMIC_CMC_PKTDMA_INTR_CLRr_DYN_RCNFG_ERR_CLRf_SET(r,f) (r).cmic_cmc_pktdma_intr_clr[0]=(((r).cmic_cmc_pktdma_intr_clr[0] & ~((uint32_t)0x1 << 4)) | ((((uint32_t)f) & 0x1) << 4)) -#define READ_CMIC_CMC_PKTDMA_INTR_CLRr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_INTR_CLRr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_intr_clr) -#define WRITE_CMIC_CMC_PKTDMA_INTR_CLRr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_INTR_CLRr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_intr_clr) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_INTR_COAL. - * - */ -typedef union CMIC_CMC_PKTDMA_INTR_COALr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_intr_coal[1]; - uint32_t _cmic_cmc_pktdma_intr_coal; -} CMIC_CMC_PKTDMA_INTR_COALr_t; - -#define CMIC_CMC_PKTDMA_INTR_COALr_CLR(r) (r).cmic_cmc_pktdma_intr_coal[0] = 0 -#define CMIC_CMC_PKTDMA_INTR_COALr_SET(r,d) (r).cmic_cmc_pktdma_intr_coal[0] = d -#define CMIC_CMC_PKTDMA_INTR_COALr_GET(r) (r).cmic_cmc_pktdma_intr_coal[0] -#define CMIC_CMC_PKTDMA_INTR_COALr_OFFSET 0x0000312c -#define CMIC_CMC_PKTDMA_INTR_COALr_TIMERf_GET(r) (((r).cmic_cmc_pktdma_intr_coal[0]) & 0xffff) -#define CMIC_CMC_PKTDMA_INTR_COALr_TIMERf_SET(r,f) (r).cmic_cmc_pktdma_intr_coal[0]=(((r).cmic_cmc_pktdma_intr_coal[0] & ~((uint32_t)0xffff)) | (((uint32_t)f) & 0xffff)) -#define CMIC_CMC_PKTDMA_INTR_COALr_COUNTf_GET(r) ((((r).cmic_cmc_pktdma_intr_coal[0]) >> 16) & 0x7fff) -#define CMIC_CMC_PKTDMA_INTR_COALr_COUNTf_SET(r,f) (r).cmic_cmc_pktdma_intr_coal[0]=(((r).cmic_cmc_pktdma_intr_coal[0] & ~((uint32_t)0x7fff << 16)) | ((((uint32_t)f) & 0x7fff) << 16)) -#define CMIC_CMC_PKTDMA_INTR_COALr_ENABLEf_GET(r) ((((r).cmic_cmc_pktdma_intr_coal[0]) >> 31) & 0x1) -#define CMIC_CMC_PKTDMA_INTR_COALr_ENABLEf_SET(r,f) (r).cmic_cmc_pktdma_intr_coal[0]=(((r).cmic_cmc_pktdma_intr_coal[0] & ~((uint32_t)0x1 << 31)) | ((((uint32_t)f) & 0x1) << 31)) -#define READ_CMIC_CMC_PKTDMA_INTR_COALr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_INTR_COALr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_intr_coal) -#define WRITE_CMIC_CMC_PKTDMA_INTR_COALr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_INTR_COALr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_intr_coal) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_INTR_ENABLE. - * - */ -typedef union CMIC_CMC_PKTDMA_INTR_ENABLEr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_intr_enable[1]; - uint32_t _cmic_cmc_pktdma_intr_enable; -} CMIC_CMC_PKTDMA_INTR_ENABLEr_t; - -#define CMIC_CMC_PKTDMA_INTR_ENABLEr_CLR(r) (r).cmic_cmc_pktdma_intr_enable[0] = 0 -#define CMIC_CMC_PKTDMA_INTR_ENABLEr_SET(r,d) (r).cmic_cmc_pktdma_intr_enable[0] = d -#define CMIC_CMC_PKTDMA_INTR_ENABLEr_GET(r) (r).cmic_cmc_pktdma_intr_enable[0] -#define CMIC_CMC_PKTDMA_INTR_ENABLEr_OFFSET 0x0000311c -#define CMIC_CMC_PKTDMA_INTR_ENABLEr_CHAIN_DONE_INTR_ENABLEf_GET(r) (((r).cmic_cmc_pktdma_intr_enable[0]) & 0x1) -#define CMIC_CMC_PKTDMA_INTR_ENABLEr_CHAIN_DONE_INTR_ENABLEf_SET(r,f) (r).cmic_cmc_pktdma_intr_enable[0]=(((r).cmic_cmc_pktdma_intr_enable[0] & ~((uint32_t)0x1)) | (((uint32_t)f) & 0x1)) -#define CMIC_CMC_PKTDMA_INTR_ENABLEr_DESC_DONE_INTR_ENABLEf_GET(r) ((((r).cmic_cmc_pktdma_intr_enable[0]) >> 1) & 0x1) -#define CMIC_CMC_PKTDMA_INTR_ENABLEr_DESC_DONE_INTR_ENABLEf_SET(r,f) (r).cmic_cmc_pktdma_intr_enable[0]=(((r).cmic_cmc_pktdma_intr_enable[0] & ~((uint32_t)0x1 << 1)) | ((((uint32_t)f) & 0x1) << 1)) -#define CMIC_CMC_PKTDMA_INTR_ENABLEr_DESC_CONTROLLED_INTR_ENABLEf_GET(r) ((((r).cmic_cmc_pktdma_intr_enable[0]) >> 2) & 0x1) -#define CMIC_CMC_PKTDMA_INTR_ENABLEr_DESC_CONTROLLED_INTR_ENABLEf_SET(r,f) (r).cmic_cmc_pktdma_intr_enable[0]=(((r).cmic_cmc_pktdma_intr_enable[0] & ~((uint32_t)0x1 << 2)) | ((((uint32_t)f) & 0x1) << 2)) -#define CMIC_CMC_PKTDMA_INTR_ENABLEr_INTR_COALESCING_INTR_ENABLEf_GET(r) ((((r).cmic_cmc_pktdma_intr_enable[0]) >> 3) & 0x1) -#define CMIC_CMC_PKTDMA_INTR_ENABLEr_INTR_COALESCING_INTR_ENABLEf_SET(r,f) (r).cmic_cmc_pktdma_intr_enable[0]=(((r).cmic_cmc_pktdma_intr_enable[0] & ~((uint32_t)0x1 << 3)) | ((((uint32_t)f) & 0x1) << 3)) -#define READ_CMIC_CMC_PKTDMA_INTR_ENABLEr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_INTR_ENABLEr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_intr_enable) -#define WRITE_CMIC_CMC_PKTDMA_INTR_ENABLEr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_INTR_ENABLEr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_intr_enable) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_PKT_COUNT_RXPKT. - * - */ -typedef union CMIC_CMC_PKTDMA_PKT_COUNT_RXPKTr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_pkt_count_rxpkt[1]; - uint32_t _cmic_cmc_pktdma_pkt_count_rxpkt; -} CMIC_CMC_PKTDMA_PKT_COUNT_RXPKTr_t; - -#define CMIC_CMC_PKTDMA_PKT_COUNT_RXPKTr_CLR(r) (r).cmic_cmc_pktdma_pkt_count_rxpkt[0] = 0 -#define CMIC_CMC_PKTDMA_PKT_COUNT_RXPKTr_SET(r,d) (r).cmic_cmc_pktdma_pkt_count_rxpkt[0] = d -#define CMIC_CMC_PKTDMA_PKT_COUNT_RXPKTr_GET(r) (r).cmic_cmc_pktdma_pkt_count_rxpkt[0] -#define CMIC_CMC_PKTDMA_PKT_COUNT_RXPKTr_OFFSET 0x00003148 -#define CMIC_CMC_PKTDMA_PKT_COUNT_RXPKTr_COUNTf_GET(r) ((r).cmic_cmc_pktdma_pkt_count_rxpkt[0]) -#define CMIC_CMC_PKTDMA_PKT_COUNT_RXPKTr_COUNTf_SET(r,f) (r).cmic_cmc_pktdma_pkt_count_rxpkt[0]=((uint32_t)f) -#define READ_CMIC_CMC_PKTDMA_PKT_COUNT_RXPKTr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_PKT_COUNT_RXPKTr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_pkt_count_rxpkt) -#define WRITE_CMIC_CMC_PKTDMA_PKT_COUNT_RXPKTr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_PKT_COUNT_RXPKTr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_pkt_count_rxpkt) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_PKT_COUNT_RXPKT_DROP. - * - */ -typedef union CMIC_CMC_PKTDMA_PKT_COUNT_RXPKT_DROPr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_pkt_count_rxpkt_drop[1]; - uint32_t _cmic_cmc_pktdma_pkt_count_rxpkt_drop; -} CMIC_CMC_PKTDMA_PKT_COUNT_RXPKT_DROPr_t; - -#define CMIC_CMC_PKTDMA_PKT_COUNT_RXPKT_DROPr_CLR(r) (r).cmic_cmc_pktdma_pkt_count_rxpkt_drop[0] = 0 -#define CMIC_CMC_PKTDMA_PKT_COUNT_RXPKT_DROPr_SET(r,d) (r).cmic_cmc_pktdma_pkt_count_rxpkt_drop[0] = d -#define CMIC_CMC_PKTDMA_PKT_COUNT_RXPKT_DROPr_GET(r) (r).cmic_cmc_pktdma_pkt_count_rxpkt_drop[0] -#define CMIC_CMC_PKTDMA_PKT_COUNT_RXPKT_DROPr_OFFSET 0x00003150 -#define CMIC_CMC_PKTDMA_PKT_COUNT_RXPKT_DROPr_COUNTf_GET(r) ((r).cmic_cmc_pktdma_pkt_count_rxpkt_drop[0]) -#define CMIC_CMC_PKTDMA_PKT_COUNT_RXPKT_DROPr_COUNTf_SET(r,f) (r).cmic_cmc_pktdma_pkt_count_rxpkt_drop[0]=((uint32_t)f) -#define READ_CMIC_CMC_PKTDMA_PKT_COUNT_RXPKT_DROPr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_PKT_COUNT_RXPKT_DROPr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_pkt_count_rxpkt_drop) -#define WRITE_CMIC_CMC_PKTDMA_PKT_COUNT_RXPKT_DROPr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_PKT_COUNT_RXPKT_DROPr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_pkt_count_rxpkt_drop) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_PKT_COUNT_TXPKT. - * - */ -typedef union CMIC_CMC_PKTDMA_PKT_COUNT_TXPKTr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_pkt_count_txpkt[1]; - uint32_t _cmic_cmc_pktdma_pkt_count_txpkt; -} CMIC_CMC_PKTDMA_PKT_COUNT_TXPKTr_t; - -#define CMIC_CMC_PKTDMA_PKT_COUNT_TXPKTr_CLR(r) (r).cmic_cmc_pktdma_pkt_count_txpkt[0] = 0 -#define CMIC_CMC_PKTDMA_PKT_COUNT_TXPKTr_SET(r,d) (r).cmic_cmc_pktdma_pkt_count_txpkt[0] = d -#define CMIC_CMC_PKTDMA_PKT_COUNT_TXPKTr_GET(r) (r).cmic_cmc_pktdma_pkt_count_txpkt[0] -#define CMIC_CMC_PKTDMA_PKT_COUNT_TXPKTr_OFFSET 0x0000314c -#define CMIC_CMC_PKTDMA_PKT_COUNT_TXPKTr_COUNTf_GET(r) ((r).cmic_cmc_pktdma_pkt_count_txpkt[0]) -#define CMIC_CMC_PKTDMA_PKT_COUNT_TXPKTr_COUNTf_SET(r,f) (r).cmic_cmc_pktdma_pkt_count_txpkt[0]=((uint32_t)f) -#define READ_CMIC_CMC_PKTDMA_PKT_COUNT_TXPKTr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_PKT_COUNT_TXPKTr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_pkt_count_txpkt) -#define WRITE_CMIC_CMC_PKTDMA_PKT_COUNT_TXPKTr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_PKT_COUNT_TXPKTr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_pkt_count_txpkt) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIG. - * - */ -typedef union CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIGr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_rxbuf_threshold_config[1]; - uint32_t _cmic_cmc_pktdma_rxbuf_threshold_config; -} CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIGr_t; - -#define CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIGr_CLR(r) (r).cmic_cmc_pktdma_rxbuf_threshold_config[0] = 0 -#define CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIGr_SET(r,d) (r).cmic_cmc_pktdma_rxbuf_threshold_config[0] = d -#define CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIGr_GET(r) (r).cmic_cmc_pktdma_rxbuf_threshold_config[0] -#define CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIGr_OFFSET 0x00003138 -#define CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIGr_RXBUF_THRESHOLDf_GET(r) (((r).cmic_cmc_pktdma_rxbuf_threshold_config[0]) & 0x1ff) -#define CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIGr_RXBUF_THRESHOLDf_SET(r,f) (r).cmic_cmc_pktdma_rxbuf_threshold_config[0]=(((r).cmic_cmc_pktdma_rxbuf_threshold_config[0] & ~((uint32_t)0x1ff)) | (((uint32_t)f) & 0x1ff)) -#define CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIGr_ENABLEf_GET(r) ((((r).cmic_cmc_pktdma_rxbuf_threshold_config[0]) >> 9) & 0x1) -#define CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIGr_ENABLEf_SET(r,f) (r).cmic_cmc_pktdma_rxbuf_threshold_config[0]=(((r).cmic_cmc_pktdma_rxbuf_threshold_config[0] & ~((uint32_t)0x1 << 9)) | ((((uint32_t)f) & 0x1) << 9)) -#define READ_CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIGr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIGr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_rxbuf_threshold_config) -#define WRITE_CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIGr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_RXBUF_THRESHOLD_CONFIGr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_rxbuf_threshold_config) - -/* - * This structure should be used to declare and program CMIC_CMC_PKTDMA_STAT. - * - */ -typedef union CMIC_CMC_PKTDMA_STATr_s { - uint32_t v[1]; - uint32_t cmic_cmc_pktdma_stat[1]; - uint32_t _cmic_cmc_pktdma_stat; -} CMIC_CMC_PKTDMA_STATr_t; - -#define CMIC_CMC_PKTDMA_STATr_CLR(r) (r).cmic_cmc_pktdma_stat[0] = 0 -#define CMIC_CMC_PKTDMA_STATr_SET(r,d) (r).cmic_cmc_pktdma_stat[0] = d -#define CMIC_CMC_PKTDMA_STATr_GET(r) (r).cmic_cmc_pktdma_stat[0] -#define CMIC_CMC_PKTDMA_STATr_OFFSET 0x00003114 -#define CMIC_CMC_PKTDMA_STATr_CHAIN_DONEf_GET(r) (((r).cmic_cmc_pktdma_stat[0]) & 0x1) -#define CMIC_CMC_PKTDMA_STATr_CHAIN_DONEf_SET(r,f) (r).cmic_cmc_pktdma_stat[0]=(((r).cmic_cmc_pktdma_stat[0] & ~((uint32_t)0x1)) | (((uint32_t)f) & 0x1)) -#define CMIC_CMC_PKTDMA_STATr_DMA_ACTIVEf_GET(r) ((((r).cmic_cmc_pktdma_stat[0]) >> 1) & 0x1) -#define CMIC_CMC_PKTDMA_STATr_DMA_ACTIVEf_SET(r,f) (r).cmic_cmc_pktdma_stat[0]=(((r).cmic_cmc_pktdma_stat[0] & ~((uint32_t)0x1 << 1)) | ((((uint32_t)f) & 0x1) << 1)) -#define CMIC_CMC_PKTDMA_STATr_STWT_ADDR_DECODE_ERRf_GET(r) ((((r).cmic_cmc_pktdma_stat[0]) >> 2) & 0x1) -#define CMIC_CMC_PKTDMA_STATr_STWT_ADDR_DECODE_ERRf_SET(r,f) (r).cmic_cmc_pktdma_stat[0]=(((r).cmic_cmc_pktdma_stat[0] & ~((uint32_t)0x1 << 2)) | ((((uint32_t)f) & 0x1) << 2)) -#define CMIC_CMC_PKTDMA_STATr_PKTWRRD_ADDR_DECODE_ERRf_GET(r) ((((r).cmic_cmc_pktdma_stat[0]) >> 3) & 0x1) -#define CMIC_CMC_PKTDMA_STATr_PKTWRRD_ADDR_DECODE_ERRf_SET(r,f) (r).cmic_cmc_pktdma_stat[0]=(((r).cmic_cmc_pktdma_stat[0] & ~((uint32_t)0x1 << 3)) | ((((uint32_t)f) & 0x1) << 3)) -#define CMIC_CMC_PKTDMA_STATr_DESCRD_ADDR_DECODE_ERRf_GET(r) ((((r).cmic_cmc_pktdma_stat[0]) >> 4) & 0x1) -#define CMIC_CMC_PKTDMA_STATr_DESCRD_ADDR_DECODE_ERRf_SET(r,f) (r).cmic_cmc_pktdma_stat[0]=(((r).cmic_cmc_pktdma_stat[0] & ~((uint32_t)0x1 << 4)) | ((((uint32_t)f) & 0x1) << 4)) -#define CMIC_CMC_PKTDMA_STATr_PKTWR_ECC_ERRf_GET(r) ((((r).cmic_cmc_pktdma_stat[0]) >> 5) & 0x1) -#define CMIC_CMC_PKTDMA_STATr_PKTWR_ECC_ERRf_SET(r,f) (r).cmic_cmc_pktdma_stat[0]=(((r).cmic_cmc_pktdma_stat[0] & ~((uint32_t)0x1 << 5)) | ((((uint32_t)f) & 0x1) << 5)) -#define CMIC_CMC_PKTDMA_STATr_CH_IN_HALTf_GET(r) ((((r).cmic_cmc_pktdma_stat[0]) >> 6) & 0x1) -#define CMIC_CMC_PKTDMA_STATr_CH_IN_HALTf_SET(r,f) (r).cmic_cmc_pktdma_stat[0]=(((r).cmic_cmc_pktdma_stat[0] & ~((uint32_t)0x1 << 6)) | ((((uint32_t)f) & 0x1) << 6)) -#define CMIC_CMC_PKTDMA_STATr_RELOAD_UNALIGNED_ERRf_GET(r) ((((r).cmic_cmc_pktdma_stat[0]) >> 7) & 0x1) -#define CMIC_CMC_PKTDMA_STATr_RELOAD_UNALIGNED_ERRf_SET(r,f) (r).cmic_cmc_pktdma_stat[0]=(((r).cmic_cmc_pktdma_stat[0] & ~((uint32_t)0x1 << 7)) | ((((uint32_t)f) & 0x1) << 7)) -#define CMIC_CMC_PKTDMA_STATr_DESC_DONEf_GET(r) ((((r).cmic_cmc_pktdma_stat[0]) >> 8) & 0x1) -#define CMIC_CMC_PKTDMA_STATr_DESC_DONEf_SET(r,f) (r).cmic_cmc_pktdma_stat[0]=(((r).cmic_cmc_pktdma_stat[0] & ~((uint32_t)0x1 << 8)) | ((((uint32_t)f) & 0x1) << 8)) -#define CMIC_CMC_PKTDMA_STATr_DESC_CONTROLLEDf_GET(r) ((((r).cmic_cmc_pktdma_stat[0]) >> 9) & 0x1) -#define CMIC_CMC_PKTDMA_STATr_DESC_CONTROLLEDf_SET(r,f) (r).cmic_cmc_pktdma_stat[0]=(((r).cmic_cmc_pktdma_stat[0] & ~((uint32_t)0x1 << 9)) | ((((uint32_t)f) & 0x1) << 9)) -#define CMIC_CMC_PKTDMA_STATr_INTR_COALESCINGf_GET(r) ((((r).cmic_cmc_pktdma_stat[0]) >> 10) & 0x1) -#define CMIC_CMC_PKTDMA_STATr_INTR_COALESCINGf_SET(r,f) (r).cmic_cmc_pktdma_stat[0]=(((r).cmic_cmc_pktdma_stat[0] & ~((uint32_t)0x1 << 10)) | ((((uint32_t)f) & 0x1) << 10)) -#define CMIC_CMC_PKTDMA_STATr_DYN_RCNFG_ERRf_GET(r) ((((r).cmic_cmc_pktdma_stat[0]) >> 11) & 0x1) -#define CMIC_CMC_PKTDMA_STATr_DYN_RCNFG_ERRf_SET(r,f) (r).cmic_cmc_pktdma_stat[0]=(((r).cmic_cmc_pktdma_stat[0] & ~((uint32_t)0x1 << 11)) | ((((uint32_t)f) & 0x1) << 11)) -#define CMIC_CMC_PKTDMA_STATr_INVALID_AXI_CMD_ERRf_GET(r) ((((r).cmic_cmc_pktdma_stat[0]) >> 12) & 0x1) -#define CMIC_CMC_PKTDMA_STATr_INVALID_AXI_CMD_ERRf_SET(r,f) (r).cmic_cmc_pktdma_stat[0]=(((r).cmic_cmc_pktdma_stat[0] & ~((uint32_t)0x1 << 12)) | ((((uint32_t)f) & 0x1) << 12)) -#define CMIC_CMC_PKTDMA_STATr_DMA_IS_ENf_GET(r) ((((r).cmic_cmc_pktdma_stat[0]) >> 13) & 0x1) -#define CMIC_CMC_PKTDMA_STATr_DMA_IS_ENf_SET(r,f) (r).cmic_cmc_pktdma_stat[0]=(((r).cmic_cmc_pktdma_stat[0] & ~((uint32_t)0x1 << 13)) | ((((uint32_t)f) & 0x1) << 13)) -#define CMIC_CMC_PKTDMA_STATr_DESC_MEM_ECC_ERRf_GET(r) ((((r).cmic_cmc_pktdma_stat[0]) >> 14) & 0x1) -#define CMIC_CMC_PKTDMA_STATr_DESC_MEM_ECC_ERRf_SET(r,f) (r).cmic_cmc_pktdma_stat[0]=(((r).cmic_cmc_pktdma_stat[0] & ~((uint32_t)0x1 << 14)) | ((((uint32_t)f) & 0x1) << 14)) -#define READ_CMIC_CMC_PKTDMA_STATr(u,_cmc,_ch,r) BCMDRD_DEV_READ32(u,CMIC_CMC_PKTDMA_STATr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_stat) -#define WRITE_CMIC_CMC_PKTDMA_STATr(u,_cmc,_ch,r) BCMDRD_DEV_WRITE32(u,CMIC_CMC_PKTDMA_STATr_OFFSET+(0x80*(_ch))+(0x2000*(_cmc)),r._cmic_cmc_pktdma_stat) - -#define RX_DCB_SIZE 16 -#define TX_DCB_SIZE 16 - -/* - * This structure should be used to declare and program TX_DCB. - * - */ -typedef union TX_DCB_s { - uint32_t v[4]; - uint32_t tx_dcb[4]; - uint32_t _tx_dcb; -} TX_DCB_t; - -#define TX_DCB_CLR(r) sal_memset(&((r).tx_dcb[0]), 0, sizeof(TX_DCB_t)) -#define TX_DCB_SET(r,i,d) (r).tx_dcb[i] = d -#define TX_DCB_GET(r,i) (r).tx_dcb[i] -#define TX_DCB_OFFSET 0x00000000 -#define TX_DCB_BYTES_TRANSFERREDf_GET(r) (((r).tx_dcb[3]) & 0xffff) -#define TX_DCB_BYTES_TRANSFERREDf_SET(r,f) (r).tx_dcb[3]=(((r).tx_dcb[3] & ~((uint32_t)0xffff)) | (((uint32_t)f) & 0xffff)) -#define TX_DCB_DONEf_GET(r) ((((r).tx_dcb[3]) >> 31) & 0x1) -#define TX_DCB_DONEf_SET(r,f) (r).tx_dcb[3]=(((r).tx_dcb[3] & ~((uint32_t)0x1 << 31)) | ((((uint32_t)f) & 0x1) << 31)) -#define TX_DCB_BYTE_COUNTf_GET(r) (((r).tx_dcb[2]) & 0xffff) -#define TX_DCB_BYTE_COUNTf_SET(r,f) (r).tx_dcb[2]=(((r).tx_dcb[2] & ~((uint32_t)0xffff)) | (((uint32_t)f) & 0xffff)) -#define TX_DCB_CHAINf_GET(r) ((((r).tx_dcb[2]) >> 16) & 0x1) -#define TX_DCB_CHAINf_SET(r,f) (r).tx_dcb[2]=(((r).tx_dcb[2] & ~((uint32_t)0x1 << 16)) | ((((uint32_t)f) & 0x1) << 16)) -#define TX_DCB_SGf_GET(r) ((((r).tx_dcb[2]) >> 17) & 0x1) -#define TX_DCB_SGf_SET(r,f) (r).tx_dcb[2]=(((r).tx_dcb[2] & ~((uint32_t)0x1 << 17)) | ((((uint32_t)f) & 0x1) << 17)) -#define TX_DCB_RELOADf_GET(r) ((((r).tx_dcb[2]) >> 18) & 0x1) -#define TX_DCB_RELOADf_SET(r,f) (r).tx_dcb[2]=(((r).tx_dcb[2] & ~((uint32_t)0x1 << 18)) | ((((uint32_t)f) & 0x1) << 18)) -#define TX_DCB_HGf_GET(r) ((((r).tx_dcb[2]) >> 19) & 0x1) -#define TX_DCB_HGf_SET(r,f) (r).tx_dcb[2]=(((r).tx_dcb[2] & ~((uint32_t)0x1 << 19)) | ((((uint32_t)f) & 0x1) << 19)) -#define TX_DCB_PURGEf_GET(r) ((((r).tx_dcb[2]) >> 22) & 0x1) -#define TX_DCB_PURGEf_SET(r,f) (r).tx_dcb[2]=(((r).tx_dcb[2] & ~((uint32_t)0x1 << 22)) | ((((uint32_t)f) & 0x1) << 22)) -#define TX_DCB_DESC_DONE_INTRf_GET(r) ((((r).tx_dcb[2]) >> 23) & 0x1) -#define TX_DCB_DESC_DONE_INTRf_SET(r,f) (r).tx_dcb[2]=(((r).tx_dcb[2] & ~((uint32_t)0x1 << 23)) | ((((uint32_t)f) & 0x1) << 23)) -#define TX_DCB_DESC_CTRL_INTRf_GET(r) ((((r).tx_dcb[2]) >> 24) & 0x1) -#define TX_DCB_DESC_CTRL_INTRf_SET(r,f) (r).tx_dcb[2]=(((r).tx_dcb[2] & ~((uint32_t)0x1 << 24)) | ((((uint32_t)f) & 0x1) << 24)) -#define TX_DCB_DESC_REMAINf_GET(r) ((((r).tx_dcb[2]) >> 25) & 0xf) -#define TX_DCB_DESC_REMAINf_SET(r,f) (r).tx_dcb[2]=(((r).tx_dcb[2] & ~((uint32_t)0xf << 25)) | ((((uint32_t)f) & 0xf) << 25)) -#define TX_DCB_DESC_STAT_WR_DISABLEf_GET(r) ((((r).tx_dcb[2]) >> 29) & 0x1) -#define TX_DCB_DESC_STAT_WR_DISABLEf_SET(r,f) (r).tx_dcb[2]=(((r).tx_dcb[2] & ~((uint32_t)0x1 << 29)) | ((((uint32_t)f) & 0x1) << 29)) -#define TX_DCB_ADDR_HIf_GET(r) ((r).tx_dcb[1]) -#define TX_DCB_ADDR_HIf_SET(r,f) (r).tx_dcb[1]=((uint32_t)f) -#define TX_DCB_ADDR_LOf_GET(r) ((r).tx_dcb[0]) -#define TX_DCB_ADDR_LOf_SET(r,f) (r).tx_dcb[0]=((uint32_t)f) - -/* - * This structure should be used to declare and program RX_DCB. - * - */ -typedef union RX_DCB_s { - uint32_t v[4]; - uint32_t rx_dcb[4]; - uint32_t _rx_dcb; -} RX_DCB_t; - -#define RX_DCB_CLR(r) sal_memset(&((r).rx_dcb[0]), 0, sizeof(RX_DCB_t)) -#define RX_DCB_SET(r,i,d) (r).rx_dcb[i] = d -#define RX_DCB_GET(r,i) (r).rx_dcb[i] -#define RX_DCB_OFFSET 0x00000000 -#define RX_DCB_BYTES_TRANSFERREDf_GET(r) (((r).rx_dcb[3]) & 0xffff) -#define RX_DCB_BYTES_TRANSFERREDf_SET(r,f) (r).rx_dcb[3]=(((r).rx_dcb[3] & ~((uint32_t)0xffff)) | (((uint32_t)f) & 0xffff)) -#define RX_DCB_END_BITf_GET(r) ((((r).rx_dcb[3]) >> 16) & 0x1) -#define RX_DCB_END_BITf_SET(r,f) (r).rx_dcb[3]=(((r).rx_dcb[3] & ~((uint32_t)0x1 << 16)) | ((((uint32_t)f) & 0x1) << 16)) -#define RX_DCB_START_BITf_GET(r) ((((r).rx_dcb[3]) >> 17) & 0x1) -#define RX_DCB_START_BITf_SET(r,f) (r).rx_dcb[3]=(((r).rx_dcb[3] & ~((uint32_t)0x1 << 17)) | ((((uint32_t)f) & 0x1) << 17)) -#define RX_DCB_ERRORf_GET(r) ((((r).rx_dcb[3]) >> 18) & 0x1) -#define RX_DCB_ERRORf_SET(r,f) (r).rx_dcb[3]=(((r).rx_dcb[3] & ~((uint32_t)0x1 << 18)) | ((((uint32_t)f) & 0x1) << 18)) -#define RX_DCB_DONEf_GET(r) ((((r).rx_dcb[3]) >> 31) & 0x1) -#define RX_DCB_DONEf_SET(r,f) (r).rx_dcb[3]=(((r).rx_dcb[3] & ~((uint32_t)0x1 << 31)) | ((((uint32_t)f) & 0x1) << 31)) -#define RX_DCB_BYTE_COUNTf_GET(r) (((r).rx_dcb[2]) & 0xffff) -#define RX_DCB_BYTE_COUNTf_SET(r,f) (r).rx_dcb[2]=(((r).rx_dcb[2] & ~((uint32_t)0xffff)) | (((uint32_t)f) & 0xffff)) -#define RX_DCB_CHAINf_GET(r) ((((r).rx_dcb[2]) >> 16) & 0x1) -#define RX_DCB_CHAINf_SET(r,f) (r).rx_dcb[2]=(((r).rx_dcb[2] & ~((uint32_t)0x1 << 16)) | ((((uint32_t)f) & 0x1) << 16)) -#define RX_DCB_SGf_GET(r) ((((r).rx_dcb[2]) >> 17) & 0x1) -#define RX_DCB_SGf_SET(r,f) (r).rx_dcb[2]=(((r).rx_dcb[2] & ~((uint32_t)0x1 << 17)) | ((((uint32_t)f) & 0x1) << 17)) -#define RX_DCB_RELOADf_GET(r) ((((r).rx_dcb[2]) >> 18) & 0x1) -#define RX_DCB_RELOADf_SET(r,f) (r).rx_dcb[2]=(((r).rx_dcb[2] & ~((uint32_t)0x1 << 18)) | ((((uint32_t)f) & 0x1) << 18)) -#define RX_DCB_DESC_DONE_INTRf_GET(r) ((((r).rx_dcb[2]) >> 23) & 0x1) -#define RX_DCB_DESC_DONE_INTRf_SET(r,f) (r).rx_dcb[2]=(((r).rx_dcb[2] & ~((uint32_t)0x1 << 23)) | ((((uint32_t)f) & 0x1) << 23)) -#define RX_DCB_DESC_CTRL_INTRf_GET(r) ((((r).rx_dcb[2]) >> 24) & 0x1) -#define RX_DCB_DESC_CTRL_INTRf_SET(r,f) (r).rx_dcb[2]=(((r).rx_dcb[2] & ~((uint32_t)0x1 << 24)) | ((((uint32_t)f) & 0x1) << 24)) -#define RX_DCB_DESC_REMAINf_GET(r) ((((r).rx_dcb[2]) >> 25) & 0xf) -#define RX_DCB_DESC_REMAINf_SET(r,f) (r).rx_dcb[2]=(((r).rx_dcb[2] & ~((uint32_t)0xf << 25)) | ((((uint32_t)f) & 0xf) << 25)) -#define RX_DCB_DESC_STAT_WR_DISABLEf_GET(r) ((((r).rx_dcb[2]) >> 29) & 0x1) -#define RX_DCB_DESC_STAT_WR_DISABLEf_SET(r,f) (r).rx_dcb[2]=(((r).rx_dcb[2] & ~((uint32_t)0x1 << 29)) | ((((uint32_t)f) & 0x1) << 29)) -#define RX_DCB_ADDR_HIf_GET(r) ((r).rx_dcb[1]) -#define RX_DCB_ADDR_HIf_SET(r,f) (r).rx_dcb[1]=((uint32_t)f) -#define RX_DCB_ADDR_LOf_GET(r) ((r).rx_dcb[0]) -#define RX_DCB_ADDR_LOf_SET(r,f) (r).rx_dcb[0]=((uint32_t)f) - -#endif /* BCMCNET_CMICR_ACC_H */ diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicx.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicx.h index 75d61c7a38bf..9d5369784776 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicx.h +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicx.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_core.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_core.h index 82341cac7b7a..e421afd0f35a 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_core.h +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_core.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -125,7 +125,7 @@ struct intr_handle { void *priv; /*! Interrupt number */ - int inum; + int intr_num; /*! Interrupt flags */ uint32_t intr_flags; @@ -190,7 +190,7 @@ struct queue_group { uint32_t irq_mask; /*! Indicating the group is attached */ - bool attached; + int attached; }; /*! @@ -721,20 +721,6 @@ typedef int (*pdma_rx_f)(struct pdma_dev *dev, int queue, void *buf); */ typedef int (*pdma_tx_f)(struct pdma_dev *dev, int queue, void *buf); -/*! - * Network device detach. - * - * \param [in] dev Pointer to device structure. - */ -typedef void (*sys_ndev_detach_f)(struct pdma_dev *dev); - -/*! - * Network device attach. - * - * \param [in] dev Pointer to device structure. - */ -typedef void (*sys_ndev_attach_f)(struct pdma_dev *dev); - /*! * Suspend Tx queue. * @@ -856,12 +842,6 @@ struct pdma_dev { /*! Packet transmission */ pdma_tx_f pkt_xmit; - /*! Network device detach */ - sys_ndev_detach_f ndev_detach; - - /*! Network device attach */ - sys_ndev_attach_f ndev_attach; - /*! Tx suspend */ sys_tx_suspend_f tx_suspend; @@ -922,13 +902,13 @@ struct pdma_dev { dev_mode_t mode; /*! Device is started */ - bool started; + int started; /*! Device is started but suspended */ - bool suspended; + int suspended; /*! Device is initialized and HMI driver is attached */ - bool attached; + int attached; }; /*! diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_dev.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_dev.h index 2a316531f1e0..aa1d47876b95 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_dev.h +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_dev.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_internal.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_internal.h index 6a4495a84bb8..f3602e07c098 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_internal.h +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_internal.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_rxtx.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_rxtx.h index cd3eb1afe933..197378108c35 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_rxtx.h +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_rxtx.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -148,19 +148,13 @@ struct pdma_rx_queue { #define PDMA_RX_QUEUE_ACTIVE (1 << 2) /*! Queue is busy */ #define PDMA_RX_QUEUE_BUSY (1 << 3) - /*! Queue in batch refilling mode */ -#define PDMA_RX_BATCH_REFILL (1 << 4) - - /*! Queue status */ - uint32_t status; /*! Queue is suspended */ -#define PDMA_RX_QUEUE_XOFF (1 << 0) +#define PDMA_RX_QUEUE_XOFF (1 << 4) + /*! Queue is batch refilled */ +#define PDMA_RX_BATCH_REFILL (1 << 5) /*! DMA buffer mode */ - enum buf_mode buf_mode; - - /*! Page order in PDMA_BUF_MODE_PAGE mode */ - uint32_t page_order; + enum buf_mode mode; }; /*! @@ -254,16 +248,13 @@ struct pdma_tx_queue { #define PDMA_TX_QUEUE_ACTIVE (1 << 2) /*! Queue is setup */ #define PDMA_TX_QUEUE_BUSY (1 << 3) - /*! Queue in polling mode */ -#define PDMA_TX_QUEUE_POLL (1 << 4) - - /*! Queue status */ - uint32_t status; /*! Queue is suspended */ -#define PDMA_TX_QUEUE_XOFF (1 << 0) +#define PDMA_TX_QUEUE_XOFF (1 << 4) + /*! Queue is poll mode */ +#define PDMA_TX_QUEUE_POLL (1 << 5) /*! DMA buffer mode */ - enum buf_mode buf_mode; + enum buf_mode mode; }; /*! diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_types.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_types.h index 67b0c3578d83..8992634097c5 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_types.h +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_types.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -118,14 +118,8 @@ typedef struct bcmcnet_dev_info { /*! Number of Rx descriptors per queue */ uint32_t nb_rx_desc[NUM_Q_MAX]; - /*! State of Rx queues */ - uint32_t rxq_state[NUM_Q_MAX]; - /*! Number of Tx descriptors per queue */ uint32_t nb_tx_desc[NUM_Q_MAX]; - - /*! State of Tx queues */ - uint32_t txq_state[NUM_Q_MAX]; } bcmcnet_dev_info_t; /*! diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_core.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_core.c index 4a1125548b03..fec920a935c1 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_core.c +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_core.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -37,7 +37,7 @@ bcmcnet_pdma_dev_init(struct pdma_dev *dev) return rv; } - dev->attached = true; + dev->attached = 1; return SHR_E_NONE; } @@ -55,7 +55,7 @@ bcmcnet_pdma_dev_cleanup(struct pdma_dev *dev) dev->ops->dev_close(dev); dev->ops = NULL; - dev->attached = false; + dev->attached = 0; return SHR_E_NONE; } @@ -83,8 +83,6 @@ bcmcnet_pdma_dev_start(struct pdma_dev *dev) return rv; } - dev->started = true; - /* Start all the Rx queues */ for (qi = 0; qi < ctrl->nb_rxq; qi++) { rv = dev->ops->rx_queue_setup(dev, qi); @@ -97,16 +95,16 @@ bcmcnet_pdma_dev_start(struct pdma_dev *dev) /* Start all the Tx queues */ for (qi = 0; qi < ctrl->nb_txq; qi++) { - rv = dev->ops->tx_queue_setup(dev, qi); - if (SHR_FAILURE(rv)) { - return rv; - } + dev->ops->tx_queue_setup(dev, qi); dev->ops->tx_queue_intr_enable(dev, qi); dev->ops->tx_queue_start(dev, qi); + dev->ops->tx_queue_wakeup(dev, qi); } bcmcnet_pdma_dev_info_get(dev); + dev->started = 1; + return SHR_E_NONE; } @@ -129,27 +127,20 @@ bcmcnet_pdma_dev_stop(struct pdma_dev *dev) /* Stop all the Rx queues */ for (qi = 0; qi < ctrl->nb_rxq; qi++) { + dev->ops->rx_queue_intr_disable(dev, qi); dev->ops->rx_queue_stop(dev, qi); dev->ops->rx_queue_release(dev, qi); } /* Stop all the Tx queues */ for (qi = 0; qi < ctrl->nb_txq; qi++) { + dev->ops->tx_queue_intr_disable(dev, qi); dev->ops->tx_queue_stop(dev, qi); + dev->ops->tx_queue_wakeup(dev, qi); dev->ops->tx_queue_release(dev, qi); } - dev->started = false; - - /* Disable all the Rx interrupts */ - for (qi = 0; qi < ctrl->nb_rxq; qi++) { - dev->ops->rx_queue_intr_disable(dev, qi); - } - - /* Disable all the Tx interrupts */ - for (qi = 0; qi < ctrl->nb_txq; qi++) { - dev->ops->tx_queue_intr_disable(dev, qi); - } + dev->started = 0; return SHR_E_NONE; } @@ -168,13 +159,13 @@ bcmcnet_pdma_dev_suspend(struct pdma_dev *dev) return SHR_E_UNAVAIL; } - dev->suspended = true; - rv = dev->ops->dev_suspend(dev); if (SHR_FAILURE(rv)) { return rv; } + dev->suspended = true; + if (dev->flags & PDMA_ABORT) { /* Abort all the Tx queues */ for (qi = 0; qi < ctrl->nb_txq; qi++) { @@ -182,7 +173,7 @@ bcmcnet_pdma_dev_suspend(struct pdma_dev *dev) } /* Abort all the Rx queues */ for (qi = 0; qi < ctrl->nb_rxq; qi++) { - dev->ops->rx_queue_stop(dev, qi); + dev->ops->rx_queue_stop(dev, qi);; } } @@ -203,8 +194,6 @@ bcmcnet_pdma_dev_resume(struct pdma_dev *dev) return SHR_E_UNAVAIL; } - dev->suspended = false; - if (dev->flags & PDMA_ABORT) { /* * H/W configuration of Packet DMA is gone in the FFB apply phase, @@ -226,6 +215,7 @@ bcmcnet_pdma_dev_resume(struct pdma_dev *dev) dev->ops->tx_queue_intr_enable(dev, qi); dev->ops->tx_queue_start(dev, qi); } + dev->flags &= ~PDMA_ABORT; } rv = dev->ops->dev_resume(dev); @@ -233,9 +223,7 @@ bcmcnet_pdma_dev_resume(struct pdma_dev *dev) return rv; } - if (dev->flags & PDMA_ABORT) { - dev->flags &= ~PDMA_ABORT; - } + dev->suspended = false; return rv; } @@ -722,7 +710,7 @@ bcmcnet_group_intr_check(struct pdma_dev *dev, int group) int bcmcnet_rx_queue_poll(struct pdma_dev *dev, int queue, int budget) { - if (!dev->started) { + if (dev->started == 0) { return SHR_E_NONE; } @@ -739,7 +727,7 @@ bcmcnet_rx_queue_poll(struct pdma_dev *dev, int queue, int budget) int bcmcnet_tx_queue_poll(struct pdma_dev *dev, int queue, int budget) { - if (!dev->started) { + if (dev->started == 0) { return SHR_E_NONE; } @@ -756,7 +744,7 @@ bcmcnet_tx_queue_poll(struct pdma_dev *dev, int queue, int budget) int bcmcnet_queue_poll(struct pdma_dev *dev, struct intr_handle *hdl, int budget) { - if (!dev->started) { + if (dev->started == 0) { return SHR_E_NONE; } @@ -773,7 +761,7 @@ bcmcnet_queue_poll(struct pdma_dev *dev, struct intr_handle *hdl, int budget) int bcmcnet_group_poll(struct pdma_dev *dev, int group, int budget) { - if (!dev->started) { + if (dev->started == 0) { return SHR_E_NONE; } diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_dev.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_dev.c index ab91bdfd0760..7b0344e83c30 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_dev.c +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_dev.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -143,7 +143,7 @@ bcn_tx_queues_alloc(struct pdma_dev *dev) txq->group_id = gi; txq->chan_id = qi + gi * dev->grp_queues; txq->ctrl = ctrl; - txq->sem = sal_sem_create("bcmcnetTxMutexSem", SAL_SEM_BINARY, 1); + txq->sem = sal_sem_create("bcmcnetTxMutexSem", SAL_SEM_BINARY, 0); if (!txq->sem) { goto error; } @@ -220,8 +220,8 @@ bcn_rx_queue_group_parse(struct pdma_dev *dev, uint32_t qbm) } rxq->buf_size += dev->rx_ph_size; /* Set mode and state for the queue */ - rxq->buf_mode = bm->rx_buf_mode(dev, rxq); - rxq->state |= PDMA_RX_QUEUE_USED; + rxq->mode = bm->rx_buf_mode(dev, rxq); + rxq->state = PDMA_RX_QUEUE_USED; if (dev->flags & PDMA_RX_BATCHING) { rxq->free_thresh = rxq->nb_desc / 4; rxq->state |= PDMA_RX_BATCH_REFILL; @@ -297,7 +297,7 @@ bcn_tx_queue_group_parse(struct pdma_dev *dev, uint32_t qbm) ctrl->grp[gi].nb_desc[qi] = txq->nb_desc; } /* Set mode and state for the queue */ - txq->state |= PDMA_TX_QUEUE_USED; + txq->state = PDMA_TX_QUEUE_USED; if (dev->flags & PDMA_TX_POLLING) { txq->free_thresh = txq->nb_desc / 4; txq->state |= PDMA_TX_QUEUE_POLL; @@ -364,7 +364,7 @@ bcmcnet_pdma_config(struct pdma_dev *dev, uint32_t bm_rxq, uint32_t bm_txq) } /* Update group metadata */ if (!ctrl->grp[gi].bm_rxq && !ctrl->grp[gi].bm_txq) { - ctrl->grp[gi].attached = false; + ctrl->grp[gi].attached = 0; ctrl->bm_grp &= ~(1 << gi); ctrl->nb_grp--; continue; @@ -398,7 +398,7 @@ bcmcnet_pdma_close(struct pdma_dev *dev) ctrl->nb_grp--; ctrl->grp[gi].irq_mask = 0; ctrl->grp[gi].poll_queues = 0; - ctrl->grp[gi].attached = false; + ctrl->grp[gi].attached = 0; } bcn_rx_queues_free(dev); @@ -420,12 +420,8 @@ bcmcnet_pdma_suspend(struct pdma_dev *dev) bcmcnet_pdma_rx_queue_suspend(dev, qi); } - if (dev->ndev_detach) { - dev->ndev_detach(dev); - } else { - for (qi = 0; qi < ctrl->nb_txq; qi++) { - bcmcnet_pdma_tx_queue_suspend(dev, qi); - } + for (qi = 0; qi < ctrl->nb_txq; qi++) { + bcmcnet_pdma_tx_queue_suspend(dev, qi); } return SHR_E_NONE; @@ -440,18 +436,14 @@ bcmcnet_pdma_resume(struct pdma_dev *dev) struct dev_ctrl *ctrl = &dev->ctrl; uint32_t qi; - if (dev->ndev_attach) { - dev->ndev_attach(dev); - } else { - for (qi = 0; qi < ctrl->nb_txq; qi++) { - bcmcnet_pdma_tx_queue_resume(dev, qi); - } - } - for (qi = 0; qi < ctrl->nb_rxq; qi++) { bcmcnet_pdma_rx_queue_resume(dev, qi); } + for (qi = 0; qi < ctrl->nb_txq; qi++) { + bcmcnet_pdma_tx_queue_resume(dev, qi); + } + return SHR_E_NONE; } @@ -493,7 +485,6 @@ bcmcnet_pdma_info_get(struct pdma_dev *dev) } dev->info.rx_buf_size[qi] = rxq->buf_size; dev->info.nb_rx_desc[qi] = rxq->nb_desc; - dev->info.rxq_state[qi] = rxq->state; } for (qi = 0; qi < ctrl->nb_txq; qi++) { @@ -502,7 +493,6 @@ bcmcnet_pdma_info_get(struct pdma_dev *dev) continue; } dev->info.nb_tx_desc[qi] = txq->nb_desc; - dev->info.txq_state[qi] = txq->state; } } @@ -691,6 +681,7 @@ bcmcnet_pdma_rx_queue_start(struct pdma_dev *dev, int queue) rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; rxq->state |= PDMA_RX_QUEUE_ACTIVE; + rxq->state &= ~PDMA_RX_QUEUE_XOFF; return hw->hdls.chan_start(hw, rxq->chan_id); } @@ -711,6 +702,7 @@ bcmcnet_pdma_rx_queue_stop(struct pdma_dev *dev, int queue) rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; rxq->state &= ~PDMA_RX_QUEUE_ACTIVE; + rxq->state |= PDMA_RX_QUEUE_XOFF; return hw->hdls.chan_stop(hw, rxq->chan_id); } @@ -731,6 +723,7 @@ bcmcnet_pdma_tx_queue_start(struct pdma_dev *dev, int queue) txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; txq->state |= PDMA_TX_QUEUE_ACTIVE; + txq->state &= ~PDMA_TX_QUEUE_XOFF; return dev->flags & PDMA_CHAIN_MODE ? SHR_E_NONE : hw->hdls.chan_start(hw, txq->chan_id); @@ -752,6 +745,7 @@ bcmcnet_pdma_tx_queue_stop(struct pdma_dev *dev, int queue) txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; txq->state &= ~PDMA_TX_QUEUE_ACTIVE; + txq->state |= PDMA_TX_QUEUE_XOFF; return hw->hdls.chan_stop(hw, txq->chan_id); } @@ -882,11 +876,7 @@ bcmcnet_pdma_tx_queue_intr_disable(struct pdma_dev *dev, int queue) txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; - if (txq->state & PDMA_TX_QUEUE_POLL) { - return SHR_E_NONE; - } else { - return hw->hdls.chan_intr_disable(hw, txq->chan_id); - } + return hw->hdls.chan_intr_disable(hw, txq->chan_id); } /*! @@ -1018,8 +1008,8 @@ bcmcnet_pdma_open(struct pdma_dev *dev) hdl->group = gi; hdl->chan = chan; hdl->dev = dev; - hdl->inum = hw->hdls.chan_intr_num_get(hw, chan); - if (hdl->inum < 0) { + hdl->intr_num = hw->hdls.chan_intr_num_get(hw, chan); + if (hdl->intr_num < 0) { return SHR_E_INTERNAL; } } diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_rxtx.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_rxtx.c index 6f42236eb08f..41504949876b 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_rxtx.c +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_rxtx.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -212,8 +212,8 @@ bcmcnet_pdma_rx_queue_setup(struct pdma_dev *dev, int queue) } if (dev->mode == DEV_MODE_VNET) { - ctrl->vsync.rx_ring_addr[rxq->chan_id] = rxq->ring_addr; - ctrl->vsync.rx_ring_size[rxq->chan_id] = rxq->nb_desc; + ctrl->vsync.rx_ring_addr[queue] = rxq->ring_addr; + ctrl->vsync.rx_ring_size[queue] = rxq->nb_desc; } rxq->state |= PDMA_RX_QUEUE_SETUP; @@ -273,12 +273,14 @@ bcmcnet_pdma_rx_vqueue_setup(struct pdma_dev *dev, int queue) return SHR_E_NONE; } - if (dev->ctrl.vsync.rx_ring_addr[vrxq->chan_id]) { + if (dev->ctrl.vsync.rx_ring_addr[queue]) { vrxq->curr = 0; - vrxq->nb_desc = dev->ctrl.vsync.rx_ring_size[vrxq->chan_id]; - vrxq->ring_addr = dev->ctrl.vsync.rx_ring_addr[vrxq->chan_id]; + vrxq->nb_desc = dev->ctrl.vsync.rx_ring_size[queue]; + vrxq->ring_addr = dev->ctrl.vsync.rx_ring_addr[queue]; vrxq->ring = dev->sys_p2v(dev, vrxq->ring_addr); vrxq->state |= PDMA_RX_QUEUE_SETUP; + } else { + return SHR_E_UNAVAIL; } return SHR_E_NONE; @@ -329,8 +331,8 @@ bcmcnet_pdma_tx_queue_setup(struct pdma_dev *dev, int queue) } if (dev->mode == DEV_MODE_VNET) { - ctrl->vsync.tx_ring_addr[txq->chan_id] = txq->ring_addr; - ctrl->vsync.tx_ring_size[txq->chan_id] = txq->nb_desc; + ctrl->vsync.tx_ring_addr[queue] = txq->ring_addr; + ctrl->vsync.tx_ring_size[queue] = txq->nb_desc; } txq->state |= PDMA_TX_QUEUE_SETUP; @@ -390,13 +392,15 @@ bcmcnet_pdma_tx_vqueue_setup(struct pdma_dev *dev, int queue) return SHR_E_NONE; } - if (dev->ctrl.vsync.tx_ring_addr[vtxq->chan_id]) { + if (dev->ctrl.vsync.tx_ring_addr[queue]) { vtxq->curr = 0; vtxq->dirt = 0; - vtxq->nb_desc = dev->ctrl.vsync.tx_ring_size[vtxq->chan_id]; - vtxq->ring_addr = dev->ctrl.vsync.tx_ring_addr[vtxq->chan_id]; + vtxq->nb_desc = dev->ctrl.vsync.tx_ring_size[queue]; + vtxq->ring_addr = dev->ctrl.vsync.tx_ring_addr[queue]; vtxq->ring = dev->sys_p2v(dev, vtxq->ring_addr); vtxq->state |= PDMA_TX_QUEUE_SETUP; + } else { + return SHR_E_UNAVAIL; } return SHR_E_NONE; @@ -584,8 +588,7 @@ bcmcnet_pdma_group_poll(struct pdma_dev *dev, int group, int budget) if (hw->hdls.chan_intr_query(hw, rxq->chan_id)) { hw->hdls.chan_clear(hw, rxq->chan_id); grp->poll_queues |= 1 << i; - } - if (rxq->state & PDMA_RX_QUEUE_BUSY) { + } else if (rxq->state & PDMA_RX_QUEUE_BUSY) { rxq->state &= ~PDMA_RX_QUEUE_BUSY; grp->poll_queues |= 1 << i; } @@ -597,10 +600,6 @@ bcmcnet_pdma_group_poll(struct pdma_dev *dev, int group, int budget) hw->hdls.chan_clear(hw, txq->chan_id); grp->poll_queues |= 1 << i; } - if (txq->state & PDMA_TX_QUEUE_BUSY) { - txq->state &= ~PDMA_TX_QUEUE_BUSY; - grp->poll_queues |= 1 << i; - } } } @@ -665,9 +664,7 @@ bcmcnet_pdma_rx_ring_dump(struct pdma_dev *dev, int queue) } if (dev->mode == DEV_MODE_HNET) { rxq = (struct pdma_rx_queue *)ctrl->vnet_rxq[queue]; - if (rxq->state & PDMA_RX_QUEUE_SETUP) { - hw->dops.rx_ring_dump(hw, rxq); - } + hw->dops.rx_ring_dump(hw, rxq); } return SHR_E_NONE; @@ -693,9 +690,7 @@ bcmcnet_pdma_tx_ring_dump(struct pdma_dev *dev, int queue) } if (dev->mode == DEV_MODE_HNET) { txq = (struct pdma_tx_queue *)ctrl->vnet_txq[queue]; - if (txq->state & PDMA_TX_QUEUE_SETUP) { - hw->dops.tx_ring_dump(hw, txq); - } + hw->dops.tx_ring_dump(hw, txq); } return SHR_E_NONE; diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd/bcmdrd_devlist.h b/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd/bcmdrd_devlist.h index 5ede02035a9c..4a2384760820 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd/bcmdrd_devlist.h +++ b/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd/bcmdrd_devlist.h @@ -4,7 +4,7 @@ * Edits to this file will be lost when it is regenerated. * Tool: INTERNAL/drd/instpkgs.pl * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -37,31 +37,6 @@ #define BROADCOM_VENDOR_ID 0x14e4 #define BROADCOM_PHYID_MSB 0x0143 -/* BCM56080 */ -#define BCM56080_VENDOR_ID 0x14e4 -#define BCM56080_DEVICE_ID 0xb080 -#define BCM56080_REV_A0 0x01 - -/* BCM56081 */ -#define BCM56081_VENDOR_ID 0x14e4 -#define BCM56081_DEVICE_ID 0xb081 -#define BCM56081_REV_A0 0x01 - -/* BCM56082 */ -#define BCM56082_VENDOR_ID 0x14e4 -#define BCM56082_DEVICE_ID 0xb082 -#define BCM56082_REV_A0 0x01 - -/* BCM56083 */ -#define BCM56083_VENDOR_ID 0x14e4 -#define BCM56083_DEVICE_ID 0xb083 -#define BCM56083_REV_A0 0x01 - -/* BCM56084 */ -#define BCM56084_VENDOR_ID 0x14e4 -#define BCM56084_DEVICE_ID 0xb084 -#define BCM56084_REV_A0 0x01 - /* BCM56780 */ #define BCM56780_VENDOR_ID 0x14e4 #define BCM56780_DEVICE_ID 0xb780 @@ -120,31 +95,6 @@ #define BCM56883_REV_A0 0x01 #define BCM56883_REV_B0 0x11 -/* BCM56890 */ -#define BCM56890_VENDOR_ID 0x14e4 -#define BCM56890_DEVICE_ID 0xb890 -#define BCM56890_REV_A0 0x01 - -/* BCM56891 */ -#define BCM56891_VENDOR_ID 0x14e4 -#define BCM56891_DEVICE_ID 0xb891 -#define BCM56891_REV_A0 0x01 - -/* BCM56892 */ -#define BCM56892_VENDOR_ID 0x14e4 -#define BCM56892_DEVICE_ID 0xb892 -#define BCM56892_REV_A0 0x01 - -/* BCM56895 */ -#define BCM56895_VENDOR_ID 0x14e4 -#define BCM56895_DEVICE_ID 0xb895 -#define BCM56895_REV_A0 0x01 - -/* BCM56896 */ -#define BCM56896_VENDOR_ID 0x14e4 -#define BCM56896_DEVICE_ID 0xb896 -#define BCM56896_REV_A0 0x01 - /* BCM56990 */ #define BCM56990_VENDOR_ID 0x14e4 #define BCM56990_DEVICE_ID 0xb990 @@ -161,10 +111,10 @@ #define BCM56992_DEVICE_ID 0xb992 #define BCM56992_REV_B0 0x11 -/* BCM56993 */ -#define BCM56993_VENDOR_ID 0x14e4 -#define BCM56993_DEVICE_ID 0xb993 -#define BCM56993_REV_B0 0x11 +/* BCM56995 */ +#define BCM56995_VENDOR_ID 0x14e4 +#define BCM56995_DEVICE_ID 0xb995 +#define BCM56995_REV_A0 0x01 /* BCM56996 */ #define BCM56996_VENDOR_ID 0x14e4 @@ -183,28 +133,6 @@ #define BCM56998_DEVICE_ID 0xb998 #define BCM56998_REV_A0 0x01 -/* BCM56995 */ -#define BCM56995_VENDOR_ID 0x14e4 -#define BCM56995_DEVICE_ID 0xb995 -#define BCM56995_REV_A0 0x01 -#define BCM56995_REV_B0 0x11 - -/* BCM56999 */ -#define BCM56999_VENDOR_ID 0x14e4 -#define BCM56999_DEVICE_ID 0xb999 -#define BCM56999_REV_A0 0x01 -#define BCM56999_REV_B0 0x11 - -/* BCM78900 */ -#define BCM78900_VENDOR_ID 0x14e4 -#define BCM78900_DEVICE_ID 0xf900 -#define BCM78900_REV_B0 0x11 - -/* BCM78905 */ -#define BCM78905_VENDOR_ID 0x14e4 -#define BCM78905_DEVICE_ID 0xf905 -#define BCM78905_REV_B0 0x11 - /* * End of Supported Devices and Revisions */ @@ -238,54 +166,6 @@ * Note that this macro will be undefined at the end of this file. */ -#if BCMDRD_CONFIG_INCLUDE_BCM56080_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -BCMDRD_DEVLIST_ENTRY(BCM56080, BCM56080_VENDOR_ID, BCM56080_DEVICE_ID, BCM56080_REV_A0, \ - 0, 0, \ - bcm56080_a0, bcm56080_a0, bcm56080_a0, \ - "Pex1", "BCM56080", \ - "1.6 Tbps Multilayer Switch", 0, 0) -#endif - -#if BCMDRD_CONFIG_INCLUDE_BCM56081_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -#ifdef BCMDRD_DEVLIST_INCLUDE_ALL -BCMDRD_DEVLIST_ENTRY(BCM56081, BCM56081_VENDOR_ID, BCM56081_DEVICE_ID, BCM56081_REV_A0, \ - 0, 0, \ - bcm56080_a0, bcm56081_a0, bcm56081_a0, \ - "Pex1", "BCM56080", \ - "1.2 Tbps Line Card w/MACsec", 0, 0) -#endif -#endif - -#if BCMDRD_CONFIG_INCLUDE_BCM56082_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -#ifdef BCMDRD_DEVLIST_INCLUDE_ALL -BCMDRD_DEVLIST_ENTRY(BCM56082, BCM56082_VENDOR_ID, BCM56082_DEVICE_ID, BCM56082_REV_A0, \ - 0, 0, \ - bcm56080_a0, bcm56082_a0, bcm56082_a0, \ - "Pex1", "BCM56080", \ - "1.08 Tbps Line Card w/MACsec", 0, 0) -#endif -#endif - -#if BCMDRD_CONFIG_INCLUDE_BCM56083_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -#ifdef BCMDRD_DEVLIST_INCLUDE_ALL -BCMDRD_DEVLIST_ENTRY(BCM56083, BCM56083_VENDOR_ID, BCM56083_DEVICE_ID, BCM56083_REV_A0, \ - 0, 0, \ - bcm56080_a0, bcm56083_a0, bcm56083_a0, \ - "Pex1", "BCM56080", \ - "1.2 Tbps Line Card", 0, 0) -#endif -#endif - -#if BCMDRD_CONFIG_INCLUDE_BCM56084_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -#ifdef BCMDRD_DEVLIST_INCLUDE_ALL -BCMDRD_DEVLIST_ENTRY(BCM56084, BCM56084_VENDOR_ID, BCM56084_DEVICE_ID, BCM56084_REV_A0, \ - 0, 0, \ - bcm56080_a0, bcm56084_a0, bcm56084_a0, \ - "Pex1", "BCM56080", \ - "1.08 Tbps Line Card", 0, 0) -#endif -#endif - #if BCMDRD_CONFIG_INCLUDE_BCM56780_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) BCMDRD_DEVLIST_ENTRY(BCM56780, BCM56780_VENDOR_ID, BCM56780_DEVICE_ID, BCM56780_REV_A0, \ 0, 0, \ @@ -422,54 +302,6 @@ BCMDRD_DEVLIST_ENTRY(BCM56883, BCM56883_VENDOR_ID, BCM56883_DEVICE_ID, BCM56883_ #endif #endif -#if BCMDRD_CONFIG_INCLUDE_BCM56890_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -BCMDRD_DEVLIST_ENTRY(BCM56890, BCM56890_VENDOR_ID, BCM56890_DEVICE_ID, BCM56890_REV_A0, \ - 0, 0, \ - bcm56890_a0, bcm56890_a0, bcm56890_a0, \ - "Trident4-X11C", "BCM56890", \ - "12.8 Tb/s 256x50G-PAM4 Programmable Switch", 0, 0) -#endif - -#if BCMDRD_CONFIG_INCLUDE_BCM56891_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -#ifdef BCMDRD_DEVLIST_INCLUDE_ALL -BCMDRD_DEVLIST_ENTRY(BCM56891, BCM56891_VENDOR_ID, BCM56891_DEVICE_ID, BCM56891_REV_A0, \ - 0, 0, \ - bcm56890_a0, bcm56891_a0, bcm56891_a0, \ - "Trident4-X11C", "BCM56890", \ - "12.8 Tb/s 256x50G-PAM4 Programmable Switch", 0, 0) -#endif -#endif - -#if BCMDRD_CONFIG_INCLUDE_BCM56892_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -#ifdef BCMDRD_DEVLIST_INCLUDE_ALL -BCMDRD_DEVLIST_ENTRY(BCM56892, BCM56892_VENDOR_ID, BCM56892_DEVICE_ID, BCM56892_REV_A0, \ - 0, 0, \ - bcm56890_a0, bcm56892_a0, bcm56892_a0, \ - "Trident4-X11C", "BCM56890", \ - "12.8 Tb/s 256x50G-PAM4 Programmable Switch", 0, 0) -#endif -#endif - -#if BCMDRD_CONFIG_INCLUDE_BCM56895_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -#ifdef BCMDRD_DEVLIST_INCLUDE_ALL -BCMDRD_DEVLIST_ENTRY(BCM56895, BCM56895_VENDOR_ID, BCM56895_DEVICE_ID, BCM56895_REV_A0, \ - 0, 0, \ - bcm56890_a0, bcm56895_a0, bcm56895_a0, \ - "Trident4-X11C", "BCM56890", \ - "6.4 Tb/s 128x50G-PAM4 Programmable Switch", 0, 0) -#endif -#endif - -#if BCMDRD_CONFIG_INCLUDE_BCM56896_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -#ifdef BCMDRD_DEVLIST_INCLUDE_ALL -BCMDRD_DEVLIST_ENTRY(BCM56896, BCM56896_VENDOR_ID, BCM56896_DEVICE_ID, BCM56896_REV_A0, \ - 0, 0, \ - bcm56890_a0, bcm56896_a0, bcm56896_a0, \ - "Trident4-X11C", "BCM56890", \ - "6.4 Tb/s 256x50G-PAM4 Programmable Switch", 0, 0) -#endif -#endif - #if BCMDRD_CONFIG_INCLUDE_BCM56990_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) BCMDRD_DEVLIST_ENTRY(BCM56990, BCM56990_VENDOR_ID, BCM56990_DEVICE_ID, BCM56990_REV_A0, \ 0, 0, \ @@ -506,14 +338,12 @@ BCMDRD_DEVLIST_ENTRY(BCM56992, BCM56992_VENDOR_ID, BCM56992_DEVICE_ID, BCM56992_ #endif #endif -#if BCMDRD_CONFIG_INCLUDE_BCM56993_B0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -#ifdef BCMDRD_DEVLIST_INCLUDE_ALL -BCMDRD_DEVLIST_ENTRY(BCM56993, BCM56993_VENDOR_ID, BCM56993_DEVICE_ID, BCM56993_REV_B0, \ +#if BCMDRD_CONFIG_INCLUDE_BCM56995_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +BCMDRD_DEVLIST_ENTRY(BCM56995, BCM56995_VENDOR_ID, BCM56995_DEVICE_ID, BCM56995_REV_A0, \ 0, 0, \ - bcm56990_b0, bcm56993_b0, bcm56993_b0, \ - "Tomahawk4", "BCM56990", \ - "12.8 Tbps Multilayer Switch", 0, 0) -#endif + bcm56995_a0, bcm56995_a0, bcm56995_a0, \ + "Tomahawk4D", "BCM56995", \ + "25.6 Tbps Multilayer Switch", 0, 0) #endif #if BCMDRD_CONFIG_INCLUDE_BCM56996_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) @@ -560,62 +390,6 @@ BCMDRD_DEVLIST_ENTRY(BCM56998, BCM56998_VENDOR_ID, BCM56998_DEVICE_ID, BCM56998_ "12.8 Tbps Multilayer Switch", 0, 0) #endif -#if BCMDRD_CONFIG_INCLUDE_BCM56995_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -#ifdef BCMDRD_DEVLIST_INCLUDE_ALL -BCMDRD_DEVLIST_ENTRY(BCM56995, BCM56995_VENDOR_ID, BCM56995_DEVICE_ID, BCM56995_REV_A0, \ - 0, 0, \ - bcm56999_a0, bcm56995_a0, bcm56995_a0, \ - "Tomahawk4D", "BCM56999", \ - "25.6 Tbps Multilayer Switch", 0, 0) -#endif -#endif - -#if BCMDRD_CONFIG_INCLUDE_BCM56995_B0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -#ifdef BCMDRD_DEVLIST_INCLUDE_ALL -BCMDRD_DEVLIST_ENTRY(BCM56995, BCM56995_VENDOR_ID, BCM56995_DEVICE_ID, BCM56995_REV_B0, \ - 0, 0, \ - bcm56999_a0, bcm56995_a0, bcm56995_b0, \ - "Tomahawk4D", "BCM56999", \ - "25.6 Tbps Multilayer Switch", 0, 0) -#endif -#endif - -#if BCMDRD_CONFIG_INCLUDE_BCM56999_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -BCMDRD_DEVLIST_ENTRY(BCM56999, BCM56999_VENDOR_ID, BCM56999_DEVICE_ID, BCM56999_REV_A0, \ - 0, 0, \ - bcm56999_a0, bcm56999_a0, bcm56999_a0, \ - "Tomahawk4D", "BCM56999", \ - "25.6 Tbps Multilayer Switch", 0, 0) -#endif - -#if BCMDRD_CONFIG_INCLUDE_BCM56999_B0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -#ifdef BCMDRD_DEVLIST_INCLUDE_ALL -BCMDRD_DEVLIST_ENTRY(BCM56999, BCM56999_VENDOR_ID, BCM56999_DEVICE_ID, BCM56999_REV_B0, \ - 0, 0, \ - bcm56999_a0, bcm56999_a0, bcm56999_b0, \ - "Tomahawk4D", "BCM56999", \ - "25.6 Tbps Multilayer Switch", 0, 0) -#endif -#endif - -#if BCMDRD_CONFIG_INCLUDE_BCM78900_B0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -BCMDRD_DEVLIST_ENTRY(BCM78900, BCM78900_VENDOR_ID, BCM78900_DEVICE_ID, BCM78900_REV_B0, \ - 0, 0, \ - bcm78900_b0, bcm78900_b0, bcm78900_b0, \ - "Tomahawk5", "BCM78900", \ - "51.2 Tbps Multilayer Switch", 0, 0) -#endif - -#if BCMDRD_CONFIG_INCLUDE_BCM78905_B0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) -#ifdef BCMDRD_DEVLIST_INCLUDE_ALL -BCMDRD_DEVLIST_ENTRY(BCM78905, BCM78905_VENDOR_ID, BCM78905_DEVICE_ID, BCM78905_REV_B0, \ - 0, 0, \ - bcm78900_b0, bcm78905_b0, bcm78905_b0, \ - "Tomahawk5", "BCM78900", \ - "25.6 Tbps Multilayer Switch", 0, 0) -#endif -#endif - /* End BCMDRD_DEVLIST_ENTRY Macros */ #ifdef BCMDRD_DEVLIST_INCLUDE_ALL diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd_config.h b/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd_config.h index 455f748e9077..42b1d5619aee 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd_config.h +++ b/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd_config.h @@ -1,4 +1,21 @@ -/*! \file bcmdrd_config.h +/* + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * 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. + * + * 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. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + * + * DO NOT EDIT THIS FILE! + * This file will be auto-generated in the near future. * * This config file defines all compilation-time specifications for * the BCMDRD. @@ -23,27 +40,13 @@ * compilation * d) Make sure the compilation include path includes * 'bcmdrd_custom_config.h' - */ -/* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ + * */ #ifndef BCMDRD_CONFIG_H #define BCMDRD_CONFIG_H + /* * Include system config file if specified: */ @@ -51,36 +54,47 @@ #include #endif + /* * OPTIONAL configuration and feature values. * Defaults are provided for all non-specified values. */ -/*! Maximum number of chips supported. */ +/* Maximum number of chips supported */ #ifndef BCMDRD_CONFIG_MAX_UNITS #define BCMDRD_CONFIG_MAX_UNITS 8 #endif -/*! Maximum number of ports per chip supported. */ +/* Maximum number of ports per chip supported */ #ifndef BCMDRD_CONFIG_MAX_PORTS #define BCMDRD_CONFIG_MAX_PORTS 848 #endif -/*! Direct access to memory-mapped registers. */ +/* Maximum number of SCHAN polls */ +#ifndef BCMDRD_CONFIG_SCHAN_MAX_POLLS +#define BCMDRD_CONFIG_SCHAN_MAX_POLLS 100000 +#endif + +/* Maximum number of MIIM polls */ +#ifndef BCMDRD_CONFIG_MIIM_MAX_POLLS +#define BCMDRD_CONFIG_MIIM_MAX_POLLS 100000 +#endif + +/* Direct access to memory-mapped registers */ #ifndef BCMDRD_CONFIG_MEMMAP_DIRECT #define BCMDRD_CONFIG_MEMMAP_DIRECT 0 #endif -/*! - * \brief Include chip symbol tables. +/* + * Include chip symbol tables for the debug shell. * * No symbolic debugging (register/memory names) will be available * without this defined. * - * This define is required to get any symbols at all. + * You should enable at least these symbols if you can afford the + * space. * - * Symbols tables are required for normal SDK operation, but may be - * excluded for small footprint base driver applications. + * This define is required to get any symbols at all. * * If you only wish to include symbols for a subset of chips in the * system (probably for code space reasons), you can define the @@ -93,17 +107,14 @@ #define BCMDRD_CONFIG_INCLUDE_CHIP_SYMBOLS 1 #endif -/*! - * \brief Include register and memory field information. +/* + * Include register and memory field information for the debug shell. * * This provides encoding, decoding, and displaying individual field * values for each register and memory. * * Requires more code space than just the chip symbols alone. * - * Symbols field information is required for normal SDK operation, but - * may be excluded for small footprint base driver applications. - * * The per-chip exclusion define * (BCMDRD_CONFIG_EXCLUDE_FIELD_INFO_) also applies. */ @@ -111,8 +122,8 @@ #define BCMDRD_CONFIG_INCLUDE_FIELD_INFO 1 #endif -/*! - * \brief Include alternative symbol names for registers and memories. +/* + * Include alternative symbol names for registers and memories. * * Mainly for internal Broadcom use, so you can safely leave this * option off. @@ -121,18 +132,6 @@ #define BCMDRD_CONFIG_INCLUDE_ALIAS_NAMES 1 #endif -/*! - * \brief Include field size checks for registers and memories. - * - * This option adds compile-time checks for field values exceeding the - * size of the field being assigned. The check in mainly intended for - * internal use, and it may trigger warnings from various memory - * sanity checker tools. - */ -#ifndef BCMDRD_CONFIG_INCLUDE_FIELD_CHECKS -#define BCMDRD_CONFIG_INCLUDE_FIELD_CHECKS 0 -#endif - #endif /* BCMDRD_CONFIG_H */ #ifdef CONFIG_OPTION @@ -145,6 +144,12 @@ CONFIG_OPTION(BCMDRD_CONFIG_MAX_UNITS) #ifdef BCMDRD_CONFIG_MAX_PORTS CONFIG_OPTION(BCMDRD_CONFIG_MAX_PORTS) #endif +#ifdef BCMDRD_CONFIG_SCHAN_MAX_POLLS +CONFIG_OPTION(BCMDRD_CONFIG_SCHAN_MAX_POLLS) +#endif +#ifdef BCMDRD_CONFIG_MIIM_MAX_POLLS +CONFIG_OPTION(BCMDRD_CONFIG_MIIM_MAX_POLLS) +#endif #ifdef BCMDRD_CONFIG_MEMMAP_DIRECT CONFIG_OPTION(BCMDRD_CONFIG_MEMMAP_DIRECT) #endif @@ -157,8 +162,5 @@ CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_FIELD_INFO) #ifdef BCMDRD_CONFIG_INCLUDE_ALIAS_NAMES CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_ALIAS_NAMES) #endif -#ifdef BCMDRD_CONFIG_INCLUDE_FIELD_CHECKS -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_FIELD_CHECKS) -#endif #endif /* CONFIG_OPTION */ #include "bcmdrd_config_chips.h" diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd_config_chips.h b/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd_config_chips.h index 1fa1afd92af0..41fb6c64a141 100644 --- a/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd_config_chips.h +++ b/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd_config_chips.h @@ -4,7 +4,7 @@ * Edits to this file will be lost when it is regenerated. * Tool: INTERNAL/drd/instpkgs.pl * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -26,17 +26,17 @@ * * (1) #define BCMDRD_CONFIG_INCLUDE_ [1|0] * -- Include or exclude all revisions of the given device - * Example: #define BCMDRD_CONFIG_INCLUDE_BCM56080 1 + * Example: #define BCMDRD_CONFIG_INCLUDE_BCM56780 1 * * (2) #define BCMDRD_CONFIG_INCLUDE__X [1|0] * -- Include or exclude all versions of the given revision - * Example: #define BCMDRD_CONFIG_INCLUDE_BCM56080_Ax 0 - * #define BCMDRD_CONFIG_INCLUde_BCM56080_Bx 1 + * Example: #define BCMDRD_CONFIG_INCLUDE_BCM56780_Ax 0 + * #define BCMDRD_CONFIG_INCLUde_BCM56780_Bx 1 * * (3) #define BCMDRD_CONFIG_INCLUDE_ [1|0] * -- Include or exclude an exact device - * Example: #define BCMDRD_CONFIG_INCLUDE_BCM56080_A0 1 - * #define BCMDRD_CONFIG_INCLUDE_BCM56080_A1 0 + * Example: #define BCMDRD_CONFIG_INCLUDE_BCM56780_A0 1 + * #define BCMDRD_CONFIG_INCLUDE_BCM56780_A1 0 * * * The value of BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT is used for any @@ -57,135 +57,6 @@ * Default configuration and dependencies for all chips */ -/* - * BCM56080 - */ - -/* Sets the default include state if it was not given */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56080 -#define BCMDRD_CONFIG_INCLUDE_BCM56080 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -/* Resolve revision dependencies */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56080_Ax -#define BCMDRD_CONFIG_INCLUDE_BCM56080_Ax BCMDRD_CONFIG_INCLUDE_BCM56080 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56080_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56080_A0 BCMDRD_CONFIG_INCLUDE_BCM56080_Ax -#endif - - -/* - * BCM56081 - */ - -/* Sets the default include state if it was not given */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56081 -#define BCMDRD_CONFIG_INCLUDE_BCM56081 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -/* Resolve revision dependencies */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56081_Ax -#define BCMDRD_CONFIG_INCLUDE_BCM56081_Ax BCMDRD_CONFIG_INCLUDE_BCM56081 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56081_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56081_A0 BCMDRD_CONFIG_INCLUDE_BCM56081_Ax -#endif -/* Resolve all interchip dependencies */ -#if BCMDRD_CONFIG_INCLUDE_BCM56081_A0 == 1 -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56080_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56080_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -#if BCMDRD_CONFIG_INCLUDE_BCM56080_A0 != 1 -#undef BCMDRD_CONFIG_INCLUDE_BCM56080_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56080_A0 1 -#define BCMDRD_CONFIG_INCLUDE_BCM56080_A0_IMPLIED 1 -#endif -#endif - - -/* - * BCM56082 - */ - -/* Sets the default include state if it was not given */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56082 -#define BCMDRD_CONFIG_INCLUDE_BCM56082 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -/* Resolve revision dependencies */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56082_Ax -#define BCMDRD_CONFIG_INCLUDE_BCM56082_Ax BCMDRD_CONFIG_INCLUDE_BCM56082 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56082_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56082_A0 BCMDRD_CONFIG_INCLUDE_BCM56082_Ax -#endif -/* Resolve all interchip dependencies */ -#if BCMDRD_CONFIG_INCLUDE_BCM56082_A0 == 1 -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56080_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56080_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -#if BCMDRD_CONFIG_INCLUDE_BCM56080_A0 != 1 -#undef BCMDRD_CONFIG_INCLUDE_BCM56080_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56080_A0 1 -#define BCMDRD_CONFIG_INCLUDE_BCM56080_A0_IMPLIED 1 -#endif -#endif - - -/* - * BCM56083 - */ - -/* Sets the default include state if it was not given */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56083 -#define BCMDRD_CONFIG_INCLUDE_BCM56083 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -/* Resolve revision dependencies */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56083_Ax -#define BCMDRD_CONFIG_INCLUDE_BCM56083_Ax BCMDRD_CONFIG_INCLUDE_BCM56083 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56083_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56083_A0 BCMDRD_CONFIG_INCLUDE_BCM56083_Ax -#endif -/* Resolve all interchip dependencies */ -#if BCMDRD_CONFIG_INCLUDE_BCM56083_A0 == 1 -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56080_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56080_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -#if BCMDRD_CONFIG_INCLUDE_BCM56080_A0 != 1 -#undef BCMDRD_CONFIG_INCLUDE_BCM56080_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56080_A0 1 -#define BCMDRD_CONFIG_INCLUDE_BCM56080_A0_IMPLIED 1 -#endif -#endif - - -/* - * BCM56084 - */ - -/* Sets the default include state if it was not given */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56084 -#define BCMDRD_CONFIG_INCLUDE_BCM56084 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -/* Resolve revision dependencies */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56084_Ax -#define BCMDRD_CONFIG_INCLUDE_BCM56084_Ax BCMDRD_CONFIG_INCLUDE_BCM56084 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56084_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56084_A0 BCMDRD_CONFIG_INCLUDE_BCM56084_Ax -#endif -/* Resolve all interchip dependencies */ -#if BCMDRD_CONFIG_INCLUDE_BCM56084_A0 == 1 -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56080_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56080_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -#if BCMDRD_CONFIG_INCLUDE_BCM56080_A0 != 1 -#undef BCMDRD_CONFIG_INCLUDE_BCM56080_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56080_A0 1 -#define BCMDRD_CONFIG_INCLUDE_BCM56080_A0_IMPLIED 1 -#endif -#endif - - /* * BCM56780 */ @@ -515,135 +386,6 @@ #endif -/* - * BCM56890 - */ - -/* Sets the default include state if it was not given */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56890 -#define BCMDRD_CONFIG_INCLUDE_BCM56890 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -/* Resolve revision dependencies */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56890_Ax -#define BCMDRD_CONFIG_INCLUDE_BCM56890_Ax BCMDRD_CONFIG_INCLUDE_BCM56890 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56890_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56890_A0 BCMDRD_CONFIG_INCLUDE_BCM56890_Ax -#endif - - -/* - * BCM56891 - */ - -/* Sets the default include state if it was not given */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56891 -#define BCMDRD_CONFIG_INCLUDE_BCM56891 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -/* Resolve revision dependencies */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56891_Ax -#define BCMDRD_CONFIG_INCLUDE_BCM56891_Ax BCMDRD_CONFIG_INCLUDE_BCM56891 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56891_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56891_A0 BCMDRD_CONFIG_INCLUDE_BCM56891_Ax -#endif -/* Resolve all interchip dependencies */ -#if BCMDRD_CONFIG_INCLUDE_BCM56891_A0 == 1 -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56890_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56890_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -#if BCMDRD_CONFIG_INCLUDE_BCM56890_A0 != 1 -#undef BCMDRD_CONFIG_INCLUDE_BCM56890_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56890_A0 1 -#define BCMDRD_CONFIG_INCLUDE_BCM56890_A0_IMPLIED 1 -#endif -#endif - - -/* - * BCM56892 - */ - -/* Sets the default include state if it was not given */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56892 -#define BCMDRD_CONFIG_INCLUDE_BCM56892 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -/* Resolve revision dependencies */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56892_Ax -#define BCMDRD_CONFIG_INCLUDE_BCM56892_Ax BCMDRD_CONFIG_INCLUDE_BCM56892 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56892_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56892_A0 BCMDRD_CONFIG_INCLUDE_BCM56892_Ax -#endif -/* Resolve all interchip dependencies */ -#if BCMDRD_CONFIG_INCLUDE_BCM56892_A0 == 1 -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56890_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56890_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -#if BCMDRD_CONFIG_INCLUDE_BCM56890_A0 != 1 -#undef BCMDRD_CONFIG_INCLUDE_BCM56890_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56890_A0 1 -#define BCMDRD_CONFIG_INCLUDE_BCM56890_A0_IMPLIED 1 -#endif -#endif - - -/* - * BCM56895 - */ - -/* Sets the default include state if it was not given */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56895 -#define BCMDRD_CONFIG_INCLUDE_BCM56895 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -/* Resolve revision dependencies */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56895_Ax -#define BCMDRD_CONFIG_INCLUDE_BCM56895_Ax BCMDRD_CONFIG_INCLUDE_BCM56895 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56895_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56895_A0 BCMDRD_CONFIG_INCLUDE_BCM56895_Ax -#endif -/* Resolve all interchip dependencies */ -#if BCMDRD_CONFIG_INCLUDE_BCM56895_A0 == 1 -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56890_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56890_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -#if BCMDRD_CONFIG_INCLUDE_BCM56890_A0 != 1 -#undef BCMDRD_CONFIG_INCLUDE_BCM56890_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56890_A0 1 -#define BCMDRD_CONFIG_INCLUDE_BCM56890_A0_IMPLIED 1 -#endif -#endif - - -/* - * BCM56896 - */ - -/* Sets the default include state if it was not given */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56896 -#define BCMDRD_CONFIG_INCLUDE_BCM56896 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -/* Resolve revision dependencies */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56896_Ax -#define BCMDRD_CONFIG_INCLUDE_BCM56896_Ax BCMDRD_CONFIG_INCLUDE_BCM56896 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56896_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56896_A0 BCMDRD_CONFIG_INCLUDE_BCM56896_Ax -#endif -/* Resolve all interchip dependencies */ -#if BCMDRD_CONFIG_INCLUDE_BCM56896_A0 == 1 -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56890_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56890_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -#if BCMDRD_CONFIG_INCLUDE_BCM56890_A0 != 1 -#undef BCMDRD_CONFIG_INCLUDE_BCM56890_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56890_A0 1 -#define BCMDRD_CONFIG_INCLUDE_BCM56890_A0_IMPLIED 1 -#endif -#endif - - /* * BCM56990 */ @@ -724,30 +466,19 @@ /* - * BCM56993 + * BCM56995 */ /* Sets the default include state if it was not given */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56993 -#define BCMDRD_CONFIG_INCLUDE_BCM56993 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56995 +#define BCMDRD_CONFIG_INCLUDE_BCM56995 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT #endif /* Resolve revision dependencies */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56993_Bx -#define BCMDRD_CONFIG_INCLUDE_BCM56993_Bx BCMDRD_CONFIG_INCLUDE_BCM56993 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56993_B0 -#define BCMDRD_CONFIG_INCLUDE_BCM56993_B0 BCMDRD_CONFIG_INCLUDE_BCM56993_Bx -#endif -/* Resolve all interchip dependencies */ -#if BCMDRD_CONFIG_INCLUDE_BCM56993_B0 == 1 -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56990_B0 -#define BCMDRD_CONFIG_INCLUDE_BCM56990_B0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -#if BCMDRD_CONFIG_INCLUDE_BCM56990_B0 != 1 -#undef BCMDRD_CONFIG_INCLUDE_BCM56990_B0 -#define BCMDRD_CONFIG_INCLUDE_BCM56990_B0 1 -#define BCMDRD_CONFIG_INCLUDE_BCM56990_B0_IMPLIED 1 +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56995_Ax +#define BCMDRD_CONFIG_INCLUDE_BCM56995_Ax BCMDRD_CONFIG_INCLUDE_BCM56995 #endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56995_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56995_A0 BCMDRD_CONFIG_INCLUDE_BCM56995_Ax #endif @@ -835,126 +566,6 @@ #endif -/* - * BCM56995 - */ - -/* Sets the default include state if it was not given */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56995 -#define BCMDRD_CONFIG_INCLUDE_BCM56995 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -/* Resolve revision dependencies */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56995_Ax -#define BCMDRD_CONFIG_INCLUDE_BCM56995_Ax BCMDRD_CONFIG_INCLUDE_BCM56995 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56995_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56995_A0 BCMDRD_CONFIG_INCLUDE_BCM56995_Ax -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56995_Bx -#define BCMDRD_CONFIG_INCLUDE_BCM56995_Bx BCMDRD_CONFIG_INCLUDE_BCM56995 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56995_B0 -#define BCMDRD_CONFIG_INCLUDE_BCM56995_B0 BCMDRD_CONFIG_INCLUDE_BCM56995_Bx -#endif -/* Resolve all interchip dependencies */ -#if BCMDRD_CONFIG_INCLUDE_BCM56995_A0 == 1 -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56999_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56999_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -#if BCMDRD_CONFIG_INCLUDE_BCM56999_A0 != 1 -#undef BCMDRD_CONFIG_INCLUDE_BCM56999_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56999_A0 1 -#define BCMDRD_CONFIG_INCLUDE_BCM56999_A0_IMPLIED 1 -#endif -#endif -#if BCMDRD_CONFIG_INCLUDE_BCM56995_B0 == 1 -#if BCMDRD_CONFIG_INCLUDE_BCM56999_A0 != 1 -#undef BCMDRD_CONFIG_INCLUDE_BCM56999_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56999_A0 1 -#define BCMDRD_CONFIG_INCLUDE_BCM56999_A0_IMPLIED 1 -#endif -#endif - - -/* - * BCM56999 - */ - -/* Sets the default include state if it was not given */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56999 -#define BCMDRD_CONFIG_INCLUDE_BCM56999 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -/* Resolve revision dependencies */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56999_Ax -#define BCMDRD_CONFIG_INCLUDE_BCM56999_Ax BCMDRD_CONFIG_INCLUDE_BCM56999 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56999_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56999_A0 BCMDRD_CONFIG_INCLUDE_BCM56999_Ax -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56999_Bx -#define BCMDRD_CONFIG_INCLUDE_BCM56999_Bx BCMDRD_CONFIG_INCLUDE_BCM56999 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56999_B0 -#define BCMDRD_CONFIG_INCLUDE_BCM56999_B0 BCMDRD_CONFIG_INCLUDE_BCM56999_Bx -#endif -/* Resolve all interchip dependencies */ -#if BCMDRD_CONFIG_INCLUDE_BCM56999_B0 == 1 -#ifndef BCMDRD_CONFIG_INCLUDE_BCM56999_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56999_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -#if BCMDRD_CONFIG_INCLUDE_BCM56999_A0 != 1 -#undef BCMDRD_CONFIG_INCLUDE_BCM56999_A0 -#define BCMDRD_CONFIG_INCLUDE_BCM56999_A0 1 -#define BCMDRD_CONFIG_INCLUDE_BCM56999_A0_IMPLIED 1 -#endif -#endif - - -/* - * BCM78900 - */ - -/* Sets the default include state if it was not given */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM78900 -#define BCMDRD_CONFIG_INCLUDE_BCM78900 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -/* Resolve revision dependencies */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM78900_Bx -#define BCMDRD_CONFIG_INCLUDE_BCM78900_Bx BCMDRD_CONFIG_INCLUDE_BCM78900 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM78900_B0 -#define BCMDRD_CONFIG_INCLUDE_BCM78900_B0 BCMDRD_CONFIG_INCLUDE_BCM78900_Bx -#endif - - -/* - * BCM78905 - */ - -/* Sets the default include state if it was not given */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM78905 -#define BCMDRD_CONFIG_INCLUDE_BCM78905 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -/* Resolve revision dependencies */ -#ifndef BCMDRD_CONFIG_INCLUDE_BCM78905_Bx -#define BCMDRD_CONFIG_INCLUDE_BCM78905_Bx BCMDRD_CONFIG_INCLUDE_BCM78905 -#endif -#ifndef BCMDRD_CONFIG_INCLUDE_BCM78905_B0 -#define BCMDRD_CONFIG_INCLUDE_BCM78905_B0 BCMDRD_CONFIG_INCLUDE_BCM78905_Bx -#endif -/* Resolve all interchip dependencies */ -#if BCMDRD_CONFIG_INCLUDE_BCM78905_B0 == 1 -#ifndef BCMDRD_CONFIG_INCLUDE_BCM78900_B0 -#define BCMDRD_CONFIG_INCLUDE_BCM78900_B0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT -#endif -#if BCMDRD_CONFIG_INCLUDE_BCM78900_B0 != 1 -#undef BCMDRD_CONFIG_INCLUDE_BCM78900_B0 -#define BCMDRD_CONFIG_INCLUDE_BCM78900_B0 1 -#define BCMDRD_CONFIG_INCLUDE_BCM78900_B0_IMPLIED 1 -#endif -#endif - - #endif /* BCMDRD_CONFIG_CHIPS_H */ /* @@ -962,24 +573,6 @@ */ #ifdef CONFIG_OPTION -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56080) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56080_Ax) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56080_A0) -#ifdef BCMDRD_CONFIG_INCLUDE_BCM56080_A0_IMPLIED -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56080_A0_IMPLIED) -#endif -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56081) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56081_Ax) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56081_A0) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56082) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56082_Ax) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56082_A0) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56083) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56083_Ax) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56083_A0) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56084) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56084_Ax) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56084_A0) CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56780) CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56780_Ax) CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56780_A0) @@ -1025,24 +618,6 @@ CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56883_Ax) CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56883_A0) CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56883_Bx) CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56883_B0) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56890) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56890_Ax) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56890_A0) -#ifdef BCMDRD_CONFIG_INCLUDE_BCM56890_A0_IMPLIED -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56890_A0_IMPLIED) -#endif -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56891) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56891_Ax) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56891_A0) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56892) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56892_Ax) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56892_A0) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56895) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56895_Ax) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56895_A0) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56896) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56896_Ax) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56896_A0) CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56990) CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56990_Ax) CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56990_A0) @@ -1060,9 +635,12 @@ CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56991_B0) CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56992) CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56992_Bx) CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56992_B0) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56993) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56993_Bx) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56993_B0) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56995) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56995_Ax) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56995_A0) +#ifdef BCMDRD_CONFIG_INCLUDE_BCM56995_A0_IMPLIED +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56995_A0_IMPLIED) +#endif CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56996) CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56996_Ax) CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56996_A0) @@ -1085,27 +663,5 @@ CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56998_A0) #ifdef BCMDRD_CONFIG_INCLUDE_BCM56998_A0_IMPLIED CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56998_A0_IMPLIED) #endif -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56995) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56995_Ax) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56995_A0) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56995_Bx) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56995_B0) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56999) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56999_Ax) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56999_A0) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56999_Bx) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56999_B0) -#ifdef BCMDRD_CONFIG_INCLUDE_BCM56999_A0_IMPLIED -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56999_A0_IMPLIED) -#endif -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM78900) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM78900_Bx) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM78900_B0) -#ifdef BCMDRD_CONFIG_INCLUDE_BCM78900_B0_IMPLIED -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM78900_B0_IMPLIED) -#endif -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM78905) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM78905_Bx) -CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM78905_B0) #undef CONFIG_OPTION #endif /* #ifdef CONFIG_OPTION */ diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmlrd/include/bcmlrd/bcmlrd_variant.h b/platform/broadcom/saibcm-modules/sdklt/bcmlrd/include/bcmlrd/bcmlrd_variant.h deleted file mode 100644 index 2949f6626425..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmlrd/include/bcmlrd/bcmlrd_variant.h +++ /dev/null @@ -1,40 +0,0 @@ -/*! \file bcmlrd_variant.h - * - * \brief BCMLRD Variant interfaces and definitions - * - * BCMLRD_VARIANT_ENTRY macros. - * - * If a list of variant entries is needed, before including this file, - * define BCMLRD_VARIANT_ENTRY as a macro. See bcmltd/include/bcmltd_variant.h - * for the parameters for BCMLRD_VARIANT_ENTRY, which are exactly the same as - * those for BCMLTD_VARIANT_ENTRY. - * - * Note that BCMLTD_VARIANT_ENTRY will be undefined at the end of this file. - * - */ -/* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - */ - -#ifndef BCMLRD_VARIANT_H -#define BCMLRD_VARIANT_H - -/* The contents between the include guard is deliberately empty. */ - -#endif /* BCMLRD_VARIANT_H */ - -/* This include must be placed outside the include guard. */ -#include diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmlrd/include/bcmlrd/chip/bcmlrd_chip_variant.h b/platform/broadcom/saibcm-modules/sdklt/bcmlrd/include/bcmlrd/chip/bcmlrd_chip_variant.h deleted file mode 100644 index 1d746a2e981b..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmlrd/include/bcmlrd/chip/bcmlrd_chip_variant.h +++ /dev/null @@ -1,48 +0,0 @@ -/*! \file bcmlrd_chip_variant.h - * - * \brief BCMLRD variant definitions - * - */ -/* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - */ - -#ifndef BCMLRD_CHIP_VARIANT_H -#define BCMLRD_CHIP_VARIANT_H - -#include - -#endif /* BCMLRD_CHIP_VARIANT_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#ifdef BCMLTD_VARIANT_OVERRIDE -#error "Use BCMLRD_VARIANT_OVERRIDE instead." -#endif -#ifdef BCMLRD_VARIANT_OVERRIDE -#define BCMLTD_VARIANT_OVERRIDE -#endif -#ifdef BCMLRD_VARIANT_ENTRY -#define BCMLTD_VARIANT_ENTRY(...) BCMLRD_VARIANT_ENTRY(__VA_ARGS__) -#include -#ifdef BCMLRD_VARIANT_OVERRIDE -#undef BCMLRD_VARIANT_OVERRIDE -#endif -#undef BCMLRD_VARIANT_ENTRY -#endif /* BCMLRD_VARIANT_ENTRY */ - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/bcmltd_variant.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/bcmltd_variant.h deleted file mode 100644 index 18abbe88055d..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/bcmltd_variant.h +++ /dev/null @@ -1,64 +0,0 @@ -/*! \file bcmltd_variant.h - * - * \brief BCMLTD Variant initerfaces and definitions - * - * Logical table variant inclusion and exclusion support within the - * BCMLTD can be specified as a combination of the following defines: - * - * #define BCMLTD_CONFIG_INCLUDE__X_ [1|0] - * -- Include or exclude the specified variant - * Example: #define BCMLTD_CONFIG_INCLUDE_BCM56880_UTLTM 1 - * - * The value of BCMLTD_CONFIG_INCLUDE_VARIANT_DEFAULT is used for any - * variants which are left unspecified. Set this value to 1 or 0 to - * include or exclude all variants by default. - * - * BCMLTD_VARIANT_ENTRY macros. - * - * If a list of variant entries is needed, before including this file, - * define BCMLTD_VARIANT_ENTRY as a macro to operate on the following - * parameters: - * - * #define BCMLTD_VARIANT_ENTRY(_bd,_bu,_va,_ve,_vu,_vv,_vo,_vd,_r0,_r1) - * - * _bd: SW Base Driver (lower case) - * _bu: SW Base Driver (upper case) - * _va: Variant name (lower case or empty for BASE) - * _ve: Variant enum symbol (upper case) - * _vu: Variant name (underscore or empty for BASE) - * _vv: Variant numeric value - * _vo: Device relative offset - * _vd: Variant Description - * _r0: Reserved - * _r1: Reserved - * - * Note that BCMLTD_VARIANT_ENTRY will be undefined at the end of this file. - * - */ -/* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - */ - -#ifndef BCMLTD_VARIANT_H -#define BCMLTD_VARIANT_H - -#include - -#endif /* BCMLTD_VARIANT_H */ - -/* This include must be placed outside the include guard. */ -#include - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/chip/bcmltd_chip_variant.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/chip/bcmltd_chip_variant.h deleted file mode 100644 index c4a5131ef2d2..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/chip/bcmltd_chip_variant.h +++ /dev/null @@ -1,42 +0,0 @@ -/*! \file bcmltd_chip_variant.h - * - * \brief BCMLTD variant definitions - * - */ -/* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - */ - -#ifndef BCMLTD_CHIP_VARIANT_H -#define BCMLTD_CHIP_VARIANT_H - -#include - -#endif /* BCMLTD_CHIP_VARIANT_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#ifdef BCMLTD_VARIANT_ENTRY -#include -#ifdef BCMLTD_VARIANT_OVERRIDE -#undef BCMLTD_VARIANT_OVERRIDE -#endif -#undef BCMLTD_VARIANT_ENTRY - -#endif /* BCMLTD_VARIANT_ENTRY */ - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/chip/bcmltd_variant_defs.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/chip/bcmltd_variant_defs.h deleted file mode 100644 index 2dfe7fe81277..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/chip/bcmltd_variant_defs.h +++ /dev/null @@ -1,28 +0,0 @@ -/*! \file bcmltd_variant_defs.h - * - * \brief BCMLTD variant definitions - * - */ -/* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - */ - -#ifndef BCMLTD_VARIANT_DEFS_H -#define BCMLTD_VARIANT_DEFS_H -#ifndef DOXYGEN_IGNORE_AUTOGEN -#include -#endif /* DOXYGEN_IGNORE_AUTOGEN */ -#endif /* BCMLTD_VARIANT_DEFS_H */ diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56080_a0/bcm56080_a0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56080_a0/bcm56080_a0_ltd_variant_def.h deleted file mode 100644 index eb0297e5ac7c..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56080_a0/bcm56080_a0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56080_A0_LTD_VARIANT_DEF_H -#define GEN_BCM56080_A0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56080_A0_BASE 1 -#define BCMLTD_VARIANT_LOCAL_BCM56080_A0_BASE 0 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56080_A0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/bcm56780_a0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/bcm56780_a0_ltd_variant_def.h deleted file mode 100644 index a4a167739bca..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/bcm56780_a0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56780_A0_LTD_VARIANT_DEF_H -#define GEN_BCM56780_A0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56780_A0_BASE 2 -#define BCMLTD_VARIANT_LOCAL_BCM56780_A0_BASE 0 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56780_A0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/cna_1_2_13/bcm56780_a0_cna_1_2_13_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/cna_1_2_13/bcm56780_a0_cna_1_2_13_ltd_variant_def.h deleted file mode 100644 index aa4b1b7dcfcb..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/cna_1_2_13/bcm56780_a0_cna_1_2_13_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56780_A0_CNA_1_2_13_LTD_VARIANT_DEF_H -#define GEN_BCM56780_A0_CNA_1_2_13_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56780_A0_CNA_1_2_13 12 -#define BCMLTD_VARIANT_LOCAL_BCM56780_A0_CNA_1_2_13 1 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56780_A0_CNA_1_2_13_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/dna_2_9_5_0/bcm56780_a0_dna_2_9_5_0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/dna_2_9_5_0/bcm56780_a0_dna_2_9_5_0_ltd_variant_def.h deleted file mode 100644 index c6d9933996dc..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/dna_2_9_5_0/bcm56780_a0_dna_2_9_5_0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56780_A0_DNA_2_9_5_0_LTD_VARIANT_DEF_H -#define GEN_BCM56780_A0_DNA_2_9_5_0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56780_A0_DNA_2_9_5_0 13 -#define BCMLTD_VARIANT_LOCAL_BCM56780_A0_DNA_2_9_5_0 2 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56780_A0_DNA_2_9_5_0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/hna_1_2_10_0/bcm56780_a0_hna_1_2_10_0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/hna_1_2_10_0/bcm56780_a0_hna_1_2_10_0_ltd_variant_def.h deleted file mode 100644 index 607e1369508b..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56780_a0/hna_1_2_10_0/bcm56780_a0_hna_1_2_10_0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56780_A0_HNA_1_2_10_0_LTD_VARIANT_DEF_H -#define GEN_BCM56780_A0_HNA_1_2_10_0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56780_A0_HNA_1_2_10_0 14 -#define BCMLTD_VARIANT_LOCAL_BCM56780_A0_HNA_1_2_10_0 3 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56780_A0_HNA_1_2_10_0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/bcm56880_a0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/bcm56880_a0_ltd_variant_def.h deleted file mode 100644 index 7b3f82532223..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/bcm56880_a0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56880_A0_LTD_VARIANT_DEF_H -#define GEN_BCM56880_A0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56880_A0_BASE 3 -#define BCMLTD_VARIANT_LOCAL_BCM56880_A0_BASE 0 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56880_A0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/cna_1_2_13/bcm56880_a0_cna_1_2_13_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/cna_1_2_13/bcm56880_a0_cna_1_2_13_ltd_variant_def.h deleted file mode 100644 index e6efc2937edf..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/cna_1_2_13/bcm56880_a0_cna_1_2_13_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56880_A0_CNA_1_2_13_LTD_VARIANT_DEF_H -#define GEN_BCM56880_A0_CNA_1_2_13_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56880_A0_CNA_1_2_13 15 -#define BCMLTD_VARIANT_LOCAL_BCM56880_A0_CNA_1_2_13 1 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56880_A0_CNA_1_2_13_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/dna_4_11_4_0/bcm56880_a0_dna_4_11_4_0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/dna_4_11_4_0/bcm56880_a0_dna_4_11_4_0_ltd_variant_def.h deleted file mode 100644 index e7af41f9b460..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/dna_4_11_4_0/bcm56880_a0_dna_4_11_4_0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56880_A0_DNA_4_11_4_0_LTD_VARIANT_DEF_H -#define GEN_BCM56880_A0_DNA_4_11_4_0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56880_A0_DNA_4_11_4_0 16 -#define BCMLTD_VARIANT_LOCAL_BCM56880_A0_DNA_4_11_4_0 2 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56880_A0_DNA_4_11_4_0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/hna_1_2_10_0/bcm56880_a0_hna_1_2_10_0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/hna_1_2_10_0/bcm56880_a0_hna_1_2_10_0_ltd_variant_def.h deleted file mode 100644 index 1694f3a1ab09..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/hna_1_2_10_0/bcm56880_a0_hna_1_2_10_0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56880_A0_HNA_1_2_10_0_LTD_VARIANT_DEF_H -#define GEN_BCM56880_A0_HNA_1_2_10_0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56880_A0_HNA_1_2_10_0 17 -#define BCMLTD_VARIANT_LOCAL_BCM56880_A0_HNA_1_2_10_0 3 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56880_A0_HNA_1_2_10_0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/utcfg/bcm56880_a0_utcfg_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/utcfg/bcm56880_a0_utcfg_ltd_variant_def.h deleted file mode 100644 index 154ab064843e..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/utcfg/bcm56880_a0_utcfg_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56880_A0_UTCFG_LTD_VARIANT_DEF_H -#define GEN_BCM56880_A0_UTCFG_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56880_A0_UTCFG 18 -#define BCMLTD_VARIANT_LOCAL_BCM56880_A0_UTCFG 4 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56880_A0_UTCFG_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/utlrd/bcm56880_a0_utlrd_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/utlrd/bcm56880_a0_utlrd_ltd_variant_def.h deleted file mode 100644 index 6a7659d095bb..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/utlrd/bcm56880_a0_utlrd_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56880_A0_UTLRD_LTD_VARIANT_DEF_H -#define GEN_BCM56880_A0_UTLRD_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56880_A0_UTLRD 19 -#define BCMLTD_VARIANT_LOCAL_BCM56880_A0_UTLRD 5 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56880_A0_UTLRD_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/utltm/bcm56880_a0_utltm_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/utltm/bcm56880_a0_utltm_ltd_variant_def.h deleted file mode 100644 index ce6a7109d385..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56880_a0/utltm/bcm56880_a0_utltm_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56880_A0_UTLTM_LTD_VARIANT_DEF_H -#define GEN_BCM56880_A0_UTLTM_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56880_A0_UTLTM 20 -#define BCMLTD_VARIANT_LOCAL_BCM56880_A0_UTLTM 6 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56880_A0_UTLTM_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56890_a0/bcm56890_a0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56890_a0/bcm56890_a0_ltd_variant_def.h deleted file mode 100644 index 067cd3aa6fd8..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56890_a0/bcm56890_a0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56890_A0_LTD_VARIANT_DEF_H -#define GEN_BCM56890_A0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56890_A0_BASE 4 -#define BCMLTD_VARIANT_LOCAL_BCM56890_A0_BASE 0 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56890_A0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56890_a0/dna_4_0_17_0/bcm56890_a0_dna_4_0_17_0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56890_a0/dna_4_0_17_0/bcm56890_a0_dna_4_0_17_0_ltd_variant_def.h deleted file mode 100644 index fcea5c979c8a..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56890_a0/dna_4_0_17_0/bcm56890_a0_dna_4_0_17_0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56890_A0_DNA_4_0_17_0_LTD_VARIANT_DEF_H -#define GEN_BCM56890_A0_DNA_4_0_17_0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56890_A0_DNA_4_0_17_0 21 -#define BCMLTD_VARIANT_LOCAL_BCM56890_A0_DNA_4_0_17_0 1 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56890_A0_DNA_4_0_17_0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56990_a0/bcm56990_a0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56990_a0/bcm56990_a0_ltd_variant_def.h deleted file mode 100644 index 0b136b21dd3c..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56990_a0/bcm56990_a0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56990_A0_LTD_VARIANT_DEF_H -#define GEN_BCM56990_A0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56990_A0_BASE 5 -#define BCMLTD_VARIANT_LOCAL_BCM56990_A0_BASE 0 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56990_A0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56990_b0/bcm56990_b0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56990_b0/bcm56990_b0_ltd_variant_def.h deleted file mode 100644 index 72f72fbd1e17..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56990_b0/bcm56990_b0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56990_B0_LTD_VARIANT_DEF_H -#define GEN_BCM56990_B0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56990_B0_BASE 6 -#define BCMLTD_VARIANT_LOCAL_BCM56990_B0_BASE 0 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56990_B0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56996_a0/bcm56996_a0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56996_a0/bcm56996_a0_ltd_variant_def.h deleted file mode 100644 index 80ef0b123700..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56996_a0/bcm56996_a0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56996_A0_LTD_VARIANT_DEF_H -#define GEN_BCM56996_A0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56996_A0_BASE 7 -#define BCMLTD_VARIANT_LOCAL_BCM56996_A0_BASE 0 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56996_A0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56996_b0/bcm56996_b0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56996_b0/bcm56996_b0_ltd_variant_def.h deleted file mode 100644 index 2a9e72e913d6..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56996_b0/bcm56996_b0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56996_B0_LTD_VARIANT_DEF_H -#define GEN_BCM56996_B0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56996_B0_BASE 8 -#define BCMLTD_VARIANT_LOCAL_BCM56996_B0_BASE 0 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56996_B0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56998_a0/bcm56998_a0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56998_a0/bcm56998_a0_ltd_variant_def.h deleted file mode 100644 index a5ec341f379a..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56998_a0/bcm56998_a0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56998_A0_LTD_VARIANT_DEF_H -#define GEN_BCM56998_A0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56998_A0_BASE 9 -#define BCMLTD_VARIANT_LOCAL_BCM56998_A0_BASE 0 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56998_A0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56999_a0/bcm56999_a0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56999_a0/bcm56999_a0_ltd_variant_def.h deleted file mode 100644 index 22ef37f20095..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm56999_a0/bcm56999_a0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56999_A0_LTD_VARIANT_DEF_H -#define GEN_BCM56999_A0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM56999_A0_BASE 10 -#define BCMLTD_VARIANT_LOCAL_BCM56999_A0_BASE 0 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM56999_A0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm78900_b0/bcm78900_b0_ltd_variant_def.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm78900_b0/bcm78900_b0_ltd_variant_def.h deleted file mode 100644 index ed6b18f0827d..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/defs/generated/bcm78900_b0/bcm78900_b0_ltd_variant_def.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM78900_B0_LTD_VARIANT_DEF_H -#define GEN_BCM78900_B0_LTD_VARIANT_DEF_H - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#define BCMLTD_VARIANT_BCM78900_B0_BASE 11 -#define BCMLTD_VARIANT_LOCAL_BCM78900_B0_BASE 0 -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - -#endif /* GEN_BCM78900_B0_LTD_VARIANT_DEF_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56080_a0/bcm56080_a0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56080_a0/bcm56080_a0_ltd_variant_entry.h deleted file mode 100644 index 50616d50963f..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56080_a0/bcm56080_a0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56080_A0_LTD_VARIANT_ENTRY_H -#define GEN_BCM56080_A0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56080_A0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56080_A0_BASE == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56080_a0,BCM56080_A0,,BASE,,BCMLTD_VARIANT_BCM56080_A0_BASE,BCMLTD_VARIANT_LOCAL_BCM56080_A0_BASE,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/bcm56780_a0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/bcm56780_a0_ltd_variant_entry.h deleted file mode 100644 index 6f6b34efbdb7..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/bcm56780_a0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56780_A0_LTD_VARIANT_ENTRY_H -#define GEN_BCM56780_A0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56780_A0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56780_A0_BASE == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56780_a0,BCM56780_A0,,BASE,,BCMLTD_VARIANT_BCM56780_A0_BASE,BCMLTD_VARIANT_LOCAL_BCM56780_A0_BASE,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/cna_1_2_13/bcm56780_a0_cna_1_2_13_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/cna_1_2_13/bcm56780_a0_cna_1_2_13_ltd_variant_entry.h deleted file mode 100644 index e80842ef117e..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/cna_1_2_13/bcm56780_a0_cna_1_2_13_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56780_A0_CNA_1_2_13_LTD_VARIANT_ENTRY_H -#define GEN_BCM56780_A0_CNA_1_2_13_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56780_A0_CNA_1_2_13_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56780_A0_CNA_1_2_13 == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56780_a0,BCM56780_A0,cna_1_2_13,CNA_1_2_13,_,BCMLTD_VARIANT_BCM56780_A0_CNA_1_2_13,BCMLTD_VARIANT_LOCAL_BCM56780_A0_CNA_1_2_13,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/dna_2_9_5_0/bcm56780_a0_dna_2_9_5_0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/dna_2_9_5_0/bcm56780_a0_dna_2_9_5_0_ltd_variant_entry.h deleted file mode 100644 index 2e3cd8ef6419..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/dna_2_9_5_0/bcm56780_a0_dna_2_9_5_0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56780_A0_DNA_2_9_5_0_LTD_VARIANT_ENTRY_H -#define GEN_BCM56780_A0_DNA_2_9_5_0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56780_A0_DNA_2_9_5_0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56780_A0_DNA_2_9_5_0 == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56780_a0,BCM56780_A0,dna_2_9_5_0,DNA_2_9_5_0,_,BCMLTD_VARIANT_BCM56780_A0_DNA_2_9_5_0,BCMLTD_VARIANT_LOCAL_BCM56780_A0_DNA_2_9_5_0,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/hna_1_2_10_0/bcm56780_a0_hna_1_2_10_0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/hna_1_2_10_0/bcm56780_a0_hna_1_2_10_0_ltd_variant_entry.h deleted file mode 100644 index 27d73773bdbc..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56780_a0/hna_1_2_10_0/bcm56780_a0_hna_1_2_10_0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56780_A0_HNA_1_2_10_0_LTD_VARIANT_ENTRY_H -#define GEN_BCM56780_A0_HNA_1_2_10_0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56780_A0_HNA_1_2_10_0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56780_A0_HNA_1_2_10_0 == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56780_a0,BCM56780_A0,hna_1_2_10_0,HNA_1_2_10_0,_,BCMLTD_VARIANT_BCM56780_A0_HNA_1_2_10_0,BCMLTD_VARIANT_LOCAL_BCM56780_A0_HNA_1_2_10_0,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/bcm56880_a0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/bcm56880_a0_ltd_variant_entry.h deleted file mode 100644 index 08775e092c8c..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/bcm56880_a0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56880_A0_LTD_VARIANT_ENTRY_H -#define GEN_BCM56880_A0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56880_A0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56880_A0_BASE == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56880_a0,BCM56880_A0,,BASE,,BCMLTD_VARIANT_BCM56880_A0_BASE,BCMLTD_VARIANT_LOCAL_BCM56880_A0_BASE,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/cna_1_2_13/bcm56880_a0_cna_1_2_13_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/cna_1_2_13/bcm56880_a0_cna_1_2_13_ltd_variant_entry.h deleted file mode 100644 index 8fb2a10d8389..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/cna_1_2_13/bcm56880_a0_cna_1_2_13_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56880_A0_CNA_1_2_13_LTD_VARIANT_ENTRY_H -#define GEN_BCM56880_A0_CNA_1_2_13_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56880_A0_CNA_1_2_13_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56880_A0_CNA_1_2_13 == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56880_a0,BCM56880_A0,cna_1_2_13,CNA_1_2_13,_,BCMLTD_VARIANT_BCM56880_A0_CNA_1_2_13,BCMLTD_VARIANT_LOCAL_BCM56880_A0_CNA_1_2_13,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/dna_4_11_4_0/bcm56880_a0_dna_4_11_4_0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/dna_4_11_4_0/bcm56880_a0_dna_4_11_4_0_ltd_variant_entry.h deleted file mode 100644 index e677601d1dfe..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/dna_4_11_4_0/bcm56880_a0_dna_4_11_4_0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56880_A0_DNA_4_11_4_0_LTD_VARIANT_ENTRY_H -#define GEN_BCM56880_A0_DNA_4_11_4_0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56880_A0_DNA_4_11_4_0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56880_A0_DNA_4_11_4_0 == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56880_a0,BCM56880_A0,dna_4_11_4_0,DNA_4_11_4_0,_,BCMLTD_VARIANT_BCM56880_A0_DNA_4_11_4_0,BCMLTD_VARIANT_LOCAL_BCM56880_A0_DNA_4_11_4_0,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/hna_1_2_10_0/bcm56880_a0_hna_1_2_10_0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/hna_1_2_10_0/bcm56880_a0_hna_1_2_10_0_ltd_variant_entry.h deleted file mode 100644 index c0707c11439a..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/hna_1_2_10_0/bcm56880_a0_hna_1_2_10_0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56880_A0_HNA_1_2_10_0_LTD_VARIANT_ENTRY_H -#define GEN_BCM56880_A0_HNA_1_2_10_0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56880_A0_HNA_1_2_10_0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56880_A0_HNA_1_2_10_0 == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56880_a0,BCM56880_A0,hna_1_2_10_0,HNA_1_2_10_0,_,BCMLTD_VARIANT_BCM56880_A0_HNA_1_2_10_0,BCMLTD_VARIANT_LOCAL_BCM56880_A0_HNA_1_2_10_0,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/utcfg/bcm56880_a0_utcfg_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/utcfg/bcm56880_a0_utcfg_ltd_variant_entry.h deleted file mode 100644 index db4192647c2b..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/utcfg/bcm56880_a0_utcfg_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56880_A0_UTCFG_LTD_VARIANT_ENTRY_H -#define GEN_BCM56880_A0_UTCFG_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56880_A0_UTCFG_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56880_A0_UTCFG == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56880_a0,BCM56880_A0,utcfg,UTCFG,_,BCMLTD_VARIANT_BCM56880_A0_UTCFG,BCMLTD_VARIANT_LOCAL_BCM56880_A0_UTCFG,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/utlrd/bcm56880_a0_utlrd_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/utlrd/bcm56880_a0_utlrd_ltd_variant_entry.h deleted file mode 100644 index 6ba897bc6800..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/utlrd/bcm56880_a0_utlrd_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56880_A0_UTLRD_LTD_VARIANT_ENTRY_H -#define GEN_BCM56880_A0_UTLRD_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56880_A0_UTLRD_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56880_A0_UTLRD == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56880_a0,BCM56880_A0,utlrd,UTLRD,_,BCMLTD_VARIANT_BCM56880_A0_UTLRD,BCMLTD_VARIANT_LOCAL_BCM56880_A0_UTLRD,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/utltm/bcm56880_a0_utltm_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/utltm/bcm56880_a0_utltm_ltd_variant_entry.h deleted file mode 100644 index 6adb5eda219f..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56880_a0/utltm/bcm56880_a0_utltm_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56880_A0_UTLTM_LTD_VARIANT_ENTRY_H -#define GEN_BCM56880_A0_UTLTM_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56880_A0_UTLTM_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56880_A0_UTLTM == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56880_a0,BCM56880_A0,utltm,UTLTM,_,BCMLTD_VARIANT_BCM56880_A0_UTLTM,BCMLTD_VARIANT_LOCAL_BCM56880_A0_UTLTM,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56890_a0/bcm56890_a0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56890_a0/bcm56890_a0_ltd_variant_entry.h deleted file mode 100644 index 56deb27eb09f..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56890_a0/bcm56890_a0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56890_A0_LTD_VARIANT_ENTRY_H -#define GEN_BCM56890_A0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56890_A0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56890_A0_BASE == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56890_a0,BCM56890_A0,,BASE,,BCMLTD_VARIANT_BCM56890_A0_BASE,BCMLTD_VARIANT_LOCAL_BCM56890_A0_BASE,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56890_a0/dna_4_0_17_0/bcm56890_a0_dna_4_0_17_0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56890_a0/dna_4_0_17_0/bcm56890_a0_dna_4_0_17_0_ltd_variant_entry.h deleted file mode 100644 index a139a20a3959..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56890_a0/dna_4_0_17_0/bcm56890_a0_dna_4_0_17_0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56890_A0_DNA_4_0_17_0_LTD_VARIANT_ENTRY_H -#define GEN_BCM56890_A0_DNA_4_0_17_0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56890_A0_DNA_4_0_17_0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56890_A0_DNA_4_0_17_0 == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56890_a0,BCM56890_A0,dna_4_0_17_0,DNA_4_0_17_0,_,BCMLTD_VARIANT_BCM56890_A0_DNA_4_0_17_0,BCMLTD_VARIANT_LOCAL_BCM56890_A0_DNA_4_0_17_0,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56990_a0/bcm56990_a0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56990_a0/bcm56990_a0_ltd_variant_entry.h deleted file mode 100644 index 7e58e4babd30..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56990_a0/bcm56990_a0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56990_A0_LTD_VARIANT_ENTRY_H -#define GEN_BCM56990_A0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56990_A0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56990_A0_BASE == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56990_a0,BCM56990_A0,,BASE,,BCMLTD_VARIANT_BCM56990_A0_BASE,BCMLTD_VARIANT_LOCAL_BCM56990_A0_BASE,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56990_b0/bcm56990_b0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56990_b0/bcm56990_b0_ltd_variant_entry.h deleted file mode 100644 index a395052a5853..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56990_b0/bcm56990_b0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56990_B0_LTD_VARIANT_ENTRY_H -#define GEN_BCM56990_B0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56990_B0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56990_B0_BASE == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56990_b0,BCM56990_B0,,BASE,,BCMLTD_VARIANT_BCM56990_B0_BASE,BCMLTD_VARIANT_LOCAL_BCM56990_B0_BASE,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56996_a0/bcm56996_a0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56996_a0/bcm56996_a0_ltd_variant_entry.h deleted file mode 100644 index 40abaeff0df0..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56996_a0/bcm56996_a0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56996_A0_LTD_VARIANT_ENTRY_H -#define GEN_BCM56996_A0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56996_A0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56996_A0_BASE == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56996_a0,BCM56996_A0,,BASE,,BCMLTD_VARIANT_BCM56996_A0_BASE,BCMLTD_VARIANT_LOCAL_BCM56996_A0_BASE,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56996_b0/bcm56996_b0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56996_b0/bcm56996_b0_ltd_variant_entry.h deleted file mode 100644 index ad387ff5c24b..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56996_b0/bcm56996_b0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56996_B0_LTD_VARIANT_ENTRY_H -#define GEN_BCM56996_B0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56996_B0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56996_B0_BASE == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56996_b0,BCM56996_B0,,BASE,,BCMLTD_VARIANT_BCM56996_B0_BASE,BCMLTD_VARIANT_LOCAL_BCM56996_B0_BASE,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56998_a0/bcm56998_a0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56998_a0/bcm56998_a0_ltd_variant_entry.h deleted file mode 100644 index b5313fb0a589..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56998_a0/bcm56998_a0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56998_A0_LTD_VARIANT_ENTRY_H -#define GEN_BCM56998_A0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56998_A0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56998_A0_BASE == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56998_a0,BCM56998_A0,,BASE,,BCMLTD_VARIANT_BCM56998_A0_BASE,BCMLTD_VARIANT_LOCAL_BCM56998_A0_BASE,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56999_a0/bcm56999_a0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56999_a0/bcm56999_a0_ltd_variant_entry.h deleted file mode 100644 index a472cabc74c3..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm56999_a0/bcm56999_a0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM56999_A0_LTD_VARIANT_ENTRY_H -#define GEN_BCM56999_A0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM56999_A0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM56999_A0_BASE == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm56999_a0,BCM56999_A0,,BASE,,BCMLTD_VARIANT_BCM56999_A0_BASE,BCMLTD_VARIANT_LOCAL_BCM56999_A0_BASE,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm78900_b0/bcm78900_b0_ltd_variant_entry.h b/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm78900_b0/bcm78900_b0_ltd_variant_entry.h deleted file mode 100644 index 339373fd1afe..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/bcmltd/include/bcmltd/entry/generated/bcm78900_b0/bcm78900_b0_ltd_variant_entry.h +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * - * DO NOT EDIT THIS FILE! - * This file is auto-generated by fltg from Logical Table mapping files. - * - * Tool: $SDK/tools/fltg/bin/fltg - * - * Edits to this file will be lost when it is regenerated. - * - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - * - ******************************************************************************/ - -#ifndef GEN_BCM78900_B0_LTD_VARIANT_ENTRY_H -#define GEN_BCM78900_B0_LTD_VARIANT_ENTRY_H -#include -#endif /* GEN_BCM78900_B0_LTD_VARIANT_ENTRY_H */ - -#ifndef DOXYGEN_IGNORE_AUTOGEN - -#if BCMLTD_CONFIG_INCLUDE_BCM78900_B0_BASE == 1 || defined(BCMLTD_VARIANT_OVERRIDE) -BCMLTD_VARIANT_ENTRY(bcm78900_b0,BCM78900_B0,,BASE,,BCMLTD_VARIANT_BCM78900_B0_BASE,BCMLTD_VARIANT_LOCAL_BCM78900_B0_BASE,NULL,0,0) -#endif - -#endif /* DOXYGEN_IGNORE_AUTOGEN */ - - diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/Kbuild b/platform/broadcom/saibcm-modules/sdklt/linux/bde/Kbuild index 7b444f5097f4..928ecdf49b7c 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/Kbuild +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/Kbuild @@ -2,11 +2,7 @@ # # Linux kernel BDE module. # -# The NGBDE_CFLAGS variable is intended for configuring non-default -# builds of the NGBDE kernel module, for example, using a different -# default DMA pool size or turning off MSI interrupts. -# -# $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. +# $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. # The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. # # This program is free software; you can redistribute it and/or @@ -24,7 +20,7 @@ obj-m := linux_ngbde.o -ccflags-y := $(LKM_CFLAGS) $(NGBDE_CFLAGS) \ +ccflags-y := $(LKM_CFLAGS) \ -I$(SDK)/linux/include \ -I$(SDK)/linux/bde \ -I$(SDK)/bcmdrd/include diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/Makefile b/platform/broadcom/saibcm-modules/sdklt/linux/bde/Makefile index f4401e62dc5e..a20346e4b50b 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/Makefile +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/Makefile @@ -1,5 +1,8 @@ +# -*- Makefile -*- # -# $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. +# Linux kernel BDE module. +# +# $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. # The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. # # This program is free software; you can redistribute it and/or @@ -14,8 +17,6 @@ # A copy of the GNU General Public License version 2 (GPLv2) can # be found in the LICENSES folder.$ # -# Linux kernel BDE module. -# include Kbuild @@ -29,4 +30,4 @@ endif .PHONY: distclean -distclean:: +distclean: diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde.h b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde.h index 5d3339ad74ef..ad1f71031cbe 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -125,13 +125,6 @@ typedef struct ngbde_irq_reg_s { /*! Mask register is of type "write 1 to clear". */ bool mask_w1tc; - /*! - * Indicates that the kmask value is valid. This is mainly to - * distinguish a mask value of zero from the mask value being - * uninitialized, as this matters during a warm boot. - */ - bool kmask_valid; - /*! Mask identifying the register bits owned by the kernel mode driver. */ uint32_t kmask; diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_dma.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_dma.c index 6e15855034c0..848664af046e 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_dma.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_dma.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -24,36 +24,34 @@ /*! \cond */ static int dma_debug = 0; -module_param(dma_debug, int, S_IRUSR | S_IWUSR); +module_param(dma_debug, int, 0); MODULE_PARM_DESC(dma_debug, "DMA debug output enable (default 0)."); /*! \endcond */ /*! Default size of of DMA memory pools (in MB). */ -#ifndef DMAPOOL_SIZE_DEFAULT #define DMAPOOL_SIZE_DEFAULT 16 -#endif /*! Default number of DMA memory pools per device. */ #define NUM_DMAPOOL_DEFAULT 1 /*! \cond */ static int dma_size = DMAPOOL_SIZE_DEFAULT; -module_param(dma_size, int, S_IRUSR); +module_param(dma_size, int, 0); MODULE_PARM_DESC(dma_size, "Size of of DMA memory pools in MB (default 16 MB)."); /*! \endcond */ /*! \cond */ -static char *dma_alloc = "auto"; -module_param(dma_alloc, charp, S_IRUSR); +static char *dma_alloc; +module_param(dma_alloc, charp, 0); MODULE_PARM_DESC(dma_alloc, "DMA allocation method auto|kapi|pgmem (default auto)"); /*! \endcond */ /*! \cond */ static int dma_pools = NUM_DMAPOOL_DEFAULT; -module_param(dma_pools, int, S_IRUSR); +module_param(dma_pools, int, 0); MODULE_PARM_DESC(dma_pools, "Number of DMA memory pools to pre-allocate per device (default 1)."); /*! \endcond */ @@ -122,12 +120,10 @@ ngbde_dmamem_pgmem_alloc(ngbde_dmactrl_t *dmactrl, ngbde_dmamem_t *dmamem) dmamem->baddr = dma_map_single(dmamem->dev, dmamem->vaddr, dmamem->size, DMA_BIDIRECTIONAL); if (dma_mapping_error(dmactrl->dev, dmamem->baddr)) { - ngbde_pgmem_free(dmamem->vaddr); - memset(dmamem, 0, sizeof(*dmamem)); + dmamem->baddr = 0; if (dma_debug) { printk("DMA: Failed to map PGMEM memory\n"); } - return; } /* Write small signature for debug purposes */ @@ -227,7 +223,7 @@ ngbde_dmamem_free(ngbde_dmamem_t *dmamem) (int)(dmamem->size / ONE_KB)); } dma_free_coherent(dmamem->dev, dmamem->size, - dmamem->vaddr, dmamem->baddr); + dmamem->vaddr, dmamem->paddr); memset(dmamem, 0, sizeof(*dmamem)); break; case NGBDE_DMA_T_PGMEM: @@ -244,7 +240,7 @@ ngbde_dmamem_free(ngbde_dmamem_t *dmamem) dmamem->size, DMA_BIDIRECTIONAL); } ngbde_pgmem_free(dmamem->vaddr); - memset(dmamem, 0, sizeof(*dmamem)); // nosemgrep + memset(dmamem, 0, sizeof(*dmamem)); break; case NGBDE_DMA_T_NONE: /* Nothing to free */ @@ -302,9 +298,7 @@ ngbde_dma_init(void) /* Check for forced DMA allocation method */ if (dma_alloc) { - if (strcmp(dma_alloc, "auto") == 0) { - dma_type = NGBDE_DMA_T_AUTO; - } else if (strcmp(dma_alloc, "kapi") == 0) { + if (strcmp(dma_alloc, "kapi") == 0) { dma_type = NGBDE_DMA_T_KAPI; } else if (strcmp(dma_alloc, "pgmem") == 0) { dma_type = NGBDE_DMA_T_PGMEM; diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_iio.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_iio.c index 99ced831e015..744cf2442fbd 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_iio.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_iio.c @@ -5,7 +5,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_intr.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_intr.c index 5d68fa92abe2..bc343a7e223e 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_intr.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_intr.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -24,7 +24,7 @@ /*! \cond */ static int intr_debug = 0; -module_param(intr_debug, int, S_IRUSR | S_IWUSR); +module_param(intr_debug, int, 0); MODULE_PARM_DESC(intr_debug, "Interrupt debug output enable (default 0)."); /*! \endcond */ @@ -476,20 +476,17 @@ ngbde_intr_reg_add(int kdev, unsigned int irq_num, if (ic->irq_active) { /* * If the interrupt is connected, then we only update the - * kernel mask for existing entries, and only if the kernel - * mask is marked as valid and differs from the existing mask. + * kernel mask for existing entries. */ for (idx = 0; idx < ic->num_regs; idx++) { ir = &ic->regs[idx]; if (ir->status_reg == ireg->status_reg && ir->mask_reg == ireg->mask_reg) { - if (ir->kmask != ireg->kmask && ireg->kmask_valid) { - ir->kmask = ireg->kmask; - if (intr_debug) { - printk("INTR: Updating interrupt register " - "0x%08x/0x%08x (0x%08x)\n", - ir->status_reg, ir->mask_reg, ir->kmask); - } + ir->kmask = ireg->kmask; + if (intr_debug) { + printk("INTR: Updating interrupt register " + "0x%08x/0x%08x (0x%08x)\n", + ir->status_reg, ir->mask_reg, ir->kmask); } return 0; } diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_ioctl.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_ioctl.c index f83857f6edcc..4eeeb2438306 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_ioctl.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_ioctl.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -156,12 +156,8 @@ ngbde_ioctl(struct file *file, unsigned int cmd, unsigned long arg) irq_num = ioc.op.irq_reg_add.irq_num; ireg.status_reg = ioc.op.irq_reg_add.status_reg; ireg.mask_reg = ioc.op.irq_reg_add.mask_reg; - ireg.kmask = 0; - ireg.kmask_valid = false; - if (ioc.op.irq_reg_add.flags & NGBDE_DEV_IRQ_REG_F_KMASK) { - ireg.kmask = ioc.op.irq_reg_add.kmask; - ireg.kmask_valid = true; - } + ireg.kmask = ioc.op.irq_reg_add.kmask; + ireg.status_is_masked = false; if (ioc.op.irq_reg_add.flags & NGBDE_DEV_IRQ_REG_F_MASKED) { ireg.status_is_masked = true; } diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_iproc_probe.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_iproc_probe.c index 10f221642c3d..218fd8262a65 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_iproc_probe.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_iproc_probe.c @@ -8,7 +8,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -30,7 +30,7 @@ /*! \cond */ static int iproc_debug = 0; -module_param(iproc_debug, int, S_IRUSR | S_IWUSR); +module_param(iproc_debug, int, 0); MODULE_PARM_DESC(iproc_debug, "IPROC debug output enable (default 0)."); /*! \endcond */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_kapi.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_kapi.c index 506231054b7d..7775100d952b 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_kapi.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_kapi.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_main.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_main.c index 38a60867b719..697412cf5b97 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_main.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_main.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -30,7 +30,7 @@ MODULE_LICENSE("GPL"); /*! \cond */ static int mmap_debug = 0; -module_param(mmap_debug, int, S_IRUSR | S_IWUSR); +module_param(mmap_debug, int, 0); MODULE_PARM_DESC(mmap_debug, "MMAP debug output enable (default 0)."); /*! \endcond */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_paxb.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_paxb.c index 376062d348d5..7b8cdda58b59 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_paxb.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_paxb.c @@ -5,7 +5,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pci_probe.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pci_probe.c index f74ccf5a4377..f444f04fa9f5 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pci_probe.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pci_probe.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -24,14 +24,14 @@ /*! \cond */ static int use_msi = 1; -module_param(use_msi, int, S_IRUSR); +module_param(use_msi, int, 0); MODULE_PARM_DESC(use_msi, "Use MSI interrupts if supported by the kernel (default 1)."); /*! \endcond */ /*! \cond */ static int pci_debug = 0; -module_param(pci_debug, int, S_IRUSR | S_IWUSR); +module_param(pci_debug, int, 0); MODULE_PARM_DESC(pci_debug, "PCI debug output enable (default 0)."); /*! \endcond */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pgmem.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pgmem.c index ec6b369780a8..1283b66e1e19 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pgmem.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pgmem.c @@ -31,7 +31,7 @@ * likely these requests are to succeed. */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -62,14 +62,14 @@ /*! \cond */ static int pgmem_chunk_size = 0; -module_param(pgmem_chunk_size, int, S_IRUSR); +module_param(pgmem_chunk_size, int, 0); MODULE_PARM_DESC(pgmem_chunk_size, "Memory chunk size in KB used by page allocator (default auto)."); /*! \endcond */ /*! \cond */ static int pgmem_debug = 0; -module_param(pgmem_debug, int, S_IRUSR | S_IWUSR); +module_param(pgmem_debug, int, 0); MODULE_PARM_DESC(pgmem_debug, "Enable page memory allocator debug output (default 0)."); /*! \endcond */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pio.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pio.c index cfcc97a94e49..13dde9de98e7 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pio.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pio.c @@ -5,7 +5,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_procfs.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_procfs.c index 6fd02ebd3d4b..883b5a8ea7d1 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_procfs.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_procfs.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -88,13 +88,22 @@ proc_release(struct inode *inode, struct file *file) return single_release(inode, file); } -struct proc_ops proc_fops = { - PROC_OWNER(THIS_MODULE) - .proc_open = proc_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_release = proc_release, +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) +static struct file_operations proc_fops = { + owner: THIS_MODULE, + open: proc_open, + read: seq_read, + llseek: seq_lseek, + release: proc_release, }; +#else +static struct proc_ops proc_fops = { + proc_open: proc_open, + proc_read: seq_read, + proc_lseek: seq_lseek, + proc_release: proc_release, +}; +#endif int ngbde_procfs_init(void) diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_swdev.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_swdev.c index a6fedc2c4a30..b8d67382f450 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_swdev.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_swdev.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/lkm.h b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/lkm.h index 4da4ab985e96..f35550922fed 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/lkm.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/lkm.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -63,21 +63,6 @@ /* Compatibility Macros */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0) -#define PROC_OWNER(_m) -#else -#define PROC_OWNER(_m) .owner = _m, -#define proc_ops file_operations -#define proc_open open -#define proc_read read -#define proc_write write -#define proc_lseek llseek -#define proc_release release -#define proc_ioctl unlocked_ioctl -#define proc_compat_ioctl compat_ioctl -#define proc_mmap mmap -#endif - #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) #define PROC_CREATE(_entry, _name, _acc, _path, _fops) \ do { \ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngbde_ioctl.h b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngbde_ioctl.h index 1a3b94f0ad5d..84088fb391f7 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngbde_ioctl.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngbde_ioctl.h @@ -9,7 +9,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -238,13 +238,6 @@ struct ngbde_ioc_intr_ctrl_s { /*! IRQ status register is a bitwise AND of mask and raw status. */ #define NGBDE_DEV_IRQ_REG_F_MASKED (1 << 1) -/*! - * Indicates that the kmask value is valid. This is mainly to - * distinguish a mask value of zero from the mask value being - * uninitialized, as this matters during a warm boot. - */ -#define NGBDE_DEV_IRQ_REG_F_KMASK (1 << 2) - /*! \} */ /*! Add interrupt register information. */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngbde_kapi.h b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngbde_kapi.h index 98a148711aaa..2d908da1f544 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngbde_kapi.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngbde_kapi.h @@ -6,7 +6,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngedk_ioctl.h b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngedk_ioctl.h index 05063d3207b0..7a4c7b5d24a1 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngedk_ioctl.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngedk_ioctl.h @@ -9,7 +9,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -82,9 +82,6 @@ /*! Handle EDK software interrupt. */ #define NGEDK_IOC_SW_INTR _IOW(NGEDK_IOC_MAGIC, 7, __u64) -/*! Handle EDK timer interrupt. */ -#define NGEDK_IOC_TIMER_INTR _IOW(NGEDK_IOC_MAGIC, 8, __u64) - /*! \} */ /*! IOCTL command return code for success. */ @@ -93,18 +90,6 @@ /*! IOCTL command return code for failure. */ #define NGEDK_IOC_FAIL ((__u32)-1) -/*! - * \name EDK IOC flags. - * \anchor NGEDK_IOC_F_xxx - */ - -/*! \{ */ - -/*! Interrupt enable/disable registers are "write 1 to clear". */ -#define NGEDK_IOC_F_W1TC (1 << 0) - -/*! \} */ - /*! Kernel module information. */ struct ngedk_ioc_mod_info_s { @@ -144,17 +129,14 @@ struct ngedk_ioc_intr_s { /*! Timer interrupts status offset */ __u32 timer_intrc_stat_reg; - /*! Timer interrupts disable offset */ - __u32 timer_intrc_disable_reg; + /*! Timer interrupts enable offset */ + __u32 timer_intrc_enable_reg; /*! Timer interrupts mask */ __u32 timer_intrc_mask_val; /*! Bitmap of cores that triggered SW interrupt. */ __u32 sw_intr_cores; - - /*! EDK ioctl flags (\ref NGEDK_IOC_F_xxx). */ - __u32 flags; }; /*! IOCTL operation data. */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_dev.h b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_dev.h index 1c6ec921c0aa..baef36109a4b 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_dev.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_dev.h @@ -9,7 +9,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -28,14 +28,7 @@ #ifndef NGKNET_DEV_H #define NGKNET_DEV_H -#include - -/*! Maximum number of devices supported */ -#ifdef NGBDE_NUM_SWDEV_MAX -#define NUM_PDMA_DEV_MAX NGBDE_NUM_SWDEV_MAX -#else -#define NUM_PDMA_DEV_MAX 16 -#endif +#include /*! Device name length */ #define NGKNET_DEV_NAME_MAX 16 @@ -291,20 +284,6 @@ typedef struct ngknet_filter_s { uint8_t user_data[NGKNET_FILTER_USER_DATA]; } ngknet_filter_t; -/*! - * \brief Device information. - */ -typedef struct ngknet_dev_info_s { - /*! Device number (from BDE) */ - int dev_no; - - /*! Device type string */ - char type_str[NGKNET_DEV_NAME_MAX]; - - /*! Device variant string */ - char var_str[NGKNET_DEV_NAME_MAX]; -} ngknet_dev_info_t; - /*! * \brief Device configure structure. */ @@ -315,14 +294,14 @@ typedef struct ngknet_dev_cfg_s { /*! Device type string */ char type_str[NGKNET_DEV_NAME_MAX]; - /*! Device variant string */ + /*! Variant string */ char var_str[NGKNET_DEV_NAME_MAX]; /*! Device ID */ uint32_t dev_id; /*! Device mode */ - int mode; + dev_mode_t mode; /*! Number of groups */ uint32_t nb_grp; diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_ioctl.h b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_ioctl.h index ad1614f8110c..42533787f927 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_ioctl.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_ioctl.h @@ -9,7 +9,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_kapi.h b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_kapi.h deleted file mode 100644 index 878a065ba39b..000000000000 --- a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_kapi.h +++ /dev/null @@ -1,379 +0,0 @@ -/*! \file ngknet_kapi.h - * - * NGKNET kernel API. - * - * This file is intended for use by other kernel modules relying on the KNET. - * - */ -/* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. - * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. - * - * 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. - * - * 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. - * - * A copy of the GNU General Public License version 2 (GPLv2) can - * be found in the LICENSES folder.$ - */ - -#ifndef NGKNET_KAPI_H -#define NGKNET_KAPI_H - -#include -#include - -/*! - * \brief NGKNET callback description. - */ -struct ngknet_callback_desc { - /* Device information */ - ngknet_dev_info_t *dinfo; - - /*! Network interface */ - ngknet_netif_t *netif; - - /*! Matched filter */ - ngknet_filter_t *filt; - - /*! Packet meta data */ - uint8_t *pmd; - - /*! Packet meta data length */ - int pmd_len; - - /*! Packet data length */ - int pkt_len; -}; - -/*! SKB callback data */ -#define NGKNET_SKB_CB(_skb) ((struct ngknet_callback_desc *)_skb->cb) - -/*! TX/RX callback init */ -typedef void -(*ngknet_dev_init_cb_f)(ngknet_dev_info_t *dinfo); - -/*! Handle Rx packet */ -typedef struct sk_buff * -(*ngknet_rx_cb_f)(struct net_device *dev, struct sk_buff *skb); - -/*! Handle Tx packet */ -typedef struct sk_buff * -(*ngknet_tx_cb_f)(struct sk_buff *skb); - -#if 0 -/*! Handle Netif callback */ -typedef int -(*ngknet_netif_cb_f)(ngknet_dev_info_t *dinfo, ngknet_netif_t *netif); -#endif -/*! Handle Filter callback */ -typedef struct sk_buff * -(*ngknet_filter_cb_f)(struct sk_buff *skb, ngknet_filter_t **filt); - -/*! PTP Rx/Tx config set */ -typedef int -(*ngknet_ptp_config_set_cb_f)(ngknet_dev_info_t *dinfo, ngknet_netif_t *netif, int *value); - -/*! PTP Rx/Tx HW timestamp get */ -typedef int -(*ngknet_ptp_hwts_get_cb_f)(struct sk_buff *skb, uint64_t *ts); - -/*! PTP Tx meta set */ -typedef int -(*ngknet_ptp_meta_set_cb_f)(struct sk_buff *skb); - -/*! PTP PHC index get */ -typedef int -(*ngknet_ptp_phc_index_get_cb_f)(ngknet_dev_info_t *dinfo, ngknet_netif_t *netif, int *index); - -/*! PTP device control */ -typedef int -(*ngknet_ptp_dev_ctrl_cb_f)(ngknet_dev_info_t *dinfo, int cmd, char *data, int len); - -/*! Netif callback */ -typedef int -(*ngknet_netif_cb_f)(struct net_device *dev); - -/*! - * \brief Register TX/RX callback device initialization callback function. - * - * The device initialization callback allows an external module to - * perform device-specific initialization in preparation for Tx and Rx - * packet processing. - * - * \param [in] dev_init_cb TX/RX callback device initialization callback - * function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_dev_init_cb_register(ngknet_dev_init_cb_f dev_init_cb); - -/*! - * \brief Unegister TX/RX callback device initialization callback function. - * - * The device initialization callback allows an external module to - * perform device-specific initialization in preparation for Tx and Rx - * packet processing. - * - * \param [in] dev_init_cb TX/RX callback device initialization callback - * function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_dev_init_cb_unregister(ngknet_dev_init_cb_f dev_init_cb); - -/*! - * \brief Register Rx callback. - * - * \param [in] rx_cb Rx callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_rx_cb_register(ngknet_rx_cb_f rx_cb); - -/*! - * \brief Unregister Rx callback. - * - * \param [in] rx_cb Rx callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_rx_cb_unregister(ngknet_rx_cb_f rx_cb); - -/*! - * \brief Register Tx callback. - * - * \param [in] tx_cb Tx callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_tx_cb_register(ngknet_tx_cb_f tx_cb); - -/*! - * \brief Unregister Tx callback. - * - * \param [in] tx_cb Tx callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_tx_cb_unregister(ngknet_tx_cb_f tx_cb); - -/*! - * \brief Register callback for network interface creation. - * - * Register a function to be called whenever a virtual network interface - * is created in the KNET kernel module. - * - * \param [in] netif_cb Callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_netif_create_cb_register(ngknet_netif_cb_f netif_cb); - -/*! - * \brief Unregister callback for network interface creation. - * - * \param [in] netif_cb Callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_netif_create_cb_unregister(ngknet_netif_cb_f netif_cb); - -/*! - * \brief Register callback for network interface destruction. - * - * Register a function to be called whenever a virtual network interface - * is destroyed in the KNET kernel module. - * - * \param [in] netif_cb Callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_netif_destroy_cb_register(ngknet_netif_cb_f netif_cb); - -/*! - * \brief Unregister callback for network interface destruction. - * - * \param [in] netif_cb Callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_netif_destroy_cb_unregister(ngknet_netif_cb_f netif_cb); - -/*! - * \brief Register filter callback. - * - * \param [in] filter_cb Filter callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_filter_cb_register(ngknet_filter_cb_f filter_cb); - -/*! - * \brief Unregister filter callback. - * - * \param [in] filter_cb Filter callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_filter_cb_unregister(ngknet_filter_cb_f filter_cb); - -/*! - * \brief Register PTP Rx config set callback. - * - * \param [in] ptp_rx_config_set_cb Rx config set callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_ptp_rx_config_set_cb_register(ngknet_ptp_config_set_cb_f ptp_rx_config_set_cb); - -/*! - * \brief Unregister PTP Rx config set callback. - * - * \param [in] ptp_rx_config_set_cb Rx config set callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_ptp_rx_config_set_cb_unregister(ngknet_ptp_config_set_cb_f ptp_rx_config_set_cb); - -/*! - * \brief Register PTP Tx config set callback. - * - * \param [in] ptp_tx_config_set_cb Tx config set callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_ptp_tx_config_set_cb_register(ngknet_ptp_config_set_cb_f ptp_tx_config_set_cb); - -/*! - * \brief Unregister PTP Tx config set callback. - * - * \param [in] ptp_tx_config_set_cb Tx config set callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_ptp_tx_config_set_cb_unregister(ngknet_ptp_config_set_cb_f ptp_tx_config_set_cb); - -/*! - * \brief Register PTP Rx HW timestamp get callback. - * - * \param [in] ptp_rx_hwts_get_cb Rx HW timestamp get callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_ptp_rx_hwts_get_cb_register(ngknet_ptp_hwts_get_cb_f ptp_rx_hwts_get_cb); - -/*! - * \brief Unregister PTP Rx HW timestamp get callback. - * - * \param [in] ptp_rx_hwts_get_cb Rx HW timestamp get callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_ptp_rx_hwts_get_cb_unregister(ngknet_ptp_hwts_get_cb_f ptp_rx_hwts_get_cb); - -/*! - * \brief Register PTP Tx HW timestamp get callback. - * - * \param [in] ptp_tx_hwts_get_cb Tx HW timestamp get callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_ptp_tx_hwts_get_cb_register(ngknet_ptp_hwts_get_cb_f ptp_tx_hwts_get_cb); - -/*! - * \brief Unregister PTP Tx HW timestamp get callback. - * - * \param [in] ptp_tx_hwts_get_cb Tx HW timestamp get callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_ptp_tx_hwts_get_cb_unregister(ngknet_ptp_hwts_get_cb_f ptp_tx_hwts_get_cb); - -/*! - * \brief Register PTP Tx meta set callback. - * - * \param [in] ptp_tx_meta_set_cb Tx meta set callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_ptp_tx_meta_set_cb_register(ngknet_ptp_meta_set_cb_f ptp_tx_meta_set_cb); - -/*! - * \brief Unregister PTP Tx meta set callback. - * - * \param [in] ptp_tx_meta_set_cb Tx meta set callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_ptp_tx_meta_set_cb_unregister(ngknet_ptp_meta_set_cb_f ptp_tx_meta_set_cb); - -/*! - * \brief Register PTP PHC index get callback. - * - * \param [in] ptp_phc_index_get_cb PHC index get callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_ptp_phc_index_get_cb_register(ngknet_ptp_phc_index_get_cb_f ptp_phc_index_get_cb); - -/*! - * \brief Unregister PTP PHC index get callback. - * - * \param [in] ptp_phc_index_get_cb PHC index get callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_ptp_phc_index_get_cb_unregister(ngknet_ptp_phc_index_get_cb_f ptp_phc_index_get_cb); - -/*! - * \brief Register PTP device control callback. - * - * \param [in] ptp_dev_ctrl_cb Device control callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_ptp_dev_ctrl_cb_register(ngknet_ptp_dev_ctrl_cb_f ptp_dev_ctrl_cb); - -/*! - * \brief Unregister PTP device control callback. - * - * \param [in] ptp_dev_ctrl_cb Device control callback function. - * - * \retval SHR_E_NONE No errors. - */ -extern int -ngknet_ptp_dev_ctrl_cb_unregister(ngknet_ptp_dev_ctrl_cb_f ptp_dev_ctrl_cb); - -#endif /* NGKNET_KAPI_H */ - diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/Kbuild b/platform/broadcom/saibcm-modules/sdklt/linux/knet/Kbuild index a23e587b1d45..1f543b8e2ccf 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/Kbuild +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/Kbuild @@ -2,7 +2,7 @@ # # Linux KNET module. # -# $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. +# $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. # The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. # # This program is free software; you can redistribute it and/or @@ -20,25 +20,18 @@ obj-m := linux_ngknet.o -ifneq ($(OUTPUT_DIR),) -INCLUDES := -I$(OUTPUT_DIR)/knet/generated/include -I$(OUTPUT_DIR)/knet/generated -endif - ccflags-y := $(KNET_CPPFLAGS) $(LKM_CFLAGS) \ -I$(SDK)/shr/include \ -I$(SDK)/bcmdrd/include \ -I$(SDK)/linux/include \ - -I$(SDK)/linux/knet/generated/include \ - -I$(SDK)/linux/knet/generated \ - $(INCLUDES) + -I$(SDK)/linux/knet/include \ + -I$(SDK)/linux/knet linux_ngknet-y := $(CHIP_OBJS) \ bcmcnet_cmicd_pdma_hw.o \ bcmcnet_cmicd_pdma_rxtx.o \ bcmcnet_cmicx_pdma_hw.o \ bcmcnet_cmicx_pdma_rxtx.o \ - bcmcnet_cmicr_pdma_hw.o \ - bcmcnet_cmicr_pdma_rxtx.o \ bcmcnet_core.o \ bcmcnet_dev.o \ bcmcnet_rxtx.o \ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/Makefile b/platform/broadcom/saibcm-modules/sdklt/linux/knet/Makefile index f13702ac92fd..2142857ad387 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/Makefile +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/Makefile @@ -1,5 +1,8 @@ +# -*- Makefile -*- # -# $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. +# Linux KNET module. +# +# $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. # The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. # # This program is free software; you can redistribute it and/or @@ -14,17 +17,11 @@ # A copy of the GNU General Public License version 2 (GPLv2) can # be found in the LICENSES folder.$ # -# Linux KNET module. -# CNETDIR = $(SDK)/bcmcnet KNETDIR = $(SDK)/linux/knet -GENDIR = $(KNETDIR)/generated SRCIDIR = $(CNETDIR)/include/bcmcnet -ifneq ($(OUTPUT_DIR),) -GENDIR = $(OUTPUT_DIR)/knet/generated -endif -DSTIDIR = $(GENDIR)/include/bcmcnet +DSTIDIR = $(KNETDIR)/include/bcmcnet # Change comma-separated list to space-separated list comma = , @@ -57,7 +54,7 @@ endif .PHONY: mklinks rmlinks knet: mklinks - $(MAKE) -C $(GENDIR) all + $(MAKE) all # # Suppress symlink error messages. @@ -80,19 +77,17 @@ mklinks: -ln -s $(SRCIDIR)/bcmcnet_cmicx.h $(DSTIDIR) $(R) -ln -s $(SRCIDIR)/bcmcnet_cmicr.h $(DSTIDIR) $(R) -ln -s $(SRCIDIR)/bcmcnet_cmicr_acc.h $(DSTIDIR) $(R) - -ln -s $(CNETDIR)/chip/*/*attach.c $(GENDIR) $(R) - -ln -s $(CNETDIR)/hmi/cmicd/*.c $(GENDIR) $(R) - -ln -s $(CNETDIR)/hmi/cmicx/*.c $(GENDIR) $(R) - -ln -s $(CNETDIR)/hmi/cmicr/*.c $(GENDIR) $(R) - -ln -s $(CNETDIR)/main/bcmcnet_core.c $(GENDIR) $(R) - -ln -s $(CNETDIR)/main/bcmcnet_dev.c $(GENDIR) $(R) - -ln -s $(CNETDIR)/main/bcmcnet_rxtx.c $(GENDIR) $(R) - -ln -s $(KNETDIR)/*.[ch] $(GENDIR) $(R) - -ln -s $(KNETDIR)/Makefile $(GENDIR) $(R) - -ln -s $(KNETDIR)/Kbuild $(GENDIR) $(R) + -ln -s $(CNETDIR)/chip/*/*attach.c $(KNETDIR) $(R) + -ln -s $(CNETDIR)/hmi/cmicd/*.c $(KNETDIR) $(R) + -ln -s $(CNETDIR)/hmi/cmicx/*.c $(KNETDIR) $(R) + -ln -s $(CNETDIR)/hmi/cmicr/*.c $(KNETDIR) $(R) + -ln -s $(CNETDIR)/main/bcmcnet_core.c $(KNETDIR) $(R) + -ln -s $(CNETDIR)/main/bcmcnet_dev.c $(KNETDIR) $(R) + -ln -s $(CNETDIR)/main/bcmcnet_rxtx.c $(KNETDIR) $(R) rmlinks: - -rm -rf $(GENDIR) + -rm -f bcm* + -rm -rf include CHIP_SRCS := $(addsuffix _pdma_attach.c,$(KNET_CHIPS)) CHIP_OBJS ?= $(patsubst %.c, %.o, $(CHIP_SRCS)) @@ -110,4 +105,4 @@ endif .PHONY: distclean -distclean:: rmlinks +distclean: rmlinks diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_buff.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_buff.h new file mode 120000 index 000000000000..b4bc2b7ffe74 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_buff.h @@ -0,0 +1 @@ +/sonic/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_buff.h \ No newline at end of file diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_cmicd.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_cmicd.h new file mode 120000 index 000000000000..cface69c6365 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_cmicd.h @@ -0,0 +1 @@ +/sonic/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicd.h \ No newline at end of file diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_cmicx.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_cmicx.h new file mode 120000 index 000000000000..ee9f52060eae --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_cmicx.h @@ -0,0 +1 @@ +/sonic/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicx.h \ No newline at end of file diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_core.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_core.h new file mode 120000 index 000000000000..83e0769b2b5e --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_core.h @@ -0,0 +1 @@ +/sonic/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_core.h \ No newline at end of file diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_dep.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_dep.h new file mode 120000 index 000000000000..8a9a6c6f6582 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_dep.h @@ -0,0 +1 @@ +/sonic/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_dep.h \ No newline at end of file diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_dev.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_dev.h new file mode 120000 index 000000000000..4ba5f9aefbaa --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_dev.h @@ -0,0 +1 @@ +/sonic/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_dev.h \ No newline at end of file diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_internal.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_internal.h new file mode 120000 index 000000000000..e9c65317d643 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_internal.h @@ -0,0 +1 @@ +/sonic/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_internal.h \ No newline at end of file diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_rxtx.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_rxtx.h new file mode 120000 index 000000000000..7bfe68f89882 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_rxtx.h @@ -0,0 +1 @@ +/sonic/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_rxtx.h \ No newline at end of file diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_types.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_types.h new file mode 120000 index 000000000000..f2e6649cd0da --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/include/bcmcnet/bcmcnet_types.h @@ -0,0 +1 @@ +/sonic/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_types.h \ No newline at end of file diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_buff.c b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_buff.c index 362c6e156e2b..5d92ed016b49 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_buff.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_buff.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -30,7 +30,7 @@ * Allocate coherent memory */ static void * -ngknet_ring_buf_alloc(struct pdma_dev *dev, uint32_t size, dma_addr_t *dma) +bcmcnet_ring_buf_alloc(struct pdma_dev *dev, uint32_t size, dma_addr_t *dma) { struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; @@ -41,7 +41,7 @@ ngknet_ring_buf_alloc(struct pdma_dev *dev, uint32_t size, dma_addr_t *dma) * Free coherent memory */ static void -ngknet_ring_buf_free(struct pdma_dev *dev, uint32_t size, void *addr, dma_addr_t dma) +bcmcnet_ring_buf_free(struct pdma_dev *dev, uint32_t size, void *addr, dma_addr_t dma) { struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; @@ -52,23 +52,22 @@ ngknet_ring_buf_free(struct pdma_dev *dev, uint32_t size, void *addr, dma_addr_t * Allocate Rx buffer */ static int -ngknet_rx_buf_alloc(struct pdma_dev *dev, struct pdma_rx_queue *rxq, - struct pdma_rx_buf *pbuf) +bcmcnet_rx_buf_alloc(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf) { struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; dma_addr_t dma; struct page *page; struct sk_buff *skb; - if (rxq->buf_mode == PDMA_BUF_MODE_PAGE) { - page = kal_dev_alloc_pages(rxq->page_order); + if (rxq->mode == PDMA_BUF_MODE_PAGE) { + page = kal_dev_alloc_page(); if (unlikely(!page)) { return SHR_E_MEMORY; } - dma = kal_dma_map_page_attrs(kdev->dev, page, 0, PAGE_SIZE * (1 << rxq->page_order), DMA_FROM_DEVICE, - DMA_ATTR_SKIP_CPU_SYNC | DMA_ATTR_WEAK_ORDERING); + dma = dma_map_page(kdev->dev, page, 0, PAGE_SIZE, DMA_FROM_DEVICE); if (unlikely(dma_mapping_error(kdev->dev, dma))) { - __free_pages(page, rxq->page_order); + __free_page(page); return SHR_E_MEMORY; } pbuf->dma = dma; @@ -97,10 +96,10 @@ ngknet_rx_buf_alloc(struct pdma_dev *dev, struct pdma_rx_queue *rxq, * Get Rx buffer DMA address */ static void -ngknet_rx_buf_dma(struct pdma_dev *dev, struct pdma_rx_queue *rxq, - struct pdma_rx_buf *pbuf, dma_addr_t *addr) +bcmcnet_rx_buf_dma(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf, dma_addr_t *addr) { - if (rxq->buf_mode == PDMA_BUF_MODE_PAGE) { + if (rxq->mode == PDMA_BUF_MODE_PAGE) { *addr = pbuf->dma + pbuf->page_offset + PDMA_RXB_RESV + pbuf->adj; } else { *addr = pbuf->dma; @@ -111,10 +110,10 @@ ngknet_rx_buf_dma(struct pdma_dev *dev, struct pdma_rx_queue *rxq, * Check Rx buffer */ static bool -ngknet_rx_buf_avail(struct pdma_dev *dev, struct pdma_rx_queue *rxq, - struct pdma_rx_buf *pbuf) +bcmcnet_rx_buf_avail(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf) { - if (rxq->buf_mode == PDMA_BUF_MODE_PAGE) { + if (rxq->mode == PDMA_BUF_MODE_PAGE) { pbuf->skb = NULL; } @@ -125,41 +124,36 @@ ngknet_rx_buf_avail(struct pdma_dev *dev, struct pdma_rx_queue *rxq, * Get Rx buffer */ static struct pkt_hdr * -ngknet_rx_buf_get(struct pdma_dev *dev, struct pdma_rx_queue *rxq, - struct pdma_rx_buf *pbuf, int len) +bcmcnet_rx_buf_get(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf, int len) { struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; struct sk_buff *skb; - uint32_t pages_size; - if (rxq->buf_mode == PDMA_BUF_MODE_PAGE) { + if (rxq->mode == PDMA_BUF_MODE_PAGE) { if (pbuf->skb) { return &pbuf->pkb->pkh; } skb = kal_build_skb(page_address(pbuf->page) + pbuf->page_offset, - PDMA_RXB_SIZE(rxq->buf_size + pbuf->adj)); + PDMA_SKB_RESV + pbuf->adj + rxq->buf_size); if (unlikely(!skb)) { return NULL; } skb_reserve(skb, PDMA_RXB_ALIGN); - pages_size = PAGE_SIZE * (1 << rxq->page_order); dma_sync_single_range_for_cpu(kdev->dev, pbuf->dma, pbuf->page_offset, - pages_size >> 1, DMA_FROM_DEVICE); + PDMA_PAGE_BUF_MAX, DMA_FROM_DEVICE); pbuf->skb = skb; pbuf->pkb = (struct pkt_buf *)skb->data; /* Try to reuse this page */ - if (unlikely(page_count(pbuf->page) != 1) || - kal_page_is_pfmemalloc(pbuf->page) || - page_to_nid(pbuf->page) != numa_mem_id()) { - kal_dma_unmap_page_attrs(kdev->dev, pbuf->dma, pages_size, DMA_FROM_DEVICE, - DMA_ATTR_SKIP_CPU_SYNC | DMA_ATTR_WEAK_ORDERING); + if (unlikely(page_count(pbuf->page) != 1)) { + dma_unmap_page(kdev->dev, pbuf->dma, PAGE_SIZE, DMA_FROM_DEVICE); pbuf->dma = 0; } else { - pbuf->page_offset ^= pages_size >> 1; + pbuf->page_offset ^= PDMA_PAGE_BUF_MAX; page_ref_inc(pbuf->page); dma_sync_single_range_for_device(kdev->dev, pbuf->dma, pbuf->page_offset, - pages_size >> 1, DMA_FROM_DEVICE); + PDMA_PAGE_BUF_MAX, DMA_FROM_DEVICE); } } else { if (!pbuf->dma) { @@ -179,20 +173,19 @@ ngknet_rx_buf_get(struct pdma_dev *dev, struct pdma_rx_queue *rxq, * Put Rx buffer */ static int -ngknet_rx_buf_put(struct pdma_dev *dev, struct pdma_rx_queue *rxq, - struct pdma_rx_buf *pbuf, int len) +bcmcnet_rx_buf_put(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf, int len) { struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; dma_addr_t dma; struct sk_buff *skb; - if (rxq->buf_mode == PDMA_BUF_MODE_PAGE) { + if (rxq->mode == PDMA_BUF_MODE_PAGE) { dev_kfree_skb_any(pbuf->skb); } else { skb = pbuf->skb; if (pbuf->pkb != (struct pkt_buf *)skb->data) { dev_kfree_skb_any(skb); - pbuf->dma = 0; return SHR_E_NONE; } dma = dma_map_single(kdev->dev, &pbuf->pkb->data + pbuf->adj, @@ -203,7 +196,7 @@ ngknet_rx_buf_put(struct pdma_dev *dev, struct pdma_rx_queue *rxq, return SHR_E_MEMORY; } pbuf->dma = dma; - skb_trim(skb, 0); + skb_trim(skb, skb->len - (PKT_HDR_SIZE + pbuf->adj + len)); } return SHR_E_NONE; @@ -213,24 +206,15 @@ ngknet_rx_buf_put(struct pdma_dev *dev, struct pdma_rx_queue *rxq, * Free Rx buffer */ static void -ngknet_rx_buf_free(struct pdma_dev *dev, struct pdma_rx_queue *rxq, - struct pdma_rx_buf *pbuf) +bcmcnet_rx_buf_free(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf) { struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; - uint32_t pages_size; - if (rxq->buf_mode == PDMA_BUF_MODE_PAGE) { - if (!pbuf->page) { - return; - } - pages_size = PAGE_SIZE * (1 << rxq->page_order); - kal_dma_unmap_page_attrs(kdev->dev, pbuf->dma, pages_size, DMA_FROM_DEVICE, - DMA_ATTR_SKIP_CPU_SYNC | DMA_ATTR_WEAK_ORDERING); - __free_pages(pbuf->page, rxq->page_order); + if (rxq->mode == PDMA_BUF_MODE_PAGE) { + dma_unmap_single(kdev->dev, pbuf->dma, PAGE_SIZE, DMA_FROM_DEVICE); + __free_page(pbuf->page); } else { - if (!pbuf->skb) { - return; - } dma_unmap_single(kdev->dev, pbuf->dma, rxq->buf_size, DMA_FROM_DEVICE); dev_kfree_skb_any(pbuf->skb); } @@ -247,42 +231,25 @@ ngknet_rx_buf_free(struct pdma_dev *dev, struct pdma_rx_queue *rxq, * Get Rx buffer mode */ static enum buf_mode -ngknet_rx_buf_mode(struct pdma_dev *dev, struct pdma_rx_queue *rxq) +bcmcnet_rx_buf_mode(struct pdma_dev *dev, struct pdma_rx_queue *rxq) { - uint32_t len, order; - - switch (ngknet_page_buffer_mode_get()) { - case 0: - /* Forced SKB mode */ - return PDMA_BUF_MODE_SKB; - case 1: - /* Forced page mode */ - break; - default: /* -1 */ - /* Select buffer mode based on system capability */ - if (kal_support_paged_skb() == 0) { - return PDMA_BUF_MODE_SKB; - } - break; - } + uint32_t len; len = dev->rx_ph_size ? rxq->buf_size : rxq->buf_size + PDMA_RXB_META; - for (order = 0; order < 32; order++) { - if (PDMA_RXB_SIZE(len) * 2 <= PAGE_SIZE * (1 << order)) { - rxq->page_order = order; - break; - } + if (PDMA_RXB_SIZE(len) <= PDMA_PAGE_BUF_MAX && PAGE_SIZE < 8192 && + kal_support_paged_skb()) { + return PDMA_BUF_MODE_PAGE; } - return PDMA_BUF_MODE_PAGE; + return PDMA_BUF_MODE_SKB; } /*! * Get Tx buffer */ static struct pkt_hdr * -ngknet_tx_buf_get(struct pdma_dev *dev, struct pdma_tx_queue *txq, - struct pdma_tx_buf *pbuf, void *buf) +bcmcnet_tx_buf_get(struct pdma_dev *dev, struct pdma_tx_queue *txq, + struct pdma_tx_buf *pbuf, void *buf) { struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; struct sk_buff *skb = (struct sk_buff *)buf; @@ -307,8 +274,8 @@ ngknet_tx_buf_get(struct pdma_dev *dev, struct pdma_tx_queue *txq, * Get Tx buffer DMA address */ static void -ngknet_tx_buf_dma(struct pdma_dev *dev, struct pdma_tx_queue *txq, - struct pdma_tx_buf *pbuf, dma_addr_t *addr) +bcmcnet_tx_buf_dma(struct pdma_dev *dev, struct pdma_tx_queue *txq, + struct pdma_tx_buf *pbuf, dma_addr_t *addr) { *addr = pbuf->dma; } @@ -317,15 +284,11 @@ ngknet_tx_buf_dma(struct pdma_dev *dev, struct pdma_tx_queue *txq, * Free Tx buffer */ static void -ngknet_tx_buf_free(struct pdma_dev *dev, struct pdma_tx_queue *txq, - struct pdma_tx_buf *pbuf) +bcmcnet_tx_buf_free(struct pdma_dev *dev, struct pdma_tx_queue *txq, + struct pdma_tx_buf *pbuf) { struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; - if (!pbuf->skb) { - return; - } - dma_unmap_single(kdev->dev, pbuf->dma, pbuf->len, DMA_TO_DEVICE); if (skb_shinfo(pbuf->skb)->tx_flags & SKBTX_IN_PROGRESS) { skb_queue_tail(&kdev->ptp_tx_queue, pbuf->skb); @@ -342,18 +305,18 @@ ngknet_tx_buf_free(struct pdma_dev *dev, struct pdma_tx_queue *txq, } static const struct pdma_buf_mngr buf_mngr = { - .ring_buf_alloc = ngknet_ring_buf_alloc, - .ring_buf_free = ngknet_ring_buf_free, - .rx_buf_alloc = ngknet_rx_buf_alloc, - .rx_buf_dma = ngknet_rx_buf_dma, - .rx_buf_avail = ngknet_rx_buf_avail, - .rx_buf_get = ngknet_rx_buf_get, - .rx_buf_put = ngknet_rx_buf_put, - .rx_buf_free = ngknet_rx_buf_free, - .rx_buf_mode = ngknet_rx_buf_mode, - .tx_buf_get = ngknet_tx_buf_get, - .tx_buf_dma = ngknet_tx_buf_dma, - .tx_buf_free = ngknet_tx_buf_free, + .ring_buf_alloc = bcmcnet_ring_buf_alloc, + .ring_buf_free = bcmcnet_ring_buf_free, + .rx_buf_alloc = bcmcnet_rx_buf_alloc, + .rx_buf_dma = bcmcnet_rx_buf_dma, + .rx_buf_avail = bcmcnet_rx_buf_avail, + .rx_buf_get = bcmcnet_rx_buf_get, + .rx_buf_put = bcmcnet_rx_buf_put, + .rx_buf_free = bcmcnet_rx_buf_free, + .rx_buf_mode = bcmcnet_rx_buf_mode, + .tx_buf_get = bcmcnet_tx_buf_get, + .tx_buf_dma = bcmcnet_tx_buf_dma, + .tx_buf_free = bcmcnet_tx_buf_free, }; /*! diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_buff.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_buff.h index e8d5a69dc4f6..948815c48304 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_buff.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_buff.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -30,9 +30,11 @@ /*! Rx SKB reserved size */ #define PDMA_SKB_RESV (PDMA_RXB_RESV + SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) /*! Rx buffer size */ -#define PDMA_RXB_SIZE(len) (SKB_DATA_ALIGN(len) + PDMA_SKB_RESV) +#define PDMA_RXB_SIZE(len) (SKB_DATA_ALIGN(len + NET_SKB_PAD) + PDMA_SKB_RESV) /*! Rx reserved meta size */ #define PDMA_RXB_META 64 +/*! Max page buffer size */ +#define PDMA_PAGE_BUF_MAX 2048 /*! * \brief Rx buffer. diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_callback.c b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_callback.c index 04d1540a270b..8f4ea5aa3f8f 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_callback.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_callback.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -102,50 +102,6 @@ ngknet_tx_cb_unregister(ngknet_tx_cb_f tx_cb) return 0; } -int -ngknet_netif_create_cb_register(ngknet_netif_cb_f netif_cb) -{ - if (callback_ctrl.netif_create_cb != NULL) { - return -1; - } - callback_ctrl.netif_create_cb = netif_cb; - - return 0; -} - -int -ngknet_netif_create_cb_unregister(ngknet_netif_cb_f netif_cb) -{ - if (netif_cb == NULL || callback_ctrl.netif_create_cb != netif_cb) { - return -1; - } - callback_ctrl.netif_create_cb = NULL; - - return 0; -} - -int -ngknet_netif_destroy_cb_register(ngknet_netif_cb_f netif_cb) -{ - if (callback_ctrl.netif_destroy_cb != NULL) { - return -1; - } - callback_ctrl.netif_destroy_cb = netif_cb; - - return 0; -} - -int -ngknet_netif_destroy_cb_unregister(ngknet_netif_cb_f netif_cb) -{ - if (netif_cb == NULL || callback_ctrl.netif_destroy_cb != netif_cb) { - return -1; - } - callback_ctrl.netif_destroy_cb = NULL; - - return 0; -} - int ngknet_filter_cb_register(ngknet_filter_cb_f filter_cb) { @@ -329,16 +285,56 @@ ngknet_ptp_dev_ctrl_cb_unregister(ngknet_ptp_dev_ctrl_cb_f ptp_dev_ctrl_cb) return 0; } +int +ngknet_netif_create_cb_register(ngknet_netif_cb_f netif_cb) +{ + if (callback_ctrl.netif_create_cb != NULL) { + return -1; + } + callback_ctrl.netif_create_cb = netif_cb; + + return 0; +} + +int +ngknet_netif_create_cb_unregister(ngknet_netif_cb_f netif_cb) +{ + if (netif_cb == NULL || callback_ctrl.netif_create_cb != netif_cb) { + return -1; + } + callback_ctrl.netif_create_cb = NULL; + + return 0; +} + +int +ngknet_netif_destroy_cb_register(ngknet_netif_cb_f netif_cb) +{ + if (callback_ctrl.netif_destroy_cb != NULL) { + return -1; + } + callback_ctrl.netif_destroy_cb = netif_cb; + + return 0; +} + +int +ngknet_netif_destroy_cb_unregister(ngknet_netif_cb_f netif_cb) +{ + if (netif_cb == NULL || callback_ctrl.netif_destroy_cb != netif_cb) { + return -1; + } + callback_ctrl.netif_destroy_cb = NULL; + + return 0; +} + EXPORT_SYMBOL(ngknet_dev_init_cb_register); EXPORT_SYMBOL(ngknet_dev_init_cb_unregister); EXPORT_SYMBOL(ngknet_rx_cb_register); EXPORT_SYMBOL(ngknet_rx_cb_unregister); EXPORT_SYMBOL(ngknet_tx_cb_register); EXPORT_SYMBOL(ngknet_tx_cb_unregister); -EXPORT_SYMBOL(ngknet_netif_create_cb_register); -EXPORT_SYMBOL(ngknet_netif_create_cb_unregister); -EXPORT_SYMBOL(ngknet_netif_destroy_cb_register); -EXPORT_SYMBOL(ngknet_netif_destroy_cb_unregister); EXPORT_SYMBOL(ngknet_filter_cb_register); EXPORT_SYMBOL(ngknet_filter_cb_unregister); EXPORT_SYMBOL(ngknet_ptp_rx_config_set_cb_register); @@ -355,4 +351,7 @@ EXPORT_SYMBOL(ngknet_ptp_phc_index_get_cb_register); EXPORT_SYMBOL(ngknet_ptp_phc_index_get_cb_unregister); EXPORT_SYMBOL(ngknet_ptp_dev_ctrl_cb_register); EXPORT_SYMBOL(ngknet_ptp_dev_ctrl_cb_unregister); - +EXPORT_SYMBOL(ngknet_netif_create_cb_register); +EXPORT_SYMBOL(ngknet_netif_create_cb_unregister); +EXPORT_SYMBOL(ngknet_netif_destroy_cb_register); +EXPORT_SYMBOL(ngknet_netif_destroy_cb_unregister); diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_callback.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_callback.h index c330c106817f..abc78aa1874f 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_callback.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_callback.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -23,7 +23,79 @@ #ifndef NGKNET_CALLBACK_H #define NGKNET_CALLBACK_H -#include +#include +#include "ngknet_main.h" + +/*! + * \brief NGKNET callback description. + */ +struct ngknet_callback_desc { + /*! Device number */ + int dev_no; + + /*! Device ID */ + uint32_t dev_id; + + /*! Device type string */ + const char *type_str; + + /*! Network interface private data */ + struct ngknet_private *priv; + + /*! Matched filter */ + struct ngknet_filter_s *filt; + + /*! Packet meta data */ + uint8_t *pmd; + + /*! Packet meta data length */ + int pmd_len; + + /*! Packet data length */ + int pkt_len; +}; + +#define NGKNET_SKB_CB(_skb) ((struct ngknet_callback_desc *)_skb->cb) + +/*! TX/RX callback init */ +typedef void +(*ngknet_dev_init_cb_f)(const struct ngknet_dev *dev); + +/*! Handle Rx packet */ +typedef struct sk_buff * +(*ngknet_rx_cb_f)(struct sk_buff *skb); + +/*! Handle Tx packet */ +typedef struct sk_buff * +(*ngknet_tx_cb_f)(struct sk_buff *skb); + +/*! Handle Filter callback */ +typedef struct sk_buff * +(*ngknet_filter_cb_f)(struct sk_buff *skb, ngknet_filter_t **filt); + +/*! PTP Rx/Tx config set */ +typedef int +(*ngknet_ptp_config_set_cb_f)(struct ngknet_private *priv, int *value); + +/*! PTP Rx/Tx HW timestamp get */ +typedef int +(*ngknet_ptp_hwts_get_cb_f)(struct sk_buff *skb, uint64_t *ts); + +/*! PTP Tx meta set */ +typedef int +(*ngknet_ptp_meta_set_cb_f)(struct sk_buff *skb); + +/*! PTP PHC index get */ +typedef int +(*ngknet_ptp_phc_index_get_cb_f)(struct ngknet_private *priv, int *index); + +/*! PTP device control */ +typedef int +(*ngknet_ptp_dev_ctrl_cb_f)(struct ngknet_dev *dev, int cmd, char *data, int len); + +/*! Netif callback */ +typedef int +(*ngknet_netif_cb_f)(struct net_device *dev); /*! * \brief NGKNET callback control. @@ -38,12 +110,6 @@ struct ngknet_callback_ctrl { /*! Handle Tx packet */ ngknet_tx_cb_f tx_cb; - /*! Handle Netif creation */ - ngknet_netif_cb_f netif_create_cb; - - /*! Handle Netif destruction */ - ngknet_netif_cb_f netif_destroy_cb; - /*! Handle filter callback */ ngknet_filter_cb_f filter_cb; @@ -67,6 +133,12 @@ struct ngknet_callback_ctrl { /*! PTP device control */ ngknet_ptp_dev_ctrl_cb_f ptp_dev_ctrl_cb; + + /*! Handle Netif create */ + ngknet_netif_cb_f netif_create_cb; + + /*! Handle Netif destroy */ + ngknet_netif_cb_f netif_destroy_cb; }; /*! @@ -79,5 +151,275 @@ struct ngknet_callback_ctrl { extern int ngknet_callback_control_get(struct ngknet_callback_ctrl **cbc); +/*! + * \brief Register TX/RX callback device initialization callback function. + * + * The device initialization callback allows an external module to + * perform device-specific initialization in preparation for Tx and Rx + * packet processing. + * + * \param [in] dev_init_cb TX/RX callback device initialization callback + * function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_dev_init_cb_register(ngknet_dev_init_cb_f dev_init_cb); + +/*! + * \brief Unegister TX/RX callback device initialization callback function. + * + * The device initialization callback allows an external module to + * perform device-specific initialization in preparation for Tx and Rx + * packet processing. + * + * \param [in] dev_init_cb TX/RX callback device initialization callback + * function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_dev_init_cb_unregister(ngknet_dev_init_cb_f dev_init_cb); + +/*! + * \brief Register Rx callback. + * + * \param [in] rx_cb Rx callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_rx_cb_register(ngknet_rx_cb_f rx_cb); + +/*! + * \brief Unregister Rx callback. + * + * \param [in] rx_cb Rx callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_rx_cb_unregister(ngknet_rx_cb_f rx_cb); + +/*! + * \brief Register Tx callback. + * + * \param [in] tx_cb Tx callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_tx_cb_register(ngknet_tx_cb_f tx_cb); + +/*! + * \brief Unregister Tx callback. + * + * \param [in] tx_cb Tx callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_tx_cb_unregister(ngknet_tx_cb_f tx_cb); + +/*! + * \brief Register filter callback. + * + * \param [in] filter_cb Filter callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_filter_cb_register(ngknet_filter_cb_f filter_cb); + +/*! + * \brief Unregister filter callback. + * + * \param [in] filter_cb Filter callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_filter_cb_unregister(ngknet_filter_cb_f filter_cb); + +/*! + * \brief Register PTP Rx config set callback. + * + * \param [in] ptp_rx_config_set_cb Rx config set callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_rx_config_set_cb_register(ngknet_ptp_config_set_cb_f ptp_rx_config_set_cb); + +/*! + * \brief Unregister PTP Rx config set callback. + * + * \param [in] ptp_rx_config_set_cb Rx config set callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_rx_config_set_cb_unregister(ngknet_ptp_config_set_cb_f ptp_rx_config_set_cb); + +/*! + * \brief Register PTP Tx config set callback. + * + * \param [in] ptp_tx_config_set_cb Tx config set callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_tx_config_set_cb_register(ngknet_ptp_config_set_cb_f ptp_tx_config_set_cb); + +/*! + * \brief Unregister PTP Tx config set callback. + * + * \param [in] ptp_tx_config_set_cb Tx config set callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_tx_config_set_cb_unregister(ngknet_ptp_config_set_cb_f ptp_tx_config_set_cb); + +/*! + * \brief Register PTP Rx HW timestamp get callback. + * + * \param [in] ptp_rx_hwts_get_cb Rx HW timestamp get callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_rx_hwts_get_cb_register(ngknet_ptp_hwts_get_cb_f ptp_rx_hwts_get_cb); + +/*! + * \brief Unregister PTP Rx HW timestamp get callback. + * + * \param [in] ptp_rx_hwts_get_cb Rx HW timestamp get callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_rx_hwts_get_cb_unregister(ngknet_ptp_hwts_get_cb_f ptp_rx_hwts_get_cb); + +/*! + * \brief Register PTP Tx HW timestamp get callback. + * + * \param [in] ptp_tx_hwts_get_cb Tx HW timestamp get callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_tx_hwts_get_cb_register(ngknet_ptp_hwts_get_cb_f ptp_tx_hwts_get_cb); + +/*! + * \brief Unregister PTP Tx HW timestamp get callback. + * + * \param [in] ptp_tx_hwts_get_cb Tx HW timestamp get callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_tx_hwts_get_cb_unregister(ngknet_ptp_hwts_get_cb_f ptp_tx_hwts_get_cb); + +/*! + * \brief Register PTP Tx meta set callback. + * + * \param [in] ptp_tx_meta_set_cb Tx meta set callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_tx_meta_set_cb_register(ngknet_ptp_meta_set_cb_f ptp_tx_meta_set_cb); + +/*! + * \brief Unregister PTP Tx meta set callback. + * + * \param [in] ptp_tx_meta_set_cb Tx meta set callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_tx_meta_set_cb_unregister(ngknet_ptp_meta_set_cb_f ptp_tx_meta_set_cb); + +/*! + * \brief Register PTP PHC index get callback. + * + * \param [in] ptp_phc_index_get_cb PHC index get callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_phc_index_get_cb_register(ngknet_ptp_phc_index_get_cb_f ptp_phc_index_get_cb); + +/*! + * \brief Unregister PTP PHC index get callback. + * + * \param [in] ptp_phc_index_get_cb PHC index get callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_phc_index_get_cb_unregister(ngknet_ptp_phc_index_get_cb_f ptp_phc_index_get_cb); + +/*! + * \brief Register PTP device control callback. + * + * \param [in] ptp_dev_ctrl_cb Device control callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_dev_ctrl_cb_register(ngknet_ptp_dev_ctrl_cb_f ptp_dev_ctrl_cb); + +/*! + * \brief Unregister PTP device control callback. + * + * \param [in] ptp_dev_ctrl_cb Device control callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_dev_ctrl_cb_unregister(ngknet_ptp_dev_ctrl_cb_f ptp_dev_ctrl_cb); + +/*! + * \brief Register Netif Create callback. + * + * \param [netif_cb] netif_cb create callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_netif_create_cb_register(ngknet_netif_cb_f netif_cb); + +/*! + * \brief Unregister Netif Create callback. + * + * \param [netif_cb] netif_cb destroy callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_netif_create_cb_unregister(ngknet_netif_cb_f netif_cb); + +/*! + * \brief Register Netif Destroy callback. + * + * \param [netif_cb] netif_cb destroy callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_netif_destroy_cb_register(ngknet_netif_cb_f netif_cb); + +/*! + * \brief Unregister Netif Destroy callback. + * + * \param [netif_cb] netif_cb destroy callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_netif_destroy_cb_unregister(ngknet_netif_cb_f netif_cb); + #endif /* NGKNET_CALLBACK_H */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_dep.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_dep.h index 6292494bc92d..4590a7a6f402 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_dep.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_dep.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -29,9 +29,8 @@ /*! Memorry barrier */ #define MEMORY_BARRIER smp_mb() -/*! CNET log macros */ -#define CNET_INFO(unit, fmt, args...) printk(KERN_INFO fmt, ##args) -#define CNET_ERROR(unit, fmt, args...) printk(KERN_ERR fmt, ##args) +/*! CNET print uitility */ +#define CNET_PR(fmt, args...) printk(fmt, ##args) struct pdma_dev; diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_extra.c b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_extra.c index 3bf2dbfdc5ef..2124cd16f6fd 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_extra.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_extra.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -263,7 +263,7 @@ ngknet_rx_pkt_filter(struct ngknet_dev *dev, struct sk_buff *skb, struct net_dev unsigned long flags; int wsize; int chan_id; - int rv, idx, match = 0,match_cb = 0; + int rv, idx, match = 0, match_cb = 0; rv = bcmcnet_pdma_dev_queue_to_chan(&dev->pdma_dev, pkb->pkh.queue_id, PDMA_Q_RX, &chan_id); @@ -330,7 +330,9 @@ ngknet_rx_pkt_filter(struct ngknet_dev *dev, struct sk_buff *skb, struct net_dev spin_unlock_irqrestore(&dev->lock, flags); return SHR_E_UNAVAIL; } - cbd->dinfo = &dev->dev_info; + cbd->dev_no = dev->dev_no; + cbd->dev_id = dev->pdma_dev.dev_id; + cbd->type_str = dev->type_str; cbd->pmd = skb->data + PKT_HDR_SIZE; cbd->pmd_len = pkh->meta_len; cbd->pkt_len = pkh->data_len; @@ -391,6 +393,7 @@ ngknet_rx_pkt_filter(struct ngknet_dev *dev, struct sk_buff *skb, struct net_dev if (dev->cbc->rx_cb) { NGKNET_SKB_CB(skb)->filt = filt; + /* Add callback filter if matched */ if (priv) { priv->filt_cb = match_cb? filt_cb : NULL; @@ -441,7 +444,7 @@ ngknet_rl_process(timer_context_t data) dev = &rc->devs[idx]; if (rc->dev_active[idx] && rc->dev_paused[idx]) { bcmcnet_pdma_dev_rx_resume(&dev->pdma_dev); - rl_ctrl.dev_paused[dev->dev_info.dev_no] = 0; + rl_ctrl.dev_paused[dev->dev_no] = 0; } } spin_unlock_irqrestore(&rc->lock, flags); @@ -478,7 +481,7 @@ ngknet_rx_rate_limit_start(struct ngknet_dev *dev) unsigned long flags; spin_lock_irqsave(&rl_ctrl.lock, flags); - rl_ctrl.dev_active[dev->dev_info.dev_no] = 1; + rl_ctrl.dev_active[dev->dev_no] = 1; spin_unlock_irqrestore(&rl_ctrl.lock, flags); if (!rl_ctrl.started) { @@ -494,7 +497,7 @@ ngknet_rx_rate_limit_stop(struct ngknet_dev *dev) unsigned long flags; spin_lock_irqsave(&rl_ctrl.lock, flags); - rl_ctrl.dev_active[dev->dev_info.dev_no] = 0; + rl_ctrl.dev_active[dev->dev_no] = 0; spin_unlock_irqrestore(&rl_ctrl.lock, flags); } @@ -512,13 +515,12 @@ ngknet_rx_rate_limit(struct ngknet_dev *dev, int limit) spin_lock_irqsave(&rl_ctrl.lock, flags); if ((++rl_ctrl.rx_pkts + rl_ctrl.rx_overruns > limit / rl_ctrl.rx_ticks) && - !rl_ctrl.dev_paused[dev->dev_info.dev_no] && - rl_ctrl.dev_active[dev->dev_info.dev_no]) { - rl_ctrl.dev_paused[dev->dev_info.dev_no] = 1; + !rl_ctrl.dev_paused[dev->dev_no] && rl_ctrl.dev_active[dev->dev_no]) { + rl_ctrl.dev_paused[dev->dev_no] = 1; rl_ctrl.rx_overruns = 0; bcmcnet_pdma_dev_rx_suspend(&dev->pdma_dev); } - if (rl_ctrl.dev_paused[dev->dev_info.dev_no]) { + if (rl_ctrl.dev_paused[dev->dev_no]) { rl_ctrl.rx_overruns++; } spin_unlock_irqrestore(&rl_ctrl.lock, flags); diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_extra.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_extra.h index 1dbeb8094a88..f9ef71f118d9 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_extra.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_extra.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_linux.c b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_linux.c index 56d3f2371b47..0f1ec3348c71 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_linux.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_linux.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -39,7 +39,19 @@ unsigned long sal_time_usecs(void) { - return (unsigned long)kal_time_usecs(); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) + struct timeval tv; + + kal_time_val_get(&tv); + + return tv.tv_sec * 1000000 + tv.tv_usec; +#else + struct timespec64 tv; + + kal_time_val_get(&tv); + + return tv.tv_sec * 1000000 + tv.tv_nsec / 1000; +#endif } void diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_linux.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_linux.h index 14475167d7e8..faed6d1f8db8 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_linux.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_linux.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -34,13 +34,6 @@ #define MODULE_PARAM(n, t, p) module_param(n, t, p) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)) -#define NGKNET_ETHTOOL_LINK_SETTINGS 1 -#else -#define NGKNET_ETHTOOL_LINK_SETTINGS 0 -#endif - #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) #define kal_vlan_hwaccel_put_tag(skb, proto, tci) \ __vlan_hwaccel_put_tag(skb, tci) @@ -51,22 +44,42 @@ __vlan_hwaccel_put_tag(skb, htons(proto), tci) #endif /* KERNEL_VERSION(3,10,0) */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0) +static inline int +kal_support_paged_skb(void) +{ + return false; +} +#else +static inline int +kal_support_paged_skb(void) +{ + return true; +} +#endif /* KERNEL_VERSION(3,6,0) */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0) +static inline struct page * +kal_dev_alloc_page(void) +{ + return NULL; +} +#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) static inline struct page * -kal_dev_alloc_pages(unsigned int order) +kal_dev_alloc_page(void) { return alloc_pages(GFP_ATOMIC | __GFP_ZERO | __GFP_COLD | - __GFP_COMP | __GFP_MEMALLOC, order); + __GFP_COMP | __GFP_MEMALLOC, 0); } #else static inline struct page * -kal_dev_alloc_pages(unsigned int order) +kal_dev_alloc_page(void) { - return dev_alloc_pages(order); + return dev_alloc_page(); } -#endif /* KERNEL_VERSION(3,19,0) */ +#endif /* KERNEL_VERSION(3,6,0) */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0) static inline struct sk_buff * kal_build_skb(void *data, unsigned int frag_size) { @@ -78,21 +91,7 @@ kal_build_skb(void *data, unsigned int frag_size) { return build_skb(data, frag_size); } -#endif /* KERNEL_VERSION(3,5,0) */ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) -static inline bool -kal_page_is_pfmemalloc(struct page *page) -{ - return false; -} -#else -static inline bool -kal_page_is_pfmemalloc(struct page *page) -{ - return page_is_pfmemalloc(page); -} -#endif /* KERNEL_VERSION(4,2,0) */ +#endif /* KERNEL_VERSION(3,6,0) */ #if LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0) static inline void @@ -108,53 +107,26 @@ kal_netif_trans_update(struct net_device *dev) } #endif /* KERNEL_VERSION(4,7,0) */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0) -static inline dma_addr_t -kal_dma_map_page_attrs(struct device *dev, struct page *page, - size_t offset, size_t size, enum dma_data_direction dir, - unsigned long attrs) -{ - return dma_map_page(dev, page, offset, size, dir); -} +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) static inline void -kal_dma_unmap_page_attrs(struct device *dev, dma_addr_t addr, - size_t size, enum dma_data_direction dir, - unsigned long attrs) -{ - dma_unmap_page(dev, addr, size, dir); -} -#else -static inline dma_addr_t -kal_dma_map_page_attrs(struct device *dev, struct page *page, - size_t offset, size_t size, enum dma_data_direction dir, - unsigned long attrs) +kal_time_val_get(struct timeval *tv) { - return dma_map_page_attrs(dev, page, offset, size, dir, attrs); + do_gettimeofday(tv); } +#elif LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) static inline void -kal_dma_unmap_page_attrs(struct device *dev, dma_addr_t addr, - size_t size, enum dma_data_direction dir, - unsigned long attrs) -{ - dma_unmap_page_attrs(dev, addr, size, dir, attrs); -} -#endif /* KERNEL_VERSION(4,10,0) */ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) -static inline s64 -kal_time_usecs(void) +kal_time_val_get(struct timeval *tv) { - struct timeval tv; - do_gettimeofday(&tv); - return tv.tv_sec * 1000000 + tv.tv_usec; + struct timespec64 ts; + ktime_get_real_ts64(&ts); + tv->tv_sec = ts.tv_sec; + tv->tv_usec = ts.tv_nsec / 1000; } #else -static inline s64 -kal_time_usecs(void) +static inline void +kal_time_val_get(struct timespec64 *tv) { - struct timespec64 ts; - ktime_get_real_ts64(&ts); - return ts.tv_sec * 1000000 + ts.tv_nsec / 1000; + ktime_get_real_ts64(tv); } #endif /* KERNEL_VERSION(3,17,0) */ @@ -186,16 +158,6 @@ kal_copy_to_user(void __user *to, const void *from, return copy_to_user(to, from, len); } -static inline int -kal_support_paged_skb(void) -{ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) - return 1; -#else - return 0; -#endif -} - /*! * System abstraction */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_main.c b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_main.c index abf1746bc435..cc40fd76d224 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_main.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_main.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -66,6 +66,7 @@ #include #include #include +#include #include #include #include @@ -155,13 +156,6 @@ MODULE_PARM_DESC(rx_batching, "Rx batching mode (default 0 in single fill mode)"); /*! \endcond */ -/*! \cond */ -static int page_buffer_mode = -1; -MODULE_PARAM(page_buffer_mode, int, 0); -MODULE_PARM_DESC(rx_batching, -"Page buffer mode (default -1 do not override, 0 forced disable, 1 forced enable)"); -/*! \endcond */ - typedef int (*drv_ops_attach)(struct pdma_dev *dev); struct bcmcnet_drv_ops { @@ -240,7 +234,11 @@ ngknet_pkt_dump(uint8_t *data, int len) static void ngknet_pkt_stats(struct pdma_dev *pdev, int dir) { - s64 ts0[2], ts1[2]; +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) + static struct timeval tv0[2], tv1[2]; +#else + static struct timespec64 tv0[2], tv1[2]; +#endif static uint32_t pkts[2] = {0}, prts[2] = {0}; static uint64_t intrs = 0; uint32_t iv_time; @@ -259,12 +257,18 @@ ngknet_pkt_stats(struct pdma_dev *pdev, int dir) } if (pkts[dir] == 0) { - ts0[dir] = kal_time_usecs(); + kal_time_val_get(&tv0[dir]); intrs = pdev->stats.intrs; } if (++pkts[dir] >= boudary) { - ts1[dir] = kal_time_usecs(); - iv_time = ts1[dir] - ts0[dir]; + kal_time_val_get(&tv1[dir]); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) + iv_time = (tv1[dir].tv_sec - tv0[dir].tv_sec) * 1000000 + + (tv1[dir].tv_usec - tv0[dir].tv_usec); +#else + iv_time = (tv1[dir].tv_sec - tv0[dir].tv_sec) * 1000000 + + (tv1[dir].tv_nsec - tv0[dir].tv_nsec) / 1000; +#endif pps = boudary * 1000 / (iv_time / 1000); prts[dir]++; /* pdev->stats.intrs is reset and re-count from 0. */ @@ -356,7 +360,7 @@ ngknet_rx_frame_process(struct net_device *ndev, struct sk_buff **oskb) skb_trim(skb, skb->len - ETH_FCS_LEN); pkh->data_len -= ETH_FCS_LEN; - if (priv->netif.flags & NGKNET_NETIF_F_RCPU_ENCAP) { + if (priv->flags & NGKNET_NETIF_F_RCPU_ENCAP) { /* Set up RCPU header */ memcpy(skb->data, skb->data + PKT_HDR_SIZE + meta_len, 2 * ETH_ALEN); if (*(uint32_t *)&dev->rcpu_ctrl.dst_mac[0] != 0 || @@ -386,9 +390,11 @@ ngknet_rx_frame_process(struct net_device *ndev, struct sk_buff **oskb) /* Optional callback handle */ if (dev->cbc->rx_cb) { struct ngknet_callback_desc *cbd = NGKNET_SKB_CB(skb); - cbd->dinfo = &dev->dev_info; - cbd->netif = &priv->netif; - if (priv->netif.flags & NGKNET_NETIF_F_RCPU_ENCAP) { + cbd->dev_no = dev->dev_no; + cbd->dev_id = dev->pdma_dev.dev_id; + cbd->type_str = dev->type_str; + cbd->priv = priv; + if (priv->flags & NGKNET_NETIF_F_RCPU_ENCAP) { cbd->pmd = skb->data + PKT_HDR_SIZE; cbd->pkt_len = ntohs(rch->data_len); } else { @@ -396,12 +402,12 @@ ngknet_rx_frame_process(struct net_device *ndev, struct sk_buff **oskb) cbd->pkt_len = pkh->data_len; } cbd->pmd_len = meta_len; - skb = dev->cbc->rx_cb(ndev, skb); + skb = dev->cbc->rx_cb(skb); if (!skb) { *oskb = NULL; return SHR_E_UNAVAIL; } - if (priv->netif.flags & NGKNET_NETIF_F_RCPU_ENCAP) { + if (priv->flags & NGKNET_NETIF_F_RCPU_ENCAP) { rch = (struct ngknet_rcpu_hdr *)skb->data; rch->data_len = htons(skb->len - PKT_HDR_SIZE - meta_len); } @@ -444,8 +450,7 @@ ngknet_netif_recv(struct net_device *ndev, struct sk_buff *skb) } } - DBG_VERB(("Rx packet sent up to ndev%d (%d bytes).\n", - priv->netif.id, skb->len)); + DBG_VERB(("Rx packet sent up to ndev%d (%d bytes).\n", priv->id, skb->len)); if (debug & DBG_LVL_PDMP) { ngknet_pkt_dump(skb->data, skb->len); } @@ -459,8 +464,14 @@ ngknet_netif_recv(struct net_device *ndev, struct sk_buff *skb) } } + if (!(priv->flags & NGKNET_NETIF_F_RCPU_ENCAP) && + ndev->features & NETIF_F_HW_VLAN_CTAG_RX && + pkh->attrs & PDMA_RX_STRIP_TAG) { + kal_vlan_hwaccel_put_tag(skb, ETH_P_8021Q, priv->vlan); + } + proto = eth_type_trans(skb, ndev); - if (priv->netif.flags & NGKNET_NETIF_F_RCPU_ENCAP) { + if (priv->flags & NGKNET_NETIF_F_RCPU_ENCAP) { skb->protocol = htons(dev->rcpu_ctrl.eth_type); } else if (!(pkh->attrs & PDMA_RX_SET_PROTO) || !skb->protocol) { skb->protocol = proto; @@ -481,14 +492,14 @@ ngknet_netif_recv(struct net_device *ndev, struct sk_buff *skb) napi = (struct napi_struct *)pdev->ctrl.grp[gi].intr_hdl[qi].priv; } - /* FIXME: File CSP on KASAN warning on use-after-free in ngknet_netif_recv */ - skb_len = skb->len; + /* FIXME: File CSP on KASAN warning on use-after-free in ngknet_netif_recv */ + skb_len = skb->len; napi_gro_receive(napi, skb); + /* Update accounting */ priv->stats.rx_packets++; priv->stats.rx_bytes += skb_len; - /* Rate limit */ if (rx_rate_limit >= 0) { if (!ngknet_rx_rate_limit_started()) { @@ -536,8 +547,9 @@ ngknet_frame_recv(struct pdma_dev *pdev, int queue, void *buf) /* Populate header, checksum status, VLAN, and protocol */ priv = netdev_priv(ndev); - if (!netif_carrier_ok(ndev) || - SHR_FAILURE(ngknet_netif_recv(ndev, skb))) { + if (netif_carrier_ok(ndev)) { + ngknet_netif_recv(ndev, skb); + } else { priv->stats.rx_dropped++; rv = SHR_E_UNAVAIL; } @@ -552,8 +564,9 @@ ngknet_frame_recv(struct pdma_dev *pdev, int queue, void *buf) /* Handle mirrored packet */ if (mndev && mskb) { priv = netdev_priv(mndev); - if (!netif_carrier_ok(mndev) || - SHR_FAILURE(ngknet_netif_recv(mndev, mskb))) { + if (netif_carrier_ok(mndev)) { + ngknet_netif_recv(mndev, mskb); + } else { priv->stats.rx_dropped++; dev_kfree_skb_any(mskb); } @@ -625,7 +638,7 @@ ngknet_ptp_tx_config(struct net_device *ndev, struct sk_buff *skb) struct ngknet_dev *dev = priv->bkn_dev; int rv; - if (priv->netif.type == NGKNET_NETIF_T_PORT) { + if (priv->type == NGKNET_NETIF_T_PORT) { rv = ngknet_ptp_tx_meta_set(ndev, skb); if (SHR_FAILURE(rv)) { return rv; @@ -670,7 +683,7 @@ ngknet_tx_frame_process(struct net_device *ndev, struct sk_buff **oskb) uint16_t tpid; /* Set up packet header */ - if (priv->netif.flags & NGKNET_NETIF_F_RCPU_ENCAP) { + if (priv->flags & NGKNET_NETIF_F_RCPU_ENCAP) { /* RCPU encapsulation packet */ data_len = pkh->attrs & PDMA_TX_HDR_COOKED ? pkh->data_len - ETH_FCS_LEN : ntohs(rch->data_len); @@ -715,8 +728,8 @@ ngknet_tx_frame_process(struct net_device *ndev, struct sk_buff **oskb) return SHR_E_NONE; } meta_len = 0; - if (priv->netif.type == NGKNET_NETIF_T_PORT) { - meta_len = priv->netif.meta_len; + if (priv->type == NGKNET_NETIF_T_PORT) { + meta_len = priv->meta_len; if (!meta_len) { printk("Tx abort: no metadata\n"); return SHR_E_UNAVAIL; @@ -739,15 +752,12 @@ ngknet_tx_frame_process(struct net_device *ndev, struct sk_buff **oskb) pkh->data_len = skb->len - PKT_HDR_SIZE - meta_len + ETH_FCS_LEN; pkh->meta_len = meta_len; pkh->attrs = 0; - if (priv->netif.type == NGKNET_NETIF_T_PORT) { + if (priv->type == NGKNET_NETIF_T_PORT) { /* Send to physical port using netif metadata */ - if (priv->netif.meta_off) { - memmove(skb->data + PKT_HDR_SIZE, - skb->data + PKT_HDR_SIZE + meta_len, - priv->netif.meta_off); + if (priv->meta_off) { + memmove(skb->data + PKT_HDR_SIZE, skb->data + PKT_HDR_SIZE + meta_len, priv->meta_off); } - memcpy(skb->data + PKT_HDR_SIZE + priv->netif.meta_off, - priv->netif.meta_data, priv->netif.meta_len); + memcpy(skb->data + PKT_HDR_SIZE + priv->meta_off, priv->meta_data, priv->meta_len); pkh->attrs |= PDMA_TX_HIGIG_PKT; } pkh->pkt_sig = dev->rcpu_ctrl.pkt_sig; @@ -761,9 +771,7 @@ ngknet_tx_frame_process(struct net_device *ndev, struct sk_buff **oskb) tag_len = (tpid == ETH_P_8021Q || tpid == ETH_P_8021AD) ? VLAN_HLEN : 0; /* Need to add VLAN tag if packet is untagged */ - if (tag_len == 0 && (priv->netif.vlan & 0xfff) != 0 && - (!(pkh->attrs & PDMA_TX_HIGIG_PKT) || - priv->netif.flags & NGKNET_NETIF_F_ADD_TAG)) { + if (!tag_len && (!(pkh->attrs & PDMA_TX_HIGIG_PKT) || priv->flags & NGKNET_NETIF_F_ADD_TAG)) { copy_len = PKT_HDR_SIZE + pkh->meta_len + 2 * ETH_ALEN; if (skb_header_cloned(skb) || skb_headroom(skb) < VLAN_HLEN) { nskb = skb_copy_expand(skb, VLAN_HLEN, 0, GFP_ATOMIC); @@ -779,8 +787,8 @@ ngknet_tx_frame_process(struct net_device *ndev, struct sk_buff **oskb) data = skb->data + PKT_HDR_SIZE + pkh->meta_len; data[12] = 0x81; data[13] = 0x00; - data[14] = priv->netif.vlan >> 8 & 0xf; - data[15] = priv->netif.vlan & 0xff; + data[14] = priv->vlan >> 8 & 0xf; + data[15] = priv->vlan & 0xff; pkh->data_len += VLAN_HLEN; tag_len = VLAN_HLEN; } @@ -788,8 +796,10 @@ ngknet_tx_frame_process(struct net_device *ndev, struct sk_buff **oskb) /* Optional callback handle */ if (dev->cbc->tx_cb) { struct ngknet_callback_desc *cbd = NGKNET_SKB_CB(skb); - cbd->dinfo = &dev->dev_info; - cbd->netif = &priv->netif; + cbd->dev_no = dev->dev_no; + cbd->dev_id = dev->pdma_dev.dev_id; + cbd->type_str = dev->type_str; + cbd->priv = priv; cbd->pmd = skb->data + PKT_HDR_SIZE; cbd->pmd_len = pkh->meta_len; cbd->pkt_len = skb->len - PKT_HDR_SIZE - pkh->meta_len; @@ -808,8 +818,7 @@ ngknet_tx_frame_process(struct net_device *ndev, struct sk_buff **oskb) pad_len = ETH_ZLEN + ETH_FCS_LEN + tag_len; if (pkh->data_len < pad_len && !(pkh->attrs & PDMA_TX_NO_PAD)) { pkh->data_len = pad_len; - if (skb_padto(skb, - PKT_HDR_SIZE + pkh->meta_len + pkh->data_len - ETH_FCS_LEN)) { + if (skb_padto(skb, PKT_HDR_SIZE + pkh->meta_len + pkh->data_len)) { if (!nskb) { *oskb = NULL; } @@ -823,52 +832,6 @@ ngknet_tx_frame_process(struct net_device *ndev, struct sk_buff **oskb) return SHR_E_NONE; } -/*! - * Network device detach callback - */ -static void -ngknet_ndev_detach(struct pdma_dev *pdev) -{ - struct ngknet_dev *dev = (struct ngknet_dev *)pdev->priv; - int vdi; - - netif_tx_lock(dev->net_dev); - netif_device_detach(dev->net_dev); - netif_tx_unlock(dev->net_dev); - - for (vdi = 1; vdi <= NUM_VDEV_MAX; vdi++) { - if (!dev->vdev[vdi]) { - continue; - } - netif_tx_lock(dev->vdev[vdi]); - netif_device_detach(dev->vdev[vdi]); - netif_tx_unlock(dev->vdev[vdi]); - } -} - -/*! - * Network device attach callback - */ -static void -ngknet_ndev_attach(struct pdma_dev *pdev) -{ - struct ngknet_dev *dev = (struct ngknet_dev *)pdev->priv; - int vdi; - - netif_tx_lock(dev->net_dev); - netif_device_attach(dev->net_dev); - netif_tx_unlock(dev->net_dev); - - for (vdi = 1; vdi <= NUM_VDEV_MAX; vdi++) { - if (!dev->vdev[vdi]) { - continue; - } - netif_tx_lock(dev->vdev[vdi]); - netif_device_attach(dev->vdev[vdi]); - netif_tx_unlock(dev->vdev[vdi]); - } -} - /*! * Suspend Tx queue callback */ @@ -1042,7 +1005,7 @@ ngknet_isr(void *isr_data) } if (iv) { - DBG_IRQ(("Got interrupt on device %d.\n", dev->dev_info.dev_no)); + DBG_IRQ(("Got interrupt on device %d.\n", dev->dev_no)); pdev->stats.intrs++; return IRQ_HANDLED; } else { @@ -1094,8 +1057,8 @@ static int ngknet_dev_hnet_wait(struct pdma_dev *pdev) { struct ngknet_dev *dev = (struct ngknet_dev *)pdev->priv; - uint32_t bmp; - int budget, qi; + int qi; + int rv; while (!kthread_should_stop()) { wait_event_interruptible(dev->hnet_wq, @@ -1105,22 +1068,12 @@ ngknet_dev_hnet_wait(struct pdma_dev *pdev) continue; } atomic_set(&dev->hnet_active, 0); - + for (qi = 0; qi < pdev->ctrl.nb_txq; qi++) { + do { + rv = pdev->pkt_xmit(pdev, qi, 0); + } while (rv == SHR_E_NONE); + } schedule_work(&dev->hnet_work); - - do { - bmp = 0x0; - for (qi = 0; qi < pdev->ctrl.nb_txq; qi++) { - bmp |= 1 << qi; - budget = pdev->ctrl.budget; - while (budget--) { - if (SHR_FAILURE(pdev->pkt_xmit(pdev, qi, 0))) { - bmp &= ~(1 << qi); - break; - } - } - } - } while (bmp); } return 0; @@ -1197,14 +1150,14 @@ ngknet_enet_open(struct net_device *ndev) return -EPERM; } - if (priv->netif.id <= 0) { + if (priv->id <= 0) { /* Register interrupt handler */ - ngbde_kapi_intr_connect(dev->dev_info.dev_no, 0, ngknet_isr, dev); + ngbde_kapi_intr_connect(dev->dev_no, 0, ngknet_isr, dev); /* Start PDMA device */ rv = bcmcnet_pdma_dev_start(pdev); if (SHR_FAILURE(rv)) { - ngbde_kapi_intr_disconnect(dev->dev_info.dev_no, 0); + ngbde_kapi_intr_disconnect(dev->dev_no, 0); return -EPERM; } @@ -1216,12 +1169,12 @@ ngknet_enet_open(struct net_device *ndev) /* Notify the stack of the actual queue counts. */ rv = netif_set_real_num_rx_queues(dev->net_dev, pdev->ctrl.nb_rxq); if (rv < 0) { - ngbde_kapi_intr_disconnect(dev->dev_info.dev_no, 0); + ngbde_kapi_intr_disconnect(dev->dev_no, 0); return rv; } rv = netif_set_real_num_tx_queues(dev->net_dev, pdev->ctrl.nb_txq); if (rv < 0) { - ngbde_kapi_intr_disconnect(dev->dev_info.dev_no, 0); + ngbde_kapi_intr_disconnect(dev->dev_no, 0); return rv; } @@ -1276,12 +1229,15 @@ ngknet_enet_stop(struct net_device *ndev) netif_tx_stop_all_queues(ndev); - if (priv->netif.id <= 0) { + if (priv->id <= 0) { /* Stop rate limit */ if (rx_rate_limit >= 0) { ngknet_rx_rate_limit_stop(dev); } + /* Suspend PDMA device */ + bcmcnet_pdma_dev_suspend(pdev); + for (gi = 0; gi < pdev->num_groups; gi++) { if (!pdev->ctrl.grp[gi].attached) { continue; @@ -1303,7 +1259,7 @@ ngknet_enet_stop(struct net_device *ndev) bcmcnet_pdma_dev_stop(pdev); /* Unregister interrupt handler */ - ngbde_kapi_intr_disconnect(dev->dev_info.dev_no, 0); + ngbde_kapi_intr_disconnect(dev->dev_no, 0); } return 0; @@ -1323,13 +1279,13 @@ ngknet_start_xmit(struct sk_buff *skb, struct net_device *ndev) int queue; int rv; - DBG_VERB(("Tx packet from ndev%d (%d bytes).\n", priv->netif.id, skb->len)); + DBG_VERB(("Tx packet from ndev%d (%d bytes).\n", priv->id, skb->len)); if (debug & DBG_LVL_PDMP) { ngknet_pkt_dump(skb->data, skb->len); } /* Do not transmit on base device */ - if (priv->netif.id <= 0) { + if (priv->id <= 0) { priv->stats.tx_dropped++; dev_kfree_skb_any(skb); return NETDEV_TX_OK; @@ -1468,7 +1424,7 @@ ngknet_do_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd) return -EFAULT; } - if (priv->netif.type != NGKNET_NETIF_T_PORT) { + if (priv->type != NGKNET_NETIF_T_PORT) { return -ENOSYS; } @@ -1564,7 +1520,7 @@ static const struct net_device_ops ngknet_netdev_ops = { }; static void -ngknet_get_drvinfo(struct net_device *ndev, struct ethtool_drvinfo *drvinfo) +ngknet_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo) { strlcpy(drvinfo->driver, "linux_ngknet", sizeof(drvinfo->driver)); snprintf(drvinfo->version, sizeof(drvinfo->version), "%d", NGKNET_IOC_VERSION); @@ -1595,41 +1551,11 @@ ngknet_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info) } #endif -#if NGKNET_ETHTOOL_LINK_SETTINGS -static int -ngknet_get_link_ksettings(struct net_device *ndev, - struct ethtool_link_ksettings *cmd) -{ - struct ngknet_private *priv = netdev_priv(ndev); - - cmd->base.speed = priv->link_settings.speed; - cmd->base.duplex = priv->link_settings.duplex; - - return 0; -} - -static int -ngknet_set_link_ksettings(struct net_device *ndev, - const struct ethtool_link_ksettings *cmd) -{ - struct ngknet_private *priv = netdev_priv(ndev); - - priv->link_settings.speed = cmd->base.speed; - priv->link_settings.duplex = cmd->base.speed ? DUPLEX_FULL : 0; - - return 0; -} -#endif - static const struct ethtool_ops ngknet_ethtool_ops = { .get_drvinfo = ngknet_get_drvinfo, #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) .get_ts_info = ngknet_get_ts_info, #endif -#if NGKNET_ETHTOOL_LINK_SETTINGS - .get_link_ksettings = ngknet_get_link_ksettings, - .set_link_ksettings = ngknet_set_link_ksettings, -#endif }; /*! @@ -1682,12 +1608,6 @@ ngknet_ndev_init(ngknet_netif_t *netif, struct net_device **nd) ndev->mtu = default_mtu ? default_mtu : rx_buffer_size; } - /* MTU range: 32 - 9198 */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) - ndev->min_mtu = PKT_HDR_SIZE; /* Min 50-byte length of packet with RCPU-encap */ - ndev->max_mtu = rx_buffer_size - (ETH_HLEN + ETH_FCS_LEN); -#endif - ndev->netdev_ops = &ngknet_netdev_ops; ndev->ethtool_ops = &ngknet_ethtool_ops; @@ -1705,9 +1625,9 @@ ngknet_ndev_init(ngknet_netif_t *netif, struct net_device **nd) memcpy(ndev->dev_addr, ma, ETH_ALEN); /* Initialize the device features */ - ndev->hw_features = NETIF_F_RXCSUM | NETIF_F_HW_CSUM | + ndev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_TX; - ndev->features = ndev->hw_features | NETIF_F_HIGHDMA; + ndev->features |= NETIF_F_HIGHDMA | NETIF_F_HW_VLAN_CTAG_RX; /* Register the kernel network device */ rv = register_netdev(ndev); @@ -1755,7 +1675,7 @@ ngknet_pdev_init(struct ngknet_dev *dev) int rv; /* Initialize PDMA control structure */ - pdev->unit = dev->dev_info.dev_no; + pdev->unit = dev->dev_no; pdev->priv = dev; pdev->ctrl.dev = pdev; pdev->ctrl.hw_addr = dev->base_addr; @@ -1765,8 +1685,6 @@ ngknet_pdev_init(struct ngknet_dev *dev) pdev->dev_read32 = ngknet_dev_read32; pdev->dev_write32 = ngknet_dev_write32; pdev->pkt_recv = ngknet_frame_recv; - pdev->ndev_detach = ngknet_ndev_detach; - pdev->ndev_attach = ngknet_ndev_attach; pdev->tx_suspend = ngknet_tx_suspend; pdev->tx_resume = ngknet_tx_resume; pdev->intr_unmask = ngknet_intr_enable; @@ -1823,9 +1741,10 @@ ngknet_dev_info_get(int dn) return SHR_E_ACCESS; } - dev->dev_info.dev_no = dn; - strlcpy(dev->dev_info.type_str, drv_ops[dev->pdma_dev.dev_type]->drv_desc, - sizeof(dev->dev_info.type_str)); + dev->dev_no = dn; + strlcpy(dev->type_str, + drv_ops[dev->pdma_dev.dev_type]->drv_desc, + sizeof(dev->type_str)); return SHR_E_NONE; } @@ -1894,15 +1813,25 @@ ngknet_dev_probe(int dn, ngknet_netif_t *netif) priv = netdev_priv(ndev); priv->net_dev = ndev; priv->bkn_dev = dev; - - netif->id = 0; + priv->id = 0; + priv->type = netif->type; + if (priv->type == NGKNET_NETIF_T_PORT) { + priv->meta_off = netif->meta_off; + priv->meta_len = netif->meta_len; + memcpy(priv->meta_data, netif->meta_data, priv->meta_len); + } + priv->flags = netif->flags; + priv->vlan = netif->vlan; + priv->chan = netif->chan; + memcpy(priv->user_data, netif->user_data, sizeof(priv->user_data)); + + netif->id = priv->id; memcpy(netif->macaddr, ndev->dev_addr, ETH_ALEN); netif->mtu = ndev->mtu; memcpy(netif->name, ndev->name, sizeof(netif->name) - 1); - memcpy(&priv->netif, netif, sizeof(priv->netif)); - if (priv->netif.flags & NGKNET_NETIF_F_BIND_CHAN) { - dev->bdev[priv->netif.chan] = ndev; + if (priv->flags & NGKNET_NETIF_F_BIND_CHAN) { + dev->bdev[priv->chan] = ndev; } /* Register for napi */ @@ -1939,7 +1868,7 @@ ngknet_dev_probe(int dn, ngknet_netif_t *netif) return SHR_E_INTERNAL; } cpumask_clear(&mask); - cpumask_set_cpu(num_online_cpus() / 2, &mask); + cpumask_set_cpu(1, &mask); set_cpus_allowed_ptr(dev->hnet_task, &mask); INIT_WORK(&dev->hnet_work, ngknet_dev_hnet_schedule); } @@ -2077,8 +2006,7 @@ ngknet_netif_create(struct ngknet_dev *dev, ngknet_netif_t *netif) if (netif->name[0] == '\0') { /* Reserve 6 vacancies for base&vitual device number, i.e. nameAB_XYZ */ if (strlen(base_dev_name) < IFNAMSIZ - 6) { - snprintf(netif->name, IFNAMSIZ, "%s%d%s", - base_dev_name, dev->dev_info.dev_no, "_"); + snprintf(netif->name, IFNAMSIZ, "%s%d%s", base_dev_name, dev->dev_no, "_"); strncat(netif->name, "%d", 3); } else { DBG_WARN(("Too long network device name: %s.\n", base_dev_name)); @@ -2120,27 +2048,36 @@ ngknet_netif_create(struct ngknet_dev *dev, ngknet_netif_t *netif) priv = netdev_priv(ndev); priv->net_dev = ndev; priv->bkn_dev = dev; - - netif->id = id; + priv->id = id; + priv->type = netif->type; + if (priv->type == NGKNET_NETIF_T_PORT) { + priv->meta_off = netif->meta_off; + priv->meta_len = netif->meta_len; + memcpy(priv->meta_data, netif->meta_data, priv->meta_len); + } + priv->flags = netif->flags; + priv->vlan = netif->vlan; + priv->chan = netif->chan; + memcpy(priv->user_data, netif->user_data, sizeof(priv->user_data)); + + netif->id = priv->id; memcpy(netif->macaddr, ndev->dev_addr, ETH_ALEN); netif->mtu = ndev->mtu; memcpy(netif->name, ndev->name, sizeof(netif->name) - 1); - memcpy(&priv->netif, netif, sizeof(priv->netif)); - if (priv->netif.flags & NGKNET_NETIF_F_BIND_CHAN) { - dev->bdev[priv->netif.chan] = ndev; + if (priv->flags & NGKNET_NETIF_F_BIND_CHAN) { + dev->bdev[priv->chan] = ndev; } /* Optional netif create callback handle */ if (dev->cbc->netif_create_cb) { - if (dev->cbc->netif_create_cb(ndev)) { - DBG_WARN(("Network interface callback (create) failed for '%s'\n", - ndev->name)); + rv = dev->cbc->netif_create_cb(ndev); + if (rv) { + DBG_WARN(("Netif create callback failed with rv %d for '%s'\n", rv, ndev->name)); } } - DBG_VERB(("Created virtual network device %s (%d).\n", - ndev->name, priv->netif.id)); + DBG_VERB(("Created virtual network device %s (%d).\n", ndev->name, priv->id)); return SHR_E_NONE; } @@ -2179,8 +2116,8 @@ ngknet_netif_destroy(struct ngknet_dev *dev, int id) set_current_state(TASK_RUNNING); } - if (priv->netif.flags & NGKNET_NETIF_F_BIND_CHAN) { - dev->bdev[priv->netif.chan] = NULL; + if (priv->flags & NGKNET_NETIF_F_BIND_CHAN) { + dev->bdev[priv->chan] = NULL; } dev->vdev[id] = NULL; @@ -2198,14 +2135,12 @@ ngknet_netif_destroy(struct ngknet_dev *dev, int id) /* Optional netif destroy callback handle */ if (dev->cbc->netif_destroy_cb) { - if (dev->cbc->netif_destroy_cb(ndev)) { - DBG_WARN(("Network interface callback (destroy) failed for '%s'\n", - ndev->name)); + int rv = dev->cbc->netif_destroy_cb(ndev); + if (rv) { + DBG_WARN(("Netif destroy callback failed with rv %d for '%s'\n", rv, ndev->name)); } } - - DBG_VERB(("Removing virtual network device %s (%d).\n", - ndev->name, priv->netif.id)); + DBG_VERB(("Removing virtual network device %s (%d).\n", ndev->name, priv->id)); netif_carrier_off(ndev); unregister_netdev(ndev); @@ -2235,7 +2170,18 @@ ngknet_netif_get(struct ngknet_dev *dev, int id, ngknet_netif_t *netif) } priv = netdev_priv(ndev); - memcpy(netif, &priv->netif, sizeof(*netif)); + netif->id = priv->id; + netif->type = priv->type; + netif->flags = priv->flags; + netif->vlan = priv->vlan; + memcpy(netif->macaddr, priv->net_dev->dev_addr, ETH_ALEN); + netif->mtu = priv->net_dev->mtu; + netif->chan = priv->chan; + memcpy(netif->name, priv->net_dev->name, sizeof(netif->name) - 1); + netif->meta_off = priv->meta_off; + netif->meta_len = priv->meta_len; + memcpy(netif->meta_data, priv->meta_data, netif->meta_len); + memcpy(netif->user_data, priv->user_data, sizeof(netif->user_data)); num = (long)dev->vdev[0]; for (id++; id < num + 1; id++) { @@ -2247,8 +2193,7 @@ ngknet_netif_get(struct ngknet_dev *dev, int id, ngknet_netif_t *netif) spin_unlock_irqrestore(&dev->lock, flags); - DBG_VERB(("Got virtual network device %s (%d).\n", - ndev->name, priv->netif.id)); + DBG_VERB(("Got virtual network device %s (%d).\n", ndev->name, priv->id)); return SHR_E_NONE; } @@ -2287,12 +2232,6 @@ ngknet_rx_rate_limit_set(int rate_limit) rx_rate_limit = rate_limit; } -int -ngknet_page_buffer_mode_get(void) -{ - return page_buffer_mode; -} - /*! * Generic module functions */ @@ -2405,8 +2344,7 @@ ngknet_ioctl(struct file *file, unsigned int cmd, unsigned long arg) } if (!strcasecmp(dev_cfg->type_str, drv_ops[dt]->drv_desc)) { pdev->dev_type = dt; - strlcpy(dev->dev_info.var_str, dev_cfg->var_str, - sizeof(dev->dev_info.var_str)); + strlcpy(dev->var_str, dev_cfg->var_str, sizeof(dev->var_str)); break; } } @@ -2419,7 +2357,7 @@ ngknet_ioctl(struct file *file, unsigned int cmd, unsigned long arg) for (gi = 0; gi < NUM_GRP_MAX; gi++) { if (1 << gi & dev_cfg->bm_grp) { pdev->ctrl.nb_grp++; - pdev->ctrl.grp[gi].attached = true; + pdev->ctrl.grp[gi].attached = 1; pdev->num_groups = gi + 1; } } @@ -2434,7 +2372,7 @@ ngknet_ioctl(struct file *file, unsigned int cmd, unsigned long arg) break; } if (dev->cbc->dev_init_cb) { - dev->cbc->dev_init_cb(&dev->dev_info); + dev->cbc->dev_init_cb(dev); } if (kal_copy_to_user((void *)(unsigned long)ioc.op.data.buf, dev_cfg, diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_main.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_main.h index e31d4bb257ab..71ea0fb84fdf 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_main.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_main.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -23,12 +23,18 @@ #ifndef NGKNET_MAIN_H #define NGKNET_MAIN_H -#include #include #include #include #include +/*! Maximum number of PDMA devices supported */ +#ifdef NGBDE_NUM_SWDEV_MAX +#define NUM_PDMA_DEV_MAX NGBDE_NUM_SWDEV_MAX +#else +#define NUM_PDMA_DEV_MAX 16 +#endif + /*! * Debug levels */ @@ -62,8 +68,11 @@ * Device description */ struct ngknet_dev { - /* Device information */ - ngknet_dev_info_t dev_info; + /*! Device type string */ + char type_str[NGKNET_DEV_NAME_MAX]; + + /*! Device type string */ + char var_str[NGKNET_DEV_NAME_MAX]; /*! Base address for PCI register access */ volatile void *base_addr; @@ -80,6 +89,9 @@ struct ngknet_dev { /*! PDMA device */ struct pdma_dev pdma_dev; + /*! Device number (from BDE) */ + int dev_no; + /*! Virtual network devices, 0 is reserved for valid number of devices. */ struct net_device *vdev[NUM_VDEV_MAX + 1]; @@ -147,8 +159,32 @@ struct ngknet_private { /*! NGKNET device */ struct ngknet_dev *bkn_dev; - /*! Network interface */ - ngknet_netif_t netif; + /*! Network interface ID */ + int id; + + /*! Network interface type */ + int type; + + /*! Network interface flags */ + uint32_t flags; + + /*! Network interface vlan */ + uint32_t vlan; + + /*! Network interface bound to */ + uint32_t chan; + + /*! Metadata offset from Ethernet header */ + uint32_t meta_off; + + /*! Metadata length */ + uint32_t meta_len; + + /*! Metadata used to send packets to physical port */ + uint8_t meta_data[NGKNET_NETIF_META_MAX]; + + /*! User data gotten back through callbacks */ + uint8_t user_data[NGKNET_NETIF_USER_DATA]; /*! Users of this network interface */ int users; @@ -162,11 +198,7 @@ struct ngknet_private { /*! HW timestamp Tx type */ int hwts_tx_type; -#if NGKNET_ETHTOOL_LINK_SETTINGS - /* Link settings */ - struct ethtool_link_settings link_settings; -#endif - /*! Matched callback filter */ + /*! Matched callback filter */ struct ngknet_filter_s *filt_cb; }; @@ -251,13 +283,5 @@ ngknet_rx_rate_limit_get(void); extern void ngknet_rx_rate_limit_set(int rate_limit); -/*! - * \brief Get page buffer mode. - * - * \retval Current page buffer mode. - */ -extern int -ngknet_page_buffer_mode_get(void); - #endif /* NGKNET_MAIN_H */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_procfs.c b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_procfs.c index ad3aefe83b32..60b59c0761d6 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_procfs.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_procfs.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -88,14 +88,24 @@ proc_debug_level_release(struct inode *inode, struct file *file) return single_release(inode, file); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) +static struct file_operations proc_debug_level_fops = { + owner: THIS_MODULE, + open: proc_debug_level_open, + read: seq_read, + write: proc_debug_level_write, + llseek: seq_lseek, + release: proc_debug_level_release, +}; +#else static struct proc_ops proc_debug_level_fops = { - PROC_OWNER(THIS_MODULE) - .proc_open = proc_debug_level_open, - .proc_read = seq_read, - .proc_write = proc_debug_level_write, - .proc_lseek = seq_lseek, - .proc_release = proc_debug_level_release, + proc_open: proc_debug_level_open, + proc_read: seq_read, + proc_write: proc_debug_level_write, + proc_lseek: seq_lseek, + proc_release: proc_debug_level_release, }; +#endif static int proc_device_info_show(struct seq_file *m, void *v) @@ -141,15 +151,9 @@ proc_device_info_show(struct seq_file *m, void *v) for (qi = 0; qi < info->nb_rx_queues; qi++) { seq_printf(m, "nb_rx_desc[%d]: %d\n", qi, info->nb_rx_desc[qi]); } - for (qi = 0; qi < info->nb_rx_queues; qi++) { - seq_printf(m, "rxq_state[%d]: 0x%x\n", qi, info->rxq_state[qi]); - } for (qi = 0; qi < info->nb_tx_queues; qi++) { seq_printf(m, "nb_tx_desc[%d]: %d\n", qi, info->nb_tx_desc[qi]); } - for (qi = 0; qi < info->nb_tx_queues; qi++) { - seq_printf(m, "txq_state[%d]: 0x%x\n", qi, info->txq_state[qi]); - } } if (!ai) { @@ -174,13 +178,22 @@ proc_device_info_release(struct inode *inode, struct file *file) return single_release(inode, file); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) +static struct file_operations proc_device_info_fops = { + owner: THIS_MODULE, + open: proc_device_info_open, + read: seq_read, + llseek: seq_lseek, + release: proc_device_info_release, +}; +#else static struct proc_ops proc_device_info_fops = { - PROC_OWNER(THIS_MODULE) - .proc_open = proc_device_info_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_release = proc_device_info_release, + proc_open: proc_device_info_open, + proc_read: seq_read, + proc_lseek: seq_lseek, + proc_release: proc_device_info_release, }; +#endif static int proc_filter_info_show(struct seq_file *m, void *v) @@ -256,13 +269,22 @@ proc_filter_info_release(struct inode *inode, struct file *file) return single_release(inode, file); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) +static struct file_operations proc_filter_info_fops = { + owner: THIS_MODULE, + open: proc_filter_info_open, + read: seq_read, + llseek: seq_lseek, + release: proc_filter_info_release, +}; +#else static struct proc_ops proc_filter_info_fops = { - PROC_OWNER(THIS_MODULE) - .proc_open = proc_filter_info_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_release = proc_filter_info_release, + proc_open: proc_filter_info_open, + proc_read: seq_read, + proc_lseek: seq_lseek, + proc_release: proc_filter_info_release, }; +#endif static int proc_netif_info_show(struct seq_file *m, void *v) @@ -348,13 +370,22 @@ proc_netif_info_release(struct inode *inode, struct file *file) return single_release(inode, file); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) +static struct file_operations proc_netif_info_fops = { + owner: THIS_MODULE, + open: proc_netif_info_open, + read: seq_read, + llseek: seq_lseek, + release: proc_netif_info_release, +}; +#else static struct proc_ops proc_netif_info_fops = { - PROC_OWNER(THIS_MODULE) - .proc_open = proc_netif_info_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_release = proc_netif_info_release, + proc_open: proc_netif_info_open, + proc_read: seq_read, + proc_lseek: seq_lseek, + proc_release: proc_netif_info_release, }; +#endif static int proc_pkt_stats_show(struct seq_file *m, void *v) @@ -424,13 +455,22 @@ proc_pkt_stats_release(struct inode *inode, struct file *file) return single_release(inode, file); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) +static struct file_operations proc_pkt_stats_fops = { + owner: THIS_MODULE, + open: proc_pkt_stats_open, + read: seq_read, + llseek: seq_lseek, + release: proc_pkt_stats_release, +}; +#else static struct proc_ops proc_pkt_stats_fops = { - PROC_OWNER(THIS_MODULE) - .proc_open = proc_pkt_stats_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_release = proc_pkt_stats_release, + proc_open: proc_pkt_stats_open, + proc_read: seq_read, + proc_lseek: seq_lseek, + proc_release: proc_pkt_stats_release, }; +#endif static int proc_rate_limit_show(struct seq_file *m, void *v) @@ -470,14 +510,24 @@ proc_rate_limit_release(struct inode *inode, struct file *file) return single_release(inode, file); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) +static struct file_operations proc_rate_limit_fops = { + owner: THIS_MODULE, + open: proc_rate_limit_open, + read: seq_read, + write: proc_rate_limit_write, + llseek: seq_lseek, + release: proc_rate_limit_release, +}; +#else static struct proc_ops proc_rate_limit_fops = { - PROC_OWNER(THIS_MODULE) - .proc_open = proc_rate_limit_open, - .proc_read = seq_read, - .proc_write = proc_rate_limit_write, - .proc_lseek = seq_lseek, - .proc_release = proc_rate_limit_release, + proc_open: proc_rate_limit_open, + proc_read: seq_read, + proc_write: proc_rate_limit_write, + proc_lseek: seq_lseek, + proc_release: proc_rate_limit_release, }; +#endif static int proc_reg_status_show(struct seq_file *m, void *v) @@ -521,13 +571,22 @@ proc_reg_status_release(struct inode *inode, struct file *file) return single_release(inode, file); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) +static struct file_operations proc_reg_status_fops = { + owner: THIS_MODULE, + open: proc_reg_status_open, + read: seq_read, + llseek: seq_lseek, + release: proc_reg_status_release, +}; +#else static struct proc_ops proc_reg_status_fops = { - PROC_OWNER(THIS_MODULE) - .proc_open = proc_reg_status_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_release = proc_reg_status_release, + proc_open: proc_reg_status_open, + proc_read: seq_read, + proc_lseek: seq_lseek, + proc_release: proc_reg_status_release, }; +#endif static int proc_ring_status_show(struct seq_file *m, void *v) @@ -575,13 +634,22 @@ proc_ring_status_release(struct inode *inode, struct file *file) return single_release(inode, file); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) +static struct file_operations proc_ring_status_fops = { + owner: THIS_MODULE, + open: proc_ring_status_open, + read: seq_read, + llseek: seq_lseek, + release: proc_ring_status_release, +}; +#else static struct proc_ops proc_ring_status_fops = { - PROC_OWNER(THIS_MODULE) - .proc_open = proc_ring_status_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_release = proc_ring_status_release, + proc_open: proc_ring_status_open, + proc_read: seq_read, + proc_lseek: seq_lseek, + proc_release: proc_ring_status_release, }; +#endif int ngknet_procfs_init(void) diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_procfs.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_procfs.h index f6df80fe7064..99e1ce93c48d 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_procfs.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_procfs.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_ptp.c b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_ptp.c index eaec51a9800f..75e22bc43f17 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_ptp.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_ptp.c @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or @@ -36,10 +36,11 @@ ngknet_ptp_rx_config_set(struct net_device *ndev, int *filter) /* * The expected Rx filter value is passed to the callback. The callback * should pass back the actual filter value by the paramter . - * The callback can use netif->user_data to get other private parameters - * like phys_port which should be introduced when the netif is created. + * The callback can use priv->user_data to get other private parameters + * such as phys_port, dev_type, etc, which should be introduced when the + * netif is created. */ - return dev->cbc->ptp_rx_config_set_cb(&dev->dev_info, &priv->netif, filter); + return dev->cbc->ptp_rx_config_set_cb(priv, filter); } int @@ -55,10 +56,11 @@ ngknet_ptp_tx_config_set(struct net_device *ndev, int type) /* * The Tx type value is passed to the callback by the parameter . * The callback should do the configuration according to the type. - * The callback can use netif->user_data to get other private parameters - * like phys_port which should be introduced when the netif is created. + * The callback can use priv->user_data to get other private parameters + * such as phys_port, dev_type, etc, which should be introduced when the + * netif is created. */ - return dev->cbc->ptp_tx_config_set_cb(&dev->dev_info, &priv->netif, &type); + return dev->cbc->ptp_tx_config_set_cb(priv, &type); } int @@ -73,8 +75,9 @@ ngknet_ptp_rx_hwts_get(struct net_device *ndev, struct sk_buff *skb, uint64_t *t return SHR_E_UNAVAIL; } - cbd->dinfo = &dev->dev_info; - cbd->netif = &priv->netif; + cbd->dev_no = dev->dev_no; + cbd->dev_id = dev->pdma_dev.dev_id; + cbd->priv = priv; cbd->pmd = skb->data + PKT_HDR_SIZE; cbd->pmd_len = pkh->meta_len; cbd->pkt_len = pkh->data_len; @@ -84,8 +87,7 @@ ngknet_ptp_rx_hwts_get(struct net_device *ndev, struct sk_buff *skb, uint64_t *t * by the parameter . * Some parameters have been consolidated to SKB as above. They can be * achieved by NGKNET_SKB_CB(skb). Specially more private paramters are - * in NGKNET_SKB_CB(skb)->dinfo or NGKNET_SKB_CB(skb)->netif->user_data - * such as dev_type, phys_port and so on. + * in NGKNET_SKB_CB(skb)->priv->user_data[]. */ return dev->cbc->ptp_rx_hwts_get_cb(skb, ts); } @@ -102,8 +104,9 @@ ngknet_ptp_tx_hwts_get(struct net_device *ndev, struct sk_buff *skb, uint64_t *t return SHR_E_UNAVAIL; } - cbd->dinfo = &dev->dev_info; - cbd->netif = &priv->netif; + cbd->dev_no = dev->dev_no; + cbd->dev_id = dev->pdma_dev.dev_id; + cbd->priv = priv; cbd->pmd = skb->data + PKT_HDR_SIZE; cbd->pmd_len = pkh->meta_len; cbd->pkt_len = pkh->data_len; @@ -117,8 +120,8 @@ ngknet_ptp_tx_hwts_get(struct net_device *ndev, struct sk_buff *skb, uint64_t *t * been tranmitted out from port. * Some parameters have been consolidated to SKB as above. They can be * achieved by NGKNET_SKB_CB(skb). Specially more private paramters are - * in NGKNET_SKB_CB(skb)->dinfo or NGKNET_SKB_CB(skb)->netif->user_data - * such as dev_type, phys_port and so on. + * in NGKNET_SKB_CB(skb)->priv->user_data[] such as phys_port, dev_type, + * and so on. */ return dev->cbc->ptp_tx_hwts_get_cb(skb, ts); } @@ -135,8 +138,9 @@ ngknet_ptp_tx_meta_set(struct net_device *ndev, struct sk_buff *skb) return SHR_E_UNAVAIL; } - cbd->dinfo = &dev->dev_info; - cbd->netif = &priv->netif; + cbd->dev_no = dev->dev_no; + cbd->dev_id = dev->pdma_dev.dev_id; + cbd->priv = priv; cbd->pmd = skb->data + PKT_HDR_SIZE; cbd->pmd_len = pkh->meta_len; cbd->pkt_len = pkh->data_len; @@ -146,8 +150,8 @@ ngknet_ptp_tx_meta_set(struct net_device *ndev, struct sk_buff *skb) * for HW timestamping according to the corresponding switch device. * Some parameters have been consolidated to SKB as above. They can be * achieved by NGKNET_SKB_CB(skb). Specially more private paramters are - * in NGKNET_SKB_CB(skb)->dinfo or NGKNET_SKB_CB(skb)->netif->user_data - * such as dev_type, phys_port and so on. + * in NGKNET_SKB_CB(skb)->priv->user_data[] such as phys_port, dev_type, + * and so on. */ return dev->cbc->ptp_tx_meta_set_cb(skb); } @@ -164,10 +168,11 @@ ngknet_ptp_phc_index_get(struct net_device *ndev, int *index) /* * The callback should return the HPC index by the parameter . - * netif->user_data can be used to get other private parameters such as - * phys_port which should be introduced when the netif is created. + * priv->user_data[] can be used to get other private parameters such as + * phys_port, dev_type, etc, which should be introduced when the netif is + * created. */ - return dev->cbc->ptp_phc_index_get_cb(&dev->dev_info, &priv->netif, index); + return dev->cbc->ptp_phc_index_get_cb(priv, index); } int @@ -178,12 +183,12 @@ ngknet_ptp_dev_ctrl(struct ngknet_dev *dev, int cmd, char *data, int len) } /* - * The callback is IOCTL dispatcher for PTP kernel driver/module. + * The callback is IOCTL dispatcher for PTP driver/module. * The parameter is the command defined by the user. The parameter * and are used for interactions between the user application * and the driver for PTP device start/stop, enable/disable, set/get, and * so on. */ - return dev->cbc->ptp_dev_ctrl_cb(&dev->dev_info, cmd, data, len); + return dev->cbc->ptp_dev_ctrl_cb(dev, cmd, data, len); } diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_ptp.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_ptp.h index c365a8d8d0e7..e881c77b5273 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_ptp.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_ptp.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/Kbuild b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/Kbuild index 0469855c7dfd..e14e25669cff 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/Kbuild +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/Kbuild @@ -2,7 +2,7 @@ # # Linux KNET Callback module. # -# $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. +# $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. # The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. # # This program is free software; you can redistribute it and/or @@ -17,32 +17,23 @@ # A copy of the GNU General Public License version 2 (GPLv2) can # be found in the LICENSES folder.$ # - -ifeq ($(BUILD_PSAMPLE),1) -PSAMPLE_CFLAGS=-DPSAMPLE_SUPPORT +ifneq ($(CONFIG_PSAMPLE),) PSAMPLE_CB_OBJS=psample-cb.o endif -ifneq ($(OUTPUT_DIR),) -INCLUDES := -I$(OUTPUT_DIR)/knet/generated/include -I$(OUTPUT_DIR)/knet/generated -endif obj-m := linux_ngknetcb.o ccflags-y := $(KNETCB_CPPFLAGS) $(LKM_CFLAGS) \ - $(SDK_PMD_KFLAGS) \ - -I$(SDK)/shr/include \ - -I$(SDK)/bcmdrd/include \ - -I$(SDK)/bcmltd/include \ - -I$(SDK)/bcmlrd/include \ - -I$(SDK)/bcmcnet/include \ - -I$(SDK)/linux/include \ - -I$(SDK)/linux/knetcb \ - -I$(SDK)/linux/knet \ - -I$(SDK)/linux/knet/generated/include \ - -I$(SDK)/linux/knet/generated \ - $(INCLUDES) \ - $(PSAMPLE_CFLAGS) \ + $(SDK_PMD_KFLAGS) \ + -I$(SDK)/shr/include \ + -I$(SDK)/bcmdrd/include \ + -I$(SDK)/bcmltd/include \ + -I$(SDK)/bcmlrd/include \ + -I$(SDK)/linux/include \ + -I$(SDK)/linux/knet/include \ + -I$(SDK)/linux/knetcb \ + -I$(SDK)/linux/knet \ + $(PSAMPLE_CFLAGS) -linux_ngknetcb-y := $(SDK_PMD_KOBJS) \ - ngknetcb_main.o \ - $(PSAMPLE_CB_OBJS) +linux_ngknetcb-y := $(SDK_PMD_KOBJS) ngknetcb_main.o \ + $(PSAMPLE_CB_OBJS) diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/Makefile b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/Makefile index b23af7ed4e86..4698183db035 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/Makefile +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/Makefile @@ -1,5 +1,8 @@ +# -*- Makefile -*- # -# $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. +# Linux KNET Callback module. +# +# $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. # The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. # # This program is free software; you can redistribute it and/or @@ -14,8 +17,6 @@ # A copy of the GNU General Public License version 2 (GPLv2) can # be found in the LICENSES folder.$ # -# Linux KNET Callback module. -# ifdef KPMD @@ -31,7 +32,7 @@ knetcb: mklinks # SDK make helper for stand-alone PMD kernel module include $(SDK)/make/kpmd.mk -distclean:: rmlinks +distclean: rmlinks endif #KPMD @@ -47,4 +48,4 @@ endif .PHONY: distclean -distclean:: +distclean: diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/ngknetcb_main.c b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/ngknetcb_main.c index 0cfe939ac5fc..af2a0c9aef3d 100644 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/ngknetcb_main.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/ngknetcb_main.c @@ -3,14 +3,14 @@ * NGKNET Callback module entry. */ /* - * $Copyright: (c) 2022 Broadcom. + * $Copyright: (c) 2019 Broadcom. * Broadcom Proprietary and Confidential. All rights reserved.$ */ #include #include #include "psample-cb.h" -#include "bcmcnet/bcmcnet_core.h" + /*! \cond */ MODULE_AUTHOR("Broadcom Corporation"); MODULE_DESCRIPTION("NGKNET Callback Module"); @@ -19,7 +19,7 @@ MODULE_LICENSE("GPL"); /*! \cond */ int debug = 0; -module_param(debug, int, 0); +MODULE_PARAM(debug, int, 0); MODULE_PARM_DESC(debug, "Debug level (default 0)"); /*! \endcond */ @@ -64,42 +64,6 @@ strip_vlan_tag(struct sk_buff *skb) } } -static uint32_t -dev_id_get(char* dev_type) -{ - uint32_t dev_id = 0xb880; - - if (0 == strcmp(dev_type, "bcm56880_a0")) - { - dev_id = 0xb880; - } - else if (0 == strcmp(dev_type, "bcm56780_a0")) - { - dev_id = 0xb780; - } - else if ((0 == strcmp(dev_type, "bcm56990_a0")) || - (0 == strcmp(dev_type, "bcm56990_b0"))) - { - dev_id = 0xb990; - } - else if ((0 == strcmp(dev_type, "bcm56996_a0")) || - (0 == strcmp(dev_type, "bcm56996_b0"))) - { - dev_id = 0xb996; - } - else if ((0== strcmp(dev_type, "bcm56995_a0")) || - (0== strcmp(dev_type, "bcm56999_a0"))) - { - dev_id = 0xb999; - } - else if ((0== strcmp(dev_type, "bcm56993_b0")) || - (0== strcmp(dev_type, "bcm56998_a0"))) - { - dev_id = 0xb993; - } - return dev_id; -} - /* * The function get_tag_status() returns the tag status. * 0 = Untagged @@ -109,7 +73,7 @@ dev_id_get(char* dev_type) * -1 = Unsupported type */ static int -get_tag_status(char* dev_type, char* dev_var, void *meta) +get_tag_status(uint32_t dev_type, uint32_t variant, void *meta) { uint32_t *valptr; uint32_t fd_index; @@ -117,24 +81,15 @@ get_tag_status(char* dev_type, char* dev_var, void *meta) int tag_status = -1; uint32_t match_id_minbit = 1; uint32_t outer_tag_match = 0x10; - uint32_t dev_id = 0xb880; - - dev_id = dev_id_get(dev_type); -#ifdef KNET_CB_DEBUG - if (debug & 0x1) { - printk("dev_type %s dev_var %s\n", dev_type, dev_var); - } -#endif - - if ((0xb880 == dev_id ) || (0xb780 == dev_id)) + + if ((dev_type == 0xb880) || (dev_type == 0xb780)) { /* Field BCM_PKTIO_RXPMD_MATCH_ID_LO has tag status in RX PMD */ fd_index = 2; valptr = (uint32_t *)meta; - match_id_minbit = (dev_id == 0xb780) ? 2 : 1; + match_id_minbit = (dev_type == 0xb780) ? 2 : 1; outer_l2_hdr = (valptr[fd_index] >> match_id_minbit & 0xFF); - outer_tag_match = (((dev_id == 0xb780) && - ((strncmp(dev_var, "DNA_", 4)) == 0)) ? 0x8 : 0x10); + outer_tag_match = ((dev_type == 0xb780 && variant == 1) ? 0x8 : 0x10); if (outer_l2_hdr & 0x1) { #ifdef KNET_CB_DEBUG if (debug & 0x1) { @@ -176,8 +131,7 @@ get_tag_status(char* dev_type, char* dev_var, void *meta) } } } - else if ((dev_id == 0xb990)|| (dev_id == 0xb996) || - (dev_id == 0xb999)|| (dev_id == 0xb993)) + else if ((dev_type == 0xb990)|| (dev_type == 0xb996)) { fd_index = 9; valptr = (uint32_t *)meta; @@ -211,7 +165,7 @@ get_tag_status(char* dev_type, char* dev_var, void *meta) } #ifdef KNET_CB_DEBUG if (debug & 0x1) { - printk("%s; Device Type: %s; tag status: %d\n", __func__, dev_type, tag_status); + printk("%s; Device Type: %d; tag status: %d\n", __func__, dev_type, tag_status); } #endif return tag_status; @@ -264,10 +218,11 @@ static struct sk_buff * strip_tag_rx_cb(struct sk_buff *skb) { const struct ngknet_callback_desc *cbd = NGKNET_SKB_CB(skb); + const struct ngknet_private *priv = cbd->priv; int rcpu_mode = 0; int tag_status; - rcpu_mode = (cbd->netif->flags & NGKNET_NETIF_F_RCPU_ENCAP)? 1 : 0; + rcpu_mode = (priv->flags & NGKNET_NETIF_F_RCPU_ENCAP)? 1 : 0; #ifdef KNET_CB_DEBUG if (debug & 0x1) { @@ -275,8 +230,8 @@ strip_tag_rx_cb(struct sk_buff *skb) "\n%4u --------------------------------------------------------------------------------\n", rx_count); printk(KERN_INFO - "RX KNET callback: dev_no=%1d; dev_id=:%6s; type_str=%4s; RCPU: %3s \n", - cbd->dinfo->dev_no, cbd->dinfo->var_str, cbd->dinfo->type_str, rcpu_mode ? "yes" : "no"); + "RX KNET callback: dev_no=%1d; dev_id=0x%04X; type_str=%4s; RCPU: %3s \n", + cbd->dev_no, cbd->dev_id, cbd->type_str, rcpu_mode ? "yes" : "no"); printk(KERN_INFO " pkt_len=%4d; pmd_len=%2d; SKB len: %4d\n", cbd->pkt_len, cbd->pmd_len, skb->len); if (cbd->filt) { @@ -285,8 +240,8 @@ strip_tag_rx_cb(struct sk_buff *skb) } printk(KERN_INFO "Before SKB (%d bytes):\n", skb->len); dump_buffer(skb->data, skb->len); - printk("rx_cb for dev %d: id %s, %s\n", cbd->dinfo->dev_no, cbd->dinfo->var_str, cbd->dinfo->type_str); - printk("netif user data: 0x%08x\n", *(uint32_t *)cbd->netif->user_data); + printk("rx_cb for dev %d: id 0x%x, %s\n", cbd->dev_no, cbd->dev_id, cbd->type_str); + printk("netif user data: 0x%08x\n", *(uint32_t *)cbd->priv->user_data); show_pmd(cbd->pmd, cbd->pmd_len); if (rcpu_mode) { const int RCPU_header_len = PKT_HDR_SIZE + cbd->pmd_len; @@ -304,9 +259,7 @@ strip_tag_rx_cb(struct sk_buff *skb) if ((!rcpu_mode) && (cbd->filt)) { if (FILTER_TAG_ORIGINAL == cbd->filt->user_data[0]) { - tag_status = get_tag_status(cbd->dinfo->type_str, - cbd->dinfo->var_str, - (void *)cbd->pmd); + tag_status = get_tag_status(cbd->dev_id, cbd->filt->user_data[1],(void *)cbd->pmd); if (tag_status < 0) { strip_stats.skipped++; goto _strip_tag_rx_cb_exit; @@ -342,7 +295,7 @@ strip_tag_tx_cb(struct sk_buff *skb) struct ngknet_callback_desc *cbd = NGKNET_SKB_CB(skb); if (debug & 0x1) { - printk("tx_cb for dev %d: %s\n", cbd->dinfo->dev_no, cbd->dinfo->type_str); + printk("tx_cb for dev %d: %s\n", cbd->dev_no, cbd->type_str); } show_pmd(cbd->pmd, cbd->pmd_len); show_mac(cbd->pmd + cbd->pmd_len); @@ -351,11 +304,11 @@ strip_tag_tx_cb(struct sk_buff *skb) } static struct sk_buff * -ngknet_rx_cb(struct net_device *dev, struct sk_buff *skb) +ngknet_rx_cb(struct sk_buff *skb) { skb = strip_tag_rx_cb(skb); -#ifdef PSAMPLE_SUPPORT - skb = psample_rx_cb(dev, skb); +#if IS_ENABLED(CONFIG_PSAMPLE) + skb = psample_rx_cb(skb); #endif return skb; } @@ -371,7 +324,7 @@ static int ngknet_netif_create_cb(struct net_device *dev) { int retv = 0; -#ifdef PSAMPLE_SUPPORT +#if IS_ENABLED(CONFIG_PSAMPLE) retv = psample_netif_create_cb(dev); #endif return retv; @@ -381,7 +334,7 @@ static int ngknet_netif_destroy_cb(struct net_device *dev) { int retv = 0; -#ifdef PSAMPLE_SUPPORT +#if IS_ENABLED(CONFIG_PSAMPLE) retv = psample_netif_destroy_cb(dev); #endif return retv; @@ -434,7 +387,7 @@ ngknetcb_mmap(struct file *filp, struct vm_area_struct *vma) } static struct file_operations ngknetcb_fops = { - PROC_OWNER(THIS_MODULE) + .owner = THIS_MODULE, .open = ngknetcb_open, .read = seq_read, .write = ngknetcb_write, @@ -445,9 +398,7 @@ static struct file_operations ngknetcb_fops = { .mmap = ngknetcb_mmap, }; -/* Added this for PROC_CREATE */ static struct proc_ops ngknetcb_proc_ops = { - PROC_OWNER(THIS_MODULE) .proc_open = ngknetcb_open, .proc_read = seq_read, .proc_write = ngknetcb_write, @@ -480,7 +431,7 @@ ngknetcb_init_module(void) ngknet_rx_cb_register(ngknet_rx_cb); ngknet_tx_cb_register(ngknet_tx_cb); -#ifdef PSAMPLE_SUPPORT +#if IS_ENABLED(CONFIG_PSAMPLE) psample_init(); #endif @@ -495,7 +446,7 @@ ngknetcb_exit_module(void) ngknet_netif_create_cb_unregister(ngknet_netif_create_cb); ngknet_netif_destroy_cb_unregister(ngknet_netif_destroy_cb); -#ifdef PSAMPLE_SUPPORT +#if IS_ENABLED(CONFIG_PSAMPLE) psample_cleanup(); #endif diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.c b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.c old mode 100755 new mode 100644 index bdd116434611..142357134ff1 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.c +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.c @@ -1,5 +1,5 @@ /* - * Copyright 2017-2022 Broadcom + * Copyright 2017-2019 Broadcom * * 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 @@ -44,7 +44,6 @@ #include #include #include "psample-cb.h" -#include "ngknet_main.h" #define PSAMPLE_CB_DBG #ifdef PSAMPLE_CB_DBG @@ -65,24 +64,16 @@ extern int debug; #define PSAMPLE_RATE_DFLT 1 #define PSAMPLE_SIZE_DFLT 128 static int psample_size = PSAMPLE_SIZE_DFLT; -module_param(psample_size, int, 0); +MODULE_PARAM(psample_size, int, 0); MODULE_PARM_DESC(psample_size, "psample pkt size (default 128 bytes)"); #define PSAMPLE_QLEN_DFLT 1024 static int psample_qlen = PSAMPLE_QLEN_DFLT; -module_param(psample_qlen, int, 0); +MODULE_PARAM(psample_qlen, int, 0); MODULE_PARM_DESC(psample_qlen, "psample queue length (default 1024 buffers)"); -#if !IS_ENABLED(CONFIG_PSAMPLE) -inline struct -psample_group *psample_group_get(struct net *net, u32 group_num) -{ - return NULL; -} -#endif - /* driver proc entry root */ static struct proc_dir_entry *psample_proc_root = NULL; static struct proc_dir_entry *knet_cb_proc_root = NULL; @@ -161,8 +152,6 @@ psample_netif_lookup_by_ifindex(int ifindex) return (NULL); } -static psample_netif_t* -psample_netif_lookup_by_port(int port) __attribute__ ((unused)); static psample_netif_t* psample_netif_lookup_by_port(int port) { @@ -183,6 +172,50 @@ psample_netif_lookup_by_port(int port) return (NULL); } +static int +psample_meta_sample_reason(uint8_t *pkt, void *pkt_meta) +{ + uint32_t *metadata = (uint32_t*)pkt_meta; + uint32_t reason = 0; + uint32_t reason_hi = 0; + uint32_t sample_rx_reason_mask = 0; + + if (metadata) { + /* Sample Pkt reason code (bcmRxReasonSampleSource) */ + switch(g_psample_info.dcb_type) { + case 36: /* TD3 */ + case 38: /* TH3 */ + reason_hi = *(metadata + 4); + reason = *(metadata + 5); + sample_rx_reason_mask = (1 << 3); + break; + case 32: /* TH1/TH2 */ + case 26: /* TD2 */ + case 23: /* HX4 */ + reason_hi = *(metadata + 2); + reason = *(metadata + 3); + sample_rx_reason_mask = (1 << 5); + break; + default: + break; + } + } + PSAMPLE_CB_DBG_PRINT("%s: DCB%d sample_rx_reason_mask: 0x%08x, reason: 0x%08x, reason_hi: 0x%08x\n", + __func__, g_psample_info.dcb_type, sample_rx_reason_mask, reason, reason_hi); + + /* Check if only sample reason code is set. + * If only sample reason code, then consume pkt. + * If other reason codes exist, then pkt should be + * passed through to Linux network stack. + */ + if ((reason & ~sample_rx_reason_mask) || reason_hi) { + return 0; /* multiple reasons set, pass through */ + } + + /* only sample rx reason set, consume pkt */ + return (PSAMPLE_PKT_HANDLED); +} + static int psample_meta_get(struct sk_buff *skb, psample_meta_t *sflow_meta) { @@ -191,18 +224,18 @@ psample_meta_get(struct sk_buff *skb, psample_meta_t *sflow_meta) int sample_size = PSAMPLE_SIZE_DFLT; psample_netif_t *psample_netif = NULL; const struct ngknet_callback_desc *cbd = NGKNET_SKB_CB(skb); - ngknet_netif_t *netif = cbd->netif; + const struct ngknet_private *netif = cbd->priv; memset(sflow_meta, 0, sizeof(psample_meta_t)); /* find src port */ - if ((psample_netif = psample_netif_lookup_by_ifindex(netif->id))) { + if ((psample_netif = psample_netif_lookup_by_ifindex(netif->net_dev->ifindex))) { src_ifindex = psample_netif->dev->ifindex; sample_rate = psample_netif->sample_rate; sample_size = psample_netif->sample_size; } else { g_psample_stats.pkts_d_meta_srcport++; PSAMPLE_CB_DBG_PRINT("%s: could not find psample netif for src dev %s (ifidx %d)\n", - __func__, netif->name, netif->id); + __func__, netif->net_dev->name, netif->net_dev->ifindex); } sflow_meta->src_ifindex = src_ifindex; @@ -218,6 +251,7 @@ psample_task(struct work_struct *work) unsigned long flags; struct list_head *list_ptr, *list_next; psample_pkt_t *pkt; + struct psample_metadata md = {0}; spin_lock_irqsave(&psample_work->lock, flags); list_for_each_safe(list_ptr, list_next, &psample_work->pkt_list) { @@ -229,32 +263,18 @@ psample_task(struct work_struct *work) /* send to psample */ if (pkt) { -#if ((IS_ENABLED(CONFIG_PSAMPLE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,13,0)) || \ - (defined PSAMPLE_MD_EXTENDED_ATTR && PSAMPLE_MD_EXTENDED_ATTR)) - struct psample_metadata md = {0}; - md.trunc_size = pkt->meta.trunc_size; - md.in_ifindex = pkt->meta.src_ifindex; - md.out_ifindex = pkt->meta.dst_ifindex; -#endif PSAMPLE_CB_DBG_PRINT("%s: group 0x%x, trunc_size %d, src_ifdx 0x%x, dst_ifdx 0x%x, sample_rate %d\n", __func__, pkt->group->group_num, pkt->meta.trunc_size, pkt->meta.src_ifindex, pkt->meta.dst_ifindex, pkt->meta.sample_rate); -#if ((IS_ENABLED(CONFIG_PSAMPLE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,13,0)) || \ - (defined PSAMPLE_MD_EXTENDED_ATTR && PSAMPLE_MD_EXTENDED_ATTR)) + md.trunc_size = pkt->meta.trunc_size; + md.in_ifindex = pkt->meta.src_ifindex; + md.out_ifindex = pkt->meta.dst_ifindex; psample_sample_packet(pkt->group, - pkt->skb, + pkt->skb, pkt->meta.sample_rate, &md); -#else - psample_sample_packet(pkt->group, - pkt->skb, - pkt->meta.trunc_size, - pkt->meta.src_ifindex, - pkt->meta.dst_ifindex, - pkt->meta.sample_rate); -#endif g_psample_stats.pkts_f_psample_mod++; dev_kfree_skb_any(pkt->skb); @@ -266,7 +286,7 @@ psample_task(struct work_struct *work) } struct sk_buff* -psample_rx_cb(struct net_device *dev, struct sk_buff *skb) +psample_rx_cb(struct sk_buff *skb) { struct psample_group *group; psample_meta_t meta; @@ -282,7 +302,7 @@ psample_rx_cb(struct net_device *dev, struct sk_buff *skb) return (NULL); } cbd = NGKNET_SKB_CB(skb); - netif = netdev_priv(dev); + netif = cbd->priv; filt_src = cbd->filt; filt = netif->filt_cb; @@ -409,6 +429,13 @@ psample_rx_cb(struct net_device *dev, struct sk_buff *skb) } PSAMPLE_FILTER_CB_PKT_HANDLED: + /* if sample reason only, consume pkt. else pass through */ + rv = psample_meta_sample_reason(skb->data, cbd->pmd); + if (PSAMPLE_PKT_HANDLED == rv) { + g_psample_stats.pkts_f_handled++; + dev_kfree_skb_any(skb); + return NULL; + } g_psample_stats.pkts_f_pass_through++; return skb; } @@ -437,22 +464,22 @@ psample_netif_create_cb(struct net_device *dev) spin_lock_irqsave(&g_psample_info.lock, flags); psample_netif->dev = dev; - psample_netif->id = netif->netif.id; + psample_netif->id = netif->id; /*Application has encoded the port in netif user data 0 & 1 */ - if (netif->netif.type == NGKNET_NETIF_T_PORT) + if (netif->type == NGKNET_NETIF_T_PORT) { - psample_netif->port = netif->netif.user_data[0]; - psample_netif->port |= netif->netif.user_data[1] << 8; + psample_netif->port = netif->user_data[0]; + psample_netif->port |= netif->user_data[1] << 8; } - psample_netif->vlan = netif->netif.vlan; + psample_netif->vlan = netif->vlan; psample_netif->sample_rate = PSAMPLE_RATE_DFLT; psample_netif->sample_size = PSAMPLE_SIZE_DFLT; - printk("\r\n Type %d vlan %d", netif->netif.type, psample_netif->vlan); + /* insert netif sorted by ID similar to bkn_knet_netif_create() */ found = 0; list_for_each(list, &g_psample_info.netif_list) { lpsample_netif = (psample_netif_t*)list; - if (netif->netif.id < lpsample_netif->id) { + if (netif->id < lpsample_netif->id) { found = 1; g_psample_info.netif_count++; break; @@ -492,7 +519,7 @@ psample_netif_destroy_cb(struct net_device *dev) list_for_each(list, &g_psample_info.netif_list) { psample_netif = (psample_netif_t*)list; - if (netif->netif.id == psample_netif->id) { + if (netif->id == psample_netif->id) { found = 1; list_del(&psample_netif->list); PSAMPLE_CB_DBG_PRINT("%s: removing psample netif '%s'\n", __func__, dev->name); @@ -505,6 +532,7 @@ psample_netif_destroy_cb(struct net_device *dev) spin_unlock_irqrestore(&g_psample_info.lock, flags); if (!found) { + printk("%s: netif ID %d not found!\n", __func__, netif->id); return (-1); } return (0); @@ -603,12 +631,11 @@ psample_proc_rate_write(struct file *file, const char *buf, } struct proc_ops psample_proc_rate_file_ops = { - PROC_OWNER(THIS_MODULE) - .proc_open = psample_proc_rate_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_write = psample_proc_rate_write, - .proc_release = single_release, + proc_open: psample_proc_rate_open, + proc_read: seq_read, + proc_lseek: seq_lseek, + proc_write: psample_proc_rate_write, + proc_release: single_release, }; /* @@ -702,12 +729,11 @@ psample_proc_size_write(struct file *file, const char *buf, } struct proc_ops psample_proc_size_file_ops = { - PROC_OWNER(THIS_MODULE) - .proc_open = psample_proc_size_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_write = psample_proc_size_write, - .proc_release = single_release, + proc_open: psample_proc_size_open, + proc_read: seq_read, + proc_lseek: seq_lseek, + proc_write: psample_proc_size_write, + proc_release: single_release, }; /* @@ -743,12 +769,11 @@ psample_proc_map_open(struct inode * inode, struct file * file) } struct proc_ops psample_proc_map_file_ops = { - PROC_OWNER(THIS_MODULE) - .proc_open = psample_proc_map_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_write = NULL, - .proc_release = single_release, + proc_open: psample_proc_map_open, + proc_read: seq_read, + proc_lseek: seq_lseek, + proc_write: NULL, + proc_release: single_release, }; /* @@ -809,12 +834,11 @@ psample_proc_debug_write(struct file *file, const char *buf, } struct proc_ops psample_proc_debug_file_ops = { - PROC_OWNER(THIS_MODULE) - .proc_open = psample_proc_debug_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_write = psample_proc_debug_write, - .proc_release = single_release, + proc_open: psample_proc_debug_open, + proc_read: seq_read, + proc_lseek: seq_lseek, + proc_write: psample_proc_debug_write, + proc_release: single_release, }; static int @@ -871,12 +895,11 @@ psample_proc_stats_write(struct file *file, const char *buf, return count; } struct proc_ops psample_proc_stats_file_ops = { - PROC_OWNER(THIS_MODULE) - .proc_open = psample_proc_stats_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_write = psample_proc_stats_write, - .proc_release = single_release, + proc_open: psample_proc_stats_open, + proc_read: seq_read, + proc_lseek: seq_lseek, + proc_write: psample_proc_stats_write, + proc_release: single_release, }; int psample_cleanup(void) diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.h b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.h old mode 100755 new mode 100644 index d89c5f4178bb..e2922a36bca4 --- a/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.h +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.h @@ -1,5 +1,5 @@ /* - * Copyright 2022 Broadcom + * Copyright 2017 Broadcom * * 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 @@ -24,7 +24,6 @@ #include #include -//#define PSAMPLE_SUPPORT 1 // TODO: MLI@BRCM - Add this as part of conditional in Makefile #define PSAMPLE_CB_NAME "psample" extern int @@ -34,14 +33,14 @@ extern int psample_cleanup(void); extern struct sk_buff* -psample_rx_cb(struct net_device *dev, struct sk_buff *skb); +psample_rx_cb(struct sk_buff *skb); /* psample data per interface */ typedef struct { struct list_head list; struct net_device *dev; uint16_t id; - uint16_t port; + uint8_t port; uint16_t vlan; uint16_t qnum; uint32_t sample_rate; diff --git a/platform/broadcom/saibcm-modules/sdklt/make/lkm.mk b/platform/broadcom/saibcm-modules/sdklt/make/lkm.mk index f565514a1123..803154e54c68 100644 --- a/platform/broadcom/saibcm-modules/sdklt/make/lkm.mk +++ b/platform/broadcom/saibcm-modules/sdklt/make/lkm.mk @@ -1,5 +1,5 @@ # -# $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. +# $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. # The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. # # This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/sdklt/shr/include/shr/shr_error.h b/platform/broadcom/saibcm-modules/sdklt/shr/include/shr/shr_error.h index 702e6317f5f0..a51dc11392b2 100644 --- a/platform/broadcom/saibcm-modules/sdklt/shr/include/shr/shr_error.h +++ b/platform/broadcom/saibcm-modules/sdklt/shr/include/shr/shr_error.h @@ -4,7 +4,7 @@ * */ /* - * $Copyright: Copyright 2018-2022 Broadcom. All rights reserved. + * $Copyright: Copyright 2018-2021 Broadcom. All rights reserved. * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/include/linux-bde.h b/platform/broadcom/saibcm-modules/systems/bde/linux/include/linux-bde.h index fa8849eb2bf7..c4d31579bfdf 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/include/linux-bde.h +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/include/linux-bde.h @@ -270,9 +270,6 @@ extern int lkbde_cpu_read(int d, uint32 addr, uint32 *buf); extern int lkbde_cpu_pci_register(int d); #endif -extern int lkbde_intr_cb_register(int d, - int (*intr_pending)(void*), - void *intr_pending_data); /* * This flag must be OR'ed onto the device number when calling * interrupt_connect/disconnect and irq_mask_set functions from diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/Makefile b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/Makefile index 1c3e94815c4e..bc7b6fef5f15 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/Makefile +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/Makefile @@ -42,6 +42,8 @@ include $(SDK)/make/Make.config LIBS = $(LIBDIR)/libkern.a +BDE = linux-kernel-bde.o + # need to add vpath sources VPATH = ../shared @@ -56,14 +58,8 @@ CFLAGS += -I../../shared/include LHDRS += mpool.h LOBJS = $(addsuffix .o, $(basename $(LSRCS))) BOBJS = $(addprefix $(BLDDIR)/,$(LOBJS)) -# -# For 'NO_PRECOMPILED_MODULE', the first kernel compilation is done -# in systems/bde/linux/kernel (and not in systems/bde/linux/kernel/kernel_module, -# which is not even created). -# All the definitions above are for the first cycle of module compilation -# -PWD := $(shell pwd) +ifneq ($(kernel_version),2_4) KERNEL_MODULE_DIR = kernel_module THIS_MOD_NAME := linux-kernel-bde @@ -71,63 +67,23 @@ MODULE = $(LIBDIR)/$(THIS_MOD_NAME).o KMODULE = $(LIBDIR)/$(THIS_MOD_NAME).ko build: $(KMODULE) +else +MODULE = $(LIBDIR)/linux-kernel-bde.o -ifeq (1,$(NO_PRECOMPILED_MODULE)) -# { -# -# These are the objects which need to be compiled, in the kernel, to -# created the module object file. -# -SRCS_COMPOSING = linux_shbde.c linux_dma.c ../shared/mpool.o $(THIS_MOD_NAME).c ../../shared/shbde_pci.o ../../shared/shbde_iproc.o ../../shared/shbde_mdio.o ../../../linux/kernel/modules/shared/gmodule.o -OBJECTS_COMPOSING = "linux_shbde.o linux_dma.o mpool.o $(THIS_MOD_NAME)-file.o shbde_pci.o shbde_iproc.o shbde_mdio.o gmodule.o" - -module: $(KMODULE) +build: module +endif -# -# Note that for NO_PRECOMPILED_MODULE, the subdirectory 'systems/bde/linux/kernel/kernel_module' -# is not created and all action is done in systems/bde/linux/kernel -# -$(KMODULE): $(SRCS_COMPOSING) - rm -fr $(BLDDIR)/$(KERNEL_MODULE_DIR) - rm -f $(BLDDIR)/*.c - rm -f $(BLDDIR)/*.o - rm -f $(BLDDIR)/*.ko - cp ${SDK}/make/Makefile.linux-kmodule $(BLDDIR)/Makefile - # - # Here we copy all source files, which are required for the - # compilation of the module, into one directory. It seems that - # specifying path for 'remote' files is not acceptable for - # the module-creation mechanism in the kernel. - # - cp ./*.c $(BLDDIR)/ - cp ./*.h $(BLDDIR)/ - cp ../shared/*.c $(BLDDIR)/ - cp ../../shared/*.c $(BLDDIR)/ - cp ../../../linux/kernel/modules/shared/*.c $(BLDDIR)/ - # - # We change here the name of the 'base' file since, it seems, the module-creation - # mechanism does not add symbols when the name of one of the files is the same as - # the name of the module itself. - # - mv $(BLDDIR)/$(THIS_MOD_NAME).c $(BLDDIR)/$(THIS_MOD_NAME)-file.c - MOD_OBJS=$(OBJECTS_COMPOSING) MOD_NAME=$(THIS_MOD_NAME) $(MAKE) -C $(BLDDIR) $(THIS_MOD_NAME).ko LOC_BLDDIR=$(BLDDIR) LOC_SRCDIR=$(PWD) -# } -else -# { module: $(MODULE) -# -# This is for the compilation of the 'precompiled' object. We keep it -# here for compatibility. -# + $(MODULE): $(BLDDIR)/.tree $(BOBJS) kernel_libs mkdir -p $(@D) $(LD) $(MODULE_LDFLAGS) -r -d $(BOBJS) $(LIBS) -o $@ +ifneq ($(kernel_version),2_4) $(KMODULE): $(MODULE) rm -fr $(BLDDIR)/$(KERNEL_MODULE_DIR) mkdir $(BLDDIR)/$(KERNEL_MODULE_DIR) cp ${SDK}/make/Makefile.linux-kmodule $(BLDDIR)/$(KERNEL_MODULE_DIR)/Makefile MOD_NAME=$(THIS_MOD_NAME) $(MAKE) -C $(BLDDIR)/$(KERNEL_MODULE_DIR) $(THIS_MOD_NAME).ko -# } endif kernel_libs: @@ -144,4 +100,6 @@ clean:: distclean:: +ifneq ($(kernel_version),2_4) .PHONY: build kernel_libs +endif diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux-kernel-bde.c b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux-kernel-bde.c index 0fc8b63437b7..be5b6282396d 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux-kernel-bde.c +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux-kernel-bde.c @@ -37,14 +37,10 @@ /* * Prevent gcc from using a compiler builtin memcpy even if using -fno-builtin or * -fno-builtin-memcpy. - * Use __inline_memcpy or __memcpy kernel function in x86 Linux instead. + * Use __memcpy kernel function in x86 Linux instead. */ #undef MEMCPY -#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)) -#define MEMCPY __inline_memcpy -#else #define MEMCPY __memcpy -#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(5.0.0)) */ #endif /* (defined(__GNUC__) && (__GNUC__ >= 8)) */ #endif /* CONFIG_X86_64 */ @@ -170,20 +166,6 @@ MODULE_PARM_DESC(spifreq, #endif - -/* Periodic timer to prevent stuck interrupt */ -static int isrtickms = 1000; -LKM_MOD_PARAM(isrtickms, "i", int, (S_IRUGO | S_IWUSR)); -MODULE_PARM_DESC(isrtickms, -"Periodic ISR tick in milliseconds."); - -/* Debug purpose to simulate stuck interrupts */ -static int dma_lock = 0; -LKM_MOD_PARAM(dma_lock, "i", int, (S_IRUGO | S_IWUSR)); -MODULE_PARM_DESC(dma_lock, -"Simulation of stuck interrupts."); - -/* Compatibility */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)) #define _ISR_RET irqreturn_t #else @@ -318,7 +300,7 @@ typedef struct bde_ctrl_s { /* Secondary mapped base address */ sal_vaddr_t alt_base_addr; - + /* BDE device description */ ibde_dev_t bde_dev; @@ -348,18 +330,6 @@ typedef struct bde_ctrl_s { /* inst_id */ uint32 inst_id; /* The instance ID of the instance controlling the device */ - - /* - * Callback function from user BDE to determine if there are pending interrupts - * currently. - */ - int (*intr_pending)(void *); - void *intr_pending_data; - uint32 interrupts; /* Current number of interrupts */ - uint32 prev_interrupts; /* Number of interrupts in previous ISR tick */ - uint32 stuck_interrupts; /* Number of stuck interrupts detected */ - uint32 no_intr_isr_ticks; /* Number of ISR ticks without interrupt occurred */ - struct timer_list isr_tick; /* Timer tick to prevent stuck interrupt */ } bde_ctrl_t; static bde_ctrl_t _devices[LINUX_BDE_MAX_DEVICES]; @@ -446,7 +416,7 @@ static void *cpu_address = NULL; #define BCM53000PCIE_DEFAULT_STATUS 0x00100146 /* 16bit wide register. offset 14, 14*2 = 0x1c */ -#define BCM53000PCIE_SPROM_OFFSET 0x1c +#define BCM53000PCIE_SPROM_OFFSET 0x1c /* bit 15:13 spromData.MaxPayloadSize. 1: 256 bytes */ #define BCM53000PCIE_SPROM_MAX_PAYLOAD_MASK 0xe000 #define BCM53000PCIE_SPROM_MAX_PAYLOAD_256B (1 << 13) @@ -634,16 +604,15 @@ _eb_device_create(resource_size_t paddr, int irq, int rd_hw, int wr_hw) static int sand_device_create(void) { -#ifndef __DUNE_LINUX_BCM_CPU_PCIE__ bde_ctrl_t* ctrl; - ctrl = _devices; /* on petra, take first device */ - + ctrl = _devices; /* FIX_ME: on petra, take first device */ +#ifndef __DUNE_LINUX_BCM_CPU_PCIE__ ctrl->dev_type |= BDE_PCI_DEV_TYPE | BDE_SWITCH_DEV_TYPE; ctrl->pci_device = NULL; /* No PCI bus */ - /* Map in the device */ /* not realy map anything */ + /* Map in the device */ /* FIX_ME: not realy map anything */ ctrl->bde_dev.base_address = (sal_vaddr_t)ioremap(0x40000000, 0x100000); ctrl->iowin[0].addr = 0x40000000; ctrl->iowin[0].size = 0x100000; @@ -663,6 +632,15 @@ sand_device_create(void) cpu_address = ioremap(0xe0000000, 0x100000); #endif + if (ctrl->bde_dev.device == PCP_PCI_DEVICE_ID) { + ctrl->bde_dev.device = GEDI_DEVICE_ID; + ctrl->bde_dev.rev = GEDI_REV_ID; + } + + if (ctrl->bde_dev.device == ACP_PCI_DEVICE_ID) { + ctrl->dev_type |= BDE_PCI_DEV_TYPE | BDE_SWITCH_DEV_TYPE; + } + #ifndef __DUNE_LINUX_BCM_CPU_PCIE__ _bde_add_device(); #endif @@ -1285,13 +1263,13 @@ static const struct pci_device_id _id_table[] = { { BROADCOM_VENDOR_ID, BCM56844_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56845_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56846_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM56847_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM56847_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56549_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56053_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56838_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56831_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM56835_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM56849_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM56835_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM56849_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56742_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56743_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56744_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, @@ -1380,7 +1358,7 @@ static const struct pci_device_id _id_table[] = { { BROADCOM_VENDOR_ID, BCM56853_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56854_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56855_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM56834_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM56834_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56750_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56830_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM55440_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, @@ -1472,7 +1450,7 @@ static const struct pci_device_id _id_table[] = { { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9656, PCI_ANY_ID, PCI_ANY_ID }, { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9056, PCI_ANY_ID, PCI_ANY_ID }, { BCM53000_VENDOR_ID, BCM53000PCIE_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, -#ifdef BCM_PETRA_SUPPORT +#ifdef BCM_PETRA_SUPPORT { BROADCOM_VENDOR_ID, BCM88350_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88351_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88450_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, @@ -1480,6 +1458,8 @@ static const struct pci_device_id _id_table[] = { { BROADCOM_VENDOR_ID, BCM88550_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88551_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88552_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { PCP_PCI_VENDOR_ID, PCP_PCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { ACP_PCI_VENDOR_ID, ACP_PCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88660_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88670_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88671_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, @@ -1673,7 +1653,6 @@ static const struct pci_device_id _id_table[] = { { BROADCOM_VENDOR_ID, BCM8884D_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM8884E_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM8884F_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88830_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88831_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88832_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88833_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, @@ -1689,10 +1668,6 @@ static const struct pci_device_id _id_table[] = { { BROADCOM_VENDOR_ID, BCM8883D_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM8883E_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM8883F_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, -#ifdef BCM_DNX3_SUPPORT - { BROADCOM_VENDOR_ID, BCM88860_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88870_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, -#endif #endif /* BCM_DNX_SUPPORT */ #ifdef BCM_DFE_SUPPORT { BROADCOM_VENDOR_ID, BCM88770_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, @@ -1727,40 +1702,6 @@ static const struct pci_device_id _id_table[] = { { BROADCOM_VENDOR_ID, BCM8879C_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM8879D_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM8879F_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, -#ifdef BCM_DNXF3_SUPPORT - { BROADCOM_VENDOR_ID, BCM88910_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88911_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88912_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88913_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88914_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88915_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88916_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88917_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88918_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88919_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM8891A_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM8891B_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM8891C_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM8891D_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM8891E_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM8891F_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88920_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88921_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88922_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88923_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88924_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88925_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88926_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88927_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88928_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88929_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM8892A_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM8892B_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM8892C_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM8892D_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM8892E_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM8892F_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, -#endif #endif { BROADCOM_VENDOR_ID, BCM56860_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56861_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, @@ -1784,7 +1725,6 @@ static const struct pci_device_id _id_table[] = { { BROADCOM_VENDOR_ID, BCM56575_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56175_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56176_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM53642_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56370_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56371_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56372_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, @@ -1838,7 +1778,7 @@ pci_do_bus_find(struct pci_bus* bus, int rc, int vendor, int device) func = dev->devfn & 0x7; if (dev->vendor == vendor && dev->device == device && rc == func) { if (debug >= 1) { - gprintk("pci_do_bus_find: dev->vendor = 0x%x, dev->device = 0x%x on rc(%d)\n", + gprintk("pci_do_bus_find: dev->vendor = 0x%x, dev->device = 0x%x on rc(%d)\n", dev->vendor, dev->device, rc); } return sub_bus; @@ -2008,9 +1948,9 @@ p2p_bridge(void) uint32 tmp, maxpayld, device_bmp=0, mask; unsigned long addr; uint16 tmp16, tmp161; - int i, bus0 = -1, bus1 = -1, port; + int i, bus0 = -1, bus1 = -1, port; struct pci_dev *pcie0, *pcie1; - + pcie0 = dev; bus0 = dev->bus->number; if ((pcie1 = PCI_FIND_DEV(BCM53000_VENDOR_ID, BCM53000PCIE_DEVICE_ID, pcie0)) != NULL) { @@ -2029,7 +1969,7 @@ p2p_bridge(void) device_bmp |= 1 << 1; } } - } + } /* configure the PCIE cap: Max payload size: 256, Max Read * Request size: 256, disabling relax ordering. @@ -2039,8 +1979,8 @@ p2p_bridge(void) i = 0; while(device_bmp) { if (device_bmp & (1 << i)){ - port = i ; - pci_read_config_dword(BCM53000PCIE_DEV(port), + port = i ; + pci_read_config_dword(BCM53000PCIE_DEV(port), BCM53000PCIE_DEV_CAP_REG, &tmp); maxpayld = (tmp & BCM53000PCIE_MAX_PAYLOAD_MASK); if (debug >= 1) { @@ -2051,44 +1991,44 @@ p2p_bridge(void) if (maxpayld != BCM53000PCIE_CAP_MAX_PAYLOAD_256B) { addr = BCM53000PCIE_BASE(port); addr |= (BCM53000PCIE_SROM_SPACE | BCM53000PCIE_SPROM_OFFSET); - tmp16 = *((uint16 *)addr); + tmp16 = *((uint16 *)addr); if (debug >= 1){ gprintk("addr %lx spromData.MaxPayloadSize: 0x%x\n", addr, tmp16); } mask = BCM53000PCIE_SPROM_MAX_PAYLOAD_MASK; if ((tmp16 & mask) != BCM53000PCIE_SPROM_MAX_PAYLOAD_256B) { tmp161 = (tmp16 & ~mask) | BCM53000PCIE_SPROM_MAX_PAYLOAD_256B; - *((uint16 *)addr) = tmp161; + *((uint16 *)addr) = tmp161; if (debug >= 1) { - tmp16 = 0; - tmp16 = *((uint16 *)addr); + tmp16 = 0; + tmp16 = *((uint16 *)addr); gprintk("Enable spromData.MaxPayloadSize to 1 (256 bytes): " "0x%x (%s w/ 0x%x)\n", tmp161, - ((tmp16 & mask) == BCM53000PCIE_SPROM_MAX_PAYLOAD_256B) ? + ((tmp16 & mask) == BCM53000PCIE_SPROM_MAX_PAYLOAD_256B) ? "Success":"Fail", tmp16); } - } - pci_read_config_dword(BCM53000PCIE_DEV(port), - BCM53000PCIE_DEV_CAP_REG, &tmp); + } + pci_read_config_dword(BCM53000PCIE_DEV(port), + BCM53000PCIE_DEV_CAP_REG, &tmp); if (debug >= 1){ - gprintk("DevCap (@%x): now is 0x%x\n\n", - BCM53000PCIE_DEV_CAP_REG, tmp); + gprintk("DevCap (@%x): now is 0x%x\n\n", + BCM53000PCIE_DEV_CAP_REG, tmp); } - } + } addr = BCM53000PCIE_BASE(port); addr |= (BCM53000PCIE_FUNC0_COFIG_SPACE | BCM53000PCIE_DEV_CTRL_REG); - tmp16 = *((uint16 *)addr); + tmp16 = *((uint16 *)addr); if (debug >= 1) { - gprintk("DevControl (@%x): 0x%x\n", BCM53000PCIE_DEV_CTRL_REG, tmp16); + gprintk("DevControl (@%x): 0x%x\n", BCM53000PCIE_DEV_CTRL_REG, tmp16); } - if (!(tmp16 & MAX_PAYLOAD_256B) || !(tmp16 & MAX_READ_REQ_256B)) { - tmp161 = tmp16 | MAX_PAYLOAD_256B | MAX_READ_REQ_256B; - *((uint16 *)addr) = tmp161; + if (!(tmp16 & MAX_PAYLOAD_256B) || !(tmp16 & MAX_READ_REQ_256B)) { + tmp161 = tmp16 | MAX_PAYLOAD_256B | MAX_READ_REQ_256B; + *((uint16 *)addr) = tmp161; if (debug >= 1) { - tmp16 = 0; - tmp16 = *((uint16 *)addr); + tmp16 = 0; + tmp16 = *((uint16 *)addr); gprintk("addr %lx Enable DevControl MaxPayloadSize to 1 (256 bytes): " "0x%x (%s w/ 0x%x)\n", addr, tmp161, (tmp16 & MAX_PAYLOAD_256B) ? "Success":"Fail", @@ -2097,22 +2037,22 @@ p2p_bridge(void) "0x%x (%s w/ 0x%x)\n\n", tmp161, (tmp16 & MAX_READ_REQ_256B) ? "Success":"Fail", tmp16); - } - } + } + } device_bmp &= ~(1 << i); } i++; } } - /* + /* * Configure max payload to 512 on all ports in the PLX8608/PLX8617. - * The device supports 128, 512, and 1024 max payload sizes. + * The device supports 128, 512, and 1024 max payload sizes. */ dev = NULL; while ((dev = PCI_FIND_DEV(PCI_VENDOR_ID_PLX, PCI_ANY_ID, dev)) != NULL) { if ((dev->device == PLX_PEX8608_DEV_ID) || - (dev->device == PLX_PEX8617_DEV_ID)) { + (dev->device == PLX_PEX8617_DEV_ID)) { uint16 ctrl_reg; pci_read_config_word(dev, PLX_PEX86XX_DEV_CTRL_REG, &ctrl_reg); ctrl_reg = (ctrl_reg & ~(7<<5)) | MAX_PAYLOAD_512B; @@ -2132,7 +2072,7 @@ p2p_bridge(void) #define PLX_LAS0_PCIBAR2 2 /* Local Address Space 0 (PCIBAR2) */ #define PLX_LAS1_PCIBAR3 3 /* Local Address Space 1 (PCIBAR3) */ -STATIC int +STATIC int _plx_las_bar_get(struct pci_dev *dev) { void *local_config_addr; @@ -2141,8 +2081,8 @@ _plx_las_bar_get(struct pci_dev *dev) local_config_addr = ioremap(pci_resource_start(dev, PLX_MMAP_PCIBAR0), pci_resource_len(dev, PLX_MMAP_PCIBAR0)); if (local_config_addr) { - uint32 las_remap_reg; - /* + uint32 las_remap_reg; + /* * Make sure LAS0BA or LAS1BA is enabled before returning * BAR that will be used to access the Local Bus */ @@ -2154,7 +2094,7 @@ _plx_las_bar_get(struct pci_dev *dev) if (las_remap_reg & PLX_LAS_EN) { bar = PLX_LAS1_PCIBAR3; } - } + } } iounmap(local_config_addr); return bar; @@ -2177,7 +2117,7 @@ _shbde_log_func(int level, const char *str, int param) * Parameters: * dev - Linux PCI device structure * Returns: - * >= 0 : dev is ever probed + * >= 0 : dev is ever probed * reutrn value is the index point to the _devices[] * -1 : dev is not probed before. */ @@ -2238,16 +2178,16 @@ _pci_msix_table_size(struct pci_dev *dev) if (entries != NULL) { nr_entries = pci_enable_msix(dev, entries, PCI_MSIX_FLAGS_QSIZE); - pci_disable_msix(dev); - kfree(entries); + if (nr_entries < 0) { + nr_entries = 0; + } + pci_disable_msix(dev); + kfree(entries); } } #else nr_entries = pci_msix_vec_count(dev); #endif - if (nr_entries < 0) { - nr_entries = 0; - } #endif return nr_entries; @@ -2385,7 +2325,7 @@ config_pci_intr_type(struct pci_dev *dev, bde_ctrl_t *ctrl, int iproc) /* check for support MSIX vector */ ret = _pci_msix_table_size(ctrl->pci_device); if (ret == 0) { - gprintk("%s: Zero MSIX table size, using MSI.\n", __func__); + gprintk("%s: Zero MSIX table size\n", __func__); ctrl->use_msi = PCI_USE_INT_MSI; } } @@ -2437,7 +2377,7 @@ _pci_probe(struct pci_dev *dev, const struct pci_device_id *ent) if (debug >= 4) {gprintk("probing: vendor_id=0x%x, device_id=0x%x\n", dev->vendor, dev->device);} if (nodevices == 1) { - return 0; + return 0; } /* Initialize Linux hardware abstraction for shared BDE functions */ @@ -2460,10 +2400,10 @@ _pci_probe(struct pci_dev *dev, const struct pci_device_id *ent) if ((ctrl->dev_type & mask) == mask) { return 0; } - } + } } #endif /* IPROC_CMICD */ - + /* * Note that a few supported devices have a non-Broadcom PCI vendor ID, * but since none of their associated PCI device IDs collide with the @@ -2780,7 +2720,17 @@ _pci_probe(struct pci_dev *dev, const struct pci_device_id *ent) ctrl->bde_dev.device = dev->device; paddr = pci_resource_start(dev, baroff); - bar_len = pci_resource_len(dev, baroff); + switch (dev->device) { +#if defined(BCM_PETRA_SUPPORT) && defined(__DUNE_LINUX_BCM_CPU_PCIE__) + case GEDI_DEVICE_ID: + case PCP_PCI_DEVICE_ID: + bar_len = 0x1000000; + break; +#endif + default: + bar_len = pci_resource_len(dev, baroff); + break; + } ctrl->bde_dev.base_address = (sal_vaddr_t)ioremap(paddr, bar_len); ctrl->iowin[0].addr = paddr; @@ -2914,7 +2864,7 @@ _pci_remove(struct pci_dev* dev) bde_ctrl_t *ctrl; if (nodevices == 1) { - return; + return; } #if defined(BCM_DFE_SUPPORT) @@ -3346,7 +3296,6 @@ _pprint(struct seq_file *m) pprintf(m, "Module parameters:\n"); pprintf(m, "\tmaxpayload=%d\n", maxpayload); pprintf(m, "\tusemsi=%d\n", usemsi); - pprintf(m, "\tisrtickms=%d\n", isrtickms); _dma_pprint(m); @@ -3425,10 +3374,6 @@ _pprint(struct seq_file *m) ctrl->inst_id < LINUX_BDE_MAX_DEVICES ? "":"(Illegal)"); } } - pprintf(m, "\t\tinterrupts:prev:stuck %d:%d:%d\n", - ctrl->interrupts, - ctrl->prev_interrupts, - ctrl->stuck_interrupts); } return 0; } @@ -3703,79 +3648,20 @@ _write(int d, uint32_t addr, uint32_t data) } -static void -_run_isrs(bde_ctrl_t *ctrl) -{ - if (ctrl->isr) { - ctrl->isr(ctrl->isr_data); - } - - if (ctrl->isr2) { - ctrl->isr2(ctrl->isr2_data); - } -} - static _ISR_RET _isr(_ISR_PARAMS(irq, dev_id, iregs)) { bde_ctrl_t *ctrl = (bde_ctrl_t *) dev_id; - if (dma_lock) { - return IRQ_HANDLED; + if (ctrl && ctrl->isr) { + ctrl->isr(ctrl->isr_data); } - - if (ctrl) { - _run_isrs(ctrl); - ctrl->interrupts++; + if (ctrl && ctrl->isr2) { + ctrl->isr2(ctrl->isr2_data); } - return IRQ_HANDLED; } -static void -lkbde_isrtick_func(bde_ctrl_t *ctrl) -{ - unsigned long flags; - - spin_lock_irqsave(&ctrl->lock, flags); - - if (ctrl->prev_interrupts == ctrl->interrupts) { - if (ctrl->intr_pending(ctrl->intr_pending_data)) { - if (++ctrl->no_intr_isr_ticks >= 2) { - /* Run interrupt handlers if there are pending interrupts. */ - spin_unlock_irqrestore(&ctrl->lock, flags); - _run_isrs(ctrl); - spin_lock_irqsave(&ctrl->lock, flags); - ctrl->stuck_interrupts++; - ctrl->no_intr_isr_ticks = 0; - } - } - } else { - ctrl->no_intr_isr_ticks = 0; - ctrl->prev_interrupts = ctrl->interrupts; - } - - ctrl->isr_tick.expires = jiffies + msecs_to_jiffies(isrtickms); - spin_unlock_irqrestore(&ctrl->lock, flags); - add_timer(&ctrl->isr_tick); -} - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)) -static void -lkbde_isrtick(unsigned long context) -{ - bde_ctrl_t *ctrl = (bde_ctrl_t *)context; - return lkbde_isrtick_func(ctrl); -} -#else -static void -lkbde_isrtick(struct timer_list *t) -{ - bde_ctrl_t *ctrl = from_timer(ctrl, t, isr_tick); - return lkbde_isrtick_func(ctrl); -} -#endif - static int _interrupt_connect(int d, void (*isr)(void *), @@ -3905,20 +3791,6 @@ _interrupt_connect(int d, } } } - - if ((ctrl->use_msi >= PCI_USE_INT_MSI) && ctrl->intr_pending) { -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)) - init_timer(&ctrl->isr_tick); - ctrl->isr_tick.data = (unsigned long)ctrl; - ctrl->isr_tick.function = lkbde_isrtick; -#else - timer_setup(&ctrl->isr_tick, lkbde_isrtick, 0); -#endif - - ctrl->isr_tick.expires = jiffies + msecs_to_jiffies(isrtickms); - add_timer(&ctrl->isr_tick); - } - return 0; err_disable_msi: @@ -3975,7 +3847,7 @@ _interrupt_disconnect(int d) ctrl->fmask = 0; if (ctrl->isr) { /* Primary handler still active */ - SYNC_IRQ(ctrl->iLine); + SYNC_IRQ(ctrl->iLine); return 0; } } else { @@ -3986,7 +3858,7 @@ _interrupt_disconnect(int d) ctrl->isr_data = NULL; if (ctrl->isr2) { /* Secondary handler still active */ - SYNC_IRQ(ctrl->iLine); + SYNC_IRQ(ctrl->iLine); return 0; } } @@ -4028,9 +3900,6 @@ _interrupt_disconnect(int d) #ifdef CONFIG_PCI_MSI if (ctrl->use_msi >= PCI_USE_INT_MSI) { _msi_disconnect(ctrl); - if (ctrl->intr_pending) { - del_timer_sync(&ctrl->isr_tick); - } } #endif } @@ -4063,7 +3932,7 @@ _iproc_ihost_write(int d, uint32_t addr, uint32_t data) writel(data, mapaddr); iounmap(mapaddr); return 0; -} +} static uint32_t _iproc_read(int d, uint32_t addr) @@ -4214,7 +4083,7 @@ lkbde_cpu_pci_register(int d) gprintk("Cannot enable pci device : vendor_id = %x, device_id = %x\n", ctrl->pci_device->vendor, ctrl->pci_device->device); } - + /* Add PCI_COMMAND_MEMORY and PCI_COMMAND_MASTER */ pci_read_config_word(ctrl->pci_device, PCI_COMMAND, &cmd); if (!(cmd & PCI_COMMAND_MEMORY) || !(cmd & PCI_COMMAND_MASTER)) { @@ -4223,6 +4092,14 @@ lkbde_cpu_pci_register(int d) } switch (ctrl->bde_dev.device) { + case GEDI_DEVICE_ID: + /* Fix bar 0 address */ /* FIXME: write full phy address */ + pci_write_config_byte(ctrl->pci_device, 0x13, 0x60); + + /* Fix Max payload size */ + pci_write_config_byte(ctrl->pci_device, 0x88, 0x2f); + pci_write_config_byte(ctrl->pci_device, 0x89, 0x10); + break; case BCM88770_DEVICE_ID: case BCM88773_DEVICE_ID: case BCM88774_DEVICE_ID: @@ -4233,9 +4110,10 @@ lkbde_cpu_pci_register(int d) case BCM88953_DEVICE_ID: case BCM88954_DEVICE_ID: case BCM88955_DEVICE_ID: - case BCM88956_DEVICE_ID: + case BCM88956_DEVICE_ID: case BCM88772_DEVICE_ID: case BCM88952_DEVICE_ID: + case ACP_PCI_DEVICE_ID: case BCM88670_DEVICE_ID: case BCM88671_DEVICE_ID: @@ -4287,12 +4165,12 @@ lkbde_cpu_pci_register(int d) case BCM88278_DEVICE_ID: case BCM88350_DEVICE_ID: case BCM88351_DEVICE_ID: - case BCM88450_DEVICE_ID: + case BCM88450_DEVICE_ID: case BCM88451_DEVICE_ID: case BCM88550_DEVICE_ID: case BCM88551_DEVICE_ID: case BCM88552_DEVICE_ID: - case BCM88660_DEVICE_ID: + case BCM88660_DEVICE_ID: case BCM88360_DEVICE_ID: case BCM88361_DEVICE_ID: case BCM88363_DEVICE_ID: @@ -4302,7 +4180,7 @@ lkbde_cpu_pci_register(int d) case BCM88561_DEVICE_ID: case BCM88562_DEVICE_ID: case BCM88661_DEVICE_ID: - case BCM88664_DEVICE_ID: + case BCM88664_DEVICE_ID: /* Fix bar 0 address */ /* FIXME: write full phy address */ pci_write_config_byte(ctrl->pci_device, 0x12, 0x10); pci_write_config_byte(ctrl->pci_device, 0x13, 0x60); @@ -4329,17 +4207,9 @@ lkbde_cpu_pci_register(int d) case Q2U_DEVICE_ID: case Q2N_DEVICE_ID: case J2P_DEVICE_ID: - case J2X_DEVICE_ID: -#ifdef BCM_DNX3_SUPPORT - case JERICHO3_DEVICE_ID: - case Q4_DEVICE_ID: -#endif #endif #ifdef BCM_DNXF_SUPPORT case BCM88790_DEVICE_ID: -#ifdef BCM_DNXF3_SUPPORT - case BCM88920_DEVICE_ID: -#endif #endif /* * For DMA transactions - set Max_Payload_Size and @@ -4372,8 +4242,8 @@ lkbde_cpu_pci_register(int d) return 0; } -/* - * Export Low level access function - currently for PCP DMA Kernel module. +/* + * Export Low level access function - currently for PCP DMA Kernel module. */ int lkbde_mem_write(int d, uint32 addr, uint32 *buf) @@ -4383,7 +4253,7 @@ lkbde_mem_write(int d, uint32 addr, uint32 *buf) if (!VALID_DEVICE(d)) return -1; ctrl = &_devices[d]; - + full_addr = (void *)ctrl->bde_dev.base_address + addr; *((uint32_t*)full_addr) = *buf; return 0; @@ -4718,7 +4588,7 @@ lkbde_irq_mask_set(int d, uint32_t addr, uint32_t mask, uint32_t fmask) /* * When a secondary interrupt handler is installed, this function - * is used to avoid activating the user mode interrupt handler + * is used to avoid activating the user mode interrupt handler * thread if all pending interrupts are handled in kernel space. * * The mask returned is the mask of all interrupts, it can be used @@ -4748,7 +4618,7 @@ lkbde_irq_mask_get(int d, uint32_t *mask, uint32_t *fmask) *fmask = ctrl->fmask; *mask = ctrl->imask | ctrl->imask2; - + return 0; } @@ -4781,33 +4651,6 @@ linux_bde_device_bitmap_t* lkbde_get_inst_devs(uint32 inst_id) return &_instance_info[inst_id].devices; } -/* - * Register a callback function to retrieve interrupt pending status from - * the user BDE. - */ -int -lkbde_intr_cb_register(int d, - int (*intr_pending)(void *), - void *intr_pending_data) -{ - bde_ctrl_t *ctrl; - - if (!VALID_DEVICE(d)) { - gprintk("lkbde_intr_cb_register: Invalid device index %d\n", d); - return -1; - } - - if (debug >= 1) { - gprintk("lkbde_intr_cb_register d %d\n", d); - } - - ctrl = _devices + d; - ctrl->intr_pending_data = intr_pending_data; - ctrl->intr_pending = intr_pending; - - return 0; -} - /* * Export functions */ @@ -4832,4 +4675,3 @@ LKM_EXPORT_SYM(lkbde_cpu_pci_register); #endif LKM_EXPORT_SYM(lkbde_is_dev_managed_by_instance); LKM_EXPORT_SYM(lkbde_get_inst_devs); -LKM_EXPORT_SYM(lkbde_intr_cb_register); diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_dma.c b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_dma.c index bdb8d121b8c3..be46282e7f8d 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_dma.c +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_dma.c @@ -285,7 +285,7 @@ static void __iomem *_dma_vbase = NULL; /* CPU physical address of the DMA buffer pool, used for mmap */ static phys_addr_t _cpu_pbase = 0; /* - * DMA buffer pool PCIe bus address, it is either identical to the CPU + * DMA buffer poool PCIe bus address, it is either identical to the CPU * physical address or another address(IOVA) translated by IOMMU. */ static phys_addr_t _dma_pbase = 0; @@ -797,9 +797,12 @@ _mpool_free(void) _use_dma_mapping = 0; } -#ifdef REMAP_DMA_NONCACHED - iounmap(_dma_vbase); +#ifndef REMAP_DMA_NONCACHED + if (_use_himem) #endif + { + iounmap(_dma_vbase); + } switch (dmaalloc) { #if _SIMPLE_MEMORY_ALLOCATION_ @@ -1033,13 +1036,16 @@ void _dma_per_device_init(int dev_index) _dma_pbase = dma_addr; _dma_pool_alloc_state = DMA_POOL_MAPPED; -#ifdef REMAP_DMA_NONCACHED - if (dma_debug >= 2) { - gprintk("remapping DMA buffer pool from physical:0x%lx original kernel_virt:0x%lx\n", - (unsigned long)_dma_pbase, (unsigned long)_dma_vbase); - } - _dma_vbase = ioremap(_dma_pbase, _dma_mem_size); +#ifndef REMAP_DMA_NONCACHED + if (_use_himem) #endif + { + if (dma_debug >= 2) { + gprintk("remapping DMA buffer pool from physical:0x%lx original kernel_virt:0x%lx\n", + (unsigned long)_dma_pbase, (unsigned long)_dma_vbase); + } + _dma_vbase = ioremap(_dma_pbase, _dma_mem_size); + } if (dma_debug >= 1) { gprintk("Mapped DMA buffer pool _use_dma_mapping:%d kernel_virt:0x%lx dma_bus:0x%lx physical:0x%lx size:0x%x dmaalloc:%d, dma64_support:%d\n", diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/linux-user-bde.c b/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/linux-user-bde.c index deff8954665b..7677aa5d4394 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/linux-user-bde.c +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/linux-user-bde.c @@ -185,17 +185,6 @@ be made. /* Defines used to distinguish CMICe from CMICm */ #define CMICE_DEV_REV_ID (0x178 / sizeof(uint32)) -#ifdef BCM_DNX3_SUPPORT -#ifndef NEED_CMICX_GEN2_INTERRUPT -#define NEED_CMICX_GEN2_INTERRUPT -#endif -#endif -#ifdef BCM_DNXF3_SUPPORT -#ifndef NEED_CMICX_GEN2_INTERRUPT -#define NEED_CMICX_GEN2_INTERRUPT -#endif -#endif - static uint32 *ihost_intr_status_base = NULL; static uint32 *ihost_intr_enable_base = NULL; @@ -583,34 +572,6 @@ _cmicx_interrupt_prepare(bde_ctrl_t *ctrl) return ret; } -static int -_cmicx_interrupt_pending(void *data) -{ - int d, ind; - uint32 stat, iena; - bde_ctrl_t *ctrl = (bde_ctrl_t *)data; - - if (ctrl->dev_type & BDE_PCI_DEV_TYPE) { - - d = (((uint8 *)ctrl - (uint8 *)_devices) / sizeof (bde_ctrl_t)); - - for (ind = 0; ind < ctrl->intr_regs.intc_intr_nof_regs; ind++) { - IPROC_READ(d, ctrl->intr_regs.intc_intr_status_base + 4 * ind, stat); - IPROC_READ(d, ctrl->intr_regs.intc_intr_enable_base + 4 * ind, iena); - if (debug >= 2) { - gprintk("INTC_INTR_STATUS_REG_%d = 0x%x\n", ind, stat); - gprintk("INTC_INTR_ENABLE_REG_%d = 0x%x\n", ind, iena); - } - if (stat & iena) { - return 1; - } - } - } - - /* No pending interrupts */ - return 0; -} - static void _cmicx_interrupt(bde_ctrl_t *ctrl) { @@ -1226,7 +1187,6 @@ _devices_init(int d) case BCM56575_DEVICE_ID: case BCM56175_DEVICE_ID: case BCM56176_DEVICE_ID: - case BCM53642_DEVICE_ID: ctrl->isr = (isr_f)_cmicx_interrupt; if (ctrl->dev_type & BDE_AXI_DEV_TYPE) { if (!ihost_intr_enable_base) { @@ -1280,7 +1240,6 @@ _devices_init(int d) case Q2U_DEVICE_ID: case Q2N_DEVICE_ID: case J2P_DEVICE_ID: - case J2X_DEVICE_ID: #endif #ifdef BCM_DNXF_SUPPORT case BCM88790_DEVICE_ID: @@ -1289,19 +1248,6 @@ _devices_init(int d) _intr_regs_init(ctrl, 0); break; -#ifdef BCM_DNX3_SUPPORT - case JERICHO3_DEVICE_ID: - case Q4_DEVICE_ID: -#endif -#ifdef BCM_DNXF3_SUPPORT - case BCM88910_DEVICE_ID: - case BCM88920_DEVICE_ID: -#endif -#if defined(BCM_DNX3_SUPPORT) || defined(BCM_DNXF3_SUPPORT) - ctrl->isr = (isr_f)_cmicx_gen2_interrupt; - _intr_regs_init(ctrl, 2); - break; -#endif } #endif /* defined(BCM_DNXF_SUPPORT) || defined(BCM_DNX_SUPPORT) */ @@ -1814,14 +1760,6 @@ _ioctl(unsigned int cmd, unsigned long arg) } if (_devices[io.dev].dev_type & BDE_SWITCH_DEV_TYPE) { if (_devices[io.dev].isr && !_devices[io.dev].enabled) { - /* PCI/CMICX Devices */ - if ((_devices[io.dev].dev_type & BDE_PCI_DEV_TYPE) && - (_devices[io.dev].isr == (isr_f)_cmicx_interrupt)) { - lkbde_intr_cb_register(io.dev, - _cmicx_interrupt_pending, - _devices+io.dev); - } - user_bde->interrupt_connect(io.dev, _devices[io.dev].isr, _devices+io.dev); diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/Makefile b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/Makefile index d42798e737db..56b83fb0da33 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/Makefile @@ -35,69 +35,31 @@ include ${SDK}/make/Make.config LIBS = $(LIBDIR)/libkern.a +ifeq ($(kernel_version),2_4) +MODULE = $(LIBDIR)/linux-bcm-knet.o +else KERNEL_MODULE_DIR = kernel_module THIS_MOD_NAME := linux-bcm-knet MODULE = $(LIBDIR)/$(THIS_MOD_NAME).o KMODULE = $(LIBDIR)/$(THIS_MOD_NAME).ko -# BCM Network Device - -ifeq (1,$(NO_PRECOMPILED_MODULE)) -# { -# -# For 'NO_PRECOMPILED_MODULE', the first kernel compilation is done -# in systems/linux/kernel/modules/bcm-knet (and not in systems/linux/kernel/modules/bcm-knet/kernel_module, -# which is not even created). -# KBUILD_EXTRA_SYMBOLS exports the symbols created on the first module compilation to -# all other module compilations. -# -KBUILD_EXTRA_SYMBOLS := ${BLDDIR}/../../../../bde/linux/kernel/Module.symvers -export KBUILD_EXTRA_SYMBOLS -# -# These are the objects which need to be compiled, in the kernel, to -# created the module object file. -# -SRCS_COMPOSING = bcm-knet.c ../shared/gmodule.c -OBJECTS_COMPOSING = "bcm-knet.o gmodule.o" -# -# Note that for NO_PRECOMPILED_MODULE, the subdirectory 'systems/linux/kernel/modules/bcm-knet/kernel_module' -# is not created and all action is done in systems/linux/kernel/modules/bcm-knet -# - -build: $(KMODULE) +build: $(MODULE) $(KMODULE) +endif -$(KMODULE): $(SRCS_COMPOSING) - rm -fr $(BLDDIR)/$(KERNEL_MODULE_DIR) - rm -f $(BLDDIR)/*.c - rm -f $(BLDDIR)/*.o - rm -f $(BLDDIR)/*.ko - cp ${SDK}/make/Makefile.linux-kmodule $(BLDDIR)/Makefile - cp ./*.c $(BLDDIR)/ - cp ../shared/*.c $(BLDDIR)/ - cat ${KBUILD_EXTRA_SYMBOLS} > $(BLDDIR)/Module.symvers - MOD_OBJS=$(OBJECTS_COMPOSING) MOD_NAME=$(THIS_MOD_NAME) $(MAKE) -C $(BLDDIR) $(THIS_MOD_NAME).ko LOC_BLDDIR=$(BLDDIR) LOC_SRCDIR=$(PWD) -# } -else -# { KBUILD_EXTRA_SYMBOLS := ${BLDDIR}/../../../../bde/linux/kernel/kernel_module/Module.symvers -export KBUILD_EXTRA_SYMBOLS -build: $(MODULE) $(KMODULE) -# -# This is for the compilation of the 'precompiled' object. We keep it -# here for compatibility. -# +# BCM Network Device + $(MODULE): $(BLDDIR)/.tree $(BOBJS) $(LIBS) $(LD) $(MODULE_LDFLAGS) -r -d $(BOBJS) $(LIBS) -o $@ - +ifneq ($(kernel_version),2_4) $(KMODULE): $(MODULE) rm -fr $(BLDDIR)/$(KERNEL_MODULE_DIR) mkdir $(BLDDIR)/$(KERNEL_MODULE_DIR) cp ${SDK}/make/Makefile.linux-kmodule $(BLDDIR)/$(KERNEL_MODULE_DIR)/Makefile cat ${KBUILD_EXTRA_SYMBOLS} > $(BLDDIR)/$(KERNEL_MODULE_DIR)/Module.symvers MOD_NAME=$(THIS_MOD_NAME) KBUILD_EXTRA_SYMBOLS="${KBUILD_EXTRA_SYMBOLS}" $(MAKE) -C $(BLDDIR)/$(KERNEL_MODULE_DIR) $(THIS_MOD_NAME).ko -# } endif # Make.depend is before clean:: so that Make.depend's clean:: runs first. @@ -108,5 +70,6 @@ clean:: $(RM) $(BLDDIR)/version.c $(BLDDIR)/version.o $(RM) $(BOBJS) $(MODULE) +ifneq ($(kernel_version),2_4) .PHONY: build - +endif diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/bcm-knet.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/bcm-knet.c old mode 100755 new mode 100644 index ae4dfb6b773b..b93f1e913fd9 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/bcm-knet.c +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/bcm-knet.c @@ -604,7 +604,6 @@ typedef struct bkn_switch_info_s { uint32_t udh_size; /* Size of UDH header on legacy devices */ uint32_t oamp_punt; /* OAMP port if nonzero */ uint8_t no_skip_udh_check; /* Indicates UDH won't be skipped */ - uint8_t oam_dm_tod_exist; /* Indicates presence of OAM TOD MSB */ uint8_t system_headers_mode; /* Indicates system header mode */ uint8_t udh_enable; /* Indicates UDH existence */ uint8_t oamp_port_number; /* Indicates number of OAMP system port number */ @@ -628,10 +627,8 @@ typedef struct bkn_switch_info_s { uint32_t poll_channels; /* Channels for polling */ uint32_t unet_channels; /* User network channels */ uint32_t inst_id; /* Instance id of this device */ - uint32_t device_id; /* Device ID, like 0x8675 for Jericho A0, 0x */ int evt_idx; /* Event queue index for this device*/ int basedev_suspended; /* Base device suspended */ - int pcie_link_status; /* This flag is used to indicate PCIE Link status, 0 for up and 1 for down */ struct sk_buff_head tx_ptp_queue; /* Tx PTP skb queue */ struct work_struct tx_ptp_work; /* Tx PTP work */ struct { @@ -967,9 +964,7 @@ typedef struct bkn_priv_s { int phys_port; u32 ptp_stats_tx; u32 ptp_stats_rx; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)) struct ethtool_link_settings link_settings; -#endif } bkn_priv_t; typedef struct bkn_filter_s { @@ -1020,6 +1015,7 @@ static knet_hw_tstamp_rx_pre_process_cb_f knet_hw_tstamp_rx_pre_process_cb = NUL static knet_hw_tstamp_ioctl_cmd_cb_f knet_hw_tstamp_ioctl_cmd_cb = NULL; static knet_netif_cb_f knet_netif_create_cb = NULL; static knet_netif_cb_f knet_netif_destroy_cb = NULL; + /* * Thread management */ @@ -1172,45 +1168,18 @@ bkn_sleep(int clicks) /* Maximum packet raw data size for filter validation. */ #define KNET_FILTER_RAW_MAX 256 -static void -dev_read32(bkn_switch_info_t *sinfo, uint32_t address, uint32_t *value) -{ - /* Devices id started with 0x8 is always from DNX devices */ - if ((sinfo->device_id & 0x8000) == 0x8000) { - if (sinfo->pcie_link_status == PCIE_LINK_STATUS_DOWN) { - /* Bypass register access when PCIE Link is down */ - return; - } - } - - DEV_READ32(sinfo, address, value); -} - -static void -dev_write32(bkn_switch_info_t *sinfo, uint32_t address, uint32_t value) -{ - /* Devices id started with 0x8 is always from DNX devices */ - if ((sinfo->device_id & 0x8000) == 0x8000) { - if (sinfo->pcie_link_status == PCIE_LINK_STATUS_DOWN) { - /* Bypass register access when PCIE Link is down */ - return; - } - } - - DEV_WRITE32(sinfo, address, value); -} - /* * Per-channel operations. * These are the basis for the TX/RX functions */ + static inline void xgs_dma_chain_clear(bkn_switch_info_t *sinfo, int chan) { DBG_IRQ(("Clear chain on device %d chan %d\n", sinfo->dev_no, chan)); - dev_write32(sinfo, CMIC_DMA_STATr, DS_DMA_EN_CLR(chan)); - dev_write32(sinfo, CMIC_DMA_STATr, DS_CHAIN_DONE_CLR(chan)); + DEV_WRITE32(sinfo, CMIC_DMA_STATr, DS_DMA_EN_CLR(chan)); + DEV_WRITE32(sinfo, CMIC_DMA_STATr, DS_CHAIN_DONE_CLR(chan)); MEMORY_BARRIER; } @@ -1218,16 +1187,16 @@ xgs_dma_chain_clear(bkn_switch_info_t *sinfo, int chan) static inline void xgs_dma_desc_clear(bkn_switch_info_t *sinfo, int chan) { - uint32_t val = 0; + uint32_t val; DBG_IRQ(("Clear desc on device %d chan %d\n", sinfo->dev_no, chan)); - dev_write32(sinfo, CMIC_DMA_STATr, DS_DESC_DONE_CLR(chan)); + DEV_WRITE32(sinfo, CMIC_DMA_STATr, DS_DESC_DONE_CLR(chan)); MEMORY_BARRIER; /* Flush write buffer */ - dev_read32(sinfo, CMIC_DMA_STATr, &val); + DEV_READ32(sinfo, CMIC_DMA_STATr, &val); MEMORY_BARRIER; } @@ -1244,9 +1213,9 @@ xgs_dma_chan_clear(bkn_switch_info_t *sinfo, int chan) static int xgs_dma_chan_init(bkn_switch_info_t *sinfo, int chan, int dir) { - uint32_t cdc = 0; + uint32_t cdc; - dev_read32(sinfo, CMIC_DMA_CTRLr, &cdc); + DEV_READ32(sinfo, CMIC_DMA_CTRLr, &cdc); cdc &= ~(0x9 << (8 * chan)); if (dir) { @@ -1255,7 +1224,7 @@ xgs_dma_chan_init(bkn_switch_info_t *sinfo, int chan, int dir) cdc |= 0x8 << (8 * chan); } - dev_write32(sinfo, CMIC_DMA_CTRLr, cdc); + DEV_WRITE32(sinfo, CMIC_DMA_CTRLr, cdc); return 0; } @@ -1264,12 +1233,12 @@ static int xgs_dma_chan_start(bkn_switch_info_t *sinfo, int chan, uint64_t dcb) { /* Write the DCB address to the DESC address for this channel */ - dev_write32(sinfo, CMIC_DMA_DESC0r + 4 * chan, dcb); + DEV_WRITE32(sinfo, CMIC_DMA_DESC0r + 4 * chan, dcb); MEMORY_BARRIER; /* Kick it off */ - dev_write32(sinfo, CMIC_DMA_STATr, DS_DMA_EN_SET(chan)); + DEV_WRITE32(sinfo, CMIC_DMA_STATr, DS_DMA_EN_SET(chan)); MEMORY_BARRIER; @@ -1279,27 +1248,26 @@ xgs_dma_chan_start(bkn_switch_info_t *sinfo, int chan, uint64_t dcb) static int xgs_dma_chan_abort(bkn_switch_info_t *sinfo, int chan, int polls) { - uint32_t ctrl = 0; - uint32_t dma_stat = 0; + uint32_t ctrl, dma_stat; int p; /* Clear enable */ - dev_write32(sinfo, CMIC_DMA_STATr, DS_DMA_EN_CLR(chan)); + DEV_WRITE32(sinfo, CMIC_DMA_STATr, DS_DMA_EN_CLR(chan)); MEMORY_BARRIER; /* Abort the channel */ - dev_read32(sinfo, CMIC_DMA_CTRLr, &ctrl); - dev_write32(sinfo, CMIC_DMA_CTRLr, ctrl | DC_ABORT_DMA(chan)); + DEV_READ32(sinfo, CMIC_DMA_CTRLr, &ctrl); + DEV_WRITE32(sinfo, CMIC_DMA_CTRLr, ctrl | DC_ABORT_DMA(chan)); MEMORY_BARRIER; /* Poll for abort completion */ for (p = 0; p < polls; p++) { - dev_read32(sinfo, CMIC_DMA_STATr, &dma_stat); + DEV_READ32(sinfo, CMIC_DMA_STATr, &dma_stat); if (!(dma_stat & DS_DMA_ACTIVE(chan))) { /* Restore previous control value */ - dev_write32(sinfo, CMIC_DMA_CTRLr, ctrl); + DEV_WRITE32(sinfo, CMIC_DMA_CTRLr, ctrl); MEMORY_BARRIER; @@ -1317,14 +1285,6 @@ xgs_dma_chan_abort(bkn_switch_info_t *sinfo, int chan, int polls) static inline void xgs_irq_mask_set(bkn_switch_info_t *sinfo, uint32_t mask) { - /* Devices id started with 0x8 is always from DNX devices */ - if ((sinfo->device_id & 0x8000) == 0x8000) { - if (sinfo->pcie_link_status == PCIE_LINK_STATUS_DOWN) { - /* Bypass hw access when PCIE Link is down */ - return; - } - } - if (sinfo->napi_poll_mode) { mask = 0; } @@ -1371,12 +1331,12 @@ xgs_irq_mask_disable(bkn_switch_info_t *sinfo, int chan, int update_hw) static inline void xgsm_dma_chain_clear(bkn_switch_info_t *sinfo, int chan) { - uint32_t cdc = 0; + uint32_t cdc; /* Disabing DMA clears chain done */ - dev_read32(sinfo, CMICM_DMA_CTRLr + 4 * chan, &cdc); + DEV_READ32(sinfo, CMICM_DMA_CTRLr + 4 * chan, &cdc); cdc &= ~(DC_CMC_ENABLE | DC_CMC_ABORT); - dev_write32(sinfo, CMICM_DMA_CTRLr + 4 * chan, cdc); + DEV_WRITE32(sinfo, CMICM_DMA_CTRLr + 4 * chan, cdc); MEMORY_BARRIER; } @@ -1390,12 +1350,12 @@ xgsm_dma_desc_clear(bkn_switch_info_t *sinfo, int chan) if (CDMA_CH(sinfo, chan)) { val |= DS_CMC_CTRLD_INT_CLR(chan); } - dev_write32(sinfo, CMICM_DMA_STAT_CLRr, val); + DEV_WRITE32(sinfo, CMICM_DMA_STAT_CLRr, val); MEMORY_BARRIER; /* Flush write buffer */ - dev_read32(sinfo, CMICM_DMA_STAT_CLRr, &val); + DEV_READ32(sinfo, CMICM_DMA_STAT_CLRr, &val); MEMORY_BARRIER; } @@ -1412,7 +1372,7 @@ xgsm_dma_chan_clear(bkn_switch_info_t *sinfo, int chan) static inline void xgsm_cdma_halt_set(bkn_switch_info_t *sinfo, int chan) { - dev_write32(sinfo, CMICM_DMA_HALT_ADDRr + 4 * chan, + DEV_WRITE32(sinfo, CMICM_DMA_HALT_ADDRr + 4 * chan, sinfo->halt_addr[chan]); MEMORY_BARRIER; @@ -1421,9 +1381,9 @@ xgsm_cdma_halt_set(bkn_switch_info_t *sinfo, int chan) static int xgsm_dma_chan_init(bkn_switch_info_t *sinfo, int chan, int dir) { - uint32_t cdc = 0; + uint32_t cdc; - dev_read32(sinfo, CMICM_DMA_CTRLr + 4 * chan, &cdc); + DEV_READ32(sinfo, CMICM_DMA_CTRLr + 4 * chan, &cdc); cdc &= ~DC_CMC_DIRECTION; if (dir) { cdc |= DC_CMC_DIRECTION; @@ -1432,7 +1392,7 @@ xgsm_dma_chan_init(bkn_switch_info_t *sinfo, int chan, int dir) cdc |= DC_CMC_CONTINUOUS | DC_CMC_CTRLD_INT; xgsm_cdma_halt_set(sinfo, chan); } - dev_write32(sinfo, CMICM_DMA_CTRLr + 4 * chan, cdc); + DEV_WRITE32(sinfo, CMICM_DMA_CTRLr + 4 * chan, cdc); return 0; } @@ -1440,17 +1400,17 @@ xgsm_dma_chan_init(bkn_switch_info_t *sinfo, int chan, int dir) static int xgsm_dma_chan_start(bkn_switch_info_t *sinfo, int chan, uint64_t dcb) { - uint32_t cdc = 0; + uint32_t cdc; /* Write the DCB address to the DESC address for this channel */ - dev_write32(sinfo, CMICM_DMA_DESC0r + 4 * chan, dcb); + DEV_WRITE32(sinfo, CMICM_DMA_DESC0r + 4 * chan, dcb); MEMORY_BARRIER; /* Kick it off */ - dev_read32(sinfo, CMICM_DMA_CTRLr + 4 * chan, &cdc); + DEV_READ32(sinfo, CMICM_DMA_CTRLr + 4 * chan, &cdc); cdc |= DC_CMC_ENABLE; - dev_write32(sinfo, CMICM_DMA_CTRLr + 4 * chan, cdc); + DEV_WRITE32(sinfo, CMICM_DMA_CTRLr + 4 * chan, cdc); MEMORY_BARRIER; @@ -1460,26 +1420,25 @@ xgsm_dma_chan_start(bkn_switch_info_t *sinfo, int chan, uint64_t dcb) static int xgsm_dma_chan_abort(bkn_switch_info_t *sinfo, int chan, int polls) { - uint32_t ctrl = 0; - uint32_t dma_stat = 0; + uint32_t ctrl, dma_stat; int p; /* Skip abort sequence if channel is not active */ - dev_read32(sinfo, CMICM_DMA_STATr, &dma_stat); + DEV_READ32(sinfo, CMICM_DMA_STATr, &dma_stat); if (!(dma_stat & DS_CMC_DMA_ACTIVE(chan))) { return 0; } /* Abort the channel */ - dev_read32(sinfo, CMICM_DMA_CTRLr + 4 * chan, &ctrl); + DEV_READ32(sinfo, CMICM_DMA_CTRLr + 4 * chan, &ctrl); ctrl |= (DC_CMC_ENABLE | DC_CMC_ABORT); - dev_write32(sinfo, CMICM_DMA_CTRLr + 4 * chan, ctrl); + DEV_WRITE32(sinfo, CMICM_DMA_CTRLr + 4 * chan, ctrl); MEMORY_BARRIER; /* Poll for abort completion */ for (p = 0; p < polls; p++) { - dev_read32(sinfo, CMICM_DMA_STATr, &dma_stat); + DEV_READ32(sinfo, CMICM_DMA_STATr, &dma_stat); if (!(dma_stat & DS_CMC_DMA_ACTIVE(chan))) { /* Clear up channel */ xgsm_dma_chan_clear(sinfo, chan); @@ -1497,14 +1456,6 @@ xgsm_irq_mask_set(bkn_switch_info_t *sinfo, uint32_t mask) uint32_t irq_mask_reg = CMICM_IRQ_PCI_MASKr; uint32_t ctrld_mask = 0; - /* Devices id started with 0x8 is always from DNX devices */ - if ((sinfo->device_id & 0x8000) == 0x8000) { - if (sinfo->pcie_link_status == PCIE_LINK_STATUS_DOWN) { - /* Bypass hw access when PCIE Link is down */ - return; - } - } - if (sinfo->napi_poll_mode) { mask = 0; } @@ -1566,21 +1517,20 @@ xgsm_irq_mask_disable(bkn_switch_info_t *sinfo, int chan, int update_hw) static inline void xgsx_dma_chain_clear(bkn_switch_info_t *sinfo, int chan) { - uint32_t ctrl = 0; - uint32_t stat = 0; + uint32_t ctrl, stat; /* Disabing DMA clears chain done */ - dev_read32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, &ctrl); + DEV_READ32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, &ctrl); ctrl &= ~(CMICX_DC_CMC_ENABLE | CMICX_DC_CMC_ABORT); - dev_write32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, ctrl); + DEV_WRITE32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, ctrl); stat = CMICX_DS_CMC_CHAIN_DONE(chan); - dev_write32(sinfo, CMICX_IRQ_STAT_CLRr, stat); + DEV_WRITE32(sinfo, CMICX_IRQ_STAT_CLRr, stat); MEMORY_BARRIER; /* Flush write buffer */ - dev_read32(sinfo, CMICX_IRQ_STAT_CLRr, &stat); + DEV_READ32(sinfo, CMICX_IRQ_STAT_CLRr, &stat); MEMORY_BARRIER; } @@ -1588,19 +1538,19 @@ xgsx_dma_chain_clear(bkn_switch_info_t *sinfo, int chan) static inline void xgsx_dma_desc_clear(bkn_switch_info_t *sinfo, int chan) { - uint32_t stat = 0; + uint32_t stat; if (CDMA_CH(sinfo, chan)) { stat = CMICX_DS_CMC_CTRLD_INT(chan); } else { stat = CMICX_DS_CMC_DESC_DONE(chan); } - dev_write32(sinfo, CMICX_IRQ_STAT_CLRr, stat); + DEV_WRITE32(sinfo, CMICX_IRQ_STAT_CLRr, stat); MEMORY_BARRIER; /* Flush write buffer */ - dev_read32(sinfo, CMICX_IRQ_STAT_CLRr, &stat); + DEV_READ32(sinfo, CMICX_IRQ_STAT_CLRr, &stat); MEMORY_BARRIER; } @@ -1617,9 +1567,9 @@ xgsx_dma_chan_clear(bkn_switch_info_t *sinfo, int chan) static inline void xgsx_cdma_halt_set(bkn_switch_info_t *sinfo, int chan) { - dev_write32(sinfo, CMICX_DMA_HALT_LOr + 0x80 * chan, + DEV_WRITE32(sinfo, CMICX_DMA_HALT_LOr + 0x80 * chan, sinfo->halt_addr[chan]); - dev_write32(sinfo, CMICX_DMA_HALT_HIr + 0x80 * chan, + DEV_WRITE32(sinfo, CMICX_DMA_HALT_HIr + 0x80 * chan, DMA_TO_BUS_HI(sinfo->halt_addr[chan] >> 32)); MEMORY_BARRIER; @@ -1628,9 +1578,9 @@ xgsx_cdma_halt_set(bkn_switch_info_t *sinfo, int chan) static int xgsx_dma_chan_init(bkn_switch_info_t *sinfo, int chan, int dir) { - uint32_t ctrl = 0; + uint32_t ctrl; - dev_read32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, &ctrl); + DEV_READ32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, &ctrl); ctrl &= ~CMICX_DC_CMC_DIRECTION; if (dir) { ctrl |= CMICX_DC_CMC_DIRECTION; @@ -1639,7 +1589,7 @@ xgsx_dma_chan_init(bkn_switch_info_t *sinfo, int chan, int dir) ctrl |= CMICX_DC_CMC_CONTINUOUS | CMICX_DC_CMC_CTRLD_INT; xgsx_cdma_halt_set(sinfo, chan); } - dev_write32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, ctrl); + DEV_WRITE32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, ctrl); MEMORY_BARRIER; @@ -1649,18 +1599,18 @@ xgsx_dma_chan_init(bkn_switch_info_t *sinfo, int chan, int dir) static int xgsx_dma_chan_start(bkn_switch_info_t *sinfo, int chan, uint64_t dcb) { - uint32_t ctrl = 0; + uint32_t ctrl; /* Write the DCB address to the DESC address for this channel */ - dev_write32(sinfo, CMICX_DMA_DESC_LOr + 0x80 * chan, dcb); - dev_write32(sinfo, CMICX_DMA_DESC_HIr + 0x80 * chan, DMA_TO_BUS_HI(dcb >> 32)); + DEV_WRITE32(sinfo, CMICX_DMA_DESC_LOr + 0x80 * chan, dcb); + DEV_WRITE32(sinfo, CMICX_DMA_DESC_HIr + 0x80 * chan, DMA_TO_BUS_HI(dcb >> 32)); MEMORY_BARRIER; /* Kick it off */ - dev_read32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, &ctrl); + DEV_READ32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, &ctrl); ctrl |= CMICX_DC_CMC_ENABLE; - dev_write32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, ctrl); + DEV_WRITE32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, ctrl); MEMORY_BARRIER; @@ -1670,26 +1620,25 @@ xgsx_dma_chan_start(bkn_switch_info_t *sinfo, int chan, uint64_t dcb) static int xgsx_dma_chan_abort(bkn_switch_info_t *sinfo, int chan, int polls) { - uint32_t ctrl = 0; - uint32_t stat = 0; + uint32_t ctrl, stat; int p; /* Skip abort sequence if channel is not active */ - dev_read32(sinfo, CMICX_DMA_STATr + 0x80 * chan, &stat); + DEV_READ32(sinfo, CMICX_DMA_STATr + 0x80 * chan, &stat); if (!(stat & CMICX_DS_CMC_DMA_ACTIVE)) { return 0; } /* Abort the channel */ - dev_read32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, &ctrl); + DEV_READ32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, &ctrl); ctrl |= CMICX_DC_CMC_ENABLE | CMICX_DC_CMC_ABORT; - dev_write32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, ctrl); + DEV_WRITE32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, ctrl); MEMORY_BARRIER; /* Poll for abort completion */ for (p = 0; p < polls; p++) { - dev_read32(sinfo, CMICX_DMA_STATr + 0x80 * chan, &stat); + DEV_READ32(sinfo, CMICX_DMA_STATr + 0x80 * chan, &stat); if (!(stat & CMICX_DS_CMC_DMA_ACTIVE)) { /* Clear up channel */ xgsx_dma_chan_clear(sinfo, chan); @@ -1728,14 +1677,6 @@ xgsx_irq_mask_set(bkn_switch_info_t *sinfo, uint32_t mask) uint32_t irq_mask, irq_fmask, disable_mask; uint32_t fmask = CMICX_TXRX_IRQ_MASK; - /* Devices id started with 0x8 is always from DNX devices */ - if ((sinfo->device_id & 0x8000) == 0x8000) { - if (sinfo->pcie_link_status == PCIE_LINK_STATUS_DOWN) { - /* Bypass hw access when PCIE Link is down */ - return; - } - } - if (sinfo->napi_poll_mode) { mask = 0; } @@ -2368,9 +2309,6 @@ bkn_rx_refill(bkn_switch_info_t *sinfo, int chan) return; } - /* Add meta data length */ - resv_size += sinfo->pkt_hdr_size; - while (sinfo->rx[chan].free < MAX_RX_DCBS) { desc = &sinfo->rx[chan].desc[sinfo->rx[chan].cur]; if (desc->skb == NULL) { @@ -2378,7 +2316,6 @@ bkn_rx_refill(bkn_switch_info_t *sinfo, int chan) if (skb == NULL) { break; } - /* Reserve buffer space for RCPU encapsulation if needed */ skb_reserve(skb, SKB_DATA_ALIGN(resv_size)); desc->skb = skb; } else { @@ -3056,9 +2993,7 @@ bkn_dpp_packet_parse_otsh( BKN_DPP_OTSH_OAM_SUB_TYPE_NOF_BITS, &oam_sub_type); if ((oam_sub_type == BKN_DPP_OTSH_OAM_SUB_TYPE_DM_1588) || (oam_sub_type == BKN_DPP_OTSH_OAM_SUB_TYPE_DM_NTP)) { - if (sinfo->oam_dm_tod_exist) { - *is_oam_dm_tod_en = TRUE; - } + *is_oam_dm_tod_en = TRUE; /* Down MEP DM trapped packets will not have UDH present (even if configured), except for QAX when custom_feature_oam_dm_tod_msb_add_enable=0 */ if (!sinfo->no_skip_udh_check) { *is_skip_udh = TRUE; @@ -4129,7 +4064,6 @@ bkn_do_skb_rx(bkn_switch_info_t *sinfo, int chan, int budget) bkn_priv_t *mpriv; struct sk_buff *mskb = NULL; uint32_t *rx_cb_meta; - int metalen; if (!sinfo->rx[chan].running) { /* Rx not ready */ @@ -4206,22 +4140,6 @@ bkn_do_skb_rx(bkn_switch_info_t *sinfo, int chan, int budget) err_woff = sinfo->pkt_hdr_size / sizeof(uint32_t) - 1; meta[err_woff] = dcb[sinfo->dcb_wsize-1]; } else { - /* Packet sent from R5(KNETSYNC) has EP_TO_CPU_HDR in skb->data - * and not in dcb header. Information within the EP_TO_CPU_HDR - * is considered as metadata to find the KNET filter. - * - * Below WAR implementation is to copy the EP_TO_CPU_HDR from - * sdk->data to dcb header(with EP_TO_CPU as 0's) for further - * packet processing. - */ - if (sinfo->dcb_type == 37 && dcb[5] == 0) { - metalen = (sinfo->dcb_wsize - 3) * sizeof(uint32_t); - meta = (uint32_t *)skb->data; - for (idx = 0; idx < BYTES2WORDS(metalen); idx++) { - dcb[idx + 2] = ntohl(meta[idx]); - } - skip_hdrlen = metalen; - } meta = dcb; err_woff = sinfo->dcb_wsize - 1; } @@ -4542,101 +4460,6 @@ bkn_do_rx(bkn_switch_info_t *sinfo, int chan, int budget) } } -static void -bkn_rx_debug_dump(bkn_switch_info_t *sinfo, int chan) -{ - uint32_t *dcb = NULL; - bkn_dcb_chain_t *dcb_chain = NULL; - struct list_head *curr, *next; - int cnt; - uint32_t irq_stat, dma_stat, dma_ctrl; - - gprintk("Rx%d DCB info (dev_no %d):\n" - " api: %d\n" - " dirty: %d\n" - " cur: %d\n" - " free: %d\n" - " run: %d\n", - chan, sinfo->dev_no, - sinfo->rx[chan].api_active, - sinfo->rx[chan].dirty, - sinfo->rx[chan].cur, - sinfo->rx[chan].free, - sinfo->rx[chan].running); - if (sinfo->rx[chan].use_rx_skb) { - gprintk(" [0x%08lx]--->\n", - (unsigned long)sinfo->rx[chan].desc[0].dcb_dma); - for (cnt = 0; cnt < MAX_RX_DCBS; cnt++) { - dcb = sinfo->rx[chan].desc[cnt].dcb_mem; - if (sinfo->cmic_type == 'x') { - gprintk(" DCB %2d: 0x%08x 0x%08x 0x%08x 0x%08x\n", cnt, - dcb[0], dcb[1], dcb[2], dcb[sinfo->dcb_wsize-1]); - } else { - gprintk(" DCB %2d: 0x%08x 0x%08x ... 0x%08x\n", cnt, - dcb[0], dcb[1], dcb[sinfo->dcb_wsize-1]); - } - } - } else { - curr = &sinfo->rx[chan].api_dcb_list; - dcb_chain = sinfo->rx[chan].api_dcb_chain; - while (dcb_chain) { - gprintk(" [0x%08lx]--->\n", (unsigned long)dcb_chain->dcb_dma); - for (cnt = 0; cnt < dcb_chain->dcb_cnt; cnt++) { - dcb = &dcb_chain->dcb_mem[sinfo->dcb_wsize * cnt]; - if (sinfo->cmic_type == 'x') { - gprintk(" DCB %2d: 0x%08x 0x%08x 0x%08x 0x%08x\n", cnt, - dcb[0], dcb[1], dcb[2], dcb[sinfo->dcb_wsize-1]); - } else { - gprintk(" DCB %2d: 0x%08x 0x%08x ... 0x%08x\n", cnt, - dcb[0], dcb[1], dcb[sinfo->dcb_wsize-1]); - } - } - next = curr->next; - if (next != &sinfo->rx[chan].api_dcb_list) { - dcb_chain = list_entry(next, bkn_dcb_chain_t, list); - curr = next; - } else { - dcb_chain = NULL; - } - } - } - - irq_stat = dma_stat = dma_ctrl = 0; - if (DEV_IS_CMICX(sinfo)) { - dev_read32(sinfo, - CMICX_IRQ_STATr, - &irq_stat); - dev_read32(sinfo, - CMICX_DMA_STATr, - &dma_stat); - dev_read32(sinfo, - CMICX_DMA_CTRLr + 0x80 * (XGS_DMA_RX_CHAN + chan), - &dma_ctrl); - } else if (DEV_IS_CMICM(sinfo)) { - dev_read32(sinfo, - CMICM_IRQ_STATr, - &irq_stat); - dev_read32(sinfo, - CMICM_DMA_STATr, - &dma_stat); - dev_read32(sinfo, - CMICM_DMA_CTRLr + 0x80 * (XGS_DMA_RX_CHAN + chan), - &dma_ctrl); - } else { - dev_read32(sinfo, - CMIC_IRQ_STATr, - &irq_stat); - dev_read32(sinfo, - CMIC_DMA_STATr, - &dma_stat); - dev_read32(sinfo, - CMIC_DMA_CTRLr + 0x80 * (XGS_DMA_RX_CHAN + chan), - &dma_ctrl); - } - gprintk("CMIC irq_stat:0x%08x dma_stat:0x%08x dma_ctrl(RX%d):0x%08x \n", - irq_stat, dma_stat, chan, dma_ctrl); -} - static void bkn_rx_desc_done(bkn_switch_info_t *sinfo, int chan) { @@ -4677,7 +4500,6 @@ bkn_rx_chain_done(bkn_switch_info_t *sinfo, int chan) } if (++maxloop > rx_sync_retry) { gprintk("Fatal error: Incomplete chain\n"); - bkn_rx_debug_dump(sinfo, chan); sinfo->rx[chan].chain_complete = 1; break; } @@ -4763,22 +4585,14 @@ bkn_hw_tstamp_tx_set(bkn_switch_info_t *sinfo, struct sk_buff *skb) hwts = KNET_SKB_CB(skb)->hwts; ts = KNET_SKB_CB(skb)->ts; - if (device_is_dnx(sinfo)) { - port = port + 1; - if (knet_hw_tstamp_tx_time_get_cb(sinfo->dev_no, port, skb->data + hdrlen, &ts, hwts) < 0) { - DBG_VERB(("Error in setting tx tstsamp \n")); - return -1; + + if (hwts == HWTSTAMP_TX_ONESTEP_SYNC) { + if (ts == 0) { + return 1; } - } else { - if (hwts == HWTSTAMP_TX_ONESTEP_SYNC) { - if (ts == 0) { - return 1; - } - } else if (hwts == HWTSTAMP_TX_ON) { - if (knet_hw_tstamp_tx_time_get_cb(sinfo->dev_no, port, skb->data + hdrlen, &ts, hwts) < 0) { - DBG_VERB(("Error in setting tx tstsamp \n")); - return -1; - } + } else if (hwts == HWTSTAMP_TX_ON) { + if (knet_hw_tstamp_tx_time_get_cb(sinfo->dev_no, port, skb->data + hdrlen, &ts) < 0) { + return -1; } } @@ -4795,41 +4609,23 @@ bkn_hw_tstamp_tx_work(struct work_struct *work) bkn_switch_info_t *sinfo = container_of(work, bkn_switch_info_t, tx_ptp_work); struct sk_buff *skb; int ret; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)) - ktime_t tstamp; -#endif while (skb_queue_len(&sinfo->tx_ptp_queue)) { skb = skb_dequeue(&sinfo->tx_ptp_queue); - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)) - tstamp = skb->tstamp; -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)) - /* - * For Linux versions with simultaneous SW and HW TS support. - * If the driver sends out SW TS included in skb->tstamp, then the - * Kernel will no longer send the HW TS to the application, - * so set the populated skb->tstamp to 0. - */ - skb->tstamp = 0; -#endif - ret = bkn_hw_tstamp_tx_set(sinfo, skb); if (ret < 0) { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)) ktime_t now; now = ktime_get(); DBG_PTP(("2Step TX Timestamp has not been taken for the current skb (%lld us)\n", - ktime_us_delta(now, tstamp))); + ktime_us_delta(now, skb->tstamp))); } else { ktime_t now; now = ktime_get(); /* Timeout 20 should be same as configured by PTP4L */ - if (ktime_us_delta(now, tstamp) >= 20000) { + if (ktime_us_delta(now, skb->tstamp) >= 20000) { DBG_PTP(("2Step TX Timestamp fetch took long time %lld us\n", - ktime_us_delta(now, tstamp))); + ktime_us_delta(now, skb->tstamp))); } #else DBG_PTP(("2Step TX Timestamp has not been taken for the current skb\n")); @@ -5182,11 +4978,11 @@ xgs_do_dma(bkn_switch_info_t *sinfo, int budget) { int rx_dcbs_done = 0, tx_dcbs_done = 0; int chan_done, budget_chans = 0; - uint32_t dma_stat = 0; + uint32_t dma_stat; int chan; int unet_chans = 0; - dev_read32(sinfo, CMIC_DMA_STATr, &dma_stat); + DEV_READ32(sinfo, CMIC_DMA_STATr, &dma_stat); for (chan = 0; chan < sinfo->rx_chans; chan++) { if (UNET_CH(sinfo, XGS_DMA_RX_CHAN + chan)) { @@ -5246,16 +5042,16 @@ xgsm_do_dma(bkn_switch_info_t *sinfo, int budget) { int rx_dcbs_done = 0, tx_dcbs_done = 0; int chan_done, budget_chans = 0; - uint32_t dma_stat =0, irq_stat = 0; + uint32_t dma_stat, irq_stat = 0; int chan; int unet_chans = 0; /* Get Controlled interrupt states for Continuous DMA mode */ if (sinfo->cdma_channels) { - dev_read32(sinfo, CMICM_IRQ_STATr, &irq_stat); + DEV_READ32(sinfo, CMICM_IRQ_STATr, &irq_stat); } - dev_read32(sinfo, CMICM_DMA_STATr, &dma_stat); + DEV_READ32(sinfo, CMICM_DMA_STATr, &dma_stat); for (chan = 0; chan < sinfo->rx_chans; chan++) { if (UNET_CH(sinfo, XGS_DMA_RX_CHAN + chan)) { @@ -5325,20 +5121,18 @@ xgsx_do_dma(bkn_switch_info_t *sinfo, int budget) { int rx_dcbs_done = 0, tx_dcbs_done = 0; int chan_done, budget_chans = 0; - uint32_t irq_stat = 0; - uint32_t tx_dma_stat = 0; - uint32_t rx_dma_stat[NUM_CMICX_RX_CHAN] = {0}; + uint32_t irq_stat, tx_dma_stat, rx_dma_stat[NUM_CMICX_RX_CHAN]; int chan; int unet_chans = 0; - dev_read32(sinfo, CMICX_IRQ_STATr, &irq_stat); - dev_read32(sinfo, CMICX_DMA_STATr + 0x80 * XGS_DMA_TX_CHAN, &tx_dma_stat); + DEV_READ32(sinfo, CMICX_IRQ_STATr, &irq_stat); + DEV_READ32(sinfo, CMICX_DMA_STATr + 0x80 * XGS_DMA_TX_CHAN, &tx_dma_stat); for (chan = 0; chan < sinfo->rx_chans; chan++) { if (UNET_CH(sinfo, XGS_DMA_RX_CHAN + chan)) { unet_chans++; continue; } - dev_read32(sinfo, + DEV_READ32(sinfo, CMICX_DMA_STATr + 0x80 * (XGS_DMA_RX_CHAN + chan), &rx_dma_stat[chan]); } @@ -5422,10 +5216,10 @@ dev_do_dma(bkn_switch_info_t *sinfo, int budget) static void xgs_isr(bkn_switch_info_t *sinfo) { - uint32_t irq_stat = 0; + uint32_t irq_stat; int rx_dcbs_done; - dev_read32(sinfo, CMIC_IRQ_STATr, &irq_stat); + DEV_READ32(sinfo, CMIC_IRQ_STATr, &irq_stat); if ((irq_stat & sinfo->irq_mask) == 0) { /* Not ours */ return; @@ -5450,10 +5244,10 @@ xgs_isr(bkn_switch_info_t *sinfo) static void xgsm_isr(bkn_switch_info_t *sinfo) { - uint32_t irq_stat = 0; + uint32_t irq_stat; int rx_dcbs_done; - dev_read32(sinfo, CMICM_IRQ_STATr, &irq_stat); + DEV_READ32(sinfo, CMICM_IRQ_STATr, &irq_stat); if ((irq_stat & sinfo->irq_mask) == 0) { /* Not ours */ return; @@ -5484,10 +5278,10 @@ xgsm_isr(bkn_switch_info_t *sinfo) static void xgsx_isr(bkn_switch_info_t *sinfo) { - uint32_t irq_stat = 0; + uint32_t irq_stat; int rx_dcbs_done; - dev_read32(sinfo, CMICX_IRQ_STATr, &irq_stat); + DEV_READ32(sinfo, CMICX_IRQ_STATr, &irq_stat); if ((irq_stat & sinfo->irq_mask) == 0) { /* Not ours */ return; @@ -5499,7 +5293,7 @@ xgsx_isr(bkn_switch_info_t *sinfo) int chan = 0; for (chan = 0; chan < NUM_DMA_CHAN; chan++) { if (irq_stat & CMICX_DS_CMC_CHAIN_DONE(chan)) { - dev_read32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, &ctrl); + DEV_READ32(sinfo, CMICX_DMA_CTRLr + 0x80 * chan, &ctrl); if (ctrl & CMICX_DC_CMC_ABORT) { DBG_IRQ(("chain %d: chain done for Abort\n", chan)); return; @@ -5902,19 +5696,17 @@ bkn_hw_tstamp_tx_config(bkn_switch_info_t *sinfo, return 0; } - if (!md && !device_is_dnx(sinfo)) { + if (!md) { return -1; } switch (sinfo->dcb_type) { case 28: /* dpp */ - case 39: /* DNX - Q2A, J2C */ break; case 26: case 32: case 33: case 35: - case 37: meta[2] |= md[0]; meta[3] |= md[1]; meta[4] |= md[2]; @@ -5949,7 +5741,7 @@ bkn_tx(struct sk_buff *skb, struct net_device *dev) uint8_t cpu_channel = 0; int headroom, tailroom; - DBG_VERB(("Netif Tx(%s): Len=%d priv->id=%d\n", dev->name, skb->len, priv->id)); + DBG_VERB(("Netif Tx: Len=%d priv->id=%d\n", skb->len, priv->id)); if (priv->id <= 0) { /* Do not transmit on base device */ @@ -5987,12 +5779,8 @@ bkn_tx(struct sk_buff *skb, struct net_device *dev) /* Account for extra OAM-TS header. */ if ((bkn_skb_tx_flags(skb) & SKBTX_HW_TSTAMP) && (hdrlen > (BKN_DNX_PTCH_2_SIZE))) { - /* T_LOCAL_PORT intf will use Module Hdr + PTCH + ITMH + ASE1588 + TSH */ - if (device_is_dnx(sinfo)) { - hdrlen += (BKN_DNX_FTMH_APP_SPECIFIC_EXT_SIZE + BKN_DNX_TSH_SIZE); - } else { - hdrlen += BKN_DPP_OTSH_SIZE_BYTE; - } + /* T_LOCAL_PORT intf will use PTCH_2 + ITMH */ + hdrlen += BKN_DPP_OTSH_SIZE_BYTE; } } @@ -6083,7 +5871,7 @@ bkn_tx(struct sk_buff *skb, struct net_device *dev) tailroom = FCS_SZ; new_skb = skb_copy_expand(skb, headroom + skb_headroom(skb), - tailroom, + tailroom + skb_tailroom(skb), GFP_ATOMIC); if (new_skb == NULL) { DBG_WARN(("Tx drop: No SKB memory\n")); @@ -6135,7 +5923,7 @@ bkn_tx(struct sk_buff *skb, struct net_device *dev) tailroom = FCS_SZ; new_skb = skb_copy_expand(skb, headroom + skb_headroom(skb), - tailroom, + tailroom + skb_tailroom(skb), GFP_ATOMIC); if (new_skb == NULL) { DBG_WARN(("Tx drop: No SKB memory\n")); @@ -6172,7 +5960,7 @@ bkn_tx(struct sk_buff *skb, struct net_device *dev) tailroom = FCS_SZ; new_skb = skb_copy_expand(skb, headroom + skb_headroom(skb), - tailroom, + tailroom + skb_tailroom(skb), GFP_ATOMIC); if (new_skb == NULL) { DBG_WARN(("Tx drop: No SKB memory\n")); @@ -6873,7 +6661,6 @@ bkn_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info) case 36: case 38: case 40: - case 37: info->so_timestamping = SOF_TIMESTAMPING_TX_HARDWARE | SOF_TIMESTAMPING_TX_SOFTWARE | SOF_TIMESTAMPING_RX_HARDWARE | @@ -6888,21 +6675,6 @@ bkn_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info) info->phc_index = -1; } break; - case 39: /* dnx - q2a, j2c */ - info->so_timestamping = SOF_TIMESTAMPING_TX_HARDWARE | - SOF_TIMESTAMPING_TX_SOFTWARE | - SOF_TIMESTAMPING_RX_HARDWARE | - SOF_TIMESTAMPING_RX_SOFTWARE | - SOF_TIMESTAMPING_SOFTWARE | - SOF_TIMESTAMPING_RAW_HARDWARE; - info->tx_types = 1 << HWTSTAMP_TX_OFF | 1 << HWTSTAMP_TX_ON | 1 << HWTSTAMP_TX_ONESTEP_SYNC; - info->rx_filters = 1 << HWTSTAMP_FILTER_NONE | 1 << HWTSTAMP_FILTER_ALL; - if (knet_hw_tstamp_ptp_clock_index_cb) { - info->phc_index = knet_hw_tstamp_ptp_clock_index_cb(sinfo->dev_no); - } else { - info->phc_index = -1; - } - break; default: info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE | SOF_TIMESTAMPING_RX_SOFTWARE | @@ -6916,27 +6688,29 @@ bkn_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info) #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)) -static int -bkn_get_link_ksettings(struct net_device *netdev, - struct ethtool_link_ksettings *cmd) +static int bkn_get_link_ksettings(struct net_device *netdev, + struct ethtool_link_ksettings *cmd) { bkn_priv_t *priv = netdev_priv(netdev); - cmd->base.speed = priv->link_settings.speed; - cmd->base.duplex = priv->link_settings.duplex; - + /* only speed info now, can enhance later */ + if (priv) { + cmd->base.speed = priv->link_settings.speed; + cmd->base.duplex = priv->link_settings.duplex; + } return 0; } -static int -bkn_set_link_ksettings(struct net_device *netdev, - const struct ethtool_link_ksettings *cmd) +static int bkn_set_link_ksettings(struct net_device *netdev, + const struct ethtool_link_ksettings *cmd) { bkn_priv_t *priv = netdev_priv(netdev); - priv->link_settings.speed = cmd->base.speed; - priv->link_settings.duplex = cmd->base.speed ? DUPLEX_FULL : 0; - + /* only speed info now, can enhance later */ + if (priv) { + priv->link_settings.speed = cmd->base.speed; + priv->link_settings.duplex = cmd->base.speed? DUPLEX_FULL : 0; + } return 0; } #endif @@ -6981,6 +6755,7 @@ bkn_init_ndev(u8 *mac, char *name) dev->mtu = rx_buffer_size; } #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) + dev->min_mtu = 68; dev->max_mtu = rx_buffer_size; #endif @@ -7003,9 +6778,11 @@ bkn_init_ndev(u8 *mac, char *name) if (name && *name) { strncpy(dev->name, name, IFNAMSIZ-1); } + #if defined(CONFIG_NET_NS) bkn_dev_net_set(dev, current->nsproxy->net_ns); #endif + /* Register the kernel Ethernet device */ if (register_netdev(dev)) { DBG_WARN(("Error registering Ethernet device.\n")); @@ -7132,11 +6909,11 @@ bkn_proc_link_write(struct file *file, const char *buf, struct proc_ops bkn_proc_link_file_ops = { PROC_OWNER(THIS_MODULE) - .proc_open = bkn_proc_link_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_write = bkn_proc_link_write, - .proc_release = single_release, + .proc_open = bkn_proc_link_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_write = bkn_proc_link_write, + .proc_release = single_release, }; /* @@ -7242,11 +7019,11 @@ bkn_proc_rate_write(struct file *file, const char *buf, struct proc_ops bkn_proc_rate_file_ops = { PROC_OWNER(THIS_MODULE) - .proc_open = bkn_proc_rate_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_write = bkn_proc_rate_write, - .proc_release = single_release, + .proc_open = bkn_proc_rate_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_write = bkn_proc_rate_write, + .proc_release = single_release, }; /* @@ -7492,10 +7269,10 @@ bkn_seq_dma_open(struct inode *inode, struct file *file) static struct proc_ops bkn_seq_dma_file_ops = { PROC_OWNER(THIS_MODULE) - .proc_open = bkn_seq_dma_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_release = seq_release + .proc_open = bkn_seq_dma_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = seq_release }; /* @@ -7582,7 +7359,7 @@ bkn_proc_debug_show(struct seq_file *m, void *v) seq_printf(m, " force_tagged: %d\n", force_tagged); seq_printf(m, " ft_tpid: %d\n", ft_tpid); seq_printf(m, " ft_pri: %d\n", ft_pri); - seq_printf(m, " ft_cfi: %d\n", ft_cfi); + seq_printf(m, " ft_pri: %d\n", ft_cfi); seq_printf(m, " ft_tpid: %d\n", ft_vid); seq_printf(m, "Active IOCTLs:\n"); seq_printf(m, " Command: %d\n", ioctl_cmd); @@ -7615,8 +7392,7 @@ bkn_proc_debug_show(struct seq_file *m, void *v) sinfo->oamp_ports[1], sinfo->oamp_ports[2], sinfo->oamp_ports[3]); - seq_printf(m, " device_id: 0x%x\n", sinfo->device_id); - seq_printf(m, " pcie_status: %d\n", sinfo->pcie_link_status); + unit++; } @@ -7630,11 +7406,11 @@ static int bkn_proc_debug_open(struct inode * inode, struct file * file) struct proc_ops bkn_proc_debug_file_ops = { PROC_OWNER(THIS_MODULE) - .proc_open = bkn_proc_debug_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_write = bkn_proc_debug_write, - .proc_release = single_release, + .proc_open = bkn_proc_debug_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_write = bkn_proc_debug_write, + .proc_release = single_release, }; /* @@ -7648,11 +7424,10 @@ bkn_proc_stats_show(struct seq_file *m, void *v) bkn_switch_info_t *sinfo; bkn_filter_t *filter; int chan; - unsigned long flags; + list_for_each(list, &_sinfo_list) { sinfo = (bkn_switch_info_t *)list; - spin_lock_irqsave(&sinfo->lock, flags); seq_printf(m, "Device stats (unit %d):\n", unit); seq_printf(m, " Interrupts %10u\n", sinfo->interrupts); @@ -7680,7 +7455,6 @@ bkn_proc_stats_show(struct seq_file *m, void *v) } unit++; - spin_unlock_irqrestore(&sinfo->lock, flags); } return 0; } @@ -7761,11 +7535,11 @@ bkn_proc_stats_write(struct file *file, const char *buf, struct proc_ops bkn_proc_stats_file_ops = { PROC_OWNER(THIS_MODULE) - .proc_open = bkn_proc_stats_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_write = bkn_proc_stats_write, - .proc_release = single_release, + .proc_open = bkn_proc_stats_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_write = bkn_proc_stats_write, + .proc_release = single_release, }; @@ -7779,11 +7553,9 @@ bkn_proc_dstats_show(struct seq_file *m, void *v) struct list_head *list; bkn_switch_info_t *sinfo; int chan; - unsigned long flags; list_for_each(list, &_sinfo_list) { sinfo = (bkn_switch_info_t *)list; - spin_lock_irqsave(&sinfo->lock, flags); seq_printf(m, "Device debug stats (unit %d):\n", unit); seq_printf(m, " Tx drop no skb %10u\n", @@ -7837,7 +7609,6 @@ bkn_proc_dstats_show(struct seq_file *m, void *v) chan, sinfo->rx[chan].pkts_d_no_api_buf); } unit++; - spin_unlock_irqrestore(&sinfo->lock, flags); } return 0; } @@ -7941,11 +7712,11 @@ bkn_proc_dstats_write(struct file *file, const char *buf, struct proc_ops bkn_proc_dstats_file_ops = { PROC_OWNER(THIS_MODULE) - .proc_open = bkn_proc_dstats_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_write = bkn_proc_dstats_write, - .proc_release = single_release, + .proc_open = bkn_proc_dstats_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_write = bkn_proc_dstats_write, + .proc_release = single_release, }; /* @@ -8049,11 +7820,11 @@ bkn_proc_ptp_stats_write(struct file *file, const char *buf, size_t count, loff_ struct proc_ops bkn_proc_ptp_stats_file_ops = { PROC_OWNER(THIS_MODULE) - .proc_open = bkn_proc_ptp_stats_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_write = bkn_proc_ptp_stats_write, - .proc_release = single_release, + .proc_open = bkn_proc_ptp_stats_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_write = bkn_proc_ptp_stats_write, + .proc_release = single_release, }; @@ -8545,7 +8316,6 @@ bkn_knet_hw_init(kcom_msg_hw_init_t *kmsg, int len) sinfo->udh_size = kmsg->udh_size; sinfo->oamp_punt = kmsg->oamp_punted; sinfo->no_skip_udh_check = kmsg->no_skip_udh_check; - sinfo->oam_dm_tod_exist = kmsg->oam_dm_tod_exist; sinfo->system_headers_mode = kmsg->system_headers_mode; sinfo->udh_enable = kmsg->udh_enable; } @@ -8735,7 +8505,7 @@ bkn_knet_netif_create(kcom_msg_netif_create_t *kmsg, int len) priv->port = kmsg->netif.port; priv->phys_port = kmsg->netif.phys_port; priv->qnum = kmsg->netif.qnum; - memset(&(priv->link_settings), 0, sizeof(struct ethtool_link_settings)); + memset(&(priv->link_settings), 0, sizeof(struct ethtool_link_settings));; } else { if (device_is_sand(sinfo) && (priv->type == KCOM_NETIF_T_VLAN)) { /* PTCH.SSPA */ @@ -8811,7 +8581,6 @@ bkn_knet_netif_create(kcom_msg_netif_create_t *kmsg, int len) kmsg->netif.id = priv->id; memcpy(kmsg->netif.macaddr, dev->dev_addr, 6); memcpy(kmsg->netif.name, dev->name, KCOM_NETIF_NAME_MAX - 1); - if (knet_netif_create_cb != NULL) { int retv = knet_netif_create_cb(kmsg->hdr.unit, &(kmsg->netif), dev); if (retv) { @@ -8867,18 +8636,11 @@ bkn_knet_netif_destroy(kcom_msg_netif_destroy_t *kmsg, int len) return sizeof(kcom_msg_hdr_t); } - if (!device_is_sand(sinfo)) { - if (knet_netif_destroy_cb != NULL) { - int retv; - kcom_netif_t netif; - memset(&netif, 0, sizeof(kcom_netif_t)); - netif.id = priv->id; - retv = knet_netif_destroy_cb(kmsg->hdr.unit, &netif, priv->dev); - if (retv) { - gprintk("warning: knet_netif_destroy_cb() returned %d for netif '%s'\n", - retv, priv->dev? priv->dev->name : "unknown"); - } - } + if (knet_netif_destroy_cb != NULL) { + kcom_netif_t netif; + memset(&netif, 0, sizeof(kcom_netif_t)); + netif.id = priv->id; + knet_netif_destroy_cb(kmsg->hdr.unit, &netif, priv->dev); } list_del(&priv->list); @@ -9274,27 +9036,6 @@ bkn_knet_wb_cleanup(kcom_msg_wb_cleanup_t *kmsg, int len) return sizeof(kcom_msg_hdr_t); } -static int -bkn_knet_pcie_link_status_set(kcom_msg_pcie_link_status_t*kmsg, int len) -{ - bkn_switch_info_t *sinfo; - unsigned long flags; - - kmsg->hdr.type = KCOM_MSG_TYPE_RSP; - - sinfo = bkn_sinfo_from_unit(kmsg->hdr.unit); - if (sinfo == NULL) { - kmsg->hdr.status = KCOM_E_PARAM; - return sizeof(kcom_msg_hdr_t); - } - - cfg_api_lock(sinfo, &flags); - sinfo->pcie_link_status = kmsg->pcie_link_status; - cfg_api_unlock(sinfo, &flags); - - return sizeof(kcom_msg_hdr_t); -} - static int bkn_handle_cmd_req(kcom_msg_t *kmsg, int len) { @@ -9400,7 +9141,7 @@ bkn_handle_cmd_req(kcom_msg_t *kmsg, int len) /* Clean up for warmbooting */ len = bkn_knet_wb_cleanup(&kmsg->wb_cleanup, len); break; - case KCOM_M_CLOCK_CMD: + case KCOM_M_CLOCK_CMD: /* PHC clock control*/ if (knet_hw_tstamp_ioctl_cmd_cb) { bkn_switch_info_t *sinfo; @@ -9418,11 +9159,6 @@ bkn_handle_cmd_req(kcom_msg_t *kmsg, int len) len = sizeof(kcom_msg_hdr_t); } break; - case KCOM_M_PCIE_LINK_STATUS: - DBG_CMD(("KCOM_M_PCIE_LINK_STATUS\n")); - /* Set PCIE link status */ - len = bkn_knet_pcie_link_status_set(&kmsg->pcie_link_status, len); - break; default: DBG_WARN(("Unsupported command (type=%d, opcode=%d)\n", kmsg->hdr.type, kmsg->hdr.opcode)); @@ -9665,7 +9401,6 @@ bkn_knet_dev_init(int d) /* Initialize default RCPU signature */ if ((bde_dev = kernel_bde->get_dev(d)) != NULL) { sinfo->rcpu_sig = bde_dev->device & ~0xf; - sinfo->device_id= bde_dev->device & ~0xf; } /* Check for override */ if (rcpu_signature) { diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/bcm-knet.h b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/bcm-knet.h index 003495364853..2f15c83c6b17 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/bcm-knet.h +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/bcm-knet.h @@ -75,7 +75,7 @@ typedef int (*knet_hw_tstamp_enable_cb_f)(int dev_no, int phys_port, int tx_type); typedef int -(*knet_hw_tstamp_tx_time_get_cb_f)(int dev_no, int phys_port, uint8_t *pkt, uint64_t *ts, int tx_type); +(*knet_hw_tstamp_tx_time_get_cb_f)(int dev_no, int phys_port, uint8_t *pkt, uint64_t *ts); typedef int (*knet_hw_tstamp_tx_meta_get_cb_f)(int dev_no, int hwts, int hdrlen, struct sk_buff *skb, uint64_t *ts, uint32_t **md); @@ -182,6 +182,7 @@ bkn_netif_destroy_cb_register(knet_netif_cb_f netif_cb); extern int bkn_netif_destroy_cb_unregister(knet_netif_cb_f netif_cb); + #endif #endif /* __LINUX_BCM_KNET_H__ */ diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/lkm.h b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/lkm.h index 7a749a40a9dd..3d66635977b2 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/lkm.h +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/lkm.h @@ -42,7 +42,7 @@ #include #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) #error Kernel too old #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/Makefile b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/Makefile index 79223a372d47..52b776f82b6c 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/Makefile @@ -35,66 +35,31 @@ include ${SDK}/make/Make.config LIBS = $(LIBDIR)/libkern.a +ifeq ($(kernel_version),2_4) +MODULE = $(LIBDIR)/linux-knet-cb.o +else KERNEL_MODULE_DIR = kernel_module THIS_MOD_NAME := linux-knet-cb MODULE = $(LIBDIR)/$(THIS_MOD_NAME).o KMODULE = $(LIBDIR)/$(THIS_MOD_NAME).ko -# BCM Network Device - -ifeq (1,$(NO_PRECOMPILED_MODULE)) -# { -KBUILD_EXTRA_SYMBOLS := ${BLDDIR}/../bcm-knet/Module.symvers -export KBUILD_EXTRA_SYMBOLS -# -# These are the objects which need to be compiled, in the kernel, to -# created the module object file. -# -SRCS_COMPOSING = knet-cb.c ../shared/gmodule.c -OBJECTS_COMPOSING = "knet-cb.o gmodule.o" +build: $(MODULE) $(KMODULE) +endif -build: $(KMODULE) -# -# Note that for NO_PRECOMPILED_MODULE, the subdirectory 'systems/linux/kernel/modules/knet-cb/kernel_module' -# is not created and all action is done in systems/linux/kernel/modules/knet-cb -# -$(KMODULE): $(SRCS_COMPOSING) - rm -fr $(BLDDIR)/$(KERNEL_MODULE_DIR) - rm -f $(BLDDIR)/*.c - rm -f $(BLDDIR)/*.o - rm -f $(BLDDIR)/*.ko - cp ${SDK}/make/Makefile.linux-kmodule $(BLDDIR)/Makefile - cp ./*.c $(BLDDIR)/ - cp ../shared/*.c $(BLDDIR)/ - # - # Wait until bcm-knet compilation is over so that we can copy its resultant - # Module.symvers - # - if [ ! -f ${KBUILD_EXTRA_SYMBOLS} ]; then sleep 5; fi - cat ${KBUILD_EXTRA_SYMBOLS} > $(BLDDIR)/Module.symvers - MOD_OBJS=$(OBJECTS_COMPOSING) MOD_NAME=$(THIS_MOD_NAME) $(MAKE) -C $(BLDDIR) $(THIS_MOD_NAME).ko LOC_BLDDIR=$(BLDDIR) LOC_SRCDIR=$(PWD) -# } -else -# { KBUILD_EXTRA_SYMBOLS := ${BLDDIR}/../bcm-knet/kernel_module/Module.symvers -export KBUILD_EXTRA_SYMBOLS -build: $(MODULE) $(KMODULE) -# -# This is for the compilation of the 'precompiled' object. We keep it -# here for compatibility. -# +# BCM Network Device + $(MODULE): $(BLDDIR)/.tree $(BOBJS) $(LIBS) $(LD) $(MODULE_LDFLAGS) -r -d $(BOBJS) $(LIBS) -o $@ - +ifneq ($(kernel_version),2_4) $(KMODULE): $(MODULE) rm -fr $(BLDDIR)/$(KERNEL_MODULE_DIR) mkdir $(BLDDIR)/$(KERNEL_MODULE_DIR) cp ${SDK}/make/Makefile.linux-kmodule $(BLDDIR)/$(KERNEL_MODULE_DIR)/Makefile cat ${KBUILD_EXTRA_SYMBOLS} > $(BLDDIR)/$(KERNEL_MODULE_DIR)/Module.symvers MOD_NAME=$(THIS_MOD_NAME) KBUILD_EXTRA_SYMBOLS="${KBUILD_EXTRA_SYMBOLS}" $(MAKE) -C $(BLDDIR)/$(KERNEL_MODULE_DIR) $(THIS_MOD_NAME).ko -# } endif # Make.depend is before clean:: so that Make.depend's clean:: runs first. @@ -105,4 +70,6 @@ clean:: $(RM) $(BLDDIR)/version.c $(BLDDIR)/version.o $(RM) $(BOBJS) $(MODULE) +ifneq ($(kernel_version),2_4) .PHONY: build +endif diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/knet-cb.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/knet-cb.c index 89428e072f6e..b420e30a3729 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/knet-cb.c +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/knet-cb.c @@ -46,7 +46,7 @@ #include /* Enable sflow sampling using psample */ -#ifdef PSAMPLE_SUPPORT +#if IS_ENABLED(CONFIG_PSAMPLE) #include "psample-cb.h" #endif @@ -334,7 +334,7 @@ knet_filter_cb(uint8_t * pkt, int size, int dev_no, void *meta, int chan, kcom_filter_t *kf) { /* check for filter callback handler */ -#ifdef PSAMPLE_SUPPORT +#if IS_ENABLED(CONFIG_PSAMPLE) if (strncmp(kf->desc, PSAMPLE_CB_NAME, strlen(PSAMPLE_CB_NAME)) == 0) { return psample_filter_cb (pkt, size, dev_no, meta, chan, kf); } @@ -343,21 +343,21 @@ knet_filter_cb(uint8_t * pkt, int size, int dev_no, void *meta, } static int -knet_netif_create_cb(int unit, kcom_netif_t *netif, struct net_device *dev) +knet_netif_create_cb(int unit, kcom_netif_t *netif, uint16 spa, struct net_device *dev) { int retv = 0; -#ifdef PSAMPLE_SUPPORT - retv = psample_netif_create_cb(unit, netif, dev); +#if IS_ENABLED(CONFIG_PSAMPLE) + retv = psample_netif_create_cb(unit, netif, spa, dev); #endif return retv; } static int -knet_netif_destroy_cb(int unit, kcom_netif_t *netif, struct net_device *dev) +knet_netif_destroy_cb(int unit, kcom_netif_t *netif, uint16 spa, struct net_device *dev) { int retv = 0; -#ifdef PSAMPLE_SUPPORT - retv = psample_netif_destroy_cb(unit, netif, dev); +#if IS_ENABLED(CONFIG_PSAMPLE) + retv = psample_netif_destroy_cb(unit, netif, spa, dev); #endif return retv; } @@ -367,7 +367,7 @@ knet_filter_cb(uint8_t * pkt, int size, int dev_no, void *meta, int chan, kcom_filter_t *kf) { /* check for filter callback handler */ -#ifdef PSAMPLE_SUPPORT +#if IS_ENABLED(CONFIG_PSAMPLE) if (strncmp(kf->desc, PSAMPLE_CB_NAME, KCOM_FILTER_DESC_MAX) == 0) { return psample_filter_cb (pkt, size, dev_no, meta, chan, kf); } @@ -379,7 +379,7 @@ static int knet_netif_create_cb(int unit, kcom_netif_t *netif, struct net_device *dev) { int retv = 0; -#ifdef PSAMPLE_SUPPORT +#if IS_ENABLED(CONFIG_PSAMPLE) retv = psample_netif_create_cb(unit, netif, dev); #endif return retv; @@ -389,7 +389,7 @@ static int knet_netif_destroy_cb(int unit, kcom_netif_t *netif, struct net_device *dev) { int retv = 0; -#ifdef PSAMPLE_SUPPORT +#if IS_ENABLED(CONFIG_PSAMPLE) retv = psample_netif_destroy_cb(unit, netif, dev); #endif return retv; @@ -427,7 +427,7 @@ _cleanup(void) bkn_netif_create_cb_unregister(knet_netif_create_cb); bkn_netif_destroy_cb_unregister(knet_netif_destroy_cb); -#ifdef PSAMPLE_SUPPORT +#if IS_ENABLED(CONFIG_PSAMPLE) psample_cleanup(); #endif return 0; @@ -445,7 +445,7 @@ _init(void) bkn_tx_skb_cb_register(strip_tag_tx_cb); } -#ifdef PSAMPLE_SUPPORT +#if IS_ENABLED(CONFIG_PSAMPLE) psample_init(); #endif bkn_filter_cb_register(knet_filter_cb); diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.c index 38c5bee6f848..2228eb44d5d3 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.c +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.c @@ -98,14 +98,6 @@ LKM_MOD_PARAM(psample_qlen, "i", int, 0); MODULE_PARM_DESC(psample_qlen, "psample queue length (default 1024 buffers)"); -#if !IS_ENABLED(CONFIG_PSAMPLE) -inline struct -psample_group *psample_group_get(struct net *net, u32 group_num) -{ - return NULL; -} -#endif - /* driver proc entry root */ static struct proc_dir_entry *psample_proc_root = NULL; static struct proc_dir_entry *knet_cb_proc_root = NULL; @@ -402,6 +394,7 @@ psample_task(struct work_struct *work) unsigned long flags; struct list_head *list_ptr, *list_next; psample_pkt_t *pkt; + struct psample_metadata md = {0}; spin_lock_irqsave(&psample_work->lock, flags); list_for_each_safe(list_ptr, list_next, &psample_work->pkt_list) { @@ -413,32 +406,18 @@ psample_task(struct work_struct *work) /* send to psample */ if (pkt) { -#if ((IS_ENABLED(CONFIG_PSAMPLE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,13,0)) || \ - (defined PSAMPLE_MD_EXTENDED_ATTR && PSAMPLE_MD_EXTENDED_ATTR)) - struct psample_metadata md = {0}; - md.trunc_size = pkt->meta.trunc_size; - md.in_ifindex = pkt->meta.src_ifindex; - md.out_ifindex = pkt->meta.dst_ifindex; -#endif PSAMPLE_CB_DBG_PRINT("%s: group 0x%x, trunc_size %d, src_ifdx 0x%x, dst_ifdx 0x%x, sample_rate %d\n", __func__, pkt->group->group_num, pkt->meta.trunc_size, pkt->meta.src_ifindex, pkt->meta.dst_ifindex, pkt->meta.sample_rate); -#if ((IS_ENABLED(CONFIG_PSAMPLE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,13,0)) || \ - (defined PSAMPLE_MD_EXTENDED_ATTR && PSAMPLE_MD_EXTENDED_ATTR)) + md.trunc_size = pkt->meta.trunc_size; + md.in_ifindex = pkt->meta.src_ifindex; + md.out_ifindex = pkt->meta.dst_ifindex; psample_sample_packet(pkt->group, pkt->skb, pkt->meta.sample_rate, &md); -#else - psample_sample_packet(pkt->group, - pkt->skb, - pkt->meta.trunc_size, - pkt->meta.src_ifindex, - pkt->meta.dst_ifindex, - pkt->meta.sample_rate); -#endif g_psample_stats.pkts_f_psample_mod++; dev_kfree_skb_any(pkt->skb); @@ -532,7 +511,7 @@ psample_filter_cb(uint8_t * pkt, int size, int dev_no, void *pkt_meta, /* setup skb to point to pkt */ memcpy(skb->data, pkt, meta.trunc_size); skb_put(skb, meta.trunc_size); - skb->len = meta.trunc_size; + skb->len = size; /* SONIC-55684 */ psample_pkt->skb = skb; spin_lock_irqsave(&g_psample_work.lock, flags); @@ -1037,7 +1016,7 @@ int psample_init(void) struct proc_dir_entry *entry; /* create procfs for psample */ - knet_cb_proc_root = proc_mkdir(PSAMPLE_PROCFS_PATH, NULL); + proc_mkdir(PSAMPLE_PROCFS_PATH, NULL); snprintf(psample_procfs_path, sizeof(psample_procfs_path), "%s/%s", PSAMPLE_PROCFS_PATH, PSAMPLE_CB_NAME); psample_proc_root = proc_mkdir(psample_procfs_path, NULL); diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.h b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.h index 40408819ef74..8f9398c51692 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.h +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.h @@ -42,7 +42,7 @@ typedef struct { struct list_head list; struct net_device *dev; uint16 id; - uint16 port; + uint8 port; uint16 vlan; uint16 qnum; uint32 sample_rate; diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/gmodule.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/gmodule.c index fd43ee5bd726..df6e2d6bb681 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/gmodule.c +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/gmodule.c @@ -141,11 +141,11 @@ static int _gmodule_proc_release(struct inode * inode, struct file * file) { struct proc_ops _gmodule_proc_fops = { PROC_OWNER(THIS_MODULE) - .proc_open = _gmodule_proc_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_write = _gmodule_proc_write, - .proc_release = _gmodule_proc_release, + .proc_open = _gmodule_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_write = _gmodule_proc_write, + .proc_release = _gmodule_proc_release, }; #else int diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/ksal.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/ksal.c index c4a9f9ce309a..9c093e0eacdf 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/ksal.c +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/ksal.c @@ -192,9 +192,9 @@ uint32 sal_time_usecs(void) { #if !defined(SAI_FIXUP) - struct timeval ltv; - do_gettimeofday(<v); - return (ltv.tv_sec * SECOND_USEC + ltv.tv_usec); + struct timeval ltv; + do_gettimeofday(<v); + return (ltv.tv_sec * SECOND_USEC + ltv.tv_usec); #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) /* ktime_to_us and ktime_get_real_ns return 64-bit integets, but this */ diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/common/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/common/Makefile index fe1b6fd08cea..a72dba96f6e2 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/user/common/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/user/common/Makefile @@ -144,7 +144,6 @@ endif ifdef BUILD_PSAMPLE ADD_TO_CFLAGS += -DPSAMPLE_SUPPORT endif - ADD_TO_CFLAGS += -I$(SDK)/systems/linux/kernel/modules/include COND_KNET_LIBS = libuser.$(libext) endif @@ -205,7 +204,7 @@ clean:: subdirs="shared bcm-knet knet-cb" \ override-target=linux-$(platform) $@ $(RM) $(KERNEL_BDE) $(USER_BDE) - $(RM) $(BCM_KNET) $(KNET_CB) + $(RM) $(BCM_KNET) $(KNET_CB) $(PSAMPLE) $(RM) $(KERN_BLDROOT)/linux-kernel-bde.$(KOBJ) $(RM) $(KERN_BLDROOT)/linux-user-bde.$(KOBJ) $(RM) $(KERN_BLDROOT)/linux-bcm-knet.$(KOBJ) diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/gts/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/gts/Makefile index 921ce62ebaf0..d02c97e3f906 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/user/gts/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/user/gts/Makefile @@ -62,7 +62,7 @@ endif export SDK -override kernel_version=5_10 +override kernel_version=5_4 platform=gts LINUX_MAKE_USER=1 diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/xlr/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/xlr/Makefile index a5b0dadf8e6e..377cf43ab68b 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/user/xlr/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/user/xlr/Makefile @@ -62,7 +62,7 @@ endif export SDK -override kernel_version=5_10 +override kernel_version=5_4 platform=xlr LINUX_MAKE_USER=1