<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
	"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>

<book id="SiS900Guide">

<bookinfo>

<title>SiS 900/7016 Fast Ethernet Device Driver</title>

<authorgroup>
<author>
<firstname>Ollie</firstname>
<surname>Lho</surname>
</author>

<author>
<firstname>Lei Chun</firstname>
<surname>Chang</surname>
</author>
</authorgroup>

<edition>Document Revision: 0.3 for SiS900 driver v1.06 &amp; v1.07</edition>
<pubdate>November 16, 2000</pubdate>

<copyright>
 <year>1999</year>
 <holder>Silicon Integrated System Corp.</holder>
</copyright>

<legalnotice>
 <para>
	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.
 </para>

 <para>
	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.
 </para>

 <para>
	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 </para>
</legalnotice>

<abstract>
<para>
This document gives some information on installation and usage of SiS 900/7016
device driver under Linux.
</para>
</abstract>

</bookinfo>

<toc></toc>

<chapter id="intro">
 <title>Introduction</title>

<para>
This document describes the revision 1.06 and 1.07 of SiS 900/7016 Fast Ethernet 
device driver under Linux. The driver is developed by Silicon Integrated
System Corp. and distributed freely under the GNU General Public License (GPL).
The driver can be compiled as a loadable module and used under Linux kernel 
version 2.2.x. (rev. 1.06)
With minimal changes, the driver can also be used under 2.3.x and 2.4.x kernel 
(rev. 1.07), please see 
<xref linkend="install"/>. If you are intended to
use the driver for earlier kernels, you are on your own.
</para>

<para>
The driver is tested with usual TCP/IP applications including
FTP, Telnet, Netscape etc. and is used constantly by the developers.
</para>

<para>
Please send all comments/fixes/questions to
<ulink url="mailto:lcchang@sis.com.tw">Lei-Chun Chang</ulink>.
</para>
</chapter>

<chapter id="changes">
 <title>Changes</title>

<para>
Changes made in Revision 1.07

<orderedlist>
<listitem>
<para>
Separation of sis900.c and sis900.h in order to move most 
constant definition to sis900.h (many of those constants were
corrected)
</para>
</listitem>

<listitem>
<para>
Clean up PCI detection, the pci-scan from Donald Becker were not used,
just simple pci&lowbar;find&lowbar;*.
</para>
</listitem>

<listitem>
<para>
MII detection is modified to support multiple mii transceiver.
</para>
</listitem>

<listitem>
<para>
Bugs in read&lowbar;eeprom, mdio&lowbar;* were removed.
</para>
</listitem>

<listitem>
<para>
Lot of sis900 irrelevant comments were removed/changed and
more comments were added to reflect the real situation.
</para>
</listitem>

<listitem>
<para>
Clean up of physical/virtual address space mess in buffer 
descriptors.
</para>
</listitem>

<listitem>
<para>
Better transmit/receive error handling.
</para>
</listitem>

<listitem>
<para>
The driver now uses zero-copy single buffer management
scheme to improve performance.
</para>
</listitem>

<listitem>
<para>
Names of variables were changed to be more consistent.
</para>
</listitem>

<listitem>
<para>
Clean up of auo-negotiation and timer code.
</para>
</listitem>

<listitem>
<para>
Automatic detection and change of PHY on the fly.
</para>
</listitem>

<listitem>
<para>
Bug in mac probing fixed.
</para>
</listitem>

<listitem>
<para>
Fix 630E equalier problem by modifying the equalizer workaround rule.
</para>
</listitem>

<listitem>
<para>
Support for ICS1893 10/100 Interated PHYceiver.
</para>
</listitem>

<listitem>
<para>
Support for media select by ifconfig.
</para>
</listitem>

<listitem>
<para>
Added kernel-doc extratable documentation.
</para>
</listitem>

</orderedlist>
</para>
</chapter>

<chapter id="tested">
 <title>Tested Environment</title>

<para>
This driver is developed on the following hardware

<itemizedlist>
<listitem>

<para>
Intel Celeron 500 with SiS 630 (rev 02) chipset
</para>
</listitem>
<listitem>

