embeddedsw/XilinxProcessorIPLib/drivers/axiethernet/doc/html/api/xaxiethernet_8c.html
Jagannadha Sutradharudu Teki 2c8f92039d embeddesw: Add initial code support
Added initial support Xilinx Embedded Software.

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
2014-06-24 16:45:01 +05:30

747 lines
38 KiB
HTML
Executable file

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>
xaxiethernet.c File Reference
</title>
<link href="$DriverApiDocsCssPath" rel="stylesheet" type="text/css">
</head>
<h3 class="PageHeader">Xilinx Processor IP Library</h3>
<hl>Software Drivers</hl>
<hr class="whs1">
<!-- Generated by Doxygen 1.4.5 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li id="current"><a href="files.html"><span>Files</span></a></li>
</ul></div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul></div>
<h1>xaxiethernet.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
The APIs in this file takes care of the primary functionalities of the driver. The APIs in this driver take care of the following:<ul>
<li>Starting or stopping the Axi Ethernet device</li><li>Initializing and resetting the Axi Ethernet device</li><li>Setting MAC address and speed/duplex of the device</li><li>Provide means for controlling the PHY and communicating with it.</li><li>Turn on/off various features/options provided by the Axi Ethernet device. See xaxiethernet.h for a detailed description of the driver. <pre>
MODIFICATION HISTORY:</pre></li></ul>
<p>
<pre> Ver Who Date Changes
----- ---- -------- -------------------------------------------------------
1.00a asa 6/30/10 First release based on the ll temac driver
1.02a asa 2/16/11 Made changes in XAxiEthernet_Reset to insert delays.
3.02a srt 4/13/13 Removed Warnings (CR 704998).</pre><p>
<pre> </pre>
<p>
<code>#include &quot;xaxiethernet.h&quot;</code><br>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#df76ade0cc708e848d0e3548e6114b13">XAxiEthernet_CfgInitialize</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr, <a class="el" href="struct_x_axi_ethernet___config.html">XAxiEthernet_Config</a> *CfgPtr, u32 EffectiveAddress)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#ebf808ed517f7be044679be22fbffad9">XAxiEthernet_Start</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#f612e83401df444a65b347b1f362b13f">XAxiEthernet_Stop</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#e42187fefd122a2b619dc97c2a7c0b33">XAxiEthernet_Reset</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#eab21d5cc87aae3d1eefffd2995b7d13">XAxiEthernet_SetMacAddress</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr, void *AddressPtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#b4a5fdde3f95c34559d18df32ad95d5f">XAxiEthernet_GetMacAddress</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr, void *AddressPtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#ea64294862c24d58e7cff95c298d20e6">XAxiEthernet_SetOptions</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr, u32 Options)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#8494d5aa374f793966b46af9a075bdb0">XAxiEthernet_ClearOptions</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr, u32 Options)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">u32&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#d3a9d32232170e51d56eeb0c8e44e63f">XAxiEthernet_GetOptions</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">u16&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#b6479eadc2d5e93ac0de36a88ec43d97">XAxiEthernet_GetOperatingSpeed</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#81347c71343b37712fe42dae06190079">XAxiEthernet_SetOperatingSpeed</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr, u16 Speed)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#0476f4f80fadd3c109a7c43474b7b8f7">XAxiEthernet_SetBadFrmRcvOption</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#9f74dd5e7c70f17a8d2486e9dac62746">XAxiEthernet_ClearBadFrmRcvOption</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#5b1a34dda91053a9f95b17074423d124">XAxiEthernet_DisableControlFrameLenCheck</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#1a53d52223222eda2481312427593547">XAxiEthernet_EnableControlFrameLenCheck</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet_8c.html#fbb78f11a9d48de4072a2e507e09fcd4">XAxiEthernet_PhySetMdioDivisor</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *InstancePtr, u8 Divisor)</td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="df76ade0cc708e848d0e3548e6114b13"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_CfgInitialize" ref="df76ade0cc708e848d0e3548e6114b13" args="(XAxiEthernet *InstancePtr, XAxiEthernet_Config *CfgPtr, u32 EffectiveAddress)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int XAxiEthernet_CfgInitialize </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="struct_x_axi_ethernet___config.html">XAxiEthernet_Config</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>CfgPtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u32&nbsp;</td>
<td class="mdname" nowrap> <em>EffectiveAddress</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_CfgInitialize initializes an AXI Ethernet device along with the <em>InstancePtr</em> that references it.<p>
The PHY is setup independently from the Ethernet core. Use the MII or whatever other interface may be present for setup.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>references the memory instance to be associated with the AXI Ethernet core instance upon initialization. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>CfgPtr</em>&nbsp;</td><td>references the structure holding the hardware configuration for the Axi Ethernet core to initialize. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>EffectiveAddress</em>&nbsp;</td><td>is the processor address used to access the base address of the AXI Ethernet instance. In systems with an MMU and virtual memory, <em>EffectiveAddress</em> is the virtual address mapped to the physical in <code>ConfigPtr-&gt;Config.BaseAddress</code>. In systems without an active MMU, <em>EffectiveAddress</em> should be set to the same value as <code>ConfigPtr-&gt;Config.BaseAddress</code>.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>XST_SUCCESS.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="9f74dd5e7c70f17a8d2486e9dac62746"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_ClearBadFrmRcvOption" ref="9f74dd5e7c70f17a8d2486e9dac62746" args="(XAxiEthernet *InstancePtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XAxiEthernet_ClearBadFrmRcvOption </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_ClearBadFrmRcvOption is used to disable the bad frame receive option.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the Axi Ethernet instance to be worked on.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="8494d5aa374f793966b46af9a075bdb0"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_ClearOptions" ref="8494d5aa374f793966b46af9a075bdb0" args="(XAxiEthernet *InstancePtr, u32 Options)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int XAxiEthernet_ClearOptions </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u32&nbsp;</td>
<td class="mdname" nowrap> <em>Options</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_ClearOptions clears the options, <em>Options</em> for the Axi Ethernet, specified by <em>InstancePtr</em>. Axi Ethernet should be stopped with <a class="el" href="xaxiethernet_8c.html#f612e83401df444a65b347b1f362b13f">XAxiEthernet_Stop()</a> before changing options.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the Axi Ethernet instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Options</em>&nbsp;</td><td>is a bitmask of OR'd XAE_*_OPTION values for options to clear. Options not specified are not affected.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS on successful completion.</li><li>XST_DEVICE_IS_STARTED if the device has not been stopped.</li></ul>
</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>See xaxiethernet.h for a description of the available options. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="5b1a34dda91053a9f95b17074423d124"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_DisableControlFrameLenCheck" ref="5b1a34dda91053a9f95b17074423d124" args="(XAxiEthernet *InstancePtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XAxiEthernet_DisableControlFrameLenCheck </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_DisableControlFrameLenCheck is used to disable the length check for control frames (pause frames). This means once the API is called, control frames larger than the minimum frame length are accepted.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the Axi Ethernet instance to be worked on.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="1a53d52223222eda2481312427593547"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_EnableControlFrameLenCheck" ref="1a53d52223222eda2481312427593547" args="(XAxiEthernet *InstancePtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XAxiEthernet_EnableControlFrameLenCheck </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_EnableControlFrameLenCheck is used to enable the length check for control frames (pause frames). After calling the API, all control frames received will be checked for proper length (less than minimum frame length). By default, upon normal start up, control frame length check is enabled. Hence this API needs to be called only if previously the control frame length check has been disabled by calling the API XAxiEthernet_DisableControlFrameLenCheck.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the Axi Ethernet instance to be worked on.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="b4a5fdde3f95c34559d18df32ad95d5f"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_GetMacAddress" ref="b4a5fdde3f95c34559d18df32ad95d5f" args="(XAxiEthernet *InstancePtr, void *AddressPtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XAxiEthernet_GetMacAddress </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>void *&nbsp;</td>
<td class="mdname" nowrap> <em>AddressPtr</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_GetMacAddress gets the MAC address for the Axi Ethernet, specified by <em>InstancePtr</em> into the memory buffer specified by <em>AddressPtr</em>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the Axi Ethernet instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>AddressPtr</em>&nbsp;</td><td>references the memory buffer to store the retrieved MAC address. This memory buffer must be at least 6 bytes in length.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd></dd></dl>
This routine also supports the extended/new VLAN and multicast mode. The XAE_RAF_NEWFNCENBL_MASK bit dictates which offset will be configured. </td>
</tr>
</table>
<a class="anchor" name="b6479eadc2d5e93ac0de36a88ec43d97"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_GetOperatingSpeed" ref="b6479eadc2d5e93ac0de36a88ec43d97" args="(XAxiEthernet *InstancePtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">u16 XAxiEthernet_GetOperatingSpeed </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_GetOperatingSpeed gets the current operating link speed. This may be the value set by <a class="el" href="xaxiethernet_8c.html#81347c71343b37712fe42dae06190079">XAxiEthernet_SetOperatingSpeed()</a> or a hardware default.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the Axi Ethernet instance to be worked on.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>Returns the link speed in units of megabits per second (10 / 100 / 1000). Can return a value of 0, in case it does not get a valid speed from EMMC.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="d3a9d32232170e51d56eeb0c8e44e63f"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_GetOptions" ref="d3a9d32232170e51d56eeb0c8e44e63f" args="(XAxiEthernet *InstancePtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">u32 XAxiEthernet_GetOptions </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_GetOptions returns the current option settings.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the Axi Ethernet instance to be worked on.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>Returns a bitmask of XAE_*_OPTION constants, each bit specifying an option that is currently active.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>See xaxiethernet.h for a description of the available options. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="fbb78f11a9d48de4072a2e507e09fcd4"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_PhySetMdioDivisor" ref="fbb78f11a9d48de4072a2e507e09fcd4" args="(XAxiEthernet *InstancePtr, u8 Divisor)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XAxiEthernet_PhySetMdioDivisor </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u8&nbsp;</td>
<td class="mdname" nowrap> <em>Divisor</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_PhySetMdioDivisor sets the MDIO clock divisor in the Axi Ethernet,specified by <em>InstancePtr</em> to the value, <em>Divisor</em>. This function must be called once after each reset prior to accessing MII PHY registers.<p>
From the Virtex-6(TM) and Spartan-6 (TM) Embedded Tri-Mode Ethernet MAC User's Guide, the following equation governs the MDIO clock to the PHY:<p>
<pre>
f[HOSTCLK]
f[MDC] = -----------------------
(1 + Divisor) * 2
</pre><p>
where f[HOSTCLK] is the bus clock frequency in MHz, and f[MDC] is the MDIO clock frequency in MHz to the PHY. Typically, f[MDC] should not exceed 2.5 MHz. Some PHYs can tolerate faster speeds which means faster access.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>references the Axi Ethernet instance on which to operate. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Divisor</em>&nbsp;</td><td>is the divisor value to set within the range of 0 to XAE_MDIO_MC_CLK_DVD_MAX.</td></tr>
</table>
</dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="e42187fefd122a2b619dc97c2a7c0b33"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_Reset" ref="e42187fefd122a2b619dc97c2a7c0b33" args="(XAxiEthernet *InstancePtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XAxiEthernet_Reset </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_Reset does not perform a soft reset of the AxiEthernet core. AxiEthernet hardware is reset by the device connected to the AXI4-Stream interface. This function inserts some delay before proceeding to check for MgtRdy bit. The delay is necessary to be at a safe side. It takes a while for the reset process to complete and for any of the AxiEthernet registers to be accessed. It then checks for MgtRdy bit in IS register to know if AxiEthernet reset is completed or not. Subsequently it calls one more driver function to complete the AxiEthernet hardware initialization.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the Axi Ethernet instance to be worked on.</td></tr>
</table>
</dl>
<dl compact><dt><b>Note:</b></dt><dd>It is the responsibility of the user to reset the AxiEthernet hardware before using it. AxiEthernet hardware should be reset through the device connected to the AXI4-Stream interface of AxiEthernet. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="0476f4f80fadd3c109a7c43474b7b8f7"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_SetBadFrmRcvOption" ref="0476f4f80fadd3c109a7c43474b7b8f7" args="(XAxiEthernet *InstancePtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XAxiEthernet_SetBadFrmRcvOption </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_SetBadFrmRcvOption is used to enable the bad frame receive option. If enabled, this option ensures that bad receive frames are allowed and passed to the AXI4-Stream interface as if they are good frames.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the Axi Ethernet instance to be worked on.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="eab21d5cc87aae3d1eefffd2995b7d13"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_SetMacAddress" ref="eab21d5cc87aae3d1eefffd2995b7d13" args="(XAxiEthernet *InstancePtr, void *AddressPtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int XAxiEthernet_SetMacAddress </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>void *&nbsp;</td>
<td class="mdname" nowrap> <em>AddressPtr</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_SetMacAddress sets the MAC address for the Axi Ethernet device, specified by <em>InstancePtr</em> to the MAC address specified by <em>AddressPtr</em>. The Axi Ethernet device must be stopped before calling this function.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the Axi Ethernet instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>AddressPtr</em>&nbsp;</td><td>is a reference to the 6-byte MAC address to set.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS on successful completion.</li><li>XST_DEVICE_IS_STARTED if the Axi Ethernet device has not stopped,</li></ul>
</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>This routine also supports the extended/new VLAN and multicast mode. The XAE_RAF_NEWFNCENBL_MASK bit dictates which offset will be configured. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="81347c71343b37712fe42dae06190079"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_SetOperatingSpeed" ref="81347c71343b37712fe42dae06190079" args="(XAxiEthernet *InstancePtr, u16 Speed)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int XAxiEthernet_SetOperatingSpeed </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u16&nbsp;</td>
<td class="mdname" nowrap> <em>Speed</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_SetOperatingSpeed sets the current operating link speed. For any traffic to be passed, this speed must match the current MII/GMII/SGMII/RGMII link speed.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>references the Axi Ethernet on which to operate. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Speed</em>&nbsp;</td><td>is the speed to set in units of Mbps. Valid values are 10, 100, or 1000.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>- XST_SUCCESS on successful setting of speed.<ul>
<li>XST_FAILURE, if the speed cannot be set for the present harwdare configuration.</li></ul>
</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ea64294862c24d58e7cff95c298d20e6"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_SetOptions" ref="ea64294862c24d58e7cff95c298d20e6" args="(XAxiEthernet *InstancePtr, u32 Options)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int XAxiEthernet_SetOptions </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u32&nbsp;</td>
<td class="mdname" nowrap> <em>Options</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_SetOptions enables the options, <em>Options</em> for the Axi Ethernet, specified by <em>InstancePtr</em>. Axi Ethernet should be stopped with <a class="el" href="xaxiethernet_8c.html#f612e83401df444a65b347b1f362b13f">XAxiEthernet_Stop()</a> before changing options.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the Axi Ethernet instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Options</em>&nbsp;</td><td>is a bitmask of OR'd XAE_*_OPTION values for options to set. Options not specified are not affected.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS on successful completion.</li><li>XST_DEVICE_IS_STARTED if the device has not been stopped.</li></ul>
</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>See xaxiethernet.h for a description of the available options. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ebf808ed517f7be044679be22fbffad9"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_Start" ref="ebf808ed517f7be044679be22fbffad9" args="(XAxiEthernet *InstancePtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XAxiEthernet_Start </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_Start starts the Axi Ethernet device as follows:<ul>
<li>Enable transmitter if XAE_TRANSMIT_ENABLE_OPTION is set</li><li>Enable receiver if XAE_RECEIVER_ENABLE_OPTION is set</li></ul>
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the Axi Ethernet instance to be worked on. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="f612e83401df444a65b347b1f362b13f"></a><!-- doxytag: member="xaxiethernet.c::XAxiEthernet_Stop" ref="f612e83401df444a65b347b1f362b13f" args="(XAxiEthernet *InstancePtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XAxiEthernet_Stop </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
XAxiEthernet_Stop gracefully stops the Axi Ethernet device as follows:<ul>
<li>Disable all interrupts from this device</li><li>Disable the receiver</li></ul>
<p>
XAxiEthernet_Stop does not modify any of the current device options.<p>
Since the transmitter is not disabled, frames currently in internal buffers or in process by a DMA engine are allowed to be transmitted.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the Axi Ethernet instance to be worked on. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.