Newer
Older
ubix2 / doc / xml / ne2k_8c.xml
@reddawg reddawg on 19 Dec 2006 134 KB rtld-elf almost workign
<?xml version='1.0' encoding='iso-8859-1' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.4.7">
  <compounddef id="ne2k_8c" kind="file">
    <compoundname>ne2k.c</compoundname>
    <includes refid="ne2k_8h" local="no">isa/ne2k.h</includes>
    <includes refid="8259_8h" local="no">isa/8259.h</includes>
    <includes refid="device_8old_8h" local="no">sys/device.old.h</includes>
    <includes refid="io_8h" local="no">sys/io.h</includes>
    <includes refid="idt_8h" local="no">sys/idt.h</includes>
    <includes refid="kmalloc_8h" local="no">lib/kmalloc.h</includes>
    <includes refid="kprintf_8h" local="no">lib/kprintf.h</includes>
    <includes refid="string_8h" local="no">string.h</includes>
    <includes refid="kpanic_8h" local="no">ubixos/kpanic.h</includes>
    <includes refid="vitals_8h" local="no">ubixos/vitals.h</includes>
    <includes refid="spinlock_8h" local="no">ubixos/spinlock.h</includes>
    <includes refid="assert_8h" local="no">assert.h</includes>
    <incdepgraph>
      <node id="5162">
        <label>sys/thread.h</label>
        <link refid="thread_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
      </node>
      <node id="5153">
        <label>ubixos/kpanic.h</label>
        <link refid="kpanic_8h"/>
      </node>
      <node id="5156">
        <label>ubixos/sched.h</label>
        <link refid="sched_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
        <childnode refid="5157" relation="include">
        </childnode>
        <childnode refid="5158" relation="include">
        </childnode>
        <childnode refid="5161" relation="include">
        </childnode>
        <childnode refid="5162" relation="include">
        </childnode>
      </node>
      <node id="5167">
        <label>ubixos/spinlock.h</label>
        <link refid="spinlock_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
      </node>
      <node id="5145">
        <label>sys/device.old.h</label>
        <link refid="device_8old_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
      </node>
      <node id="5142">
        <label>isa/ne2k.h</label>
        <link refid="ne2k_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
        <childnode refid="5145" relation="include">
        </childnode>
      </node>
      <node id="5154">
        <label>ubixos/vitals.h</label>
        <link refid="vitals_8h"/>
        <childnode refid="5155" relation="include">
        </childnode>
        <childnode refid="5164" relation="include">
        </childnode>
      </node>
      <node id="5143">
        <label>ubixos/types.h</label>
        <link refid="types_8h"/>
        <childnode refid="5144" relation="include">
        </childnode>
      </node>
      <node id="5144">
        <label>sys/_types.h</label>
        <link refid="__types_8h"/>
      </node>
      <node id="5152">
        <label>string.h</label>
        <link refid="string_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
      </node>
      <node id="5163">
        <label>ubixos/time.h</label>
        <link refid="time_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
        <childnode refid="5147" relation="include">
        </childnode>
      </node>
      <node id="5158">
        <label>vfs/file.h</label>
        <link refid="file_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
        <childnode refid="5159" relation="include">
        </childnode>
        <childnode refid="5160" relation="include">
        </childnode>
      </node>
      <node id="5161">
        <label>sys/tss.h</label>
        <link refid="tss_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
      </node>
      <node id="5150">
        <label>lib/kmalloc.h</label>
        <link refid="kmalloc_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
      </node>
      <node id="5148">
        <label>sys/idt.h</label>
        <link refid="idt_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
        <childnode refid="5149" relation="include">
        </childnode>
      </node>
      <node id="5164">
        <label>vfs/vfs.h</label>
        <link refid="vfs_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
        <childnode refid="5158" relation="include">
        </childnode>
        <childnode refid="5160" relation="include">
        </childnode>
        <childnode refid="5165" relation="include">
        </childnode>
        <childnode refid="5162" relation="include">
        </childnode>
      </node>
      <node id="5160">
        <label>vfs/mount.h</label>
        <link refid="mount_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
      </node>
      <node id="5151">
        <label>lib/kprintf.h</label>
        <link refid="kprintf_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
      </node>
      <node id="5149">
        <label>sys/gdt.h</label>
        <link refid="gdt_8h"/>
      </node>
      <node id="5168">
        <label>assert.h</label>
        <link refid="assert_8h"/>
      </node>
      <node id="5155">
        <label>ubixos/ubthread.h</label>
        <link refid="ubthread_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
        <childnode refid="5156" relation="include">
        </childnode>
        <childnode refid="5163" relation="include">
        </childnode>
      </node>
      <node id="5159">
        <label>ubixfs/dirCache.h</label>
        <link refid="dirCache_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
      </node>
      <node id="5141">
        <label>src/sys/isa/ne2k.c</label>
        <link refid="ne2k.c"/>
        <childnode refid="5142" relation="include">
        </childnode>
        <childnode refid="5146" relation="include">
        </childnode>
        <childnode refid="5145" relation="include">
        </childnode>
        <childnode refid="5147" relation="include">
        </childnode>
        <childnode refid="5148" relation="include">
        </childnode>
        <childnode refid="5150" relation="include">
        </childnode>
        <childnode refid="5151" relation="include">
        </childnode>
        <childnode refid="5152" relation="include">
        </childnode>
        <childnode refid="5153" relation="include">
        </childnode>
        <childnode refid="5154" relation="include">
        </childnode>
        <childnode refid="5167" relation="include">
        </childnode>
        <childnode refid="5168" relation="include">
        </childnode>
      </node>
      <node id="5165">
        <label>sys/sysproto.h</label>
        <link refid="sysproto_8h"/>
        <childnode refid="5166" relation="include">
        </childnode>
        <childnode refid="5162" relation="include">
        </childnode>
      </node>
      <node id="5166">
        <label>sys/signal.h</label>
        <link refid="signal_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
      </node>
      <node id="5157">
        <label>ubixos/tty.h</label>
        <link refid="tty_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
      </node>
      <node id="5147">
        <label>sys/io.h</label>
        <link refid="io_8h"/>
      </node>
      <node id="5146">
        <label>isa/8259.h</label>
        <link refid="8259_8h"/>
        <childnode refid="5143" relation="include">
        </childnode>
      </node>
    </incdepgraph>
      <sectiondef kind="func">
      <memberdef kind="function" id="ne2k_8c_1d2f71b50095121367bb6b0ed3181e89c" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type></type>
        <definition>asm</definition>
        <argsstring>(&quot;.globl ne2kISR         \n&quot;&quot;ne2kISR:               \n&quot;&quot;  pusha                \n&quot;&quot;  call ne2kHandler     \n&quot;&quot;  popa                 \n&quot;&quot;  iret                 \n&quot;)</argsstring>
        <name>asm</name>
        <param>
          <type>&quot;.globl ne2kISR \n&quot;&quot;ne2kISR: \n&quot;&quot; pusha \n&quot;&quot; call ne2kHandler \n&quot;&quot; popa \n&quot;&quot; iret \n&quot;</type>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" line="60"/>
      </memberdef>
      <memberdef kind="function" id="ne2k_8c_120e9fce07d30c847b2f794191f55e5ea" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>static int dp_pkt2user</definition>
        <argsstring>(struct device *dev, int page, int length)</argsstring>
        <name>dp_pkt2user</name>
        <param>
          <type>struct <ref refid="structdevice" kindref="compound">device</ref> *</type>
          <declname>dev</declname>
        </param>
        <param>
          <type>int</type>
          <declname>page</declname>
        </param>
        <param>
          <type>int</type>
          <declname>length</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" line="46" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" bodystart="297" bodyend="311"/>
        <references refid="structnicBuffer_19679b6c2e76a7617884e422c11aa3eac" compoundref="ne2k_8h" startline="54">nicBuffer::buffer</references>
        <references refid="ne2k_8h_1be1b4cb2c953c25ccdc10fcb1aa7e47d" compoundref="ne2k_8h" startline="154">DP_PAGESIZE</references>
        <references refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" compoundref="kprintf_8c" startline="38" endline="49">kprintf</references>
        <references refid="ne2k_8h_165b49da573a73ea73aa905bae31f4aa5" compoundref="ne2k_8c" startline="313" endline="339">ne2kAllocBuffer</references>
        <references refid="ne2k_8h_145a65b2b7a15b7e7c46fd8831528c8d0" compoundref="ne2k_8c" startline="164" endline="189">NICtoPC</references>
        <references refid="ne2k_8h_1ba51915c87d64af47fb1cc59348961c9" compoundref="ne2k_8h" startline="61">OK</references>
        <references refid="ne2k_8h_1e05994559a4ee216a39b3307b7911493" compoundref="ne2k_8h" startline="65">stopPage</references>
        <referencedby refid="ne2k_8c_193484a1eaa8e1b265202c6cccfed65f3" compoundref="ne2k_8c" startline="223" endline="277">dp_recv</referencedby>
      </memberdef>
      <memberdef kind="function" id="ne2k_8c_193484a1eaa8e1b265202c6cccfed65f3" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>static int dp_recv</definition>
        <argsstring>(struct device *)</argsstring>
        <name>dp_recv</name>
        <param>
          <type>struct <ref refid="structdevice" kindref="compound">device</ref> *</type>
          <defname>dev</defname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" line="48" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" bodystart="223" bodyend="277"/>
        <references refid="ne2k_8c_120e9fce07d30c847b2f794191f55e5ea" compoundref="ne2k_8c" startline="297" endline="311">dp_pkt2user</references>
        <references refid="ne2k_8c_182ba0a2f0d1c6dc1381e5c15118bb5ef" compoundref="ne2k_8c" startline="279" endline="295">getblock</references>
        <references refid="io_8h_177b934268de1b3ecdcf3f275413b3108" compoundref="io_8c" startline="39" endline="47">inportByte</references>
        <references refid="structdevice_19467302b748ed3627bae8e3ecee7af87" compoundref="device_8old_8h" startline="31">device::ioAddr</references>
        <references refid="kpanic_8h_1db9a182aa071791a306163d50d653deb" compoundref="kpanic_8c" startline="42" endline="60">kpanic</references>
        <references refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" compoundref="kprintf_8c" startline="38" endline="49">kprintf</references>
        <references refid="ne2k_8h_14c97ad2e89582cb65022a052df40c04a" compoundref="ne2k_8h" startline="71">NE_BNRY</references>
        <references refid="ne2k_8h_155d8236fd5c94eb16a5a06c3e4b07df1" compoundref="ne2k_8h" startline="68">NE_CMD</references>
        <references refid="ne2k_8h_15e30e2969b60a082d50bf3ce80d9d766" compoundref="ne2k_8h" startline="74">NE_CURRENT</references>
        <references refid="ne2k_8h_1ba51915c87d64af47fb1cc59348961c9" compoundref="ne2k_8h" startline="61">OK</references>
        <references refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" compoundref="io_8c" startline="73" endline="79">outportByte</references>
        <references refid="ne2k_8h_13e9285670345a7583ca516cc8f7aafb8" compoundref="ne2k_8h" startline="57">RSR_FO</references>
        <references refid="ne2k_8h_1c1d77583edd2eba6e96cc7633558e461" compoundref="ne2k_8h" startline="58">RSR_PRX</references>
        <references refid="ne2k_8h_1819b8c4fa81871ceacc1790d6fd2b2f1" compoundref="ne2k_8h" startline="64">startPage</references>
        <references refid="ne2k_8h_1e05994559a4ee216a39b3307b7911493" compoundref="ne2k_8h" startline="65">stopPage</references>
        <referencedby refid="ne2k_8c_11e664af4b82fdc7971db793f0e9b3ebd" compoundref="ne2k_8c" startline="191" endline="221">ne2kHandler</referencedby>
      </memberdef>
      <memberdef kind="function" id="ne2k_8c_182ba0a2f0d1c6dc1381e5c15118bb5ef" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void getblock</definition>
        <argsstring>(struct device *dev, int page, size_t offset, size_t size, void *dst)</argsstring>
        <name>getblock</name>
        <param>
          <type>struct <ref refid="structdevice" kindref="compound">device</ref> *</type>
          <declname>dev</declname>
        </param>
        <param>
          <type>int</type>
          <declname>page</declname>
        </param>
        <param>
          <type><ref refid="types_8h_17619b847aeded8a6d14cbfa212b2cdfb" kindref="member">size_t</ref></type>
          <declname>offset</declname>
        </param>
        <param>
          <type><ref refid="types_8h_17619b847aeded8a6d14cbfa212b2cdfb" kindref="member">size_t</ref></type>
          <declname>size</declname>
        </param>
        <param>
          <type>void *</type>
          <declname>dst</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" line="47" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" bodystart="279" bodyend="295"/>
        <references refid="ne2k_8h_1be1b4cb2c953c25ccdc10fcb1aa7e47d" compoundref="ne2k_8h" startline="154">DP_PAGESIZE</references>
        <references refid="ne2k_8h_160b09a580fe0020e08e133cd8ec0a50d" compoundref="ne2k_8h" startline="97">E8390_RREAD</references>
        <references refid="ne2k_8h_1c3d2ce0fc9cc0e4e0c6e6a1484f08ddf" compoundref="ne2k_8h" startline="96">E8390_START</references>
        <references refid="ne2k_8h_194ed811925b8c9a71ec0c3590a15868c" compoundref="ne2k_8h" startline="108">EN0_ISR</references>
        <references refid="ne2k_8h_19834bfab75d2f822b0f684e612917281" compoundref="ne2k_8h" startline="111">EN0_RSARHI</references>
        <references refid="ne2k_8h_1352cf7775b146c81c2e1cf81110c9c7e" compoundref="ne2k_8h" startline="110">EN0_RSARLO</references>
        <references refid="io_8h_1fb703b187feb4b92444454df6c3dd9e6" compoundref="io_8c" startline="56" endline="64">inportWord</references>
        <references refid="structdevice_19467302b748ed3627bae8e3ecee7af87" compoundref="device_8old_8h" startline="31">device::ioAddr</references>
        <references refid="ne2k_8h_155d8236fd5c94eb16a5a06c3e4b07df1" compoundref="ne2k_8h" startline="68">NE_CMD</references>
        <references refid="ne2k_8h_15b7cdde018b5a4d42f91183d216d3f0d" compoundref="ne2k_8h" startline="132">NE_DATAPORT</references>
        <references refid="ne2k_8h_1b8733e4b199b85891fb58c80bd65967a" compoundref="ne2k_8h" startline="75">NE_RBCR0</references>
        <references refid="ne2k_8h_1c023921e5da8473a400c04b2e268c621" compoundref="ne2k_8h" startline="76">NE_RBCR1</references>
        <references refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" compoundref="io_8c" startline="73" endline="79">outportByte</references>
        <referencedby refid="ne2k_8c_193484a1eaa8e1b265202c6cccfed65f3" compoundref="ne2k_8c" startline="223" endline="277">dp_recv</referencedby>
      </memberdef>
      <memberdef kind="function" id="ne2k_8c_1033e069050ace667acb10ed9ffc8ac6c" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ne2k_init</definition>
        <argsstring>()</argsstring>
        <name>ne2k_init</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" line="70" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" bodystart="70" bodyend="113"/>
        <references refid="gdt_8h_15ee8638767e24765a2690483745d60d0" compoundref="gdt_8h" startline="47">dDpl0</references>
        <references refid="gdt_8h_17eb6dc7004c613df58764da5df7d85d8" compoundref="gdt_8h" startline="37">dInt</references>
        <references refid="ne2k_8h_12dcfc12834d5a417dcf43e2ca248f0cd" compoundref="ne2k_8h" startline="149">DP_CNTR0</references>
        <references refid="ne2k_8h_1e99a5201b20f9fd87b195c1074a643ec" compoundref="ne2k_8h" startline="150">DP_CNTR1</references>
        <references refid="ne2k_8h_1b56dccd8151d77ad3dbd832b65601af0" compoundref="ne2k_8h" startline="151">DP_CNTR2</references>
        <references refid="ne2k_8h_18336bb3cb0a54a93522379477340fdec" compoundref="ne2k_8h" startline="139">DP_CURR</references>
        <references refid="ne2k_8h_1b748b31fd480e8195caac541bc792c2b" compoundref="ne2k_8h" startline="140">DP_MAR0</references>
        <references refid="ne2k_8h_16e5cdffc808e98e09eca1efad797abf4" compoundref="ne2k_8h" startline="141">DP_MAR1</references>
        <references refid="ne2k_8h_16aff3543036b8ddf515d243b0e1ddf34" compoundref="ne2k_8h" startline="142">DP_MAR2</references>
        <references refid="ne2k_8h_11a62c9c151ca3a621f0683d0eaba12fe" compoundref="ne2k_8h" startline="143">DP_MAR3</references>
        <references refid="ne2k_8h_1ce5a77fb812564273e5304dd138ac29f" compoundref="ne2k_8h" startline="144">DP_MAR4</references>
        <references refid="ne2k_8h_10ec81b4dbe6150ae308588ed7de0f686" compoundref="ne2k_8h" startline="145">DP_MAR5</references>
        <references refid="ne2k_8h_1649d4943e589ed684b2e0faf811dc0af" compoundref="ne2k_8h" startline="146">DP_MAR6</references>
        <references refid="ne2k_8h_1fc53aa624a738deb114bf3d20257f108" compoundref="ne2k_8h" startline="147">DP_MAR7</references>
        <references refid="gdt_8h_1be5eb76416aff1d9114e1cdb8b0797fe" compoundref="gdt_8h" startline="48">dPresent</references>
        <references refid="io_8h_177b934268de1b3ecdcf3f275413b3108" compoundref="io_8c" startline="39" endline="47">inportByte</references>
        <references refid="structdevice_19467302b748ed3627bae8e3ecee7af87" compoundref="device_8old_8h" startline="31">device::ioAddr</references>
        <references refid="structdevice_1893bc785f272d1fedb2b4c14e31a7f35" compoundref="device_8old_8h" startline="32">device::irq</references>
        <references refid="8259_8h_10ac079c4d770f02e505f4d8569a6960a">irqEnable</references>
        <references refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" compoundref="kmalloc_8c" startline="247" endline="339">kmalloc</references>
        <references refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" compoundref="kprintf_8c" startline="38" endline="49">kprintf</references>
        <references refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" compoundref="ne2k_8c" startline="51">mDev</references>
        <references refid="8259_8h_17d84962c1a1c225344a94545309f92fc" compoundref="8259_8h" startline="42">mVec</references>
        <references refid="ne2k_8h_1a1d4735355686cbdc2d6bf145c413db3">ne2kISR</references>
        <references refid="ne2k_8h_14c97ad2e89582cb65022a052df40c04a" compoundref="ne2k_8h" startline="71">NE_BNRY</references>
        <references refid="ne2k_8h_155d8236fd5c94eb16a5a06c3e4b07df1" compoundref="ne2k_8h" startline="68">NE_CMD</references>
        <references refid="ne2k_8h_1759300669dab4522e8c261d764303a9b" compoundref="ne2k_8h" startline="79">NE_DCR</references>
        <references refid="ne2k_8h_104dfd3c3cd4a3f758cb038b78231493f" compoundref="ne2k_8h" startline="80">NE_IMR</references>
        <references refid="ne2k_8h_10b931a9b3f618839c02bc888b12fad6b" compoundref="ne2k_8h" startline="73">NE_ISR</references>
        <references refid="ne2k_8h_178aa15aa3cd9df670d1724be92b0157d" compoundref="ne2k_8h" startline="69">NE_PSTART</references>
        <references refid="ne2k_8h_14991431a50163bff66590bf8a7fb3c72" compoundref="ne2k_8h" startline="70">NE_PSTOP</references>
        <references refid="ne2k_8h_1b8733e4b199b85891fb58c80bd65967a" compoundref="ne2k_8h" startline="75">NE_RBCR0</references>
        <references refid="ne2k_8h_1c023921e5da8473a400c04b2e268c621" compoundref="ne2k_8h" startline="76">NE_RBCR1</references>
        <references refid="ne2k_8h_1e0e015081ca05ecec4bf833265485fb9" compoundref="ne2k_8h" startline="77">NE_RCR</references>
        <references refid="ne2k_8h_1ea9754b13e450b45d0eb6d79e0a1f4aa" compoundref="ne2k_8h" startline="78">NE_TCR</references>
        <references refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" compoundref="io_8c" startline="73" endline="79">outportByte</references>
        <references refid="idt_8h_1174a47ed653fc64fff6b5bb1b895c2cf" compoundref="idt_8c" startline="156" endline="164">setVector</references>
        <references refid="ne2k_8h_1819b8c4fa81871ceacc1790d6fd2b2f1" compoundref="ne2k_8h" startline="64">startPage</references>
        <references refid="ne2k_8h_1e05994559a4ee216a39b3307b7911493" compoundref="ne2k_8h" startline="65">stopPage</references>
        <references refid="start_8S_162df326d54f8b2ece412319c4360ef3e" compoundref="start_8S" startline="51">x20</references>
      </memberdef>
      <memberdef kind="function" id="ne2k_8c_1dae239918a8091c31abf996cee262c92" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="structnicBuffer" kindref="compound">nicBuffer</ref> *</type>
        <definition>struct nicBuffer* ne2kAllocBuffer</definition>
        <argsstring>(int length)</argsstring>
        <name>ne2kAllocBuffer</name>
        <param>
          <type>int</type>
          <declname>length</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" line="313" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" bodystart="313" bodyend="339"/>
        <references refid="structnicBuffer_19679b6c2e76a7617884e422c11aa3eac" compoundref="ne2k_8h" startline="54">nicBuffer::buffer</references>
        <references refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" compoundref="kmalloc_8c" startline="247" endline="339">kmalloc</references>
        <references refid="structnicBuffer_1959ee09a7a6fc875f3d5d651576f37c4" compoundref="ne2k_8h" startline="53">nicBuffer::length</references>
        <references refid="ne2k_8c_1764e2356e3d80b20b7f2466d32ebf9f2" compoundref="ne2k_8c" startline="44">ne2k_spinLock</references>
        <references refid="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" compoundref="ne2k_8c" startline="50">ne2kBuffer</references>
        <references refid="structnicBuffer_1b019ceba7f84eddae7d6b2abc538906a" compoundref="ne2k_8h" startline="52">nicBuffer::next</references>
        <references refid="spinlock_8h_12cd9a4502680fb8e7f0fe6b029e558b1" compoundref="spinlock_8c" startline="56" endline="62">spinLock</references>
        <references refid="spinlock_8h_1dd996cbbb3b9826dd9c8cf02b66a4c65" compoundref="spinlock_8c" startline="37" endline="46">spinUnlock</references>
        <referencedby refid="ne2k_8c_120e9fce07d30c847b2f794191f55e5ea" compoundref="ne2k_8c" startline="297" endline="311">dp_pkt2user</referencedby>
      </memberdef>
      <memberdef kind="function" id="ne2k_8c_1deb7b37e43d9b5203408374d8d8ce586" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void ne2kFreeBuffer</definition>
        <argsstring>(struct nicBuffer *buf)</argsstring>
        <name>ne2kFreeBuffer</name>
        <param>
          <type>struct <ref refid="structnicBuffer" kindref="compound">nicBuffer</ref> *</type>
          <declname>buf</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" line="353" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" bodystart="353" bodyend="357"/>
        <references refid="structnicBuffer_19679b6c2e76a7617884e422c11aa3eac" compoundref="ne2k_8h" startline="54">nicBuffer::buffer</references>
        <references refid="kmalloc_8h_1aa9ed6886459604cf73ccdbf6410e487" compoundref="kmalloc_8c" startline="351" endline="391">kfree</references>
      </memberdef>
      <memberdef kind="function" id="ne2k_8c_1954f14d0270247855900254097728c57" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="structnicBuffer" kindref="compound">nicBuffer</ref> *</type>
        <definition>struct nicBuffer* ne2kGetBuffer</definition>
        <argsstring>()</argsstring>
        <name>ne2kGetBuffer</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" line="341" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" bodystart="341" bodyend="351"/>
        <references refid="ne2k_8c_1764e2356e3d80b20b7f2466d32ebf9f2" compoundref="ne2k_8c" startline="44">ne2k_spinLock</references>
        <references refid="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" compoundref="ne2k_8c" startline="50">ne2kBuffer</references>
        <references refid="structnicBuffer_1b019ceba7f84eddae7d6b2abc538906a" compoundref="ne2k_8h" startline="52">nicBuffer::next</references>
        <references refid="ap-boot_8S_11a3ac2137e21f6f0d400f1996914dd19" compoundref="ap-boot_8S" startline="6">x1</references>
      </memberdef>
      <memberdef kind="function" id="ne2k_8c_11e664af4b82fdc7971db793f0e9b3ebd" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void ne2kHandler</definition>
        <argsstring>()</argsstring>
        <name>ne2kHandler</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" line="191" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" bodystart="191" bodyend="221"/>
        <references refid="ne2k_8c_193484a1eaa8e1b265202c6cccfed65f3" compoundref="ne2k_8c" startline="223" endline="277">dp_recv</references>
        <references refid="8259_8h_1417bb9e0e5c2751570faf6d7b848f977" compoundref="8259_8h" startline="39">eoi</references>
        <references refid="io_8h_177b934268de1b3ecdcf3f275413b3108" compoundref="io_8c" startline="39" endline="47">inportByte</references>
        <references refid="structdevice_19467302b748ed3627bae8e3ecee7af87" compoundref="device_8old_8h" startline="31">device::ioAddr</references>
        <references refid="8259_8h_12b9ec30943ddb0a2ef3bd7ccfd2026c0">irqDisable</references>
        <references refid="8259_8h_10ac079c4d770f02e505f4d8569a6960a">irqEnable</references>
        <references refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" compoundref="kprintf_8c" startline="38" endline="49">kprintf</references>
        <references refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" compoundref="ne2k_8c" startline="51">mDev</references>
        <references refid="8259_8h_10195451428bc646f820202dc15f25d9f" compoundref="8259_8h" startline="35">mPic</references>
        <references refid="ne2k_8h_104dfd3c3cd4a3f758cb038b78231493f" compoundref="ne2k_8h" startline="80">NE_IMR</references>
        <references refid="ne2k_8h_10b931a9b3f618839c02bc888b12fad6b" compoundref="ne2k_8h" startline="73">NE_ISR</references>
        <references refid="ne2k_8h_1c9016fe03699a7b0ebea5db11ee8aa69" compoundref="ne2k_8h" startline="72">NE_TPSR</references>
        <references refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" compoundref="io_8c" startline="73" endline="79">outportByte</references>
        <references refid="8259_8h_17d4efc593ecc4ace3d92e1f4ee919b99" compoundref="8259_8h" startline="37">sPic</references>
        <references refid="fdc_8c_1e2746d1bf47d4f690105d083b966fa82" compoundref="fdc_8c" startline="54">status</references>
      </memberdef>
      <memberdef kind="function" id="ne2k_8c_145a65b2b7a15b7e7c46fd8831528c8d0" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int NICtoPC</definition>
        <argsstring>(struct device *dev, void *packet, int length, int nic_addr)</argsstring>
        <name>NICtoPC</name>
        <param>
          <type>struct <ref refid="structdevice" kindref="compound">device</ref> *</type>
          <declname>dev</declname>
        </param>
        <param>
          <type>void *</type>
          <declname>packet</declname>
        </param>
        <param>
          <type>int</type>
          <declname>length</declname>
        </param>
        <param>
          <type>int</type>
          <declname>nic_addr</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" line="164" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" bodystart="164" bodyend="189"/>
        <references refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" compoundref="assert_8h" startline="64">assert</references>
        <references refid="ne2k_8h_194ed811925b8c9a71ec0c3590a15868c" compoundref="ne2k_8h" startline="108">EN0_ISR</references>
        <references refid="ne2k_8h_113af46188f103450f08ce0346bde34af" compoundref="ne2k_8h" startline="107">EN0_RCNTHI</references>
        <references refid="ne2k_8h_1b5b4b2e9eb20e5ec41e7784bf5148900" compoundref="ne2k_8h" startline="106">EN0_RCNTLO</references>
        <references refid="ne2k_8h_19834bfab75d2f822b0f684e612917281" compoundref="ne2k_8h" startline="111">EN0_RSARHI</references>
        <references refid="ne2k_8h_1352cf7775b146c81c2e1cf81110c9c7e" compoundref="ne2k_8h" startline="110">EN0_RSARLO</references>
        <references refid="io_8h_1fb703b187feb4b92444454df6c3dd9e6" compoundref="io_8c" startline="56" endline="64">inportWord</references>
        <references refid="structdevice_19467302b748ed3627bae8e3ecee7af87" compoundref="device_8old_8h" startline="31">device::ioAddr</references>
        <references refid="ne2k_8h_15b7cdde018b5a4d42f91183d216d3f0d" compoundref="ne2k_8h" startline="132">NE_DATAPORT</references>
        <references refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" compoundref="io_8c" startline="73" endline="79">outportByte</references>
        <referencedby refid="ne2k_8c_120e9fce07d30c847b2f794191f55e5ea" compoundref="ne2k_8c" startline="297" endline="311">dp_pkt2user</referencedby>
      </memberdef>
      <memberdef kind="function" id="ne2k_8c_1f6446fd497eb16b637ebed77c7a0aeaf" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int PCtoNIC</definition>
        <argsstring>(struct device *dev, void *packet, int length)</argsstring>
        <name>PCtoNIC</name>
        <param>
          <type>struct <ref refid="structdevice" kindref="compound">device</ref> *</type>
          <declname>dev</declname>
        </param>
        <param>
          <type>void *</type>
          <declname>packet</declname>
        </param>
        <param>
          <type>int</type>
          <declname>length</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" line="115" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" bodystart="115" bodyend="162"/>
        <references refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" compoundref="assert_8h" startline="64">assert</references>
        <references refid="ne2k_8h_19220d4793c7d8dd1844a006713faafee" compoundref="ne2k_8h" startline="98">E8390_RWRITE</references>
        <references refid="ne2k_8h_1c3d2ce0fc9cc0e4e0c6e6a1484f08ddf" compoundref="ne2k_8h" startline="96">E8390_START</references>
        <references refid="ne2k_8h_194ed811925b8c9a71ec0c3590a15868c" compoundref="ne2k_8h" startline="108">EN0_ISR</references>
        <references refid="ne2k_8h_113af46188f103450f08ce0346bde34af" compoundref="ne2k_8h" startline="107">EN0_RCNTHI</references>
        <references refid="ne2k_8h_1b5b4b2e9eb20e5ec41e7784bf5148900" compoundref="ne2k_8h" startline="106">EN0_RCNTLO</references>
        <references refid="ne2k_8h_19834bfab75d2f822b0f684e612917281" compoundref="ne2k_8h" startline="111">EN0_RSARHI</references>
        <references refid="ne2k_8h_1352cf7775b146c81c2e1cf81110c9c7e" compoundref="ne2k_8h" startline="110">EN0_RSARLO</references>
        <references refid="io_8h_177b934268de1b3ecdcf3f275413b3108" compoundref="io_8c" startline="39" endline="47">inportByte</references>
        <references refid="structdevice_19467302b748ed3627bae8e3ecee7af87" compoundref="device_8old_8h" startline="31">device::ioAddr</references>
        <references refid="kpanic_8h_1db9a182aa071791a306163d50d653deb" compoundref="kpanic_8c" startline="42" endline="60">kpanic</references>
        <references refid="ne2k_8h_15b7cdde018b5a4d42f91183d216d3f0d" compoundref="ne2k_8h" startline="132">NE_DATAPORT</references>
        <references refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" compoundref="io_8c" startline="73" endline="79">outportByte</references>
        <references refid="io_8h_1243f6b6d22cc5948908b764d58efc2b0" compoundref="io_8c" startline="104" endline="110">outportWord</references>
      </memberdef>
      </sectiondef>
      <sectiondef kind="var">
      <memberdef kind="variable" id="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" prot="public" static="yes" mutable="no">
        <type>struct <ref refid="structdevice" kindref="compound">device</ref> *</type>
        <definition>struct device* mDev</definition>
        <argsstring></argsstring>
        <name>mDev</name>
        <initializer> 0x0</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" line="51" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" bodystart="51" bodyend="-1"/>
        <referencedby refid="ne2k_8c_1033e069050ace667acb10ed9ffc8ac6c" compoundref="ne2k_8c" startline="70" endline="113">ne2k_init</referencedby>
        <referencedby refid="ne2k_8c_11e664af4b82fdc7971db793f0e9b3ebd" compoundref="ne2k_8c" startline="191" endline="221">ne2kHandler</referencedby>
      </memberdef>
      <memberdef kind="variable" id="ne2k_8c_1764e2356e3d80b20b7f2466d32ebf9f2" prot="public" static="yes" mutable="no">
        <type><ref refid="spinlock_8h_1a240e9404b4ede1e0d714610080d1176" kindref="member">spinLock_t</ref></type>
        <definition>spinLock_t ne2k_spinLock</definition>
        <argsstring></argsstring>
        <name>ne2k_spinLock</name>
        <initializer> SPIN_LOCK_INITIALIZER</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" line="44" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" bodystart="44" bodyend="-1"/>
        <referencedby refid="ne2k_8c_1dae239918a8091c31abf996cee262c92" compoundref="ne2k_8c" startline="313" endline="339">ne2kAllocBuffer</referencedby>
        <referencedby refid="ne2k_8c_1954f14d0270247855900254097728c57" compoundref="ne2k_8c" startline="341" endline="351">ne2kGetBuffer</referencedby>
      </memberdef>
      <memberdef kind="variable" id="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" prot="public" static="yes" mutable="no">
        <type>struct <ref refid="structnicBuffer" kindref="compound">nicBuffer</ref> *</type>
        <definition>struct nicBuffer* ne2kBuffer</definition>
        <argsstring></argsstring>
        <name>ne2kBuffer</name>
        <initializer> 0x0</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" line="50" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c" bodystart="50" bodyend="-1"/>
        <referencedby refid="ne2k_8c_1dae239918a8091c31abf996cee262c92" compoundref="ne2k_8c" startline="313" endline="339">ne2kAllocBuffer</referencedby>
        <referencedby refid="ne2k_8c_1954f14d0270247855900254097728c57" compoundref="ne2k_8c" startline="341" endline="351">ne2kGetBuffer</referencedby>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment">/*****************************************************************************************</highlight></codeline>