<para>
SiS 900 (rev 01) and SiS 7016/7014 Fast Ethernet Card
</para>
</listitem>

</itemizedlist>

and tested with these software environments

<itemizedlist>
<listitem>

<para>
Red Hat Linux version 6.2
</para>
</listitem>
<listitem>

<para>
Linux kernel version 2.4.0
</para>
</listitem>
<listitem>

<para>
Netscape version 4.6
</para>
</listitem>
<listitem>

<para>
NcFTP 3.0.0 beta 18
</para>
</listitem>
<listitem>

<para>
Samba version 2.0.3
</para>
</listitem>

</itemizedlist>

</para>

</chapter>

<chapter id="files">
<title>Files in This Package</title>

<para>
In the package you can find these files:
</para>

<para>
<variablelist>

<varlistentry>
<term>sis900.c</term>
<listitem>
<para>
Driver source file in C 
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>sis900.h</term>
<listitem>
<para>
Header file for sis900.c
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>sis900.sgml</term>
<listitem>
<para>
DocBook SGML source of the document
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>sis900.txt</term>
<listitem>
<para>
Driver document in plain text
</para>
</listitem>
</varlistentry>

</variablelist>
</para>
</chapter>

<chapter id="install">
 <title>Installation</title>

<para>
Silicon Integrated System Corp. is cooperating closely with core Linux Kernel
developers. The revisions of SiS 900 driver are distributed by the usuall channels
for kernel tar files and patches. Those kernel tar files for official kernel and
patches for kernel pre-release can be download at 
<ulink url="http://ftp.kernel.org/pub/linux/kernel/">official kernel ftp site</ulink>
and its mirrors.
The 1.06 revision can be found in kernel version later than 2.3.15 and pre-2.2.14, 
and 1.07 revision can be found in kernel version 2.4.0.
If you have no prior experience in networking under Linux, please read
<ulink url="http://www.tldp.org/">Ethernet HOWTO</ulink> and
<ulink url="http://www.tldp.org/">Networking HOWTO</ulink> available from
Linux Documentation Project (LDP).
</para>

<para>
The driver is bundled in release later than 2.2.11 and 2.3.15 so this 
is the most easy case. 
Be sure you have the appropriate packages for compiling kernel source.
Those packages are listed in Document/Changes in kernel source 
distribution. If you have to install the driver other than those bundled
in kernel release, you should have your driver file 
<filename>sis900.c</filename> and <filename>sis900.h</filename> 
copied into <filename class="directory">/usr/src/linux/drivers/net/</filename> first.
There are two alternative ways to install the driver
</para>

<sect1>
<title>Building the driver as loadable module</title>

<para>
To build the driver as a loadable kernel module you have to reconfigure
the kernel to activate network support by
</para>

<para><screen>
make menuconfig
</screen></para>

<para>
Choose <quote>Loadable module support  ---></quote>, 
then select <quote>Enable loadable module support</quote>.
</para>

<para>
Choose <quote>Network Device Support  ---></quote>, select 
<quote>Ethernet (10 or 100Mbit)</quote>.
Then select <quote>EISA, VLB, PCI and on board controllers</quote>, 
and choose <quote>SiS 900/7016 PCI Fast Ethernet Adapter support</quote> 
to <quote>M</quote>.
</para>

<para>
After reconfiguring the kernel, you can make the driver module by
</para>

<para><screen>
make modules
</screen></para>

<para>
The driver should be compiled with no errors. After compiling the driver,
the driver can be installed to proper place by
</para>

<para><screen>
make modules_install
</screen></para>

<para>
Load the driver into kernel by
</para>

<para><screen>
insmod sis900
</screen></para>

<para>
When loading the driver into memory, some information message can be view by
</para>

<para>
<screen>
dmesg
</screen>

or

<screen>
cat /var/log/message
</screen>
</para>

<para>
If the driver is loaded properly you will have messages similar to this:
</para>

