<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";
mso-fareast-language:DA;}
span.EmailStyle19
{mso-style-type:personal-compose;
font-family:"Arial","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:3.0cm 2.0cm 3.0cm 2.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DA" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">We have been developing our own Ethernet-over-Ethercat capable slave module. We have currently a very simple implementation, with an microcontroller attached to
an ET1100 ASIC via SPI. By enabling EOE_SUPPORT, we have been able to send and receive Ethernet data over this setup.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">However we would like some more control over the assigned MAC address of the slave module. Right now, it is assigned a calculated value of 00:11:22:33:44:[some
index]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">We would like to set the MAC address to unique value from our own pool of MAC addresses, preferably with the command: “ifconfig eoe0s1 hw ether 00:AA:BB:CC:DD:EE”
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">When we do this, we get the error: “ifconfig: SIOCSIFHWADDR: Operation not supported”<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">As far as we can tell, is because in the initialization function: ec_eoe_init() in master/ethernet.c, an update-function is not assigned to the (*set_mac_address)
function pointer of the net_device.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">Would it be possible to add such a function to master/ethernet.c? An example could be:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<pre style="background:white"><a name="L282"></a><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/net/ethernet/eth.c#L282"><span lang="EN-US">282</span></a><span lang="EN-US" style="color:black"> int </span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=eth_mac_addr"><span lang="EN-US">eth_mac_addr</span></a></span><span lang="EN-US" style="color:black">(struct </span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=net_device"><span lang="EN-US">net_device</span></a></span><span lang="EN-US" style="color:black"> *</span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=dev"><span lang="EN-US">dev</span></a></span><span lang="EN-US" style="color:black">, void *</span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=p"><span lang="EN-US">p</span></a></span><span lang="EN-US" style="color:black">)<o:p></o:p></span></pre>
<pre style="background:white"><a name="L283"></a><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/net/ethernet/eth.c#L283"><span lang="EN-US">283</span></a><span lang="EN-US" style="color:black"> {<o:p></o:p></span></pre>
<pre style="background:white"><a name="L284"></a><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/net/ethernet/eth.c#L284"><span lang="EN-US">284</span></a><span lang="EN-US" style="color:black"> struct </span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=sockaddr"><span lang="EN-US">sockaddr</span></a></span><span lang="EN-US" style="color:black"> *</span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=addr"><span lang="EN-US">addr</span></a></span><span lang="EN-US" style="color:black"> = </span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=p"><span lang="EN-US">p</span></a></span><span lang="EN-US" style="color:black">;<o:p></o:p></span></pre>
<pre style="background:white"><a name="L285"></a><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/net/ethernet/eth.c#L285"><span lang="EN-US">285</span></a><span lang="EN-US" style="color:black"> <o:p></o:p></span></pre>
<pre style="background:white"><a name="L286"></a><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/net/ethernet/eth.c#L286"><span lang="EN-US">286</span></a><span lang="EN-US" style="color:black"> if (</span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=netif_running"><span lang="EN-US">netif_running</span></a></span><span lang="EN-US" style="color:black">(</span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=dev"><span lang="EN-US">dev</span></a></span><span lang="EN-US" style="color:black">))<o:p></o:p></span></pre>
<pre style="background:white"><a name="L287"></a><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/net/ethernet/eth.c#L287"><span lang="EN-US">287</span></a><span lang="EN-US" style="color:black"> return -</span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=EBUSY"><span lang="EN-US">EBUSY</span></a></span><span lang="EN-US" style="color:black">;<o:p></o:p></span></pre>
<pre style="background:white"><a name="L288"></a><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/net/ethernet/eth.c#L288"><span lang="EN-US">288</span></a><span lang="EN-US" style="color:black"> if (!</span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=is_valid_ether_addr"><span lang="EN-US">is_valid_ether_addr</span></a></span><span lang="EN-US" style="color:black">(</span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=addr"><span lang="EN-US">addr</span></a></span><span lang="EN-US" style="color:black">->sa_data))<o:p></o:p></span></pre>
<pre style="background:white"><a name="L289"></a><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/net/ethernet/eth.c#L289"><span lang="EN-US">289</span></a><span lang="EN-US" style="color:black"> return -</span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=EADDRNOTAVAIL"><span lang="EN-US">EADDRNOTAVAIL</span></a></span><span lang="EN-US" style="color:black">;<o:p></o:p></span></pre>
<pre style="background:white"><a name="L290"></a><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/net/ethernet/eth.c#L290"><span lang="EN-US">290</span></a><span lang="EN-US" style="color:black"> </span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=memcpy"><span lang="EN-US">memcpy</span></a></span><span lang="EN-US" style="color:black">(</span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=dev"><span lang="EN-US">dev</span></a></span><span lang="EN-US" style="color:black">-></span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=dev_addr"><span lang="EN-US">dev_addr</span></a></span><span lang="EN-US" style="color:black">, </span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=addr"><span lang="EN-US">addr</span></a></span><span lang="EN-US" style="color:black">->sa_data, </span><span style="color:black"><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/ident?i=ETH_ALEN"><span lang="EN-US">ETH_ALEN</span></a></span><span lang="EN-US" style="color:black">);<o:p></o:p></span></pre>
<pre style="background:white"><a name="L291"></a><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/net/ethernet/eth.c#L291"><span lang="EN-US">291</span></a><span lang="EN-US" style="color:black"> return 0;<o:p></o:p></span></pre>
<pre style="background:white"><a name="L292"></a><a href="http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/net/ethernet/eth.c#L292"><span lang="EN-US">292</span></a><span lang="EN-US" style="color:black"> }<o:p></o:p></span></pre>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">From linux_source/net/Ethernet/eth.c<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:ZH-CN">Best regards
</span><span lang="EN-US" style="mso-fareast-language:ZH-CN"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:ZH-CN">Jens Seiersen</span></b><span lang="EN-US" style="mso-fareast-language:ZH-CN"><br>
</span><i><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:ZH-CN">DEIF Wind Power Technology</span></i><span lang="EN-US" style="mso-fareast-language:ZH-CN"><br>
</span><i><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:ZH-CN">Hardware Developer<o:p></o:p></span></i></p>
</div>
</body>
</html>