In the Network Interface Cards page:

- Mention /boot/loader.conf when we talk about modules;

- The NDIS driver part does not belong to wireless devices section since
  it can be used for other Ethernet device, so move that part to its own
  section in the network device configuration page.  I also updated the
  previous text to match 5.5, 6.X and 7.X

  Based on docs/84961 (submitted by Fredrik Lindberg
  <fli+freebsd@shapeshifter.se>), docs/97229 (submitted by Gavin
  Atkinson <gavin@mod3.co.uk>) and many other requests/remarks.
This commit is contained in:
Marc Fonvieille 2006-07-21 09:53:30 +00:00
parent d644e2cb4f
commit 0793255df0
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=28355

View file

@ -894,7 +894,7 @@ ukphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto</screen>
<itemizedlist>
<listitem>
<para>The easiest way is to simply load a kernel module for
your network card with &man.kldload.8;. Not all NIC
your network card with &man.kldload.8;, or automatically at boot time by adding the appropriate line to the file <filename>/boot/loader.conf</filename>. Not all NIC
drivers are available as modules; notable examples of
devices for which modules do not exist are ISA cards.</para>
</listitem>
@ -912,6 +912,128 @@ ukphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto</screen>
not have to build a new kernel.</para>
</listitem>
</itemizedlist>
<sect3 id="config-network-ndis">
<title>Using &windows; NDIS Drivers</title>
<indexterm><primary>NDIS</primary></indexterm>
<indexterm><primary>NDISulator</primary></indexterm>
<indexterm><primary>&windows; drivers</primary></indexterm>
<indexterm><primary>Microsoft Windows</primary></indexterm>
<indexterm><primary>Microsoft Windows</primary>
<secondary>device drivers</secondary></indexterm>
<indexterm><primary>KLD (kernel loadable
object)</primary></indexterm>
<!-- We should probably omit the expanded name, and add a <see> entry
for it. Whatever is done must also be done to the same indexterm in
linuxemu/chapter.sgml -->
<para>Unfortunately, there are still many vendors that do not
provide schematics for their drivers to the open source
community because they regard such information as trade
secrets. Consequently, the developers of &os; and other
operating systems are left two choices: develop the drivers
by a long and pain-staking process of reverse engineering or
using the existing driver binaries available for the
&microsoft.windows; platforms. Most developers, including
those involved with &os;, have taken the latter
approach.</para>
<para>Thanks to the contributions of Bill Paul (wpaul), as of
&os;&nbsp;5.3-RELEASE there is <quote>native</quote> support
for the Network Driver Interface Specification (NDIS). The
&os; NDISulator (otherwise known as Project Evil) takes a
&windows; driver binary and basically tricks it into
thinking it is running on &windows;. Because the
&man.ndis.4; driver is using a &windows; binary, it is only
usable on &i386; and amd64 systems.</para>
<note>
<para>The &man.ndis.4; driver is designed to support mainly
PCI, CardBus and PCMCIA devices, USB devices are not yet
supported.</para>
</note>
<para>In order to use the NDISulator, you need three
things:</para>
<orderedlist>
<listitem>
<para>Kernel sources</para>
</listitem>
<listitem>
<para>&windowsxp; driver binary
(<filename>.SYS</filename> extension)</para>
</listitem>
<listitem>
<para>&windowsxp; driver configuration file
(<filename>.INF</filename> extension)</para>
</listitem>
</orderedlist>
<para>Locate the files for your specific card. Generally,
they can be found on the included CDs or at the vendors'
websites. In the following examples, we will use
<filename>W32DRIVER.SYS</filename> and
<filename>W32DRIVER.INF</filename>.</para>
<note>
<para>You can not use a &windows;/i386 driver with
&os;/amd64, you must get a &windows;/amd64 driver to make it
work properly.</para>
</note>
<para>The next step is to compile the driver binary into a
loadable kernel module. To accomplish this, as
<username>root</username>, use &man.ndisgen.8;:</para>
<screen>&prompt.root; <userinput>ndisgen <replaceable>/path/to/W32DRIVER.INF</replaceable> <replaceable>/path/to/W32DRIVER.SYS</replaceable></userinput></screen>
<para>The &man.ndisgen.8; utility is interactive and will
prompt for any extra information it requires; it will
produce a kernel module in the current directory which can
be loaded as follows:</para>
<screen>&prompt.root; <userinput>kldload <replaceable>./W32DRIVER.ko</replaceable></userinput></screen>
<para>In addition to the generated kernel module, you must
load the <filename>ndis.ko</filename> and
<filename>if_ndis.ko</filename> modules. This should be
automatically done when you load any module that depends on
&man.ndis.4;. If you want to load them manually, use the
following commands:</para>
<screen>&prompt.root; <userinput>kldload ndis</userinput>
&prompt.root; <userinput>kldload if_ndis</userinput></screen>
<para>The first command loads the NDIS miniport driver
wrapper, the second loads the actual network
interface.</para>
<para>Now, check &man.dmesg.8; to see if there were any errors
loading. If all went well, you should get output resembling
the following:</para>
<screen>ndis0: &lt;Wireless-G PCI Adapter&gt; mem 0xf4100000-0xf4101fff irq 3 at device 8.0 on pci1
ndis0: NDIS API version: 5.0
ndis0: Ethernet address: 0a:b1:2c:d3:4e:f5
ndis0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
ndis0: 11g rates: 6Mbps 9Mbps 12Mbps 18Mbps 36Mbps 48Mbps 54Mbps</screen>
<para>From here you can treat the
<devicename>ndis0</devicename> device like any other network
interface (e.g., <devicename>dc0</devicename>).</para>
<para>You can configure the system to load the NDIS modules at
boot time in the same way as with any other module. First,
copy the generated module,
<filename>W32DRIVER.ko</filename>, to the <filename
class="directory">/boot/modules</filename> directory. Then,
add the following line to
<filename>/boot/loader.conf</filename>:</para>
<programlisting>W32DRIVER_load="YES"</programlisting>
</sect3>
</sect2>
<sect2>