<para><screen>
sis900.c: v1.07.06  11/07/2000
eth0: SiS 900 PCI Fast Ethernet at 0xd000, IRQ 10, 00:00:e8:83:7f:a4.
eth0: SiS 900 Internal MII PHY transceiver found at address 1.
eth0: Using SiS 900 Internal MII PHY as default
</screen></para>

<para>
showing the version of the driver and the results of probing routine.
</para>

<para>
Once the driver is loaded, network can be brought up by
</para>

<para><screen>
/sbin/ifconfig eth0 IPADDR broadcast BROADCAST netmask NETMASK media TYPE
</screen></para>

<para>
where IPADDR, BROADCAST, NETMASK are your IP address, broadcast address and
netmask respectively. TYPE is used to set medium type used by the device. 
Typical values are "10baseT"(twisted-pair 10Mbps Ethernet) or "100baseT"
(twisted-pair 100Mbps Ethernet). For more information on how to configure 
network interface, please refer to  
<ulink url="http://www.tldp.org/">Networking HOWTO</ulink>.
</para>

<para>
The link status is also shown by kernel messages. For example, after the
network interface is activated, you may have the message:
</para>

<para><screen>
eth0: Media Link On 100mbps full-duplex
</screen></para>

<para>
If you try to unplug the twist pair (TP) cable you will get
</para>

<para><screen>
eth0: Media Link Off
</screen></para>

<para>
indicating that the link is failed.
</para>
</sect1>

<sect1>
<title>Building the driver into kernel</title>

<para>
If you want to make the driver into kernel, choose <quote>Y</quote> 
rather than <quote>M</quote> on 
<quote>SiS 900/7016 PCI Fast Ethernet Adapter support</quote> 
when configuring the kernel. Build the kernel image in the usual way
</para>

<para><screen>
make clean

make bzlilo
</screen></para>

<para>
Next time the system reboot, you have the driver in memory.
</para>

</sect1>
</chapter>

<chapter id="problems">
 <title>Known Problems and Bugs</title>

<para>
There are some known problems and bugs. If you find any other bugs please 
mail to <ulink url="mailto:lcchang@sis.com.tw">lcchang@sis.com.tw</ulink>

<orderedlist>

<listitem>
<para>
AM79C901 HomePNA PHY is not thoroughly tested, there may be some 
bugs in the <quote>on the fly</quote> change of transceiver. 
</para>
</listitem>

<listitem>
<para>
A bug is hidden somewhere in the receive buffer management code, 
the bug causes NULL pointer reference in the kernel. This fault is 
caught before bad things happen and reported with the message:

<computeroutput>
eth0: NULL pointer encountered in Rx ring, skipping 
</computeroutput>

which can be viewed with <literal remap="tt">dmesg</literal> or
<literal remap="tt">cat /var/log/message</literal>.
</para>
</listitem>

<listitem>
<para>
The media type change from 10Mbps to 100Mbps twisted-pair ethernet 
by ifconfig causes the media link down.
</para>
</listitem>

</orderedlist>
</para>
</chapter>

<chapter id="RHistory">
 <title>Revision History</title>

<para>
<itemizedlist>

<listitem>
<para>
November 13, 2000, Revision 1.07, seventh release, 630E problem fixed 
and further clean up.
</para>
</listitem>

<listitem>
<para>
November 4, 1999, Revision 1.06, Second release, lots of clean up
and optimization.
</para>
</listitem>

<listitem>
<para>
August 8, 1999, Revision 1.05, Initial Public Release
</para>
</listitem>

</itemizedlist>
</para>
</chapter>

<chapter id="acknowledgements">
 <title>Acknowledgements</title>

<para>
This driver was originally derived form 
<ulink url="mailto:becker@cesdis1.gsfc.nasa.gov">Donald Becker</ulink>'s
<ulink url="ftp://cesdis.gsfc.nasa.gov/pub/linux/drivers/kern-2.3/pci-skeleton.c"
>pci-skeleton</ulink> and
<ulink url="ftp://cesdis.gsfc.nasa.gov/pub/linux/drivers/kern-2.3/rtl8139.c"
>rtl8139</ulink> drivers. Donald also provided various suggestion
regarded with improvements made in revision 1.06.
</para>

