Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/ibde.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* $Id: ibde.h,v 1.27 Broadcom SDK $
*
* $Copyright: 2017-2025 Broadcom Inc. All rights reserved.
* $Copyright: 2017-2026 Broadcom Inc. All rights reserved.
*
* Permission is granted to use, copy, modify and/or distribute this
* software under either one of the licenses below.
Expand Down
4 changes: 3 additions & 1 deletion include/kcom.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* $Id: kcom.h,v 1.9 Broadcom SDK $
* $Copyright: 2017-2025 Broadcom Inc. All rights reserved.
*
* $Copyright: 2017-2026 Broadcom Inc. All rights reserved.
*
* Permission is granted to use, copy, modify and/or distribute this
* software under either one of the licenses below.
Expand Down Expand Up @@ -209,6 +210,7 @@ typedef struct kcom_netif_s {

#define KCOM_FILTER_F_ANY_DATA (1U << 0)
#define KCOM_FILTER_F_STRIP_TAG (1U << 1)
#define KCOM_FILTER_F_OOB_RAW (1U << 2)

#define KCOM_FILTER_DESC_MAX 32

Expand Down
2 changes: 1 addition & 1 deletion include/sal/types.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* $Id: types.h,v 1.3 Broadcom SDK $
*
* $Copyright: 2017-2025 Broadcom Inc. All rights reserved.
* $Copyright: 2017-2026 Broadcom Inc. All rights reserved.
*
* Permission is granted to use, copy, modify and/or distribute this
* software under either one of the licenses below.
Expand Down
2 changes: 1 addition & 1 deletion include/sdk_config.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* $Id: sdk_config.h,v 1.5 Broadcom SDK $
*
* $Copyright: 2017-2025 Broadcom Inc. All rights reserved.
* $Copyright: 2017-2026 Broadcom Inc. All rights reserved.
*
* Permission is granted to use, copy, modify and/or distribute this
* software under either one of the licenses below.
Expand Down
82 changes: 82 additions & 0 deletions include/shared/bitop.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* $Id: bitop.h,v 1.16 Broadcom SDK $
*
* $Copyright: 2017-2026 Broadcom Inc. All rights reserved.
*
* Permission is granted to use, copy, modify and/or distribute this
* software under either one of the licenses below.
*
* License Option 1: GPL
*
* 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 (the "GPL").
*
* 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 version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*
*
* License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license
*
* This software is governed by the Broadcom Open Network Switch APIs license:
* https://www.broadcom.com/products/ethernet-connectivity/software/opennsa $
*
*
*
* Bit Array Operations
*/

#ifndef _SHR_BITOP_H
#define _SHR_BITOP_H

#include <sal/types.h>

/* Base type for declarations */
#define SHR_BITDCL uint32
#define SHR_BITWID 32

/* (internal) Number of SHR_BITDCLs needed to contain _max bits */
#define _SHR_BITDCLSIZE(_max) (((_max) + SHR_BITWID - 1) / SHR_BITWID)
#define SHRi_BITDCLSIZE(_max) (((_max) + SHR_BITWID - 1) / SHR_BITWID)

/* Size for giving to malloc and memset to handle _max bits */
#define SHR_BITALLOCSIZE(_max) (_SHR_BITDCLSIZE(_max) * sizeof (SHR_BITDCL))


/* (internal) Number of SHR_BITDCLs needed to contain from start bit to start bit + range */
#define _SHR_BITDCLSIZE_FROM_START_BIT(_start_bit, _range) (_range + _start_bit -1)/SHR_BITWID - _start_bit/SHR_BITWID + 1

/* Size of SHR_BITDCLs needed to contain from start bit to start bit + range.
Needed when you want to do autosync */
#define SHR_BITALLOCSIZE_FROM_START_BIT(_start_bit, _range) (_SHR_BITDCLSIZE_FROM_START_BIT(_start_bit, _range) * sizeof (SHR_BITDCL))



/* Declare bit array _n of size _max bits */
#define SHR_BITDCLNAME(_n, _max) SHR_BITDCL _n[_SHR_BITDCLSIZE(_max)]
/* Declare bit array _n of size _max bits, and clear it */
#define SHR_BIT_DCL_CLR_NAME(_n, _max) SHR_BITDCL _n[_SHR_BITDCLSIZE(_max)] = {0}

/* (internal) Generic operation macro on bit array _a, with bit _b */
#define _SHR_BITOP(_a, _b, _op) \
(((_a)[(_b) / SHR_BITWID]) _op (1U << ((_b) % SHR_BITWID)))

/* Specific operations */
#define SHR_BITGET(_a, _b) _SHR_BITOP(_a, _b, &)
#define SHR_BITSET(_a, _b) _SHR_BITOP(_a, _b, |=)
#define SHR_BITCLR(_a, _b) _SHR_BITOP(_a, _b, &= ~)
#define SHR_BITWRITE(_a, _b, _val) ((_val) ? SHR_BITSET(_a, _b) : SHR_BITCLR(_a, _b))
#define SHR_BIT_ITER(_a, _max, _b) \
for ((_b) = 0; (_b) < (_max); (_b)++) \
if ((_a)[(_b) / SHR_BITWID] == 0) \
(_b) += (SHR_BITWID - 1); \
else if (SHR_BITGET((_a), (_b)))

#define SHR_IS_BITSET(_a, _b) (_SHR_BITOP(_a, _b, &) ? TRUE : FALSE)

#endif /* !_SHR_BITOP_H */
103 changes: 103 additions & 0 deletions include/shared/error.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* $Id: error.h,v 1.23 Broadcom SDK $
*
* $Copyright: 2017-2026 Broadcom Inc. All rights reserved.
*
* Permission is granted to use, copy, modify and/or distribute this
* software under either one of the licenses below.
*
* License Option 1: GPL
*
* 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 (the "GPL").
*
* 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 version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*
*
* License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license
*
* This software is governed by the Broadcom Open Network Switch APIs license:
* https://www.broadcom.com/products/ethernet-connectivity/software/opennsa $
*
*
*
* This file defines common error codes to be shared between API layers.
*
* Its contents are not used directly by applications; it is used only
* by header files of parent APIs which need to define error codes.
*/

#ifndef _SHR_ERROR_H
#define _SHR_ERROR_H

typedef enum {
_SHR_E_NONE = 0,
_SHR_E_INTERNAL = -1,
_SHR_E_MEMORY = -2,
_SHR_E_UNIT = -3,
_SHR_E_PARAM = -4,
_SHR_E_EMPTY = -5,
_SHR_E_FULL = -6,
_SHR_E_NOT_FOUND = -7,
_SHR_E_EXISTS = -8,
_SHR_E_TIMEOUT = -9,
_SHR_E_BUSY = -10,
_SHR_E_FAIL = -11,
_SHR_E_DISABLED = -12,
_SHR_E_BADID = -13,
_SHR_E_RESOURCE = -14,
_SHR_E_CONFIG = -15,
_SHR_E_UNAVAIL = -16,
_SHR_E_INIT = -17,
_SHR_E_PORT = -18,
_SHR_E_IO = -19,
_SHR_E_ACCESS = -20,
_SHR_E_NO_HANDLER = -21,
_SHR_E_PARTIAL = -22,

_SHR_E_LIMIT = -23 /* Must come last */
} _shr_error_t;

#define _SHR_ERRMSG_INIT { \
"Ok", /* E_NONE */ \
"Internal error", /* E_INTERNAL */ \
"Out of memory", /* E_MEMORY */ \
"Invalid unit", /* E_UNIT */ \
"Invalid parameter", /* E_PARAM */ \
"Table empty", /* E_EMPTY */ \
"Table full", /* E_FULL */ \
"Entry not found", /* E_NOT_FOUND */ \
"Entry exists", /* E_EXISTS */ \
"Operation timed out", /* E_TIMEOUT */ \
"Operation still running", /* E_BUSY */ \
"Operation failed", /* E_FAIL */ \
"Operation disabled", /* E_DISABLED */ \
"Invalid identifier", /* E_BADID */ \
"No resources for operation", /* E_RESOURCE */ \
"Invalid configuration", /* E_CONFIG */ \
"Feature unavailable", /* E_UNAVAIL */ \
"Feature not initialized", /* E_INIT */ \
"Invalid port", /* E_PORT */ \
"I/O error", /* E_IO */ \
"Access error", /* E_ACCESS */ \
"No handler", /* E_NO_HANDLER */ \
"Partial success", /* E_PARTIAL */ \
"Unknown error" /* E_LIMIT */ \
}

