<ahref="mac_8c.html">Go to the documentation of this file.</a><divclass="fragment"><preclass="fragment"><aname="l00001"></a>00001 <spanclass="comment">/*</span>
<aname="l00035"></a>00035 <spanclass="preprocessor">#include "<aclass="code"href="ch_8h.html"title="ChibiOS/RT main include file.">ch.h</a>"</span>
<aname="l00065"></a>00065 <aclass="code"href="group___m_a_c___l_l_d.html#ga37e276cbed823fb80fdce3df3f9f7ddf"title="Low level MAC initialization.">mac_lld_init</a>();
<aname="l00073"></a><aclass="code"href="group___m_a_c.html#ga34d60b00ad9794d52da6833e18c9ec70">00073</a><spanclass="keywordtype">void</span><aclass="code"href="group___m_a_c.html#ga34d60b00ad9794d52da6833e18c9ec70"title="Initialize the standard part of a MACDriver structure.">macObjectInit</a>(<aclass="code"href="struct_m_a_c_driver.html"title="Structure representing a MAC driver.">MACDriver</a> *macp) {
<aname="l00074"></a>00074
<aname="l00075"></a>00075 <aclass="code"href="group__semaphores.html#gafe8fc6155a871074e8017efd908b2c58"title="Initializes a semaphore with the specified counter value.">chSemInit</a>(&macp-><aclass="code"href="struct_m_a_c_driver.html#a667cd08245f7f3cbd2c9fb7cf5abe2bd">md_tdsem</a>, 0);
<aname="l00076"></a>00076 <aclass="code"href="group__semaphores.html#gafe8fc6155a871074e8017efd908b2c58"title="Initializes a semaphore with the specified counter value.">chSemInit</a>(&macp-><aclass="code"href="struct_m_a_c_driver.html#ade31ca2c5d242cd0418f3e44d92beaee">md_rdsem</a>, 0);
<aname="l00078"></a>00078 <spanclass="preprocessor"></span><aclass="code"href="group__events.html#gab8d0fdc09be629dfb438c32a0523db42"title="Initializes an Event Source.">chEvtInit</a>(&macp-><aclass="code"href="struct_m_a_c_driver.html#a99d364bf90207cc47155765ae151bfc6">md_rdevent</a>);
<aname="l00115"></a><aclass="code"href="group___m_a_c.html#ga7304721038db1d7c0cb616c9c4d3f0ce">00115</a><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a><aclass="code"href="group___m_a_c.html#ga7304721038db1d7c0cb616c9c4d3f0ce"title="Allocates a transmission descriptor.">macWaitTransmitDescriptor</a>(<aclass="code"href="struct_m_a_c_driver.html"title="Structure representing a MAC driver.">MACDriver</a> *macp,
<aname="l00116"></a>00116 <aclass="code"href="struct_m_a_c_transmit_descriptor.html"title="Structure representing a transmit descriptor.">MACTransmitDescriptor</a> *tdp,
<aname="l00117"></a>00117 <aclass="code"href="group__types.html#gae3e32a98d431a02106616da3071832dd"title="System Time, recommended fastest unsigned.">systime_t</a> time) {
<aname="l00118"></a>00118 <aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> msg;
<aname="l00122"></a>00122 <aclass="code"href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42"title="Enters the kernel lock mode.">chSysLock</a>();
<aname="l00123"></a>00123 <aclass="code"href="group__types.html#gae3e32a98d431a02106616da3071832dd"title="System Time, recommended fastest unsigned.">systime_t</a> now = <aclass="code"href="group__time.html#ga137c8f67c450f34416a786d169be90e2"title="Current system time.">chTimeNow</a>();
<aname="l00124"></a>00124 <spanclass="keywordflow">if</span> ((msg = <aclass="code"href="group__semaphores.html#ga924ec5d191bb8debe8727ae4dd5d6d03"title="Performs a wait operation on a semaphore with timeout specification.">chSemWaitTimeoutS</a>(&macp-><aclass="code"href="struct_m_a_c_driver.html#a667cd08245f7f3cbd2c9fb7cf5abe2bd">md_tdsem</a>, time)) == <aclass="code"href="group__scheduler.html#gaf28d5427eeeb8f737cc7db495157780c"title="Low level message sent to a thread awakened by a timeout.">RDY_TIMEOUT</a>)
<aname="l00126"></a>00126 <spanclass="keywordflow">if</span> (time != <aclass="code"href="group__scheduler.html#gae1568cf3090c973c3bc47f86ae2f5afb"title="Infinite time specification for all the syscalls with a timeout specification.">TIME_INFINITE</a>)
<aname="l00127"></a>00127 time -= (<aclass="code"href="group__time.html#ga137c8f67c450f34416a786d169be90e2"title="Current system time.">chTimeNow</a>() - now);
<aname="l00128"></a>00128 <aclass="code"href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e"title="Leaves the kernel lock mode.">chSysUnlock</a>();
<aname="l00139"></a><aclass="code"href="group___m_a_c.html#ga0f692163094614561eace2a8c30938f9">00139</a><spanclass="keywordtype">void</span><aclass="code"href="group___m_a_c.html#ga0f692163094614561eace2a8c30938f9"title="Releases a transmit descriptor and starts the transmission of the enqueued data as a single frame...">macReleaseTransmitDescriptor</a>(<aclass="code"href="struct_m_a_c_transmit_descriptor.html"title="Structure representing a transmit descriptor.">MACTransmitDescriptor</a> *tdp) {
<aname="l00141"></a>00141 <aclass="code"href="group___m_a_c___l_l_d.html#ga29cd5df4ce571b7088c7107cf7901330"title="Releases a transmit descriptor and starts the transmission of the enqueued data as a single frame...">mac_lld_release_transmit_descriptor</a>(tdp);
<aname="l00161"></a><aclass="code"href="group___m_a_c.html#ga151a33674ef86c2403ac7797fa87805c">00161</a><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a><aclass="code"href="group___m_a_c.html#ga151a33674ef86c2403ac7797fa87805c"title="Waits for a received frame.">macWaitReceiveDescriptor</a>(<aclass="code"href="struct_m_a_c_driver.html"title="Structure representing a MAC driver.">MACDriver</a> *macp,
<aname="l00162"></a>00162 <aclass="code"href="struct_m_a_c_receive_descriptor.html"title="Structure representing a receive descriptor.">MACReceiveDescriptor</a> *rdp,
<aname="l00163"></a>00163 <aclass="code"href="group__types.html#gae3e32a98d431a02106616da3071832dd"title="System Time, recommended fastest unsigned.">systime_t</a> time) {
<aname="l00164"></a>00164 <aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> msg;
<aname="l00168"></a>00168 <aclass="code"href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42"title="Enters the kernel lock mode.">chSysLock</a>();
<aname="l00169"></a>00169 <aclass="code"href="group__types.html#gae3e32a98d431a02106616da3071832dd"title="System Time, recommended fastest unsigned.">systime_t</a> now = <aclass="code"href="group__time.html#ga137c8f67c450f34416a786d169be90e2"title="Current system time.">chTimeNow</a>();
<aname="l00170"></a>00170 <spanclass="keywordflow">if</span> ((msg = <aclass="code"href="group__semaphores.html#ga924ec5d191bb8debe8727ae4dd5d6d03"title="Performs a wait operation on a semaphore with timeout specification.">chSemWaitTimeoutS</a>(&macp-><aclass="code"href="struct_m_a_c_driver.html#ade31ca2c5d242cd0418f3e44d92beaee">md_rdsem</a>, time)) == <aclass="code"href="group__scheduler.html#gaf28d5427eeeb8f737cc7db495157780c"title="Low level message sent to a thread awakened by a timeout.">RDY_TIMEOUT</a>)
<aname="l00172"></a>00172 <spanclass="keywordflow">if</span> (time != <aclass="code"href="group__scheduler.html#gae1568cf3090c973c3bc47f86ae2f5afb"title="Infinite time specification for all the syscalls with a timeout specification.">TIME_INFINITE</a>)
<aname="l00173"></a>00173 time -= (<aclass="code"href="group__time.html#ga137c8f67c450f34416a786d169be90e2"title="Current system time.">chTimeNow</a>() - now);
<aname="l00174"></a>00174 <aclass="code"href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e"title="Leaves the kernel lock mode.">chSysUnlock</a>();
<aname="l00186"></a><aclass="code"href="group___m_a_c.html#ga4c6470b965aef1ee65bc6dd24c71bc5c">00186</a><spanclass="keywordtype">void</span><aclass="code"href="group___m_a_c.html#ga4c6470b965aef1ee65bc6dd24c71bc5c"title="Releases a receive descriptor.">macReleaseReceiveDescriptor</a>(<aclass="code"href="struct_m_a_c_receive_descriptor.html"title="Structure representing a receive descriptor.">MACReceiveDescriptor</a> *rdp) {
<aname="l00187"></a>00187
<aname="l00188"></a>00188 <aclass="code"href="group___m_a_c___l_l_d.html#gaa04797c813452cbc715d4233e4c44f49"title="Releases a receive descriptor.">mac_lld_release_receive_descriptor</a>(rdp);
<aname="l00199"></a><aclass="code"href="group___m_a_c.html#gab5bf748233450f371b5a88f2accf87e1">00199</a><aclass="code"href="group__types.html#ga7556af1cb61728b53228fa3af1c851de"title="Boolean, recommended the fastest signed.">bool_t</a><aclass="code"href="group___m_a_c.html#gab5bf748233450f371b5a88f2accf87e1"title="Updates and returns the link status.">macPollLinkStatus</a>(<aclass="code"href="struct_m_a_c_driver.html"title="Structure representing a MAC driver.">MACDriver</a> *macp) {
<aname="l00200"></a>00200
<aname="l00201"></a>00201 <spanclass="keywordflow">return</span><aclass="code"href="group___m_a_c___l_l_d.html#ga5d9f510e66cbdd6f4968c5411c2de7a5"title="Updates and returns the link status.">mac_lld_poll_link_status</a>(macp);
Generated on Sun Oct 24 2010 09:40:37 for ChibiOS/RT by <ahref="http://www.doxygen.org/index.html"><imgsrc="doxygen.png"alt="doxygen"align="middle"border="0"></a> 1.7.1</small></address>