<para>
The 1.05 revision was created by 
<ulink url="mailto:cmhuang@sis.com.tw">Jim Huang</ulink>, AMD 79c901
support was added by <ulink url="mailto:lcs@sis.com.tw">Chin-Shan Li</ulink>.
</para>
</chapter>

<chapter id="functions">
<title>List of Functions</title>
<!-- drivers/net/sis900.c -->
<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-get-mac-addr">sis900_get_mac_addr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_get_mac_addr</refname>
 <refpurpose>
   Get MAC address for stand alone SiS900 model
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int __devinit <function>sis900_get_mac_addr </function></funcdef>
   <paramdef>struct pci_dev * <parameter>pci_dev</parameter></paramdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>pci_dev</parameter></term>
   <listitem>
    <para>
      the sis900 pci device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to get address for 
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Older SiS900 and friends, use EEPROM to store MAC address.
   MAC address is read from <function>read_eeprom</function> into <parameter>net_dev</parameter>-&gt;dev_addr.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis630e-get-mac-addr">sis630e_get_mac_addr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis630e_get_mac_addr</refname>
 <refpurpose>
      Get MAC address for SiS630E model
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int __devinit <function>sis630e_get_mac_addr </function></funcdef>
   <paramdef>struct pci_dev * <parameter>pci_dev</parameter></paramdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>pci_dev</parameter></term>
   <listitem>
    <para>
      the sis900 pci device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to get address for 
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   SiS630E model, use APC CMOS RAM to store MAC address.
   APC CMOS RAM is accessed through ISA bridge.
   MAC address is read into <parameter>net_dev</parameter>-&gt;dev_addr.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis635-get-mac-addr">sis635_get_mac_addr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis635_get_mac_addr</refname>
 <refpurpose>
      Get MAC address for SIS635 model
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int __devinit <function>sis635_get_mac_addr </function></funcdef>
   <paramdef>struct pci_dev * <parameter>pci_dev</parameter></paramdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>pci_dev</parameter></term>
   <listitem>
    <para>
      the sis900 pci device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to get address for 
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   SiS635 model, set MAC Reload Bit to load Mac address from APC
   to rfdr. rfdr is accessed through rfcr. MAC address is read into 
   <parameter>net_dev</parameter>-&gt;dev_addr.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis96x-get-mac-addr">sis96x_get_mac_addr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis96x_get_mac_addr</refname>
 <refpurpose>
      Get MAC address for SiS962 or SiS963 model
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int __devinit <function>sis96x_get_mac_addr </function></funcdef>
   <paramdef>struct pci_dev * <parameter>pci_dev</parameter></paramdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>pci_dev</parameter></term>
   <listitem>
    <para>
      the sis900 pci device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to get address for 
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   SiS962 or SiS963 model, use EEPROM to store MAC address. And EEPROM 
   is shared by
   LAN and 1394. When access EEPROM, send EEREQ signal to hardware first 
   and wait for EEGNT. If EEGNT is ON, EEPROM is permitted to be access 
   by LAN, otherwise is not. After MAC address is read from EEPROM, send
   EEDONE signal to refuse EEPROM access by LAN. 
   The EEPROM map of SiS962 or SiS963 is different to SiS900. 
   The signature field in SiS962 or SiS963 spec is meaningless. 
   MAC address is read into <parameter>net_dev</parameter>-&gt;dev_addr.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-probe">sis900_probe</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_probe</refname>
 <refpurpose>
      Probe for sis900 device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int __devinit <function>sis900_probe </function></funcdef>
   <paramdef>struct pci_dev * <parameter>pci_dev</parameter></paramdef>
   <paramdef>const struct pci_device_id * <parameter>pci_id</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>pci_dev</parameter></term>
   <listitem>
    <para>
      the sis900 pci device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>pci_id</parameter></term>
   <listitem>
    <para>
      the pci device ID
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Check and probe sis900 net device for <parameter>pci_dev</parameter>.
   Get mac address according to the chip revision, 
   and assign SiS900-specific entries in the device structure.