<codeline lineno="2"><highlight class="comment"><sp/>Copyright<sp/>(c)<sp/>2002-2004<sp/>The<sp/>UbixOS<sp/>Project</highlight></codeline>
<codeline lineno="3"><highlight class="comment"><sp/>All<sp/>rights<sp/>reserved.</highlight></codeline>
<codeline lineno="4"><highlight class="comment"></highlight></codeline>
<codeline lineno="5"><highlight class="comment"><sp/>Redistribution<sp/>and<sp/>use<sp/>in<sp/>source<sp/>and<sp/>binary<sp/>forms,<sp/>with<sp/>or<sp/>without<sp/>modification,<sp/>are</highlight></codeline>
<codeline lineno="6"><highlight class="comment"><sp/>permitted<sp/>provided<sp/>that<sp/>the<sp/>following<sp/>conditions<sp/>are<sp/>met:</highlight></codeline>
<codeline lineno="7"><highlight class="comment"></highlight></codeline>
<codeline lineno="8"><highlight class="comment"><sp/>Redistributions<sp/>of<sp/>source<sp/>code<sp/>must<sp/>retain<sp/>the<sp/>above<sp/>copyright<sp/>notice,<sp/>this<sp/>list<sp/>of</highlight></codeline>
<codeline lineno="9"><highlight class="comment"><sp/>conditions,<sp/>the<sp/>following<sp/>disclaimer<sp/>and<sp/>the<sp/>list<sp/>of<sp/>authors.<sp/><sp/>Redistributions<sp/>in<sp/>binary</highlight></codeline>
<codeline lineno="10"><highlight class="comment"><sp/>form<sp/>must<sp/>reproduce<sp/>the<sp/>above<sp/>copyright<sp/>notice,<sp/>this<sp/>list<sp/>of<sp/>conditions,<sp/>the<sp/>following</highlight></codeline>
<codeline lineno="11"><highlight class="comment"><sp/>disclaimer<sp/>and<sp/>the<sp/>list<sp/>of<sp/>authors<sp/>in<sp/>the<sp/>documentation<sp/>and/or<sp/>other<sp/>materials<sp/>provided</highlight></codeline>
<codeline lineno="12"><highlight class="comment"><sp/>with<sp/>the<sp/>distribution.<sp/>Neither<sp/>the<sp/>name<sp/>of<sp/>the<sp/>UbixOS<sp/>Project<sp/>nor<sp/>the<sp/>names<sp/>of<sp/>its</highlight></codeline>
<codeline lineno="13"><highlight class="comment"><sp/>contributors<sp/>may<sp/>be<sp/>used<sp/>to<sp/>endorse<sp/>or<sp/>promote<sp/>products<sp/>derived<sp/>from<sp/>this<sp/>software</highlight></codeline>
<codeline lineno="14"><highlight class="comment"><sp/>without<sp/>specific<sp/>prior<sp/>written<sp/>permission.</highlight></codeline>
<codeline lineno="15"><highlight class="comment"></highlight></codeline>
<codeline lineno="16"><highlight class="comment"><sp/>THIS<sp/>SOFTWARE<sp/>IS<sp/>PROVIDED<sp/>BY<sp/>THE<sp/>COPYRIGHT<sp/>HOLDERS<sp/>AND<sp/>CONTRIBUTORS<sp/>&quot;AS<sp/>IS&quot;<sp/>AND<sp/>ANY</highlight></codeline>
<codeline lineno="17"><highlight class="comment"><sp/>EXPRESS<sp/>OR<sp/>IMPLIED<sp/>WARRANTIES,<sp/>INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>THE<sp/>IMPLIED<sp/>WARRANTIES<sp/>OF</highlight></codeline>
<codeline lineno="18"><highlight class="comment"><sp/>MERCHANTABILITY<sp/>AND<sp/>FITNESS<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE<sp/>ARE<sp/>DISCLAIMED.<sp/>IN<sp/>NO<sp/>EVENT<sp/>SHALL</highlight></codeline>
<codeline lineno="19"><highlight class="comment"><sp/>THE<sp/>COPYRIGHT<sp/>OWNER<sp/>OR<sp/>CONTRIBUTORS<sp/>BE<sp/>LIABLE<sp/>FOR<sp/>ANY<sp/>DIRECT,<sp/>INDIRECT,<sp/>INCIDENTAL,</highlight></codeline>
<codeline lineno="20"><highlight class="comment"><sp/>SPECIAL,<sp/>EXEMPLARY,<sp/>OR<sp/>CONSEQUENTIAL<sp/>DAMAGES<sp/>(INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>PROCUREMENT</highlight></codeline>
<codeline lineno="21"><highlight class="comment"><sp/>OF<sp/>SUBSTITUTE<sp/>GOODS<sp/>OR<sp/>SERVICES;<sp/>LOSS<sp/>OF<sp/>USE,<sp/>DATA,<sp/>OR<sp/>PROFITS;<sp/>OR<sp/>BUSINESS<sp/>INTERRUPTION)</highlight></codeline>
<codeline lineno="22"><highlight class="comment"><sp/>HOWEVER<sp/>CAUSED<sp/>AND<sp/>ON<sp/>ANY<sp/>THEORY<sp/>OF<sp/>LIABILITY,<sp/>WHETHER<sp/>IN<sp/>CONTRACT,<sp/>STRICT<sp/>LIABILITY,<sp/>OR</highlight></codeline>
<codeline lineno="23"><highlight class="comment"><sp/>TORT<sp/>(INCLUDING<sp/>NEGLIGENCE<sp/>OR<sp/>OTHERWISE)<sp/>ARISING<sp/>IN<sp/>ANY<sp/>WAY<sp/>OUT<sp/>OF<sp/>THE<sp/>USE<sp/>OF<sp/>THIS</highlight></codeline>
<codeline lineno="24"><highlight class="comment"><sp/>SOFTWARE,<sp/>EVEN<sp/>IF<sp/>ADVISED<sp/>OF<sp/>THE<sp/>POSSIBILITY<sp/>OF<sp/>SUCH<sp/>DAMAGE.</highlight></codeline>
<codeline lineno="25"><highlight class="comment"></highlight></codeline>
<codeline lineno="26"><highlight class="comment"><sp/>$Id$</highlight></codeline>
<codeline lineno="27"><highlight class="comment"></highlight></codeline>
<codeline lineno="28"><highlight class="comment">*****************************************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="29"><highlight class="normal"></highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="ne2k_8h" kindref="compound">isa/ne2k.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="8259_8h" kindref="compound">isa/8259.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="device_8old_8h" kindref="compound">sys/device.old.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="33"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="io_8h" kindref="compound">sys/io.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="34"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="idt_8h" kindref="compound">sys/idt.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="35"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="kmalloc_8h" kindref="compound">lib/kmalloc.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="36"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="kprintf_8h" kindref="compound">lib/kprintf.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="37"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="string_8h" kindref="compound">string.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="38"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="kpanic_8h" kindref="compound">ubixos/kpanic.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="vitals_8h" kindref="compound">ubixos/vitals.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="spinlock_8h" kindref="compound">ubixos/spinlock.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="41"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="assert_8h" kindref="compound">assert.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="42"><highlight class="normal"></highlight></codeline>
<codeline lineno="43"><highlight class="normal"></highlight></codeline>
<codeline lineno="44" refid="ne2k_8c_1764e2356e3d80b20b7f2466d32ebf9f2" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="spinlock_8h_1a240e9404b4ede1e0d714610080d1176" kindref="member">spinLock_t</ref><sp/><ref refid="ne2k_8c_1764e2356e3d80b20b7f2466d32ebf9f2" kindref="member">ne2k_spinLock</ref><sp/>=<sp/><ref refid="spinlock_8h_10fe85a4f3642683148b25916d6c5eafd" kindref="member">SPIN_LOCK_INITIALIZER</ref>;</highlight></codeline>
<codeline lineno="45"><highlight class="normal"></highlight></codeline>
<codeline lineno="46"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ne2k_8c_120e9fce07d30c847b2f794191f55e5ea" kindref="member">dp_pkt2user</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structdevice" kindref="compound">device</ref><sp/>*dev,</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>page,</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>length);</highlight></codeline>
<codeline lineno="47"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="ne2k_8c_182ba0a2f0d1c6dc1381e5c15118bb5ef" kindref="member">getblock</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structdevice" kindref="compound">device</ref><sp/>*dev,</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>page,<ref refid="types_8h_17619b847aeded8a6d14cbfa212b2cdfb" kindref="member">size_t</ref><sp/>offset,<ref refid="types_8h_17619b847aeded8a6d14cbfa212b2cdfb" kindref="member">size_t</ref><sp/><ref refid="structdevice__interface_182fda947114f5c8d53fb7acbd7eb0e21" kindref="member">size</ref>,</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*dst);</highlight></codeline>
<codeline lineno="48"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ne2k_8c_193484a1eaa8e1b265202c6cccfed65f3" kindref="member">dp_recv</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structdevice" kindref="compound">device</ref><sp/>*);</highlight></codeline>
<codeline lineno="49"><highlight class="normal"></highlight></codeline>
<codeline lineno="50" refid="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structnicBuffer" kindref="compound">nicBuffer</ref><sp/>*<ref refid="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" kindref="member">ne2kBuffer</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="51" refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structdevice" kindref="compound">device</ref><sp/><sp/><sp/><sp/>*<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="52"><highlight class="normal"></highlight></codeline>
<codeline lineno="53"><highlight class="normal"></highlight><highlight class="keyword">asm</highlight><highlight class="normal">(</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/></highlight><highlight class="stringliteral">&quot;.globl<sp/>ne2kISR<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/></highlight><highlight class="stringliteral">&quot;ne2kISR:<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/></highlight><highlight class="stringliteral">&quot;<sp/><sp/>pusha<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>\n&quot;</highlight><highlight class="normal"><sp/></highlight><highlight class="comment">/*<sp/>Save<sp/>all<sp/>registers<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/></highlight><highlight class="stringliteral">&quot;<sp/><sp/>call<sp/>ne2kHandler<sp/><sp/><sp/><sp/><sp/>\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/></highlight><highlight class="stringliteral">&quot;<sp/><sp/>popa<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/></highlight><highlight class="stringliteral">&quot;<sp/><sp/>iret<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>\n&quot;</highlight><highlight class="normal"><sp/></highlight><highlight class="comment">/*<sp/>Exit<sp/>interrupt<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/>);</highlight></codeline>
<codeline lineno="61"><highlight class="normal"></highlight></codeline>
<codeline lineno="62"><highlight class="normal"></highlight><highlight class="comment">/************************************************************************</highlight></codeline>
<codeline lineno="63"><highlight class="comment"></highlight></codeline>
<codeline lineno="64"><highlight class="comment">Function:<sp/>int<sp/>ne2kInit(uInt32<sp/>ioAddr)</highlight></codeline>
<codeline lineno="65"><highlight class="comment">Description:<sp/>This<sp/>Function<sp/>Will<sp/>Initialize<sp/>The<sp/>Programmable<sp/>Timer</highlight></codeline>
<codeline lineno="66"><highlight class="comment"></highlight></codeline>
<codeline lineno="67"><highlight class="comment">Notes:</highlight></codeline>
<codeline lineno="68"><highlight class="comment"></highlight></codeline>
<codeline lineno="69"><highlight class="comment">************************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="70" refid="ne2k_8c_1033e069050ace667acb10ed9ffc8ac6c" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ne2k_8h_1033e069050ace667acb10ed9ffc8ac6c" kindref="member">ne2k_init</ref>()<sp/>{</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref><sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structdevice" kindref="compound">device</ref><sp/>*)<ref refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structdevice" kindref="compound">device</ref>));</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>=<sp/>0x280;</highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/><ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_1893bc785f272d1fedb2b4c14e31a7f35" kindref="member">irq</ref><sp/><sp/><sp/><sp/>=<sp/>10;</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/><ref refid="idt_8h_1174a47ed653fc64fff6b5bb1b895c2cf" kindref="member">setVector</ref>(&amp;<ref refid="ne2k_8h_1a1d4735355686cbdc2d6bf145c413db3" kindref="member">ne2kISR</ref>,<sp/><ref refid="8259_8h_17d84962c1a1c225344a94545309f92fc" kindref="member">mVec</ref>+10,<sp/><ref refid="gdt_8h_1be5eb76416aff1d9114e1cdb8b0797fe" kindref="member">dPresent</ref><sp/>+<sp/><ref refid="gdt_8h_17eb6dc7004c613df58764da5df7d85d8" kindref="member">dInt</ref><sp/>+<sp/><ref refid="gdt_8h_15ee8638767e24765a2690483745d60d0" kindref="member">dDpl0</ref>);</highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><ref refid="8259_8h_10ac079c4d770f02e505f4d8569a6960a" kindref="member">irqEnable</ref>(10);</highlight></codeline>
<codeline lineno="76"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/>kprintf(&quot;ne0<sp/>-<sp/>irq:<sp/>%i,<sp/>ioAddr:<sp/>0x%X<sp/>MAC:<sp/>%X:%X:%X:%X:%X:%X\n&quot;,dev-&gt;irq,dev-&gt;ioAddr,dev-&gt;net-&gt;mac[0]<sp/>&amp;<sp/>0xFF,dev-&gt;net-&gt;mac[1]<sp/>&amp;<sp/>0xFF,dev-&gt;net-&gt;mac[2]<sp/>&amp;<sp/>0xFF,dev-&gt;net-&gt;mac[3]<sp/>&amp;<sp/>0xFF,dev-&gt;net-&gt;mac[4]<sp/>&amp;<sp/>0xFF,dev-&gt;net-&gt;mac[5]<sp/>&amp;<sp/>0xFF);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="77"><highlight class="normal"></highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_155d8236fd5c94eb16a5a06c3e4b07df1" kindref="member">NE_CMD</ref>,<sp/>0x21);<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>stop<sp/>mode</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="79"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1759300669dab4522e8c261d764303a9b" kindref="member">NE_DCR</ref>,0x29);<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>0x29<sp/>data<sp/>config<sp/>reg</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1b8733e4b199b85891fb58c80bd65967a" kindref="member">NE_RBCR0</ref>,0x00);<sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>LOW<sp/>byte<sp/>count<sp/>(remote)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1c023921e5da8473a400c04b2e268c621" kindref="member">NE_RBCR1</ref>,0x00);<sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>HIGH<sp/>byte<sp/>count<sp/>(remote)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1e0e015081ca05ecec4bf833265485fb9" kindref="member">NE_RCR</ref>,0x3C);<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>receive<sp/>config<sp/>reg</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1ea9754b13e450b45d0eb6d79e0a1f4aa" kindref="member">NE_TCR</ref>,0x02);<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>LOOP<sp/>mode<sp/>(temp)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_178aa15aa3cd9df670d1724be92b0157d" kindref="member">NE_PSTART</ref>,<ref refid="ne2k_8h_1819b8c4fa81871ceacc1790d6fd2b2f1" kindref="member">startPage</ref>);<sp/></highlight><highlight class="comment">//<sp/>0x26<sp/>PAGE<sp/>start</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="85"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_14c97ad2e89582cb65022a052df40c04a" kindref="member">NE_BNRY</ref>,<ref refid="ne2k_8h_1819b8c4fa81871ceacc1790d6fd2b2f1" kindref="member">startPage</ref>);<sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>0x26<sp/>BOUNDARY</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_14991431a50163bff66590bf8a7fb3c72" kindref="member">NE_PSTOP</ref>,<ref refid="ne2k_8h_1e05994559a4ee216a39b3307b7911493" kindref="member">stopPage</ref>);<sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>0x40<sp/>PAGE<sp/>stop</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="87"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_10b931a9b3f618839c02bc888b12fad6b" kindref="member">NE_ISR</ref>,0xFF);<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>interrupt<sp/>status<sp/>reg</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_104dfd3c3cd4a3f758cb038b78231493f" kindref="member">NE_IMR</ref>,0x0B);</highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_155d8236fd5c94eb16a5a06c3e4b07df1" kindref="member">NE_CMD</ref>,0x61);<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>PAGE<sp/>1<sp/>regs</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="90"><highlight class="normal"></highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1b748b31fd480e8195caac541bc792c2b" kindref="member">DP_MAR0</ref>,<sp/>0xFF);</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_16e5cdffc808e98e09eca1efad797abf4" kindref="member">DP_MAR1</ref>,<sp/>0xFF);</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_16aff3543036b8ddf515d243b0e1ddf34" kindref="member">DP_MAR2</ref>,<sp/>0xFF);</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_11a62c9c151ca3a621f0683d0eaba12fe" kindref="member">DP_MAR3</ref>,<sp/>0xFF);</highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1ce5a77fb812564273e5304dd138ac29f" kindref="member">DP_MAR4</ref>,<sp/>0xFF);</highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_10ec81b4dbe6150ae308588ed7de0f686" kindref="member">DP_MAR5</ref>,<sp/>0xFF);</highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1649d4943e589ed684b2e0faf811dc0af" kindref="member">DP_MAR6</ref>,<sp/>0xFF);</highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1fc53aa624a738deb114bf3d20257f108" kindref="member">DP_MAR7</ref>,<sp/>0xFF);</highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_18336bb3cb0a54a93522379477340fdec" kindref="member">DP_CURR</ref>,<sp/><ref refid="ne2k_8h_1819b8c4fa81871ceacc1790d6fd2b2f1" kindref="member">startPage</ref><sp/>+<sp/>1);</highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_155d8236fd5c94eb16a5a06c3e4b07df1" kindref="member">NE_CMD</ref>,<sp/><sp/>0<ref refid="start_8S_162df326d54f8b2ece412319c4360ef3e" kindref="member">x20</ref>);</highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/><ref refid="io_8h_177b934268de1b3ecdcf3f275413b3108" kindref="member">inportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_12dcfc12834d5a417dcf43e2ca248f0cd" kindref="member">DP_CNTR0</ref>);<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>reset<sp/>counters<sp/>by<sp/>reading<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/><ref refid="io_8h_177b934268de1b3ecdcf3f275413b3108" kindref="member">inportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1e99a5201b20f9fd87b195c1074a643ec" kindref="member">DP_CNTR1</ref>);</highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/><ref refid="io_8h_177b934268de1b3ecdcf3f275413b3108" kindref="member">inportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1b56dccd8151d77ad3dbd832b65601af0" kindref="member">DP_CNTR2</ref>);</highlight></codeline>
<codeline lineno="104"><highlight class="normal"></highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1ea9754b13e450b45d0eb6d79e0a1f4aa" kindref="member">NE_TCR</ref>,<sp/><sp/>0x00);</highlight></codeline>
<codeline lineno="106"><highlight class="normal"></highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_155d8236fd5c94eb16a5a06c3e4b07df1" kindref="member">NE_CMD</ref>,<sp/>0x0);</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1759300669dab4522e8c261d764303a9b" kindref="member">NE_DCR</ref>,<sp/>0x29);</highlight></codeline>
<codeline lineno="109"><highlight class="normal"></highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;Initialized&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Return<sp/>so<sp/>we<sp/>know<sp/>everything<sp/>went<sp/>well<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="113"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="114"><highlight class="normal"></highlight></codeline>
<codeline lineno="115" refid="ne2k_8c_1f6446fd497eb16b637ebed77c7a0aeaf" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ne2k_8h_1f6446fd497eb16b637ebed77c7a0aeaf" kindref="member">PCtoNIC</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structdevice" kindref="compound">device</ref><sp/>*dev,</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*packet,</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>length)<sp/>{</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/>i<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/><ref refid="types_8h_13b65128d2644e9b80cec9a69bfa7e094" kindref="member">uInt16</ref><sp/>*packet16<sp/>=<sp/>(<ref refid="types_8h_13b65128d2644e9b80cec9a69bfa7e094" kindref="member">uInt16</ref><sp/>*)packet;</highlight></codeline>
<codeline lineno="118"><highlight class="normal"><sp/><sp/><ref refid="types_8h_1a4e0f27a9aca905e340c06d2dcae843c" kindref="member">uInt8</ref><sp/><sp/>*packet8<sp/><sp/>=<sp/>(<ref refid="types_8h_1a4e0f27a9aca905e340c06d2dcae843c" kindref="member">uInt8</ref><sp/><sp/>*)packet;</highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/><ref refid="types_8h_1a4e0f27a9aca905e340c06d2dcae843c" kindref="member">uInt8</ref><sp/><sp/><sp/>word16<sp/><sp/><sp/>=<sp/>0x1;</highlight></codeline>
<codeline lineno="120"><highlight class="normal"></highlight></codeline>
<codeline lineno="121"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((<ref refid="io_8h_177b934268de1b3ecdcf3f275413b3108" kindref="member">inportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref>)<sp/>&amp;<sp/>0x04)<sp/>==<sp/>0x04)<sp/>{</highlight></codeline>
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1db9a182aa071791a306163d50d653deb" kindref="member">kpanic</ref>(</highlight><highlight class="stringliteral">&quot;Device<sp/>Not<sp/>Ready\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="124"><highlight class="normal"></highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/><ref refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(length);</highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((word16<sp/>==<sp/>1)<sp/>&amp;&amp;<sp/>(length<sp/>&amp;<sp/>0x01))<sp/>{</highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/>length++;</highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="129"><highlight class="normal"></highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref>+<ref refid="ne2k_8h_1b5b4b2e9eb20e5ec41e7784bf5148900" kindref="member">EN0_RCNTLO</ref>,(length<sp/>&amp;<sp/>0xFF));</highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref>+<ref refid="ne2k_8h_113af46188f103450f08ce0346bde34af" kindref="member">EN0_RCNTHI</ref>,(length<sp/>&gt;&gt;<sp/>8));</highlight></codeline>
<codeline lineno="132"><highlight class="normal"></highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref>+<ref refid="ne2k_8h_1352cf7775b146c81c2e1cf81110c9c7e" kindref="member">EN0_RSARLO</ref>,0x0);</highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref>+<ref refid="ne2k_8h_19834bfab75d2f822b0f684e612917281" kindref="member">EN0_RSARHI</ref>,0x41);</highlight></codeline>
<codeline lineno="135"><highlight class="normal"></highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref>,<ref refid="ne2k_8h_19220d4793c7d8dd1844a006713faafee" kindref="member">E8390_RWRITE</ref>+<ref refid="ne2k_8h_1c3d2ce0fc9cc0e4e0c6e6a1484f08ddf" kindref="member">E8390_START</ref>);</highlight></codeline>
<codeline lineno="137"><highlight class="normal"></highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(word16<sp/>!=<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;i&lt;length/2;i++){</highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="io_8h_1243f6b6d22cc5948908b764d58efc2b0" kindref="member">outportWord</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_15b7cdde018b5a4d42f91183d216d3f0d" kindref="member">NE_DATAPORT</ref>,packet16[i]);</highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;i&lt;length;i++){</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_15b7cdde018b5a4d42f91183d216d3f0d" kindref="member">NE_DATAPORT</ref>,packet8[i]);</highlight></codeline>
<codeline lineno="146"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;i&lt;=100;i++)<sp/>{</highlight></codeline>
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((<ref refid="io_8h_177b934268de1b3ecdcf3f275413b3108" kindref="member">inportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref>+<ref refid="ne2k_8h_194ed811925b8c9a71ec0c3590a15868c" kindref="member">EN0_ISR</ref>)<sp/>&amp;<sp/>0x40)<sp/>==<sp/>0x40)<sp/>{</highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="154"><highlight class="normal"></highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;ioAddr+<ref refid="ne2k_8h_194ed811925b8c9a71ec0c3590a15868c" kindref="member">EN0_ISR</ref>,0x40);</highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;ioAddr+<ref refid="ne2k_8h_16c3f2eca9677ccb05d29d7aac3f25d4c" kindref="member">EN0_TPSR</ref>,0x41);</highlight><highlight class="comment">//ei_local-&gt;txStartPage);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;ioAddr+0x05,(length<sp/>&amp;<sp/>0xFF));</highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;ioAddr+0x06,(length<sp/>&gt;&gt;<sp/>8));</highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/><ref refid="io_8h_1f0c1dd5717007bf73b6c5119dfe7eaf2" kindref="member">outportByteP</ref>(dev-&gt;ioAddr,0x26);</highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//kprintf(&quot;SENT\n&quot;);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(length);</highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="163"><highlight class="normal"></highlight></codeline>
<codeline lineno="164" refid="ne2k_8c_145a65b2b7a15b7e7c46fd8831528c8d0" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ne2k_8h_145a65b2b7a15b7e7c46fd8831528c8d0" kindref="member">NICtoPC</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structdevice" kindref="compound">device</ref><sp/>*dev,</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*packet,</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>length,</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>nic_addr)<sp/>{</highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><ref refid="types_8h_13b65128d2644e9b80cec9a69bfa7e094" kindref="member">uInt16</ref><sp/>*packet16<sp/>=<sp/>(<ref refid="types_8h_13b65128d2644e9b80cec9a69bfa7e094" kindref="member">uInt16</ref><sp/>*)packet;</highlight></codeline>
<codeline lineno="167"><highlight class="normal"></highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/><ref refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(length);</highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(length<sp/>&amp;<sp/>0x01)</highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/><sp/><sp/>length++;</highlight></codeline>
<codeline lineno="172"><highlight class="normal"></highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="174"><highlight class="normal"></highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref>+<ref refid="ne2k_8h_1b5b4b2e9eb20e5ec41e7784bf5148900" kindref="member">EN0_RCNTLO</ref>,(length<sp/>&amp;<sp/>0xFF));</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref>+<ref refid="ne2k_8h_113af46188f103450f08ce0346bde34af" kindref="member">EN0_RCNTHI</ref>,(length<sp/>&gt;&gt;<sp/>8));</highlight></codeline>
<codeline lineno="177"><highlight class="normal"></highlight></codeline>
<codeline lineno="178"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref>+<ref refid="ne2k_8h_1352cf7775b146c81c2e1cf81110c9c7e" kindref="member">EN0_RSARLO</ref>,nic_addr<sp/>&amp;<sp/>0xFF);</highlight></codeline>
<codeline lineno="179"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref>+<ref refid="ne2k_8h_19834bfab75d2f822b0f684e612917281" kindref="member">EN0_RSARHI</ref>,nic_addr<sp/>&gt;&gt;<sp/>8);</highlight></codeline>
<codeline lineno="180"><highlight class="normal"></highlight></codeline>
<codeline lineno="181"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref>,0x0A);</highlight></codeline>
<codeline lineno="182"><highlight class="normal"></highlight></codeline>
<codeline lineno="183"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;i&lt;length/2;i++){</highlight></codeline>
<codeline lineno="184"><highlight class="normal"><sp/><sp/><sp/><sp/>packet16[i]<sp/>=<sp/><ref refid="io_8h_1fb703b187feb4b92444454df6c3dd9e6" kindref="member">inportWord</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_15b7cdde018b5a4d42f91183d216d3f0d" kindref="member">NE_DATAPORT</ref>);</highlight></codeline>
<codeline lineno="185"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="186"><highlight class="normal"></highlight></codeline>
<codeline lineno="187"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref>+<ref refid="ne2k_8h_194ed811925b8c9a71ec0c3590a15868c" kindref="member">EN0_ISR</ref>,0x40);</highlight></codeline>
<codeline lineno="188"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(length);</highlight></codeline>
<codeline lineno="189"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="190"><highlight class="normal"></highlight></codeline>
<codeline lineno="191" refid="ne2k_8c_11e664af4b82fdc7971db793f0e9b3ebd" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="ne2k_8h_11e664af4b82fdc7971db793f0e9b3ebd" kindref="member">ne2kHandler</ref>()<sp/>{</highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/><ref refid="types_8h_13b65128d2644e9b80cec9a69bfa7e094" kindref="member">uInt16</ref><sp/>isr<sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/><ref refid="types_8h_13b65128d2644e9b80cec9a69bfa7e094" kindref="member">uInt16</ref><sp/><ref refid="fdc_8c_1e2746d1bf47d4f690105d083b966fa82" kindref="member">status</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/><ref refid="8259_8h_12b9ec30943ddb0a2ef3bd7ccfd2026c0" kindref="member">irqDisable</ref>(10);</highlight></codeline>
<codeline lineno="196"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="8259_8h_10195451428bc646f820202dc15f25d9f" kindref="member">mPic</ref>,<sp/><ref refid="8259_8h_1417bb9e0e5c2751570faf6d7b848f977" kindref="member">eoi</ref>);</highlight></codeline>
<codeline lineno="197"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="8259_8h_17d4efc593ecc4ace3d92e1f4ee919b99" kindref="member">sPic</ref>,<sp/><ref refid="8259_8h_1417bb9e0e5c2751570faf6d7b848f977" kindref="member">eoi</ref>);</highlight></codeline>
<codeline lineno="198"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="199"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">asm</highlight><highlight class="normal">(</highlight><highlight class="stringliteral">&quot;sti&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="200"><highlight class="normal"></highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/>isr<sp/>=<sp/><ref refid="io_8h_177b934268de1b3ecdcf3f275413b3108" kindref="member">inportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_10b931a9b3f618839c02bc888b12fad6b" kindref="member">NE_ISR</ref>);</highlight></codeline>
<codeline lineno="202"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="203"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((isr<sp/>&amp;<sp/>0x02)<sp/>==<sp/>0x02)<sp/>{</highlight></codeline>
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_10b931a9b3f618839c02bc888b12fad6b" kindref="member">NE_ISR</ref>,<sp/>0x0A);</highlight></codeline>
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/>status<sp/>=<sp/><ref refid="io_8h_177b934268de1b3ecdcf3f275413b3108" kindref="member">inportByte</ref>(0x280<sp/>+<sp/><ref refid="ne2k_8h_1c9016fe03699a7b0ebea5db11ee8aa69" kindref="member">NE_TPSR</ref>);</highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight></codeline>
<codeline lineno="207"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((isr<sp/>&amp;<sp/>0x01)<sp/>==<sp/>0x01)<sp/>{</highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="ne2k_8c_193484a1eaa8e1b265202c6cccfed65f3" kindref="member">dp_recv</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>))<sp/>{</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;Error<sp/>Getting<sp/>Packet\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(mDev-&gt;ioAddr<sp/>+<sp/><ref refid="ne2k_8h_10b931a9b3f618839c02bc888b12fad6b" kindref="member">NE_ISR</ref>,<sp/>0x05);</highlight></codeline>
<codeline lineno="212"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="213"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="214"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_104dfd3c3cd4a3f758cb038b78231493f" kindref="member">NE_IMR</ref>,0x0);</highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(<ref refid="ne2k_8c_1eebda15be7c1218c6072e6e0f057ff14" kindref="member">mDev</ref>-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_104dfd3c3cd4a3f758cb038b78231493f" kindref="member">NE_IMR</ref>,0x0B);</highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">asm</highlight><highlight class="normal">(</highlight><highlight class="stringliteral">&quot;cli&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="218"><highlight class="normal"><sp/><sp/><ref refid="8259_8h_10ac079c4d770f02e505f4d8569a6960a" kindref="member">irqEnable</ref>(10);</highlight></codeline>
<codeline lineno="219"><highlight class="normal"></highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="222"><highlight class="normal"></highlight></codeline>
<codeline lineno="223" refid="ne2k_8c_193484a1eaa8e1b265202c6cccfed65f3" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ne2k_8c_193484a1eaa8e1b265202c6cccfed65f3" kindref="member">dp_recv</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structdevice" kindref="compound">device</ref><sp/>*dev)<sp/>{</highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/><ref refid="structdp__rcvhdr" kindref="compound">dp_rcvhdr_t</ref><sp/>header;</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>pageno<sp/>=<sp/>0x0,<sp/>curr<sp/>=<sp/>0x0,<sp/>next<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>packet_processed<sp/>=<sp/>0x0,<sp/>r<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="227"><highlight class="normal"><sp/><sp/><ref refid="types_8h_13b65128d2644e9b80cec9a69bfa7e094" kindref="member">uInt16</ref><sp/>eth_type<sp/>=<sp/>0x0;<sp/><sp/></highlight></codeline>
<codeline lineno="228"><highlight class="normal"></highlight></codeline>
<codeline lineno="229"><highlight class="normal"><sp/><sp/><ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref><sp/>length<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="230"><highlight class="normal"></highlight></codeline>
<codeline lineno="231"><highlight class="normal"><sp/><sp/>pageno<sp/>=<sp/><ref refid="io_8h_177b934268de1b3ecdcf3f275413b3108" kindref="member">inportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_14c97ad2e89582cb65022a052df40c04a" kindref="member">NE_BNRY</ref>)<sp/>+<sp/>1;</highlight></codeline>
<codeline lineno="232"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(pageno<sp/>==<sp/><ref refid="ne2k_8h_1e05994559a4ee216a39b3307b7911493" kindref="member">stopPage</ref>)<sp/>pageno<sp/>=<sp/><ref refid="ne2k_8h_1819b8c4fa81871ceacc1790d6fd2b2f1" kindref="member">startPage</ref>;</highlight></codeline>
<codeline lineno="233"><highlight class="normal"></highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">do</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_155d8236fd5c94eb16a5a06c3e4b07df1" kindref="member">NE_CMD</ref>,<sp/>0x40);</highlight></codeline>
<codeline lineno="236"><highlight class="normal"><sp/><sp/><sp/><sp/>curr<sp/>=<sp/><ref refid="io_8h_177b934268de1b3ecdcf3f275413b3108" kindref="member">inportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_15e30e2969b60a082d50bf3ce80d9d766" kindref="member">NE_CURRENT</ref>);</highlight></codeline>
<codeline lineno="237"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref>,<sp/>0x0);</highlight></codeline>
<codeline lineno="238"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(curr<sp/>==<sp/>pageno)<sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="ne2k_8c_182ba0a2f0d1c6dc1381e5c15118bb5ef" kindref="member">getblock</ref>(dev,<sp/>pageno,<sp/>(<ref refid="types_8h_17619b847aeded8a6d14cbfa212b2cdfb" kindref="member">size_t</ref>)0,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(header),<sp/>&amp;header);</highlight></codeline>
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="ne2k_8c_182ba0a2f0d1c6dc1381e5c15118bb5ef" kindref="member">getblock</ref>(dev,<sp/>pageno,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(header)<sp/>+<sp/>2*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(<ref refid="unionetheraddr" kindref="compound">ether_addr_t</ref>),<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(eth_type),<sp/>&amp;eth_type);</highlight></codeline>
<codeline lineno="241"><highlight class="normal"></highlight></codeline>
<codeline lineno="242"><highlight class="normal"><sp/><sp/><sp/><sp/>length<sp/>=<sp/>(header.dr_rbcl<sp/>|<sp/>(header.dr_rbch<sp/>&lt;&lt;<sp/>8))<sp/>-<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(<ref refid="structdp__rcvhdr" kindref="compound">dp_rcvhdr_t</ref>);</highlight></codeline>
<codeline lineno="243"><highlight class="normal"><sp/><sp/><sp/><sp/>next<sp/>=<sp/>header.dr_next;</highlight></codeline>
<codeline lineno="244"><highlight class="normal"></highlight></codeline>
<codeline lineno="245"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//kprintf(&quot;length:<sp/>[0x%X:0x%X:0x%X]\n&quot;,header.dr_next,header.dr_status,length);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="246"><highlight class="normal"></highlight></codeline>
<codeline lineno="247"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(length<sp/>&lt;<sp/>60<sp/>||<sp/>length<sp/>&gt;<sp/>1514)<sp/>{</highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;dp8390:<sp/>packet<sp/>with<sp/>strange<sp/>length<sp/>arrived:<sp/>%d\n&quot;</highlight><highlight class="normal">,length);</highlight></codeline>
<codeline lineno="249"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>next=<sp/>curr;</highlight></codeline>
<codeline lineno="250"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="251"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(next<sp/>&lt;<sp/>startPage<sp/>||<sp/>next<sp/>&gt;=<sp/><ref refid="ne2k_8h_1e05994559a4ee216a39b3307b7911493" kindref="member">stopPage</ref>)<sp/>{</highlight></codeline>
<codeline lineno="252"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;dp8390:<sp/>strange<sp/>next<sp/>page\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="253"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>next=<sp/>curr;</highlight></codeline>
<codeline lineno="254"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="255"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(header.dr_status<sp/>&amp;<sp/><ref refid="ne2k_8h_13e9285670345a7583ca516cc8f7aafb8" kindref="member">RSR_FO</ref>)<sp/>{</highlight></codeline>
<codeline lineno="256"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1db9a182aa071791a306163d50d653deb" kindref="member">kpanic</ref>(</highlight><highlight class="stringliteral">&quot;dp8390:<sp/>fifo<sp/>overrun,<sp/>resetting<sp/>receive<sp/>buffer\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="257"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>next<sp/>=<sp/>curr;</highlight></codeline>
<codeline lineno="258"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="259"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(header.dr_status<sp/>&amp;<sp/><ref refid="ne2k_8h_1c1d77583edd2eba6e96cc7633558e461" kindref="member">RSR_PRX</ref>)<sp/>{</highlight></codeline>
<codeline lineno="260"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>r<sp/>=<sp/><ref refid="ne2k_8c_120e9fce07d30c847b2f794191f55e5ea" kindref="member">dp_pkt2user</ref>(dev,<sp/>pageno,<sp/>length);</highlight></codeline>
<codeline lineno="261"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(r<sp/>!=<sp/><ref refid="ne2k_8h_1ba51915c87d64af47fb1cc59348961c9" kindref="member">OK</ref>)<sp/>{</highlight></codeline>
<codeline lineno="262"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;FRUIT&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="263"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="264"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="265"><highlight class="normal"></highlight></codeline>
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>packet_processed<sp/>=<sp/>0x1;</highlight></codeline>
<codeline lineno="267"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(next<sp/>==<sp/><ref refid="ne2k_8h_1819b8c4fa81871ceacc1790d6fd2b2f1" kindref="member">startPage</ref>)</highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_14c97ad2e89582cb65022a052df40c04a" kindref="member">NE_BNRY</ref>,<sp/><ref refid="ne2k_8h_1e05994559a4ee216a39b3307b7911493" kindref="member">stopPage</ref><sp/>-<sp/>1);</highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_14c97ad2e89582cb65022a052df40c04a" kindref="member">NE_BNRY</ref>,<sp/>next<sp/>-<sp/>1);</highlight></codeline>
<codeline lineno="272"><highlight class="normal"></highlight></codeline>
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/>pageno<sp/>=<sp/>next;</highlight></codeline>
<codeline lineno="274"><highlight class="normal"></highlight></codeline>
<codeline lineno="275"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(packet_processed<sp/>==<sp/>0x0);</highlight></codeline>
<codeline lineno="276"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="277"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="278"><highlight class="normal"></highlight></codeline>
<codeline lineno="279" refid="ne2k_8c_182ba0a2f0d1c6dc1381e5c15118bb5ef" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="ne2k_8c_182ba0a2f0d1c6dc1381e5c15118bb5ef" kindref="member">getblock</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structdevice" kindref="compound">device</ref><sp/>*dev,</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>page,<ref refid="types_8h_17619b847aeded8a6d14cbfa212b2cdfb" kindref="member">size_t</ref><sp/>offset,<ref refid="types_8h_17619b847aeded8a6d14cbfa212b2cdfb" kindref="member">size_t</ref><sp/>size,</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*dst)<sp/>{</highlight></codeline>
<codeline lineno="280"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="types_8h_13b65128d2644e9b80cec9a69bfa7e094" kindref="member">uInt16</ref><sp/>*ha<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="281"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="282"><highlight class="normal"></highlight></codeline>
<codeline lineno="283"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ha<sp/>=<sp/>(<ref refid="types_8h_13b65128d2644e9b80cec9a69bfa7e094" kindref="member">uInt16</ref><sp/>*)<sp/>dst;</highlight></codeline>
<codeline lineno="284"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>offset<sp/>=<sp/>page<sp/>*<sp/><ref refid="ne2k_8h_1be1b4cb2c953c25ccdc10fcb1aa7e47d" kindref="member">DP_PAGESIZE</ref><sp/>+<sp/>offset;</highlight></codeline>
<codeline lineno="285"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1b8733e4b199b85891fb58c80bd65967a" kindref="member">NE_RBCR0</ref>,<sp/>size<sp/>&amp;<sp/>0xFF);</highlight></codeline>
<codeline lineno="286"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1c023921e5da8473a400c04b2e268c621" kindref="member">NE_RBCR1</ref>,<sp/>size<sp/>&gt;&gt;<sp/>8);</highlight></codeline>
<codeline lineno="287"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_1352cf7775b146c81c2e1cf81110c9c7e" kindref="member">EN0_RSARLO</ref>,<sp/>offset<sp/>&amp;<sp/>0xFF);</highlight></codeline>
<codeline lineno="288"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_19834bfab75d2f822b0f684e612917281" kindref="member">EN0_RSARHI</ref>,<sp/>offset<sp/>&gt;&gt;<sp/>8);</highlight></codeline>
<codeline lineno="289"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_155d8236fd5c94eb16a5a06c3e4b07df1" kindref="member">NE_CMD</ref>,<sp/><ref refid="ne2k_8h_160b09a580fe0020e08e133cd8ec0a50d" kindref="member">E8390_RREAD</ref><sp/>|<sp/><ref refid="ne2k_8h_1c3d2ce0fc9cc0e4e0c6e6a1484f08ddf" kindref="member">E8390_START</ref>);</highlight></codeline>
<codeline lineno="290"><highlight class="normal"></highlight></codeline>
<codeline lineno="291"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>size<sp/>/=<sp/>2;</highlight></codeline>
<codeline lineno="292"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=<sp/>0;<sp/>i&lt;size;<sp/>i++)</highlight></codeline>
<codeline lineno="293"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ha[i]=<sp/><ref refid="io_8h_1fb703b187feb4b92444454df6c3dd9e6" kindref="member">inportWord</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref><sp/>+<sp/><ref refid="ne2k_8h_15b7cdde018b5a4d42f91183d216d3f0d" kindref="member">NE_DATAPORT</ref>);</highlight></codeline>
<codeline lineno="294"><highlight class="normal"><sp/><sp/><ref refid="io_8h_18acc1a06073db2e7b92ffbd00fbd0cf1" kindref="member">outportByte</ref>(dev-&gt;<ref refid="structdevice_19467302b748ed3627bae8e3ecee7af87" kindref="member">ioAddr</ref>+<ref refid="ne2k_8h_194ed811925b8c9a71ec0c3590a15868c" kindref="member">EN0_ISR</ref>,0x40);</highlight></codeline>
<codeline lineno="295"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="296"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="297" refid="ne2k_8c_120e9fce07d30c847b2f794191f55e5ea" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ne2k_8c_120e9fce07d30c847b2f794191f55e5ea" kindref="member">dp_pkt2user</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structdevice" kindref="compound">device</ref><sp/>*dev,</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>page,</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>length)<sp/>{</highlight></codeline>
<codeline lineno="298"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>last<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="299"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structnicBuffer" kindref="compound">nicBuffer</ref><sp/>*tmpBuf<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="300"><highlight class="normal"><sp/></highlight></codeline>
<codeline lineno="301"><highlight class="normal"><sp/><sp/>last<sp/>=<sp/>page<sp/>+<sp/>(length<sp/>-<sp/>1)<sp/>/<sp/><ref refid="ne2k_8h_1be1b4cb2c953c25ccdc10fcb1aa7e47d" kindref="member">DP_PAGESIZE</ref>;</highlight></codeline>
<codeline lineno="302"><highlight class="normal"></highlight></codeline>
<codeline lineno="303"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(last<sp/>&gt;=<sp/><ref refid="ne2k_8h_1e05994559a4ee216a39b3307b7911493" kindref="member">stopPage</ref>)<sp/>{</highlight></codeline>
<codeline lineno="304"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;FOOK<sp/>STOP<sp/>PAGE!!!&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="305"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="306"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="307"><highlight class="normal"><sp/><sp/><sp/><sp/>tmpBuf<sp/>=<sp/><ref refid="ne2k_8h_165b49da573a73ea73aa905bae31f4aa5" kindref="member">ne2kAllocBuffer</ref>(length);</highlight></codeline>
<codeline lineno="308"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="ne2k_8h_145a65b2b7a15b7e7c46fd8831528c8d0" kindref="member">NICtoPC</ref>(dev,tmpBuf-&gt;<ref refid="structnicBuffer_19679b6c2e76a7617884e422c11aa3eac" kindref="member">buffer</ref>,length,page<sp/>*<sp/><ref refid="ne2k_8h_1be1b4cb2c953c25ccdc10fcb1aa7e47d" kindref="member">DP_PAGESIZE</ref><sp/>+<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(<ref refid="structdp__rcvhdr" kindref="compound">dp_rcvhdr_t</ref>));</highlight></codeline>
<codeline lineno="309"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="310"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(<ref refid="ne2k_8h_1ba51915c87d64af47fb1cc59348961c9" kindref="member">OK</ref>);</highlight></codeline>
<codeline lineno="311"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="312"><highlight class="normal"></highlight></codeline>
<codeline lineno="313" refid="ne2k_8c_1dae239918a8091c31abf996cee262c92" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structnicBuffer" kindref="compound">nicBuffer</ref><sp/>*<ref refid="ne2k_8h_165b49da573a73ea73aa905bae31f4aa5" kindref="member">ne2kAllocBuffer</ref>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structnicBuffer_1959ee09a7a6fc875f3d5d651576f37c4" kindref="member">length</ref>)<sp/>{</highlight></codeline>
<codeline lineno="314"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structnicBuffer" kindref="compound">nicBuffer</ref><sp/>*tmpBuf<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="315"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="316"><highlight class="normal"><sp/><sp/><ref refid="spinlock_8h_12cd9a4502680fb8e7f0fe6b029e558b1" kindref="member">spinLock</ref>(&amp;<ref refid="ne2k_8c_1764e2356e3d80b20b7f2466d32ebf9f2" kindref="member">ne2k_spinLock</ref>);</highlight></codeline>
<codeline lineno="317"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="318"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" kindref="member">ne2kBuffer</ref><sp/>==<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="319"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" kindref="member">ne2kBuffer</ref><sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structnicBuffer" kindref="compound">nicBuffer</ref><sp/>*)<ref refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structnicBuffer" kindref="compound">nicBuffer</ref>));</highlight></codeline>
<codeline lineno="320"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" kindref="member">ne2kBuffer</ref>-&gt;<ref refid="structnicBuffer_1b019ceba7f84eddae7d6b2abc538906a" kindref="member">next</ref><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="321"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" kindref="member">ne2kBuffer</ref>-&gt;<ref refid="structnicBuffer_1959ee09a7a6fc875f3d5d651576f37c4" kindref="member">length</ref><sp/>=<sp/>length;</highlight></codeline>
<codeline lineno="322"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" kindref="member">ne2kBuffer</ref>-&gt;<ref refid="structnicBuffer_19679b6c2e76a7617884e422c11aa3eac" kindref="member">buffer</ref><sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)<ref refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(length);</highlight></codeline>
<codeline lineno="323"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="spinlock_8h_1dd996cbbb3b9826dd9c8cf02b66a4c65" kindref="member">spinUnlock</ref>(&amp;<ref refid="ne2k_8c_1764e2356e3d80b20b7f2466d32ebf9f2" kindref="member">ne2k_spinLock</ref>);</highlight></codeline>
<codeline lineno="324"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(<ref refid="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" kindref="member">ne2kBuffer</ref>);</highlight></codeline>
<codeline lineno="325"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="326"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="327"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(tmpBuf<sp/>=<sp/><ref refid="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" kindref="member">ne2kBuffer</ref>;tmpBuf-&gt;<ref refid="structnicBuffer_1b019ceba7f84eddae7d6b2abc538906a" kindref="member">next</ref><sp/>!=<sp/>0x0;tmpBuf<sp/>=<sp/>tmpBuf-&gt;<ref refid="structnicBuffer_1b019ceba7f84eddae7d6b2abc538906a" kindref="member">next</ref>);</highlight></codeline>
<codeline lineno="328"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="329"><highlight class="normal"><sp/><sp/><sp/><sp/>tmpBuf-&gt;<ref refid="structnicBuffer_1b019ceba7f84eddae7d6b2abc538906a" kindref="member">next</ref><sp/><sp/><sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structnicBuffer" kindref="compound">nicBuffer</ref><sp/>*)<ref refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structnicBuffer" kindref="compound">nicBuffer</ref>));</highlight></codeline>
<codeline lineno="330"><highlight class="normal"><sp/><sp/><sp/><sp/>tmpBuf<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>tmpBuf-&gt;<ref refid="structnicBuffer_1b019ceba7f84eddae7d6b2abc538906a" kindref="member">next</ref>;</highlight></codeline>
<codeline lineno="331"><highlight class="normal"><sp/><sp/><sp/><sp/>tmpBuf-&gt;<ref refid="structnicBuffer_1b019ceba7f84eddae7d6b2abc538906a" kindref="member">next</ref><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="332"><highlight class="normal"><sp/><sp/><sp/><sp/>tmpBuf-&gt;<ref refid="structnicBuffer_1959ee09a7a6fc875f3d5d651576f37c4" kindref="member">length</ref><sp/>=<sp/>length;</highlight></codeline>
<codeline lineno="333"><highlight class="normal"><sp/><sp/><sp/><sp/>tmpBuf-&gt;<ref refid="structnicBuffer_19679b6c2e76a7617884e422c11aa3eac" kindref="member">buffer</ref><sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)<ref refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(length);</highlight></codeline>
<codeline lineno="334"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="spinlock_8h_1dd996cbbb3b9826dd9c8cf02b66a4c65" kindref="member">spinUnlock</ref>(&amp;<ref refid="ne2k_8c_1764e2356e3d80b20b7f2466d32ebf9f2" kindref="member">ne2k_spinLock</ref>);</highlight></codeline>
<codeline lineno="335"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(tmpBuf);</highlight></codeline>
<codeline lineno="336"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="337"><highlight class="normal"><sp/><sp/><ref refid="spinlock_8h_1dd996cbbb3b9826dd9c8cf02b66a4c65" kindref="member">spinUnlock</ref>(&amp;<ref refid="ne2k_8c_1764e2356e3d80b20b7f2466d32ebf9f2" kindref="member">ne2k_spinLock</ref>);</highlight></codeline>
<codeline lineno="338"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="339"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="340"><highlight class="normal"></highlight></codeline>
<codeline lineno="341" refid="ne2k_8c_1954f14d0270247855900254097728c57" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structnicBuffer" kindref="compound">nicBuffer</ref><sp/>*<ref refid="ne2k_8h_1954f14d0270247855900254097728c57" kindref="member">ne2kGetBuffer</ref>()<sp/>{</highlight></codeline>
<codeline lineno="342"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structnicBuffer" kindref="compound">nicBuffer</ref><sp/>*tmpBuf<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="343"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="344"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="ne2k_8c_1764e2356e3d80b20b7f2466d32ebf9f2" kindref="member">ne2k_spinLock</ref><sp/>==<sp/>0<ref refid="ap-boot_8S_11a3ac2137e21f6f0d400f1996914dd19" kindref="member">x1</ref>)</highlight></codeline>
<codeline lineno="345"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="346"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="347"><highlight class="normal"><sp/><sp/>tmpBuf<sp/><sp/><sp/><sp/><sp/>=<sp/><ref refid="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" kindref="member">ne2kBuffer</ref>;</highlight></codeline>
<codeline lineno="348"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" kindref="member">ne2kBuffer</ref><sp/>!=<sp/>0x0)</highlight></codeline>
<codeline lineno="349"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" kindref="member">ne2kBuffer</ref><sp/>=<sp/><ref refid="ne2k_8c_135dea25bdf37bb1ee0edd26d50fdc3c2" kindref="member">ne2kBuffer</ref>-&gt;<ref refid="structnicBuffer_1b019ceba7f84eddae7d6b2abc538906a" kindref="member">next</ref>;</highlight></codeline>
<codeline lineno="350"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(tmpBuf);</highlight></codeline>
<codeline lineno="351"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="352"><highlight class="normal"></highlight></codeline>
<codeline lineno="353" refid="ne2k_8c_1deb7b37e43d9b5203408374d8d8ce586" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="ne2k_8h_164fadb818ec0d7f27ef04cbceac2a828" kindref="member">ne2kFreeBuffer</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structnicBuffer" kindref="compound">nicBuffer</ref><sp/>*<ref refid="structbuf" kindref="compound">buf</ref>)<sp/>{</highlight></codeline>
<codeline lineno="354"><highlight class="normal"><sp/><sp/><ref refid="kmalloc_8h_1aa9ed6886459604cf73ccdbf6410e487" kindref="member">kfree</ref>(buf-&gt;<ref refid="structnicBuffer_19679b6c2e76a7617884e422c11aa3eac" kindref="member">buffer</ref>);</highlight></codeline>
<codeline lineno="355"><highlight class="normal"><sp/><sp/><ref refid="kmalloc_8h_1aa9ed6886459604cf73ccdbf6410e487" kindref="member">kfree</ref>(buf);</highlight></codeline>
<codeline lineno="356"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="357"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="358"><highlight class="normal"></highlight></codeline>
<codeline lineno="359"><highlight class="normal"></highlight><highlight class="comment">/***</highlight></codeline>
<codeline lineno="360"><highlight class="comment"></highlight></codeline>
<codeline lineno="361"><highlight class="comment"><sp/>$Log$</highlight></codeline>
<codeline lineno="362"><highlight class="comment"><sp/>Revision<sp/>1.1.1.1<sp/><sp/>2006/06/01<sp/>12:46:12<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="363"><highlight class="comment"><sp/>ubix2</highlight></codeline>
<codeline lineno="364"><highlight class="comment"></highlight></codeline>
<codeline lineno="365"><highlight class="comment"><sp/>Revision<sp/>1.2<sp/><sp/>2005/10/12<sp/>00:13:37<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="366"><highlight class="comment"><sp/>Removed</highlight></codeline>
<codeline lineno="367"><highlight class="comment"></highlight></codeline>
<codeline lineno="368"><highlight class="comment"><sp/>Revision<sp/>1.1.1.1<sp/><sp/>2005/09/26<sp/>17:24:02<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="369"><highlight class="comment"><sp/>no<sp/>message</highlight></codeline>
<codeline lineno="370"><highlight class="comment"></highlight></codeline>
<codeline lineno="371"><highlight class="comment"><sp/>Revision<sp/>1.24<sp/><sp/>2004/09/28<sp/>21:47:56<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="372"><highlight class="comment"><sp/>Fixed<sp/>deadlock<sp/>now<sp/>safe<sp/>to<sp/>use<sp/>in<sp/>bochs</highlight></codeline>
<codeline lineno="373"><highlight class="comment"></highlight></codeline>
<codeline lineno="374"><highlight class="comment"><sp/>Revision<sp/>1.23<sp/><sp/>2004/09/16<sp/>22:35:28<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="375"><highlight class="comment"><sp/>Demo<sp/>Release</highlight></codeline>
<codeline lineno="376"><highlight class="comment"></highlight></codeline>
<codeline lineno="377"><highlight class="comment"><sp/>Revision<sp/>1.22<sp/><sp/>2004/09/15<sp/>21:25:33<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="378"><highlight class="comment"><sp/>Fixens</highlight></codeline>
<codeline lineno="379"><highlight class="comment"></highlight></codeline>
<codeline lineno="380"><highlight class="comment"><sp/>Revision<sp/>1.21<sp/><sp/>2004/09/11<sp/>19:15:37<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="381"><highlight class="comment"><sp/>here<sp/>you<sp/>go<sp/>irq<sp/>10<sp/>io<sp/>240<sp/>for<sp/>your<sp/>ne2k<sp/>nic</highlight></codeline>
<codeline lineno="382"><highlight class="comment"></highlight></codeline>
<codeline lineno="383"><highlight class="comment"><sp/>Revision<sp/>1.20<sp/><sp/>2004/09/07<sp/>22:26:04<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="384"><highlight class="comment"><sp/>synced<sp/>in</highlight></codeline>
<codeline lineno="385"><highlight class="comment"></highlight></codeline>
<codeline lineno="386"><highlight class="comment"><sp/>Revision<sp/>1.19<sp/><sp/>2004/09/07<sp/>21:54:38<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="387"><highlight class="comment"><sp/>ok<sp/>reverted<sp/>back<sp/>to<sp/>old<sp/>scheduling<sp/>for<sp/>now....</highlight></codeline>
<codeline lineno="388"><highlight class="comment"></highlight></codeline>
<codeline lineno="389"><highlight class="comment"><sp/>Revision<sp/>1.18<sp/><sp/>2004/09/06<sp/>15:13:25<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="390"><highlight class="comment"><sp/>Last<sp/>commit<sp/>before<sp/>FreeBSD<sp/>6.0</highlight></codeline>
<codeline lineno="391"><highlight class="comment"></highlight></codeline>
<codeline lineno="392"><highlight class="comment"><sp/>Revision<sp/>1.17<sp/><sp/>2004/08/01<sp/>20:40:45<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="393"><highlight class="comment"><sp/>Net<sp/>related<sp/>fixes</highlight></codeline>
<codeline lineno="394"><highlight class="comment"></highlight></codeline>
<codeline lineno="395"><highlight class="comment"><sp/>Revision<sp/>1.16<sp/><sp/>2004/07/28<sp/>22:23:02<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="396"><highlight class="comment"><sp/>make<sp/>sure<sp/>it<sp/>still<sp/>works<sp/>before<sp/>I<sp/>goto<sp/>bed</highlight></codeline>
<codeline lineno="397"><highlight class="comment"></highlight></codeline>
<codeline lineno="398"><highlight class="comment"><sp/>Revision<sp/>1.15<sp/><sp/>2004/07/17<sp/>17:04:47<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="399"><highlight class="comment"><sp/>ne2k:<sp/>added<sp/>assert<sp/>hopefully<sp/>it<sp/>will<sp/>help<sp/>me<sp/>solve<sp/>this<sp/>dma<sp/>size<sp/>0<sp/>random<sp/>error</highlight></codeline>
<codeline lineno="400"><highlight class="comment"></highlight></codeline>
<codeline lineno="401"><highlight class="comment"><sp/>Revision<sp/>1.14<sp/><sp/>2004/07/14<sp/>12:03:50<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="402"><highlight class="comment"><sp/>ne2k:<sp/>ne2kInit<sp/>to<sp/>ne2k_init</highlight></codeline>
<codeline lineno="403"><highlight class="comment"><sp/>Changed<sp/>Startup<sp/>Routines</highlight></codeline>
<codeline lineno="404"><highlight class="comment"></highlight></codeline>
<codeline lineno="405"><highlight class="comment"><sp/>Revision<sp/>1.13<sp/><sp/>2004/06/04<sp/>10:19:42<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="406"><highlight class="comment"><sp/>notes:<sp/>we<sp/>compile<sp/>again,<sp/>thank<sp/>g-d<sp/>anyways<sp/>i<sp/>was<sp/>about<sp/>to<sp/>cry</highlight></codeline>
<codeline lineno="407"><highlight class="comment"></highlight></codeline>
<codeline lineno="408"><highlight class="comment"><sp/>Revision<sp/>1.12<sp/><sp/>2004/05/21<sp/>12:48:22<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="409"><highlight class="comment"><sp/>Cleaned<sp/>up</highlight></codeline>
<codeline lineno="410"><highlight class="comment"></highlight></codeline>
<codeline lineno="411"><highlight class="comment"><sp/>Revision<sp/>1.11<sp/><sp/>2004/05/19<sp/>04:07:42<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="412"><highlight class="comment"><sp/>kmalloc(size,pid)<sp/>no<sp/>more<sp/>it<sp/>is<sp/>no<sp/>kmalloc(size);<sp/>the<sp/>way<sp/>it<sp/>should<sp/>of<sp/>been</highlight></codeline>
<codeline lineno="413"><highlight class="comment"></highlight></codeline>
<codeline lineno="414"><highlight class="comment"><sp/>Revision<sp/>1.10<sp/><sp/>2004/05/10<sp/>02:23:24<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="415"><highlight class="comment"><sp/>Minor<sp/>Changes<sp/>To<sp/>Source<sp/>Code<sp/>To<sp/>Prepare<sp/>It<sp/>For<sp/>Open<sp/>Source<sp/>Release</highlight></codeline>
<codeline lineno="416"><highlight class="comment"></highlight></codeline>
<codeline lineno="417"><highlight class="comment"><sp/>END</highlight></codeline>
<codeline lineno="418"><highlight class="comment"><sp/>***/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="419"><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="/usr/home/reddawg/source/ubix2/src/sys/isa/ne2k.c"/>
  </compounddef>
</doxygen>