The goal is to be able to say "I want data at this rate on this channel" without worrying about the details; if that isn't possible there will be an error return.
There are two board-specific sets of functions (edt_ocm_xxx, edt_oc192_xxx) and a general set of edt_ocx_xxx. If a particular task is identical for both mezzanine cards, there will only be the edt_ocx_xxx version. Otherwise, the edt_ocx_xxx function will either call other edt_ocx_xxx functions or will call the board-specific version.
The initialization functions are separated into the following sequence of stages. It is possible to return to functions in the sequence for full or partial reinitialization a channel. At each stage in the sequence there will be different diagnostic functions available.
First, to start with the base board in an unknown state, call edt_ocx_base_init. This will make sure that at least a default baseboard and mezzanine bitfile(s) are loaded so the mezzanine board can be identified, and the PLLs between baseboard and mezzanine are in synch (checking both SYS_LOCK and LOCAL_SYS_LOCK).
This function will abort any dma on the other channel on the OCM card.
At this point the mezzanine card can be identified, and the SFP or XFP modules can be queried for their status.
Normally this function need only be called once after poweron, unless a different baseboard interface bitfile is requested.
The rate setting step makes sure that the correct mezzanine bitfile is loaded for the target line rate, and the correct clock source is selected. If an improper rate for the channel is requested, there will be a non-zero error return.
This sets the framing parameters, descrambling, enables memory, etc.
This starts the framer and resets the frontend PLLs. The channel fifo is flushed. Failure to see the SIG_DET bit or if the LOL bit is set will cause a non-zero error return.
This assumes that ring-buffers have been configured. It starts the ring-buffer acquisition, then turns on the channel enable bit to start DMA. If framing is enabled, it will wait for frame and return an error if framing times out.
|
Modules |
| | OCM Mezzanine Access Functions |
| | Setup and diagnostic functions specific to OCM mezzanine channels.
|
| | OC192 Mezzanine Access Functions |
| | Setup and diagnostic functions specific to OC192 mezzanine channels.
|
| | OC192 LIU Access Functions |
| | OC192 Mezzanine LIU Serial Access Functions The oc192_mdio functions are for reading and writing the LIU chip through its serial protocol.
|
Data Structures |
| struct | EdtOCConfig |
| | Structure used to pass configuration parameters to the edt_ocx_xxx routines. More...
|
| struct | EdtOCConfig |
| | Structure used to pass configuration parameters to the edt_ocx_xxx routines. More...
|
| struct | EdtOCXFrameErrors |
| | Structure used by function edt_ocx_get_framing_errors() for returning various framing errors from the framer registers. More...
|
| struct | EdtOCXFrameErrors |
| | Structure used by function edt_ocx_get_framing_errors() for returning various framing errors from the framer registers. More...
|
Defines |
|
#define | EDT_OCX_BYTE_SWAP 0x1 |
| | Flags for edt_ocx_configure.
|
|
#define | EDT_OCX_DESCRAMBLE 0x10 |
| | Turn on descrambler.
|
|
#define | EDT_OCX_ENABLE_MEM 0x20 |
| | Turn on mezzanine memory.
|
|
#define | EDT_OCX_FORCE_LOAD 0x20000 |
|
#define | EDT_OCX_FRAMED 0x8 |
| | Turn on framing.
|
|
#define | EDT_OCX_FULL_INIT 0x800 |
| | Initialize baseboard as well as mezzanine.
|
|
#define | EDT_OCX_INVERT 0x4000 |
| | Invert data when checking.
|
|
#define | EDT_OCX_LOOPBACK 0x2000 |
| | Enable loop back through LIU.
|
|
#define | EDT_OCX_LSB_FIRST 0x4 |
|
#define | EDT_OCX_NO_SIG_DET 0x40000 |
|
#define | EDT_OCX_ORDER_MASK 0x7 |
| | mask for lower three order bits
|
|
#define | EDT_OCX_OVHD_ONLY 0x40 |
| | Filter out overhead only.
|
|
#define | EDT_OCX_PRBS_EN 0x200 |
| | Turn on PRBS pattern generator in LIU.
|
|
#define | EDT_OCX_REMOTE_LPBK 0x10000 |
| | Enable remote loopback from LIU.
|
|
#define | EDT_OCX_RESYNCH 0x10000 |
|
#define | EDT_OCX_SCRAMBLE 0x1000 |
| | Scramble data going out.
|
|
#define | EDT_OCX_SET_DEMUX 0x8000 |
| | set the demux array
|
|
#define | EDT_OCX_SHORT_SWAP 0x2 |
|
#define | EDT_OCX_SKIP_LOAD 0x400 |
| | Disable loading correct bitfile - fail instead.
|
|
#define | EDT_OCX_SWAP (EDT_OCX_BYTE_SWAP | EDT_OCX_SHORT_SWAP) |
| | Both swaps give network order on x86 architecture.
|
|
#define | EDT_OCX_TAGGED_DATA 0x80000 |
| | turn on OC192 data tagging
|
Enumerations |
| enum | EdtLineRate |
| | line rate constants
|
Functions |
| int | edt_ocx_base_init (EdtDev *edt_p, EdtOCConfig *cfg) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_channel_set_rate (EdtDev *edt_p, EdtOCConfig *cfg) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_channel_setup (EdtDev *edt_p, EdtOCConfig *cfg) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_channel_signal_detect (EdtDev *edt_p) |
| | checks SIG_DET bit
|
| int | edt_ocx_channel_start (EdtDev *edt_p) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_check_interface (EdtDev *edt_p, char *target_file, int force_load) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_check_mezz_bitfile (EdtDev *edt_p, EdtOCConfig *cfg) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_configure (EdtDev *edt_p, EdtOCConfig *cfg) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| char * | edt_ocx_default_bitfile (int mezz_id) |
| | - Parameters:
-
| mezz.id | Either MEZZ_OCM or MEZZ_OC192 (filled in by edt_get_board_description) |
|
| int | edt_ocx_demux_chan_enable (EdtDev *edt_p, int channel, u_char state) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_demux_get (EdtDev *edt_p, EdtLineRate line_rate, u_char *onoff) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_demux_get_chan_enabled (EdtDev *edt_p, int channel) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_demux_set (EdtDev *edt_p, EdtLineRate line_rate, u_char *onoff) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| void | edt_ocx_enable_framing_errors (EdtDev *edt_p, int state) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_get_framing_errors (EdtDev *edt_p, EdtOCXFrameErrors *err_p) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_has_mezz_bitfile (EdtDev *edt_p, char *bitfile_name) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_load_default_mezzanine (EdtDev *edt_p, EdtLineRate line_rate, char *mezz_0, char *mezz_1) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_lock_channel_clock (EdtDev *edt_p, int channel, int timeout) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_lock_clocks (EdtDev *edt_p, int timeout) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_lock_local_clock (EdtDev *edt_p, int timeout) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| char * | edt_ocx_mezz_filename (EdtDev *edt_p, EdtLineRate line_rate) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| void | edt_ocx_reset_sys_en (EdtDev *edt_p, int channel) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
|
void | edt_ocx_set_channel_direction (EdtDev *edt_p, int channel, int do_write) |
| void | edt_ocx_set_channel_enable (EdtDev *edt_p, int channel, int state) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_set_clock_select (EdtDev *edt_p, EdtLineRate line_rate) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| void | edt_ocx_set_lsbfirst (EdtDev *edt_p, int channel, int state) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_speed_capable (EdtDev *edt_p, EdtLineRate line_rate) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
| int | edt_ocx_wait_for_frame (EdtDev *edt_p, int timeout) |
| | - Parameters:
-
| edt_p | pointer to device structure |
|
|
int | edt_reg_set_bitmask (EdtDev *edt_p, u_int reg, u_int mask, int state) |