</para>
</refsect1>
<refsect1>
<title>ie</title>
<para>
    <function>sis900_open</function>, <function>sis900_start_xmit</function>, <function>sis900_close</function>, etc.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-mii-probe">sis900_mii_probe</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_mii_probe</refname>
 <refpurpose>
      Probe MII PHY for sis900
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int __init <function>sis900_mii_probe </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to probe for
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Search for total of 32 possible mii phy addresses.
   Identify and set current phy if found one,
   return error if it failed to found.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-default-phy">sis900_default_phy</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_default_phy</refname>
 <refpurpose>
      Select default PHY for sis900 mac.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>u16 <function>sis900_default_phy </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to probe for
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Select first detected PHY with link as default.
   If no one is link on, select PHY whose types is HOME as default.
   If HOME doesn't exist, select LAN.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-set-capability">sis900_set_capability</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_set_capability</refname>
 <refpurpose>
      set the media capability of network adapter.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sis900_set_capability </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
   <paramdef>struct mii_phy * <parameter>phy</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to probe for
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>phy</parameter></term>
   <listitem>
    <para>
      default PHY
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Set the media capability of network adapter according to
   mii status register. It's necessary before auto-negotiate.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-read-eeprom">read_eeprom</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>read_eeprom</refname>
 <refpurpose>
      Read Serial EEPROM
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>u16 __devinit <function>read_eeprom </function></funcdef>
   <paramdef>long <parameter>ioaddr</parameter></paramdef>
   <paramdef>int <parameter>location</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>ioaddr</parameter></term>
   <listitem>
    <para>
      base i/o address
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>location</parameter></term>
   <listitem>
    <para>
      the EEPROM location to read
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Read Serial EEPROM through EEPROM Access Register.
   Note that location is in word (16 bits) unit
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-mdio-read">mdio_read</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>mdio_read</refname>
 <refpurpose>
      read MII PHY register
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>mdio_read </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
   <paramdef>int <parameter>phy_id</parameter></paramdef>
   <paramdef>int <parameter>location</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to read
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>phy_id</parameter></term>
   <listitem>
    <para>
      the phy address to read
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>location</parameter></term>
   <listitem>
    <para>
      the phy regiester id to read
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Read MII registers through MDIO and MDC
   using MDIO management frame structure and protocol(defined by ISO/IEC).
   Please see SiS7014 or ICS spec
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-mdio-write">mdio_write</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>mdio_write</refname>
 <refpurpose>
      write MII PHY register
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>mdio_write </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
   <paramdef>int <parameter>phy_id</parameter></paramdef>
   <paramdef>int <parameter>location</parameter></paramdef>
   <paramdef>int <parameter>value</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to write
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>phy_id</parameter></term>
   <listitem>
    <para>
      the phy address to write
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>location</parameter></term>
   <listitem>
    <para>
      the phy regiester id to write
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>value</parameter></term>
   <listitem>
    <para>
      the register value to write with
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Write MII registers with <parameter>value</parameter> through MDIO and MDC
   using MDIO management frame structure and protocol(defined by ISO/IEC)
   please see SiS7014 or ICS spec
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-reset-phy">sis900_reset_phy</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_reset_phy</refname>
 <refpurpose>
      reset sis900 mii phy.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>u16 <function>sis900_reset_phy </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
   <paramdef>int <parameter>phy_addr</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to write
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>phy_addr</parameter></term>
   <listitem>
    <para>
      default phy address
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Some specific phy can't work properly without reset.
   This function will be called during initialization and
   link status change from ON to DOWN.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-open">sis900_open</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_open</refname>
 <refpurpose>
      open sis900 device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sis900_open </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to open
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Do some initialization and start net interface.
   enable interrupts and set sis900 timer.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-init-rxfilter">sis900_init_rxfilter</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_init_rxfilter</refname>
 <refpurpose>
      Initialize the Rx filter
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sis900_init_rxfilter </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to initialize for
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Set receive filter address to our MAC address
   and enable packet filtering.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-init-tx-ring">sis900_init_tx_ring</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_init_tx_ring</refname>
 <refpurpose>
      Initialize the Tx descriptor ring
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sis900_init_tx_ring </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to initialize for
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Initialize the Tx descriptor ring, 
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-init-rx-ring">sis900_init_rx_ring</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_init_rx_ring</refname>
 <refpurpose>
      Initialize the Rx descriptor ring
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sis900_init_rx_ring </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to initialize for
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Initialize the Rx descriptor ring, 
   and pre-allocate recevie buffers (socket buffer)
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis630-set-eq">sis630_set_eq</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis630_set_eq</refname>
 <refpurpose>
      set phy equalizer value for 630 LAN
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sis630_set_eq </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
   <paramdef>u8 <parameter>revision</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to set equalizer value
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>revision</parameter></term>
   <listitem>
    <para>
      630 LAN revision number
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   630E equalizer workaround rule(Cyrus Huang 08/15)
   PHY register 14h(Test)
