File tree Expand file tree Collapse file tree 3 files changed +39
-1
lines changed
subsys/net/l2/ethernet/gptp Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,12 @@ extern "C" {
3434
3535#define GPTP_PRIORITY1_NON_GM_CAPABLE 255
3636#define GPTP_PRIORITY1_GM_CAPABLE 248
37+
38+ #if defined(CONFIG_NET_GPTP_BMCA_PRIORITY2 )
39+ #define GPTP_PRIORITY2_DEFAULT CONFIG_NET_GPTP_BMCA_PRIORITY2
40+ #else
3741#define GPTP_PRIORITY2_DEFAULT 248
42+ #endif
3843
3944/** @endcond */
4045
Original file line number Diff line number Diff line change @@ -195,6 +195,31 @@ config NET_GPTP_PATH_TRACE_ELEMENTS
195195 Announce message. Each array element takes 8 bytes. If this value
196196 is set to 8, then 8 * 8 = 64 bytes of memory is used.
197197
198+ config NET_GPTP_BMCA_PRIORITY1
199+ int "BMCA priority1 value"
200+ default 248 if NET_GPTP_GM_CAPABLE
201+ default 255
202+ range 0 255
203+ help
204+ The priority1 attribute of the local clock. It is used in the
205+ Best Master Clock selection Algorithm (BMCA), lower values take
206+ precedence. The default value is 255 if the device is non grand
207+ master capable, and 248 if it is GM capable.
208+ See Chapter 8.6.2.1 of IEEE 802.1AS for a more detailed description
209+ of priority1. Note that if the system is non GM capable, then the
210+ value 255 is used always and this setting is ignored.
211+
212+ config NET_GPTP_BMCA_PRIORITY2
213+ int "BMCA priority2 value"
214+ default 248
215+ range 0 255
216+ help
217+ The priority2 attribute of the local clock. It is used in the BMCA
218+ (Best Master Clock selection Algorithm), lower values take
219+ precedence. The default value is 248.
220+ See Chapter 8.6.2.5 of IEEE 802.1AS for a more detailed description
221+ of priority2.
222+
198223config NET_GPTP_STATISTICS
199224 bool "Collect gPTP statistics"
200225 help
Original file line number Diff line number Diff line change @@ -382,7 +382,15 @@ static void gptp_init_clock_ds(void)
382382 GPTP_OFFSET_SCALED_LOG_VAR_UNKNOWN ;
383383
384384 if (default_ds -> gm_capable ) {
385- default_ds -> priority1 = GPTP_PRIORITY1_GM_CAPABLE ;
385+ /* The priority1 value cannot be 255 for GM capable
386+ * system.
387+ */
388+ if (CONFIG_NET_GPTP_BMCA_PRIORITY1 ==
389+ GPTP_PRIORITY1_NON_GM_CAPABLE ) {
390+ default_ds -> priority1 = GPTP_PRIORITY1_GM_CAPABLE ;
391+ } else {
392+ default_ds -> priority1 = CONFIG_NET_GPTP_BMCA_PRIORITY1 ;
393+ }
386394 } else {
387395 default_ds -> priority1 = GPTP_PRIORITY1_NON_GM_CAPABLE ;
388396 }
You can’t perform that action at this time.
0 commit comments