extern char *_shr_errmsg[];

#define _SHR_ERRMSG(r) \
_shr_errmsg[(((int)r) <= 0 && ((int)r) > _SHR_E_LIMIT) ? -(r) : -_SHR_E_LIMIT]

#define _SHR_E_SUCCESS(rv) ((rv) >= 0)
#define _SHR_E_FAILURE(rv) ((rv) < 0)

#endif /* !_SHR_ERROR_H */
43 changes: 23 additions & 20 deletions include/soc/devids.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* $Id: devids.h,v 1.309 Broadcom SDK $
*
* $Copyright: 2017-2025 Broadcom Inc. All rights reserved.
* $Copyright: 2017-2026 Broadcom Inc. All rights reserved.
*
* Permission is granted to use, copy, modify and/or distribute this
* software under either one of the licenses below.
Expand Down Expand Up @@ -1767,17 +1767,14 @@
#define BCM8879C_DEVICE_ID 0x879C
#define BCM8879D_DEVICE_ID 0x879D
#define BCM8879E_DEVICE_ID 0x879E
#define BCM8879F_DEVICE_ID 0x879F
#define BCM8879F_DEVICE_ID 0x879F
#ifdef BCM_DNXF3_SUPPORT
#define RAMON2_DEVICE_ID 0x8910
#define BCM8891F_DEVICE_ID 0x891F
#define RAMON3_DEVICE_ID 0x8920
#endif
#ifdef BCM_DNXFE_SUPPORT
#ifdef BCM_RAMON_4_SUPPORT
#define RAMON4_DEVICE_ID 0x9470
#endif
#endif

#define ARADPLUS_DEVICE_ID 0x8660
#define ARADPLUS_A0_REV_ID 0x0001
#define BCM88660_DEVICE_ID ARADPLUS_DEVICE_ID
Expand Down Expand Up @@ -2086,24 +2083,24 @@
#define Q3U_ORIG_DEVICE_ID 0x8400
#define Q3N_ORIG_DEVICE_ID 0x8405
#endif
#ifdef BCM_JERICHO_4_SUPPORT
#define JERICHO4_DEVICE_ID 0x9450
#define Q4_DEVICE_ID 0x9420
#endif

#ifdef BCM_Q4D_SUPPORT
#define Q4D_DEVICE_ID 0x9430
#define Q4D_PT200_START_DEVICE_ID 0x9436
#define Q4D_PT200_END_DEVICE_ID 0x9439
#endif


#ifdef BCM_J4L_SUPPORT
#define J4L_DEVICE_ID 0x9410
#endif


#endif
#endif /* BCM_DNX3_SUPPORT */


#define JERICHO4_DEVICE_ID 0x9450
#define Q4_DEVICE_ID 0x9420
#define Q4D_DEVICE_ID 0x9430
#define Q4D_200G_START_DEVICE_ID 0x9436
#define Q4D_200G_END_DEVICE_ID 0x9439
#define J4L_DEVICE_ID 0x9410
#define Q4DL_DEVICE_ID 0x94E0
#define Q4DL_200G_START_DEVICE_ID 0x94E6
#define Q4DL_200G_END_DEVICE_ID 0x94E9

#define Q2A_DEVICE_ID 0x8480
#define Q2A_A0_REV_ID DNXC_A0_REV_ID
#define Q2A_B0_REV_ID DNXC_B0_REV_ID
Expand Down Expand Up @@ -2243,7 +2240,7 @@

#define PLX9056_DEVICE_ID 0x9056 /* needed for DNX_TEST_BOARD */

