| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=9"/>
- <meta name="generator" content="Doxygen 1.8.13"/>
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
- <title>Lightweight USB stack: usb_cdce.h Source File</title>
- <link href="../../tabs.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="../../jquery.js"></script>
- <script type="text/javascript" src="../../dynsections.js"></script>
- <link href="../../navtree.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="../../resize.js"></script>
- <script type="text/javascript" src="../../navtreedata.js"></script>
- <script type="text/javascript" src="../../navtree.js"></script>
- <script type="text/javascript">
- $(document).ready(initResizable);
- </script>
- <link href="../../search/search.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="../../search/searchdata.js"></script>
- <script type="text/javascript" src="../../search/search.js"></script>
- <link href="../../doxygen.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
- <div id="titlearea">
- <table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td id="projectalign" style="padding-left: 0.5em;">
- <div id="projectname">Lightweight USB stack
-  <span id="projectnumber">1.0</span>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.8.13 -->
- <script type="text/javascript">
- var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
- </script>
- <script type="text/javascript" src="../../menudata.js"></script>
- <script type="text/javascript" src="../../menu.js"></script>
- <script type="text/javascript">
- $(function() {
- initMenu('../../',true,false,'search.php','Search');
- $(document).ready(function() { init_search(); });
- });
- </script>
- <div id="main-nav"></div>
- </div><!-- top -->
- <div id="side-nav" class="ui-resizable side-nav-resizable">
- <div id="nav-tree">
- <div id="nav-tree-contents">
- <div id="nav-sync" class="sync"></div>
- </div>
- </div>
- <div id="splitbar" style="-moz-user-select:none;"
- class="ui-resizable-handle">
- </div>
- </div>
- <script type="text/javascript">
- $(document).ready(function(){initNavTree('d5/de0/a00050_source.html','../../');});
- </script>
- <div id="doc-content">
- <!-- window showing the filter options -->
- <div id="MSearchSelectWindow"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- onkeydown="return searchBox.OnSearchSelectKey(event)">
- </div>
- <!-- iframe showing the search results (closed by default) -->
- <div id="MSearchResultsWindow">
- <iframe src="javascript:void(0)" frameborder="0"
- name="MSearchResults" id="MSearchResults">
- </iframe>
- </div>
- <div class="header">
- <div class="headertitle">
- <div class="title">usb_cdce.h</div> </div>
- </div><!--header-->
- <div class="contents">
- <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/* This file is the part of the Lightweight USB device Stack for STM32 microcontrollers</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> *</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * Copyright ©2016 Dmitry Filimonchuk <dmitrystu[at]gmail[dot]com></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> *</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> */</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> </div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#ifndef _USB_CDC_ECM_H_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#define _USB_CDC_ECM_H_</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  <span class="keyword">extern</span> <span class="stringliteral">"C"</span> {</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#gad30ede9d7409eb94f9eb814cb156d57d"> 32</a></span> <span class="preprocessor">#define USB_CDC_SUBCLASS_ETH 0x06 </span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor"> </span><span class="comment">/* @} */</span><span class="preprocessor"></span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#gae4596d96a7943186b877715b95213ffb"> 37</a></span> <span class="preprocessor">#define USB_DTYPE_CDC_ETHERNET 0x0F </span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="preprocessor">#define USB_CDC_SET_ETH_MULTICAST_FILTERS 0x40 </span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="preprocessor">#define USB_CDC_SET_ETH_PM_PATTERN_FILTER 0x41 </span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="preprocessor">#define USB_CDC_GET_ETH_PM_PATTERN_FILTER 0x42 </span></div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#ga9ddc847229395c8bed66f3d3f94e320a"> 45</a></span> <span class="preprocessor">#define USB_CDC_SET_ETH_PACKET_FILTER 0x43 </span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="preprocessor">#define USB_CDC_GET_ETH_STATISTIC 0x44 </span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="preprocessor">#define USB_ETH_XMIT_OK (1<<0) </span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="preprocessor">#define USB_ETH_RCV_OK (1<<1) </span></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="preprocessor">#define USB_ETH_XMIT_ERROR (1<<2) </span></div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#ga8a5ad78b1b40fb5ccc8805f976941c45"> 58</a></span> <span class="preprocessor">#define USB_ETH_RCV_ERROR (1<<3) </span></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="preprocessor">#define USB_ETH_RCV_NO_BUFFER (1<<4) </span></div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="preprocessor">#define USB_ETH_DIRECTED_BYTES_XMIT (1<<5) </span></div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#ga0d57074899882a07ffbe7d64e4fd3f71"> 62</a></span> <span class="preprocessor">#define USB_ETH_DIRECTED_FRAMES_XMIT (1<<6) </span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="preprocessor">#define USB_ETH_MULTICAST_BYTES_XMIT (1<<7) </span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="preprocessor">#define USB_ETH_MULTICAST_FRAMES_XMIT (1<<8) </span></div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#ga9e54a532a0486e9090b07e3550c284c2"> 65</a></span> <span class="preprocessor">#define USB_ETH_BROADCAST_BYTES_XMIT (1<<9) </span></div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#ga63b44fb1deb4902fd78ea1bf926e12a8"> 66</a></span> <span class="preprocessor">#define USB_ETH_BROADCAST_FRAMES_XMIT (1<<10) </span></div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#ga5b55a000b3dfa62b452064a8571754d0"> 67</a></span> <span class="preprocessor">#define USB_ETH_DIRECTED_BYTES_RCV (1<<11) </span></div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#ga384e872103082828e070569e662efbc4"> 68</a></span> <span class="preprocessor">#define USB_ETH_DIRECTED_FRAMES_RCV (1<<12) </span></div><div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#ga7044e1d06a1d1fb1250234c0b786b943"> 69</a></span> <span class="preprocessor">#define USB_ETH_MULTICAST_BYTES_RCV (1<<13) </span></div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#gacaed335621c330e3f0b6c18bb18e293e"> 70</a></span> <span class="preprocessor">#define USB_ETH_MULTICAST_FRAMES_RCV (1<<14) </span></div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#ga4cca8c88d3e48eac6b30afba8f6c6453"> 71</a></span> <span class="preprocessor">#define USB_ETH_BROADCAST_BYTES_RCV (1<<15) </span></div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#ga4fb4fa04075c4997064ca5af4b3a8f4f"> 72</a></span> <span class="preprocessor">#define USB_ETH_BROADCAST_FRAMES_RCV (1<<16) </span></div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#ga6a47e1431996639b0ab6ed969cf09525"> 73</a></span> <span class="preprocessor">#define USB_ETH_RCV_CRC_ERROR (1<<17) </span></div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#gad8aee65d007b0183e4d267484cf92f56"> 75</a></span> <span class="preprocessor">#define USB_ETH_TRANSMIT_QUEUE_LENGTH (1<<18) </span></div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#gaa3ddfe30cde9d549c0f9f862ca3c6446"> 76</a></span> <span class="preprocessor">#define USB_ETH_RCV_ERROR_ALIGNMENT (1<<19) </span></div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#gafe286067dc35a2d68c070b0675ae8714"> 77</a></span> <span class="preprocessor">#define USB_ETH_XMIT_ONE_COLLISION (1<<20) </span></div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#gadd2362d9365e3386bafb30f9332ff3ad"> 78</a></span> <span class="preprocessor">#define USB_ETH_XMIT_MORE_COLLISIONS (1<<21) </span></div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="preprocessor">#define USB_ETH_XMIT_DEFERRED (1<<22) </span></div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="preprocessor">#define USB_ETH_XMIT_MAX_COLLISIONS (1<<23) </span></div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#gac29dfccf74d36c13210eb671f98636a0"> 81</a></span> <span class="preprocessor">#define USB_ETH_RCV_OVERRUN (1<<24) </span></div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#ga7081430408190ff94b9393f50b43cdd1"> 82</a></span> <span class="preprocessor">#define USB_ETH_XMIT_UNDERRUN (1<<25) </span></div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#ga9e946aa59ce6d0fb07211ebfe2f3bbbc"> 83</a></span> <span class="preprocessor">#define USB_ETH_XMIT_HEARTBEAT_FAILURE (1<<26) </span></div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#gad7c536ddf854009b05cd716eadeaf654"> 84</a></span> <span class="preprocessor">#define USB_ETH_XMIT_TIMES_CRS_LOST (1<<27) </span></div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="../../d4/d7d/a00093.html#ga489d1af8311e355761ffb3d1b9a4d1ed"> 85</a></span> <span class="preprocessor">#define USB_ETH_XMIT_LATE_COLLISIONS (1<<28) </span></div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> <span class="preprocessor">struct usb_cdc_ether_desc {</span></div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  uint8_t bFunctionLength; </div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  uint8_t bDescriptorType; </div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  uint8_t bDescriptorSubType; </div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  uint8_t iMACAddress; </div><div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="../../d5/db1/a00140.html"> 100</a></span>  uint32_t bmEthernetStatistics; </div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="../../d5/db1/a00140.html#aa41981e8a207e8b269b34ae7b0d6f846"> 102</a></span>  uint16_t wMaxSegmentSize; </div><div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="../../d5/db1/a00140.html#a8ccce18badfc75fabf48609c32d45ed9"> 104</a></span>  uint16_t wNumberMCFilters; </div><div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="../../d5/db1/a00140.html#a049a94099d671d51f7fcf617b4ed9e3f"> 106</a></span>  uint8_t bNumberPowerFilters; </div><div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="../../d5/db1/a00140.html#a0f8e2d1cd6932d758baf7c8f99cac1e4"> 108</a></span> } __attribute__ ((packed));</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span> </div><div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="../../d5/db1/a00140.html#aafe03d826183e052d07768d43098a640"> 112</a></span> <span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  }</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> </div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="preprocessor">#endif </span><span class="comment">/* _USB_CDC_ECM_H_ */</span><span class="preprocessor"></span></div></div><!-- fragment --></div><!-- contents -->
- </div><!-- doc-content -->
- <!-- start footer part -->
- <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- <li class="navelem"><a class="el" href="../../dir_bfccd401955b95cf8c75461437045ac0.html">inc</a></li><li class="navelem"><b>usb_cdce.h</b></li>
- <li class="footer">Generated by
- <a href="http://www.doxygen.org/index.html">
- <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
- </ul>
- </div>
- </body>
- </html>
|