mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
Move port_bit() to rtl837x_common.h as PORT_BIT(), a uint16_t shift, and MAC_ADDR_LEN from rtl837x_lldp.h next to it, and use MAC_ADDR_LEN for every address in the LACP code instead of a literal 6. Define lacp_mux_update() before its first caller and drop the forward declaration, declare variables at the top of their blocks, put the operator at the end of a continued line, drop the field value comments of the LACPDU struct, and leave lacp_port_lag to lacp_init() instead of initialising it in the test environment.
36 lines
899 B
C
36 lines
899 B
C
#ifndef _LLDP_H_
|
|
#define _LLDP_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
#define LLDP_MIN_ETHERNET_PAYLOAD_LENGTH 46
|
|
#define LLDP_ETHERTYPE 0x88cc
|
|
#define LLDP_ETHERTYPE_LENGTH 2
|
|
#define LLDP_MAX_FRAME 256
|
|
#define LLDP_TX_INTERVAL_TICKS 6000
|
|
|
|
#define LLDP_PORT_ID_TLV_TYPE 2
|
|
#define LLDP_PORT_ID_TLV_LENGTH 0x02
|
|
#define LLDP_PORT_ID_TLV_SUBTYPE 0x07
|
|
|
|
#define LLDP_TTL_TLV_TYPE 3
|
|
#define LLDP_TTL_TLV_LENGTH 2
|
|
#define LLDP_TTL_TTL_SECONDS 120
|
|
|
|
#define LLDP_CHASSIS_ID_TLV_TYPE 1
|
|
#define LLDP_CHASSIS_ID_TLV_LENGTH 7
|
|
#define LLDP_CHASSIS_ID_TLV_SUBTYPE 4
|
|
|
|
#define LLDP_SYSNAME_TLV_TYPE 5
|
|
#define LLDP_SYSDESC_TLV_TYPE 6
|
|
|
|
void lldp_init(void) __banked;
|
|
void lldp_tick(void) __banked;
|
|
void lldp_send(void) __banked;
|
|
void lldp_set_addresses(void) __banked;
|
|
void lldp_set_rtl_wrapper(void) __banked;
|
|
uint8_t lldp_sysname(__xdata uint8_t *p) __banked;
|
|
uint8_t lldp_sysdesc(__xdata uint8_t *p) __banked;
|
|
|
|
#endif
|