</para>
</refsect1>
<refsect1>
<title>Bit 14</title>
<para>
    0 -- Automatically dectect (default)
   1 -- Manually set Equalizer filter
</para>
</refsect1>
<refsect1>
<title>Bit 13</title>
<para>
    0 -- (Default)
   1 -- Speed up convergence of equalizer setting
</para>
</refsect1>
<refsect1>
<title>Bit 9 </title>
<para>
    0 -- (Default)
   1 -- Disable Baseline Wander
   Bit 3~7   -- Equalizer filter setting
</para>
</refsect1>
<refsect1>
<title>Link ON</title>
<para>
    Set Bit 9, 13 to 1, Bit 14 to 0
   Then calculate equalizer value
   Then set equalizer value, and set Bit 14 to 1, Bit 9 to 0
</para>
</refsect1>
<refsect1>
<title>Link Off</title>
<para>
   Set Bit 13 to 1, Bit 14 to 0
</para>
</refsect1>
<refsect1>
<title>Calculate Equalizer value</title>
<para>
   When Link is ON and Bit 14 is 0, SIS900PHY will auto-dectect proper equalizer value.
   When the equalizer is stable, this value is not a fixed value. It will be within
   a small range(eg. 7~9). Then we get a minimum and a maximum value(eg. min=7, max=9)
   0 &lt;= max &lt;= 4  --&gt; set equalizer to max
   5 &lt;= max &lt;= 14 --&gt; set equalizer to max+1 or set equalizer to max+2 if max == min
   max &gt;= 15      --&gt; set equalizer to max+5 or set equalizer to max+6 if max == min
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-timer">sis900_timer</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_timer</refname>
 <refpurpose>
      sis900 timer routine
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sis900_timer </function></funcdef>
   <paramdef>unsigned long <parameter>data</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>data</parameter></term>
   <listitem>
    <para>
      pointer to sis900 net device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   On each timer ticks we check two things, 
   link status (ON/OFF) and link mode (10/100/Full/Half)
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-check-mode">sis900_check_mode</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_check_mode</refname>
 <refpurpose>
      check the media mode for sis900
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sis900_check_mode </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
   <paramdef>struct mii_phy * <parameter>mii_phy</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to be checked
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>mii_phy</parameter></term>
   <listitem>
    <para>
      the mii phy
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Older driver gets the media mode from mii status output
   register. Now we set our media capability and auto-negotiate
   to get the upper bound of speed and duplex between two ends.
   If the types of mii phy is HOME, it doesn't need to auto-negotiate
   and autong_complete should be set to 1.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-set-mode">sis900_set_mode</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_set_mode</refname>
 <refpurpose>
      Set the media mode of mac register.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sis900_set_mode </function></funcdef>
   <paramdef>long <parameter>ioaddr</parameter></paramdef>
   <paramdef>int <parameter>speed</parameter></paramdef>
   <paramdef>int <parameter>duplex</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>ioaddr</parameter></term>
   <listitem>
    <para>
      the address of the device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>speed</parameter></term>
   <listitem>
    <para>
      the transmit speed to be determined
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>duplex</parameter></term>
   <listitem>
    <para>
      the duplex mode to be determined
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Set the media mode of mac register txcfg/rxcfg according to
   speed and duplex of phy. Bit EDB_MASTER_EN indicates the EDB
   bus is used instead of PCI bus. When this bit is set 1, the
   Max DMA Burst Size for TX/RX DMA should be no larger than 16
   double words.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-auto-negotiate">sis900_auto_negotiate</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_auto_negotiate</refname>
 <refpurpose>
      Set the Auto-Negotiation Enable/Reset bit.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sis900_auto_negotiate </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
   <paramdef>int <parameter>phy_addr</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to read mode for
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>phy_addr</parameter></term>
   <listitem>
    <para>
      mii phy address
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   If the adapter is link-on, set the auto-negotiate enable/reset bit.
   autong_complete should be set to 0 when starting auto-negotiation.
   autong_complete should be set to 1 if we didn't start auto-negotiation.
   sis900_timer will wait for link on again if autong_complete = 0.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-read-mode">sis900_read_mode</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_read_mode</refname>
 <refpurpose>
      read media mode for sis900 internal phy
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sis900_read_mode </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
   <paramdef>int * <parameter>speed</parameter></paramdef>
   <paramdef>int * <parameter>duplex</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to read mode for
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>speed</parameter></term>
   <listitem>
    <para>
      the transmit speed to be determined
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>duplex</parameter></term>
   <listitem>
    <para>
      the duplex mode to be determined
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   The capability of remote end will be put in mii register autorec
   after auto-negotiation. Use AND operation to get the upper bound
   of speed and duplex between two ends.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-tx-timeout">sis900_tx_timeout</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_tx_timeout</refname>
 <refpurpose>
      sis900 transmit timeout routine
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sis900_tx_timeout </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to transmit
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   print transmit timeout status
   disable interrupts and do some tasks
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-start-xmit">sis900_start_xmit</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_start_xmit</refname>
 <refpurpose>
      sis900 start transmit routine
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sis900_start_xmit </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
      socket buffer pointer to put the data being transmitted
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to transmit with
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Set the transmit buffer descriptor, 
   and write TxENA to enable transmit state machine.
   tell upper layer if the buffer is full
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-interrupt">sis900_interrupt</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_interrupt</refname>
 <refpurpose>
      sis900 interrupt handler
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>irqreturn_t <function>sis900_interrupt </function></funcdef>
   <paramdef>int <parameter>irq</parameter></paramdef>
   <paramdef>void * <parameter>dev_instance</parameter></paramdef>
   <paramdef>struct pt_regs * <parameter>regs</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
      the irq number
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>dev_instance</parameter></term>
   <listitem>
    <para>
      the client data object
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>regs</parameter></term>
   <listitem>
    <para>
      snapshot of processor context
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   The interrupt handler does all of the Rx thread work, 
   and cleans up after the Tx thread
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-rx">sis900_rx</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_rx</refname>
 <refpurpose>
      sis900 receive routine
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sis900_rx </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device which receives data
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Process receive interrupt events, 
   put buffer to higher layer and refill buffer pool
