axiethernet: xavb_hw.c File Reference

| axiethernet Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
xavb_hw.c File Reference

## Overview

The xavb_hw driver.

Functions in this file are the minimum required functions for this driver. See xavb_hw.h for a detailed description of the driver.

    MODIFICATION HISTORY:

    Ver   Who  Date     Changes

    1.00a mbr  09/19/08 First release
    1.01a mbr  06/24/09 PTP frame format updates for IEEE802.1 AS draft 5-0
    2_02a mbr  09/16/09 Updates for programmable PTP timers
    2_04a kag  07/23/10 PTP frame format updates for IEEE802.1 AS draft 6-7
    3_01a kag  08/29/11 Added new APIs to update the RX Filter Control Reg.
                  Fix for CR:572539. Updated bit map for Rx Filter
                  control reg.

## Functions
void | XAvbMac_ReadStats (u32 BaseAddress, u32 CounterId, XAvb_Uint64 *Value)
| This function reads the given Ethernet Statistic Register. More...
void | XAvb_ReadRtc (u32 BaseAddress, XAvb_RtcFormat *RtcValue)
| This function reads the current Real Time Counter (RTC) value. More...
void | XAvb_WriteRtcOffset (u32 BaseAddress, XAvb_RtcFormat *RtcValue)
| This function writes to the Real Time Counter (RTC) Offset Registers. More...

## Function Documentation

void XAvb_ReadRtc | ( | u32 | BaseAddress,
|  | XAvb_RtcFormat * | RtcValue
| ) |  |

This function reads the current Real Time Counter (RTC) value.

Parameters

  BaseAddress | is the base address of the device
  RtcValue | is a pointer to a struct in which to store the value read from the RTC (The RTC 48-bit seconds field and the 32-bit ns field of this struct are updated).

Returns
  None

Note
  This is provided as a basic function since the ns field MUST be read before the seconds/epoch registers (reading the ns samples the entire RTC in hardware).

References XAvb_RtcFormat::NanoSeconds, XAvb_RtcFormat::SecondsLower, XAvb_RtcFormat::SecondsUpper, XAVB_RTC_NANOSEC_VALUE_OFFSET, XAVB_RTC_SEC_LOWER_VALUE_OFFSET, and XAVB_RTC_SEC_UPPER_VALUE_OFFSET.

Referenced by XAvb_CalcRtcOffset(), and XAvb_SendPDelayRespFollowUp().

void XAvb_WriteRtcOffset | ( | u32 | BaseAddress,
|  | XAvb_RtcFormat * | RtcValue
| ) |  |

This function writes to the Real Time Counter (RTC) Offset Registers.

Parameters

  BaseAddress | is the base address of the device
  RtcValue | is the nanoseconds and seconds offset values that should be written to the RTC.

Returns
  None

Note
  This is provided as a basic function since the ns field MUST be written after the seconds/epoch offset registers (writing to the ns offset registers samples the entire RTC offset in hardware).

References XAvb_RtcFormat::NanoSeconds, XAvb_RtcFormat::SecondsLower, XAvb_RtcFormat::SecondsUpper, XAVB_RTC_NANOSEC_OFFSET, XAVB_RTC_SEC_LOWER_OFFSET, and XAVB_RTC_SEC_UPPER_OFFSET.

Referenced by XAvb_CalcRtcOffset().

void XAvbMac_ReadStats | ( | u32 | BaseAddress,
|  | u32 | CounterId,
|  | XAvb_Uint64 * | Value
| ) |  |

This function reads the given Ethernet Statistic Register.

Parameters

  BaseAddress | is the base address of the device
  CounterID | is the Statistic Counter to be read
  Value | a pointer to the read value of the 64-bit value of the counter and it is updated by this function

Returns
  None.

Note
  The CounterID's defined here are the same as the Statistic Counter Addresses as used with the TEMAC core. Since each counter is 8-bytes wide, we must multiply these Counter ID's by 8 (or a left shift of 3) when mapping this into the PLB memory map. The 64-bit counter value is read as two separate 32-bit accesses.

References XAvb_Uint64::Lower, and XAvb_Uint64::Upper.