swiGetBoardClock

Retrieves the board clocking configuration and the current status of the clocks.

Prototype

DWORD swiGetBoardClock ( SWIHD swihd, DWORD clocktype, SWI_QUERY_CLOCK_ARGS *args, unsigned size )

Argument

Description

swihd

Switch handle.

clocktype

Specifies the MVIP standard to which clocking on the board applies. Refer to the Details section for acceptable values.

args

Pointer to a clock parameter structure for querying the CT bus board clock:

typedef struct
{
    DWORD size;
    DWORD clocktype;
    DWORD clocksource;
    DWORD network;
    union
    {
       struct
       {
              DWORD mc1clockmode;
              DWORD autofallback;
              DWORD fallbackoccurred;
       } mc1;  /* only for MC1*/

       struct
       {
              DWORD clockmode;
              DWORD autofallback;
              DWORD fallbackoccurred;
              DWORD clockstatus_a;
              DWORD clockstatus_b;
              DWORD clockstatus_netref1;
              DWORD clockstatus_netref2;
       }h100; /* only for h100 */

    } ext; /* extension, specific parts for each board, based on
              clocktype */
} SWI_QUERY_CLOCK_ARGS;

Refer to the Details section for a description of these fields.

size

Specifies the number of bytes contained in the structure.


Return values

Return value

Description

SUCCESS

 

CTAERR_DRIVER_ERROR

Underlying driver retrieved an unrecognized error. Call swiGetLastError to retrieve the MVIP device error code.

CTAERR_INVALID_HANDLE

swihd is not a valid switch handle.

CTAERR_SVR_COMM

Communication error in the server environment.

SWIERR_INVALID_CLOCK_PARM

Value of a clock configuration parameter is invalid.

SWIERR_INVALID_PARAMETER

Board-specific clock parameter value is invalid.


Details

swiGetBoardClock retrieves information about the configuration of the board clocking and the current status of the clocks for a CT bus board.

H.100/H.110 are supported.

Acceptable values for clocktype are:

The clocksource and network fields of the SWI_QUERY_CLOCK_ARGS structure are identical across all board types.

Field

Description

clocksource

Origination of the clock reference. Acceptable values are:

MVIP95_SOURCE_INTERNAL

MVIP95_SOURCE_NETWORK

 

Additional values for clocksource for H.100/H.110 boards are:

MVIP95_SOURCE_H100_A

MVIP95_SOURCE_H100_B

MVIP95_SOURCE_H100_NETREF

MVIP95_SOURCE_H110_NETREF_1

MVIP95_SOURCE_H110_NETREF_2

network

Device source for the MVIP clock signals. Acceptable values for network are 1 to n where n is the number of devices on the specified board capable of being a clock source. A value for network is valid only when clocksource is equal to MVIP95_SOURCE_NETWORK.


The fields specific to the H.100/H.110 boards are described in the following table:

Field

Description

clockmode

Board's control of the H.100/H.110 clocks. Acceptable values are:

MVIP95_H100_SLAVE

MVIP95_H100_MASTER_A

MVIP95_H100_MASTER_B

MVIP95_H100_STAND_ALONE

autofallback

Whether the board is set to automatically switch to fallback mode and become a slave to the alternate H.100/H.110 clock. Acceptable values are:

MVIP95_H100_DISABLE_AUTO_FB

MVIP95_H100_ENABLE_AUTO_FB

fallbackoccurred

Wand has fallen back to the secondary reference. Acceptable values are:

MVIP95_H100_NO_FALLBACK_OCCURRED

MVIP95_H100_FALLBACK_OCCURRED

clockstatus_a

Quality of the A clock master signal. Acceptable values are:

MVIP95_CLOCK_STATUS_GOOD

MVIP95_CLOCK_STATUS_BAD

MVIP95_CLOCK_STATUS_UNKNOWN

clockstatus_b

Quality of the B clock master signal. Acceptable values are:

MVIP95_CLOCK_STATUS_GOOD

MVIP95_CLOCK_STATUS_BAD

MVIP95_CLOCK_STATUS_UNKNOWN

clockstatus_netref1

Quality of the NETREF (H.100) or NETREF_1 (H.110) clock signal. Acceptable values are:

MVIP95_CLOCK_STATUS_GOOD

MVIP95_CLOCK_STATUS_BAD

MVIP95_CLOCK_STATUS_UNKNOWN

clockstatus_netref2

Quality of the NETREF_2 (H.110 only) clock master signal. Acceptable values are:

MVIP95_CLOCK_STATUS_GOOD

MVIP95_CLOCK_STATUS_BAD

MVIP95_CLOCK_STATUS_UNKNOWN


Refer to Configuring the clocks for more information about querying clocks.

If CTAERR_DRIVER_ERROR is returned, call swiGetLastError to retrieve the MVIP device error code.

See also

swiConfigBoardClock, swiOpenSwitch

Example

void myGetClock (SWIHD swihd)
{
     SWI_QUERY_CLOCK_ARGS    queryclock;
     DWORD                   clocktype;
     unsigned                size;

     size = sizeof (SWI_QUERY_CLOCK_ARGS);
     swiGetBoardClock  (swihd,  clocktype, &queryclock, size);
}