</para>
</refsect1>
<refsect1>
<title>Note</title>
<para>
    This fucntion is called by interrupt handler, 
   don't do <quote>too much</quote> work here
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-finish-xmit">sis900_finish_xmit</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_finish_xmit</refname>
 <refpurpose>
      finish up transmission of packets
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sis900_finish_xmit </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to be transmitted on
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Check for error condition and free socket buffer etc 
   schedule for more transmission as needed
</para>
</refsect1>
<refsect1>
<title>Note</title>
<para>
    This fucntion is called by interrupt handler, 
   don't do <quote>too much</quote> work here
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-close">sis900_close</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_close</refname>
 <refpurpose>
      close sis900 device 
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sis900_close </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to be closed
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Disable interrupts, stop the Tx and Rx Status Machine 
   free Tx and RX socket buffer
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-get-drvinfo">sis900_get_drvinfo</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_get_drvinfo</refname>
 <refpurpose>
      Return information about driver
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sis900_get_drvinfo </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
   <paramdef>struct ethtool_drvinfo * <parameter>info</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to probe
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>info</parameter></term>
   <listitem>
    <para>
      container for info returned
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Process ethtool command such as <quote>ehtool -i</quote> to show information
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-set-wol">sis900_set_wol</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_set_wol</refname>
 <refpurpose>
      Set up Wake on Lan registers
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sis900_set_wol </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
   <paramdef>struct ethtool_wolinfo * <parameter>wol</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to probe
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>wol</parameter></term>
   <listitem>
    <para>
      container for info passed to the driver
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Process ethtool command <quote>wol</quote> to setup wake on lan features.
   SiS900 supports sending WoL events if a correct packet is received,
   but there is no simple way to filter them to only a subset (broadcast,
   multicast, unicast or arp).
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-mii-ioctl">mii_ioctl</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>mii_ioctl</refname>
 <refpurpose>
      process MII i/o control command 
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>mii_ioctl </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
   <paramdef>struct ifreq * <parameter>rq</parameter></paramdef>
   <paramdef>int <parameter>cmd</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to command for
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>rq</parameter></term>
   <listitem>
    <para>
      parameter for command
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>cmd</parameter></term>
   <listitem>
    <para>
      the i/o command
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Process MII command like read/write MII register
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-get-stats">sis900_get_stats</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_get_stats</refname>
 <refpurpose>
      Get sis900 read/write statistics 
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct net_device_stats * <function>sis900_get_stats </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to get statistics for
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   get tx/rx statistics for sis900
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-set-config">sis900_set_config</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_set_config</refname>
 <refpurpose>
      Set media type by net_device.set_config 
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sis900_set_config </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>struct ifmap * <parameter>map</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
      the net device for media type change
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>map</parameter></term>
   <listitem>
    <para>
      ifmap passed by ifconfig
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Set media type to 10baseT, 100baseT or 0(for auto) by ifconfig
   we support only port changes. All other runtime configuration
   changes will be ignored
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-mcast-bitnr">sis900_mcast_bitnr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_mcast_bitnr</refname>
 <refpurpose>
      compute hashtable index 
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>u16 <function>sis900_mcast_bitnr </function></funcdef>
   <paramdef>u8 * <parameter>addr</parameter></paramdef>
   <paramdef>u8 <parameter>revision</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>addr</parameter></term>
   <listitem>
    <para>
      multicast address
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>revision</parameter></term>
   <listitem>
    <para>
      revision id of chip
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   SiS 900 uses the most sigificant 7 bits to index a 128 bits multicast
   hash table, which makes this function a little bit different from other drivers
   SiS 900 B0 &amp; 635 M/B uses the most significat 8 bits to index 256 bits
   multicast hash table. 
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-set-rx-mode">set_rx_mode</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>set_rx_mode</refname>
 <refpurpose>
      Set SiS900 receive mode 
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>set_rx_mode </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to be set
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Set SiS900 receive mode for promiscuous, multicast, or broadcast mode.
   And set the appropriate multicast filter.
   Multicast hash table changes from 128 to 256 bits for 635M/B &amp; 900B0.
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-reset">sis900_reset</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_reset</refname>
 <refpurpose>
      Reset sis900 MAC 
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sis900_reset </function></funcdef>
   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net_dev</parameter></term>
   <listitem>
    <para>
      the net device to reset
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   reset sis900 MAC and wait until finished
   reset through command register
   change backoff algorithm for 900B0 &amp; 635 M/B
</para>
</refsect1>
</refentry>

<refentry>
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>March 2006</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase id="API-sis900-remove">sis900_remove</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
 <refname>sis900_remove</refname>
 <refpurpose>
      Remove sis900 device 
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void __devexit <function>sis900_remove </function></funcdef>
   <paramdef>struct pci_dev * <parameter>pci_dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>pci_dev</parameter></term>
   <listitem>
    <para>
      the pci device to be removed
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   remove and release SiS900 net device
</para>
</refsect1>
</refentry>

</chapter>

</book>