/* Tomahawk F1 */
/* Tomahawk Ultra */
#define BCM78920_DEVICE_ID 0xf920
#define BCM78920_A0_REV_ID 0x0001
#define BCM78923_DEVICE_ID 0xf923
Expand All @@ -2253,6 +2250,12 @@
#define BCM78928_DEVICE_ID 0xf928
#define BCM78928_A0_REV_ID 0x0001

/* Tomahawk Ultra */
#define BCM78920_B0_REV_ID 0x0011
#define BCM78923_B0_REV_ID 0x0011
#define BCM78924_B0_REV_ID 0x0011
#define BCM78928_B0_REV_ID 0x0011

/* Trident4 X11c */
#define BCM56890_DEVICE_ID 0xb890
#define BCM56890_A0_REV_ID 0x0001
Expand Down
2 changes: 1 addition & 1 deletion make/Make.clang
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# $Id: Make.clang
#
# $Copyright: 2017-2025 Broadcom Inc. All rights reserved.
# $Copyright: 2017-2026 Broadcom Inc. All rights reserved.
#
# Permission is granted to use, copy, modify and/or distribute this
# software under either one of the licenses below.
Expand Down
26 changes: 13 additions & 13 deletions make/Make.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# $Id: Make.config,v 1.3 Broadcom SDK $
#
# $Copyright: 2017-2025 Broadcom Inc. All rights reserved.
# $Copyright: 2017-2026 Broadcom Inc. All rights reserved.
#
# Permission is granted to use, copy, modify and/or distribute this
# software under either one of the licenses below.
Expand Down Expand Up @@ -83,25 +83,33 @@ endif # ALL_CHIPS

ifdef ALL_DNX2_CHIPS
CFGFLAGS += -DBCM_DNX_SUPPORT
CFGFLAGS += -DBCM_INSTANCE_SUPPORT
endif

ifdef ALL_DNX3_CHIPS
CFGFLAGS += -DBCM_DNX3_SUPPORT
CFGFLAGS += -DBCM_INSTANCE_SUPPORT
endif


ifdef ALL_DNXF1_CHIPS
CFGFLAGS += -DBCM_DNXF_SUPPORT
CFGFLAGS += -DBCM_INSTANCE_SUPPORT
endif

ifdef ALL_DNXF3_CHIPS
CFGFLAGS += -DBCM_DNXF3_SUPPORT
CFGFLAGS += -DBCM_INSTANCE_SUPPORT
endif

ifdef ALL_DNXGEN4_CHIPS
CFGFLAGS += -DBCM_JERICHO_4_SUPPORT
CFGFLAGS += -DBCM_J4L_SUPPORT
CFGFLAGS += -DBCM_Q4D_SUPPORT
CFGFLAGS += -DBCM_Q4DL_SUPPORT
endif

CFGFLAGS += -DBCM_INSTANCE_SUPPORT
# For PKTIO implementation files
ifdef PKTIO_IMPL
CFGFLAGS += -DPKTIO_IMPL=1
endif # PKTIO_IMPL

#
# By default, turn off the "changing directory" message.
Expand Down Expand Up @@ -212,14 +220,6 @@ CFLAGS += ${INCFLAGS}
CXXFLAGS += ${INCFLAGS}
CPPFLAGS += ${INCFLAGS}

CFLAGS += -DSAI_FIXUP -UKCOM_FILTER_MAX -DKCOM_FILTER_MAX=1025 -UKCOM_NETIF_MAX -DKCOM_NETIF_MAX=1056

# Flags for DNX ASIC family
CFLAGS += -DBCM_DNX_SUPPORT -DBCM_DNX2_SUPPORT -DBCM_DNXF_SUPPORT -DBCM_DNX3_SUPPORT
#
# # Flag to enable multi instance support
CFLAGS += -DBCM_INSTANCE_SUPPORT

#
# Debug #ifdef control
#
Expand Down
2 changes: 1 addition & 1 deletion make/Make.depend
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# $Id: Make.depend,v 1.14 Broadcom SDK $
#
# $Copyright: 2017-2025 Broadcom Inc. All rights reserved.
# $Copyright: 2017-2026 Broadcom Inc. All rights reserved.
#
# Permission is granted to use, copy, modify and/or distribute this
# software under either one of the licenses below.
Expand Down
Loading