Commit b5ae33a0 authored by Cesar Prados's avatar Cesar Prados

lldp: add formfactor definition during compilation

define macro with the name of the formfactor to be used
by the preprocessor
parent 898d341c
......@@ -108,6 +108,7 @@ OUTPUT-$(CONFIG_WR_SWITCH) = rt_cpu
OUTPUT := $(OUTPUT-y)
GIT_VER = $(shell git describe --always --dirty | sed 's;^wr-switch-sw-;;')
FORM_FACTOR = "vetar2a"
all: tools $(OUTPUT).ram $(OUTPUT).vhd $(OUTPUT).mif
......@@ -138,7 +139,7 @@ sdb-lib/libsdbfs.a:
$(MAKE) -C sdb-lib
$(OUTPUT).elf: $(LDS-y) $(AUTOCONF) gitmodules $(OUTPUT).o config.o
$(CC) $(CFLAGS) -D__GIT_VER__="\"$(GIT_VER)\"" -c revision.c
$(CC) $(CFLAGS) -D__GIT_VER__="\"$(GIT_VER)\"" -c revision.c -D__FORM_FACTOR__="\"$(FORM_FACTOR)\""
${CC} -o $@ revision.o config.o $(OUTPUT).o $(LDFLAGS)
${OBJDUMP} -d $(OUTPUT).elf > $(OUTPUT)_disasm.S
$(SIZE) $@
......
......@@ -4,5 +4,6 @@
extern const char *build_revision;
extern const char *build_date;
extern const char *build_time;
extern const char *form_factor;
#endif /* __REVISION_H__ */
......@@ -99,7 +99,7 @@ static void lldp_add_tlv(int tlv_type) {
/* TLV Info srting */
/* fixme, define how to get formfactor name */
//strcpy(lldpdu+lldpdu_len, form_factor);
strcpy(lldpdu+lldpdu_len, form_factor);
lldpdu_len += tlv_type_len[tlv_type];
break;
case SYS_DESCR:
......
......@@ -13,6 +13,8 @@ const char *build_revision = stats.commit_id;
const char *build_date = stats.build_date;
const char *build_time = stats.build_time;
const char *form_factor = __FORM_FACTOR__;
/*
* We export softpll internal status to the ARM cpu, for SNMP. Thus,
* we place this structure at a known address in the linker script
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment