20 #include "modules/wltune.h"
31 #define IGNORE_WR_STATE
38 volatile WrxInfo * info =
wrxInfo();
40 if (info->wState == WRX_WRS_IDLE &&
41 info->pState == WRX_PTP_SLAVE &&
42 info->sState == WRX_WR_TRACK_PHASE)
return true;
45 if (info->wState == WRX_WRS_IDLE &&
46 info->pState == WRX_PTP_LISTENING &&
48 logInfo(
"No WhiteRabbit - For testing only!");
55 void _subsNetExecEvent (
ClbEvent event)
82 logError(
"Failed to initialize Wavelength tuning");
97 volatile WrxInfo * info =
wrxInfo();
98 #ifdef IGNORE_WR_STATE
99 if (!wrStateValid()) {
100 logWarn(
"Wrx not in correct state: whiteRabbit=%d, PTP=%d, SERVO=%d", info->wState, info->pState, info->sState);
103 if (!wrStateValid()) {
123 static void resolveSvrIp()
134 ms_mac_t * mac = ms_arp_lookup(&ip);
143 logInfo(
"Resolved MAC: %04x:%04x:%04x\n",
148 bool _subsNetUpdate(
ClbState state, uint32_t time)
163 volatile WrxInfo * info =
wrxInfo();
176 net.
wr_temp = info->brdTemp * 100 + info->brdTempFrac;;
177 net.
sfp_temp = info->sfpTemp * 100 + (info->sfpTempFrac * 100) / 256;
#define NET_WR_DELTA_MASTER_RX
Master receive delta delay index.
ClbEvent
All state change events.
#define NET_WR_DELTA_SLAVE_TX
Slave transmit delta delay index.
int16_t sfp_temp
SFP module temperature, in 1/100th of a degree.
static void _clbStateModErr(int idx)
Invoked by subsystem to indicate an error happened.
uint16_t tx_output_power
Receiver output power in steps of 0.1 uW per count.
uint16_t ipmux_srv_mac[3]
Server MAC address, set to 00 to resolve.
Provides access to all variables of the various subsystems.
bool netIpValid()
Returns whether or not the Ip is valid.
#define NET_WR_DELTA_MASTER_TX
Master transmit delta delay index.
void ipMuxFlush(uint32_t channelMask, uint8_t ipmFlushOp)
Flushes the IPMUX's FIFO's.
uint8_t clbSys2Idx[6]
Mapping from subsystem ID to index.
bool netMuxDest(uint32_t destIp, uint16_t *destMac)
Sets the IPMux destination.
#define logWarn(MSG,...)
Format a log message with warning level.
uint32_t ipmux_srv_ip
Server IP address (0xAABBCCDD = AA.BB.CC.DD)
int8_t wr_st_gen
White Rabbit general state.
bool netInit()
Initializes the network.
Undefined => Idle, for internal use only.
void errPrint(bool clear)
Prints the last error.
net_t net
Provides access to all process variables of subsystem Networking & IPMux.
int8_t wr_st_ptp
White Rabbit PTP State.
int32_t wr_delta[4]
White Rabbit Delta values, where each entry is a delta-value.
bool wrxUp()
Returns whether or not the WhiteRabbit interface is up and running.
void errClear()
Clears the current error.
volatile WrxInfo * wrxInfo()
Returns the whiteRabbit information structure if available, else NULL.
uint16_t wr_bitslide
White Rabbit Bitslide value.
uint16_t rx_input_power
Receiver input power in steps of 0.1 uW per count.
uint64_t wr_mu
White Rabbit Round-Trip time.
#define NET_WR_DELTA_SLAVE_RX
Slave receive delta delay index.
#define logError(MSG,...)
Format a log message with fatal level.
#define LOG_DEF(NAME,...)
Define a logger for a module.
The CLB stare module tracks is responsible for state management of the various sub-systems on the CLB...
void netShowInfo(bool extended)
Shows network configuration information.
Implements a generic logger facility.
void _clbStateError(int idx, int error, const char *message, const char *name)
Invoked by subsystem to indicate an error happened.
int16_t wr_temp
White Rabbit temperature (DS18S20), in 1/100th of a degree.
WhiteRabbit exchange exchanges information between the 2nd LM32 and WhiteRabbit though a small client...
#define logInfo(MSG,...)
Write a log message with formatting on info level.
void _clbStateUpdate(int idx, ClbEvent event, uint8_t status)
Invoked by the subsystem to indicate a state change has happened.
int64_t cable_rtt
Cable roundtrip time in ps.
int8_t wr_st_serv
White Rabbit servo state.