summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 19:08:33 -0800
committerLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 19:08:33 -0800
commit2d80cb2a5e022225b9512ccc98f7979cc4b92ce8 (patch)
treea7f247ba424b5366ce443b3d9cb5b4c7f6538e3f /Documentation
parent75b566af5cc6f64f9ab5b66608ff8ce18098a2b4 (diff)
v2.4.5.8 -> v2.4.5.9
- make sure "sync()" doesn't effectively lock up the machine by overloading all the IO resources - fix up some network memory allocations that don't wan tto wait on IO. - merge with Alan (including MIPS update) - Jeff Garzik: network driver updates. - Al Viro: System V FS update (write capability, page cache, mondo cleanups) - Kai Germaschewski: ISDN cleanups, TURBOPAM driver by Stelian Pop - Ben Fennema: UDF update (time handling, i_blocks fix) - Neil Brown: md error handling improvements, knfsd file handle compatibility - Paul Mackerras: PPC update - Jakub Jelinek: fix up kernel linker scripts to accept .rodata better - Patrick Mochel: fix PME handling in pci_enable_wake() - Chris Mason: reiserfs PF_MEMALLOC handling
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/Configure.help36
-rw-r--r--Documentation/DocBook/Makefile16
-rw-r--r--Documentation/DocBook/procfs-guide.tmpl625
-rw-r--r--Documentation/DocBook/procfs_example.c249
-rw-r--r--Documentation/fb/matroxfb.txt29
-rw-r--r--Documentation/networking/TODO2
-rw-r--r--Documentation/networking/sk98lin.txt83
7 files changed, 998 insertions, 42 deletions
diff --git a/Documentation/Configure.help b/Documentation/Configure.help
index fd1366108374..799e354d230b 100644
--- a/Documentation/Configure.help
+++ b/Documentation/Configure.help
@@ -9457,6 +9457,15 @@ CONFIG_TULIP
module, say M here and read Documentation/modules.txt as well as
Documentation/networking/net-modules.txt.
+New Tulip bus configuration (EXPERIMENTAL)
+CONFIG_TULIP_MWI
+ This configures your Tulip card specifically for the card and
+ system cache line size type you are using.
+
+ This is experimental code, not yet tested on many boards.
+
+ If unsure, say N.
+
Digi Intl. RightSwitch support
CONFIG_DGRS
This is support for the Digi International RightSwitch series of
@@ -12180,12 +12189,13 @@ CONFIG_NTFS_RW
If unsure, say N.
-System V and Coherent file system support (read only)
+System V, Version 7, Xenix and Coherent filesystem support (read only)
CONFIG_SYSV_FS
SCO, Xenix and Coherent are commercial Unix systems for Intel
- machines. Saying Y here would allow you to read from their floppies
- and hard disk partitions. If you also want to write to these media,
- say Y to "SYSV file system write support" below.
+ machines, and Version 7 was used on the DEC PDP-11. Saying Y
+ here would allow you to read from their floppies and hard disk
+ partitions. If you also want to write to these media, say Y to
+ "SYSV file system write support" below.
If you have floppies or hard disk partitions like that, it is likely
that they contain binaries from those other Unix systems; in order
@@ -12194,7 +12204,9 @@ CONFIG_SYSV_FS
Xenix, Wyse, UnixWare, Dell Unix and System V programs under Linux
and is often needed to run commercial software that's only available
for those systems. It's available via FTP (user: anonymous) from
- ftp://tsx-11.mit.edu/pub/linux/BETA ).
+ ftp://tsx-11.mit.edu/pub/linux/BETA ). NOTE: that will work only for
+ binaries from Intel-based systems; PDP ones will have to wait until
+ somebody ports Linux to -11 ;-)
If you only intend to mount files from some other Unix over the
network using NFS, you don't need the System V file system support
@@ -16128,6 +16140,20 @@ CONFIG_ISDN_DRV_ACT2000
isdn4k-utils package. Please read the file
Documentation/isdn/README.act2000 for more information.
+Auvertech TurboPAM support
+CONFIG_ISDN_DRV_TPAM
+ This enables support for the Auvertech TurboPAM ISDN-card.
+ For running this card, additional firmware is necessary, which has
+ to be downloaded into the card using a utility which is distributed
+ separately from the Auvertech's web site: http://www.auvertech.fr.
+
+ Please redirect all support questions to support@auvertech.fr.
+
+ If you want to compile this as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want),
+ say M here and read Documentation/modules.txt. The module will be
+ called tpam.o.
+
Hypercope HYSDN cards (Champ, Ergo, Metro) support (module)
CONFIG_HYSDN
Say Y here if you have one of Hypercope's active PCI ISDN cards
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index 569f70915dd9..d2b63417e0b9 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -1,7 +1,7 @@
BOOKS := wanbook.sgml z8530book.sgml mcabook.sgml videobook.sgml \
kernel-api.sgml parportbook.sgml kernel-hacking.sgml \
kernel-locking.sgml via-audio.sgml mousedrivers.sgml sis900.sgml \
- deviceiobook.sgml
+ deviceiobook.sgml procfs-guide.sgml
PS := $(patsubst %.sgml, %.ps, $(BOOKS))
PDF := $(patsubst %.sgml, %.pdf, $(BOOKS))
@@ -9,6 +9,7 @@ HTML := $(patsubst %.sgml, %, $(BOOKS))
IMG-parportbook := parport-share.fig parport-multi.fig parport-structure.fig
EPS-parportbook := $(patsubst %.fig, %.eps, $(IMG-parportbook))
JPG-parportbook := $(patsubst %.fig, %.jpeg, $(IMG-parportbook))
+C-procfs-example = procfs_example.sgml
books: $(BOOKS)
@@ -28,6 +29,15 @@ html: $(HTML)
%.jpeg: %.fig
-fig2dev -Ljpeg $< $@
+%.sgml: %.c
+ echo "<programlisting>" > $@
+ expand --tabs=8 < $< | \
+ sed -e "s/&/\\&amp;/g" \
+ -e "s/</\\&lt;/g" \
+ -e "s/>/\\&gt;/g" >> $@
+ echo "</programlisting>" >> $@
+
+
$(TOPDIR)/scripts/docproc:
$(MAKE) -C $(TOPDIR)/scripts docproc
@@ -67,6 +77,9 @@ videobook.sgml: videobook.tmpl $(TOPDIR)/drivers/media/video/videodev.c
$(TOPDIR)/scripts/docgen $(TOPDIR)/drivers/media/video/videodev.c \
<videobook.tmpl >videobook.sgml
+procfs-guide.sgml: procfs-guide.tmpl procfs_example.sgml
+ $(TOPDIR)/scripts/docgen < procfs-guide.tmpl >$@
+
APISOURCES := $(TOPDIR)/drivers/media/video/videodev.c \
$(TOPDIR)/arch/i386/kernel/irq.c \
$(TOPDIR)/arch/i386/kernel/mca.c \
@@ -128,6 +141,7 @@ clean:
-$(RM) $(BOOKS)
-$(RM) $(DVI) $(AUX) $(TEX) $(LOG) $(OUT)
-$(RM) $(JPG-parportbook) $(EPS-parportbook)
+ -$(RM) $(C-procfs-example)
mrproper: clean
-$(RM) $(PS) $(PDF)
diff --git a/Documentation/DocBook/procfs-guide.tmpl b/Documentation/DocBook/procfs-guide.tmpl
new file mode 100644
index 000000000000..6f9496ac9cee
--- /dev/null
+++ b/Documentation/DocBook/procfs-guide.tmpl
@@ -0,0 +1,625 @@
+<!-- -*- sgml -*- -->
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN"[
+<!ENTITY procfsexample SYSTEM "procfs_example.sgml">
+]>
+
+<book id="LKProcfsGuide">
+ <bookinfo>
+ <title>Linux Kernel Procfs Guide</title>
+
+ <authorgroup>
+ <author>
+ <firstname>Erik</firstname>
+ <othername>(J.A.K.)</othername>
+ <surname>Mouw</surname>
+ <affiliation>
+ <orgname>Delft University of Technology</orgname>
+ <orgdiv>Faculty of Information Technology and Systems</orgdiv>
+ <address>
+ <email>J.A.K.Mouw@its.tudelft.nl</email>
+ <pob>PO BOX 5031</pob>
+ <postcode>2600 GA</postcode>
+ <city>Delft</city>
+ <country>The Netherlands</country>
+ </address>
+ </affiliation>
+ </author>
+ </authorgroup>
+
+ <revhistory>
+ <revision>
+ <revnumber>1.0&nbsp;</revnumber>
+ <date>May 30, 2001</date>
+ <revremark>Initial revision posted to linux-kernel</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.1&nbsp;</revnumber>
+ <date>June 3, 2001</date>
+ <revremark>Revised after comments from linux-kernel</revremark>
+ </revision>
+ </revhistory>
+
+ <copyright>
+ <year>2001</year>
+ <holder>Erik Mouw</holder>
+ </copyright>
+
+
+ <legalnotice>
+ <para>
+ This documentation 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 documentation 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>
+
+ <para>
+ For more details see the file COPYING in the source
+ distribution of Linux.
+ </para>
+ </legalnotice>
+ </bookinfo>
+
+
+
+
+ <toc>
+ </toc>
+
+
+
+
+ <preface>
+ <title>Preface</title>
+
+ <para>
+ This guide describes the use of the procfs file system from
+ within the Linux kernel. The idea to write this guide came up on
+ the #kernelnewbies IRC channel (see <ulink
+ url="http://www.kernelnewbies.org/">http://www.kernelnewbies.org/</ulink>),
+ when Jeff Garzik explained the use of procfs and forwarded me a
+ message Alexander Viro wrote to the linux-kernel mailing list. I
+ agreed to write it up nicely, so here it is.
+ </para>
+
+ <para>
+ I'd like to thank Jeff Garzik
+ <email>jgarzik@mandrakesoft.com</email> and Alexander Viro
+ <email>viro@math.psu.edu</email> for their input, Tim Waugh
+ <email>twaugh@redhat.com</email> for his <ulink
+ url="http://people.redhat.com/twaugh/docbook/selfdocbook/">Selfdocbook</ulink>,
+ and Marc Joosen <email>marcj@historia.et.tudelft.nl</email> for
+ proofreading.
+ </para>
+
+ <para>
+ This documentation was written while working on the LART
+ computing board (<ulink
+ url="http://www.lart.tudelft.nl/">http://www.lart.tudelft.nl/</ulink>),
+ which is sponsored by the Mobile Multi-media Communications
+ (<ulink
+ url="http://www.mmc.tudelft.nl/">http://www.mmc.tudelft.nl/</ulink>)
+ and Ubiquitous Communications (<ulink
+ url="http://www.ubicom.tudelft.nl/">http://www.ubicom.tudelft.nl/</ulink>)
+ projects.
+ </para>
+
+ <para>
+ Erik
+ </para>
+ </preface>
+
+
+
+
+ <chapter id="intro">
+ <title>Introduction</title>
+
+ <para>
+ The <filename class="directory">/proc</filename> file system
+ (procfs) is a special file system in the linux kernel. It's a
+ virtual file system: it is not associated with a block device
+ but exists only in memory. The files in the procfs are there to
+ allow userland programs access to certain information from the
+ kernel (like process information in <filename
+ class="directory">/proc/[0-9]+/</filename>), but also for debug
+ purposes (like <filename>/proc/ksyms</filename>).
+ </para>
+
+ <para>
+ This guide describes the use of the procfs file system from
+ within the Linux kernel. It starts by introducing all relevant
+ functions to manage the files within the file system. After that
+ it shows how to communicate with userland, and some tips and
+ tricks will be pointed out. Finally a complete example will be
+ shown.
+ </para>
+
+ <para>
+ Note that the files in <filename
+ class="directory">/proc/sys</filename> are sysctl files: they
+ don't belong to procfs and are governed by a completely
+ different API described in the Kernel API book.
+ </para>
+ </chapter>
+
+
+
+
+ <chapter id="managing">
+ <title>Managing procfs entries</title>
+
+ <para>
+ This chapter describes the functions that various kernel
+ components use to populate the procfs with files, symlinks,
+ device nodes, and directories.
+ </para>
+
+ <para>
+ A minor note before we start: if you want to use any of the
+ procfs functions, be sure to include the correct header file!
+ This should be one of the first lines in your code:
+ </para>
+
+ <programlisting>
+#include &lt;linux/proc_fs.h&gt;
+ </programlisting>
+
+
+
+
+ <sect1 id="regularfile">
+ <title>Creating a regular file</title>
+
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>struct proc_dir_entry* <function>create_proc_entry</function></funcdef>
+ <paramdef>const char* <parameter>name</parameter></paramdef>
+ <paramdef>mode_t <parameter>mode</parameter></paramdef>
+ <paramdef>struct proc_dir_entry* <parameter>parent</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+
+ <para>
+ This function creates a regular file with the name
+ <parameter>name</parameter>, file mode
+ <parameter>mode</parameter> in the directory
+ <parameter>parent</parameter>. To create a file in the root of
+ the procfs, use <constant>NULL</constant> as
+ <parameter>parent</parameter> parameter. When successful, the
+ function will return a pointer to the freshly created
+ <structname>struct proc_dir_entry</structname>; otherwise it
+ will return <constant>NULL</constant>. <xref
+ linkend="userland"> describes how to do something useful with
+ regular files.
+ <para>
+
+ <para>
+ Note that it is specifically supported that you can pass a
+ path that spans multiple directories. For example
+ <function>create_proc_entry</function>(<parameter>"drivers/via0/info"</parameter>)
+ will create the <filename class="directory">via0</filename>
+ directory if necessary, with standard
+ <constant>0755</constant> permissions.
+ </para>
+
+ <para>
+ If you only want to be able to read the file, the function
+ <function>create_proc_read_entry</function> described in <xref
+ linkend="convenience"> may be used to create and initialise
+ the procfs entry in one single call.
+ </para>
+ </sect1>
+
+
+
+
+ <sect1>
+ <title>Creating a symlink</title>
+
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>struct proc_dir_entry*
+ <function>proc_symlink</function></funcdef> <paramdef>const
+ char* <parameter>name</parameter></paramdef>
+ <paramdef>struct proc_dir_entry*
+ <parameter>parent</parameter></paramdef> <paramdef>const
+ char* <parameter>dest</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+
+ <para>
+ This creates a symlink in the procfs directory
+ <parameter>parent</parameter> that points from
+ <parameter>name</parameter> to
+ <parameter>dest</parameter>. This translates in userland to
+ <literal>ln -s</literal> <parameter>dest</parameter>
+ <parameter>name</parameter>.
+ </para>
+ </sect1>
+
+
+
+
+ <sect1>
+ <title>Creating a device</title>
+
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>struct proc_dir_entry* <function>proc_mknod</function></funcdef>
+ <paramdef>const char* <parameter>name</parameter></paramdef>
+ <paramdef>mode_t <parameter>mode</parameter></paramdef>
+ <paramdef>struct proc_dir_entry* <parameter>parent</parameter></paramdef>
+ <paramdef>kdev_t <parameter>rdev</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+
+ <para>
+ Creates a device file <parameter>name</parameter> with mode
+ <parameter>mode</parameter> in the procfs directory
+ <parameter>parent</parameter>. The device file will work on
+ the device <parameter>rdev</parameter>, which can be generated
+ by using the <literal>MKDEV</literal> macro from
+ <literal>linux/kdev_t.h</literal>. The
+ <parameter>mode</parameter> parameter
+ <emphasis>must</emphasis> contain <constant>S_IFBLK</constant>
+ or <constant>S_IFCHR</constant> to create a device
+ node. Compare with userland <literal>mknod
+ --mode=</literal><parameter>mode</parameter>
+ <parameter>name</parameter> <parameter>rdev</parameter>.
+ </para>
+ </sect1>
+
+
+
+
+ <sect1>
+ <title>Creating a directory</title>
+
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>struct proc_dir_entry* <function>proc_mkdir</function></funcdef>
+ <paramdef>const char* <parameter>name</parameter></paramdef>
+ <paramdef>struct proc_dir_entry* <parameter>parent</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+
+ <para>
+ Create a directory <parameter>name</parameter> in the procfs
+ directory <parameter>parent</parameter>.
+ </para>
+ </sect1>
+
+
+
+
+ <sect1>
+ <title>Removing an entry</title>
+
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>void <function>remove_proc_entry</function></funcdef>
+ <paramdef>const char* <parameter>name</parameter></paramdef>
+ <paramdef>struct proc_dir_entry* <parameter>parent</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+
+ <para>
+ Removes the entry <parameter>name</parameter> in the directory
+ <parameter>parent</parameter> from the procfs. Entries are
+ removed by their <emphasis>name</emphasis>, not by the
+ <structname>struct proc_dir_entry</structname> returned by the
+ various create functions. Note that this function doesn't
+ recursively remove entries.
+ </para>
+
+ <para>
+ Be sure to free the <structfield>data</structfield> entry from
+ the <structname>struct proc_dir_entry</structname> before
+ <function>remove_proc_entry</function> is called (that is: if
+ there was some <structfield>data</structfield> allocated, of
+ course). See <xref linkend="usingdata"> for more information
+ on using the <structfield>data</structfield> entry.
+ </para>
+ </sect1>
+ </chapter>
+
+
+
+
+ <chapter id="userland">
+ <title>Communicating with userland</title>
+
+ <para>
+ Instead of reading (or writing) information directly from
+ kernel memory, procfs works with <emphasis>call back
+ functions</emphasis> for files: functions that are called when
+ a specific file is being read or written. Such functions have
+ to be initialised after the procfs file is created by setting
+ the <structfield>read_proc</structfield> and/or
+ <structfield>write_proc</structfield> fields in the
+ <structname>struct proc_dir_entry*</structname> that the
+ function <function>create_proc_entry</function> returned:
+ </para>
+
+ <programlisting>
+struct proc_dir_entry* entry;
+
+entry->read_proc = read_proc_foo;
+entry->write_proc = write_proc_foo;
+ </programlisting>
+
+ <para>
+ If you only want to use a the
+ <structfield>read_proc</structfield>, the function
+ <function>create_proc_read_entry</function> described in <xref
+ linkend="convenience"> may be used to create and initialise the
+ procfs entry in one single call.
+ </para>
+
+
+
+ <sect1>
+ <title>Reading data</title>
+
+ <para>
+ The read function is a call back function that allows userland
+ processes to read data from the kernel. The read function
+ should have the following format:
+ </para>
+
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>read_func</function></funcdef>
+ <paramdef>char* <parameter>page</parameter></paramdef>
+ <paramdef>char** <parameter>start</parameter></paramdef>
+ <paramdef>off_t <parameter>off</parameter></paramdef>
+ <paramdef>int <parameter>count</parameter></paramdef>
+ <paramdef>int* <parameter>eof</parameter></paramdef>
+ <paramdef>void* <parameter>data</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+
+ <para>
+ The read function should write its information into the
+ <parameter>page</parameter>. For proper use, the function
+ should start writing at an offset of
+ <parameter>off</parameter> in <parameter>page</parameter> and
+ write at most <parameter>count</parameter> bytes, but because
+ most read functions are quite simple and only return a small
+ amount of information, these two parameters are usually
+ ignored (it breaks pagers like <literal>more</literal> and
+ <literal>less</literal>, but <literal>cat</literal> still
+ works).
+ </para>
+
+ <para>
+ If the <parameter>off</parameter> and
+ <parameter>count</parameter> parameters are properly used,
+ <parameter>eof</parameter> should be used to signal that the
+ end of the file has been reached by writing
+ <literal>1</literal> to the memory location
+ <parameter>eof</parameter> points to.
+ </para>
+
+ <para>
+ The parameter <parameter>start</parameter> doesn't seem to be
+ used anywhere in the kernel. The <parameter>data</parameter>
+ parameter can be used to create a single call back function for
+ several files, see <xref linkend="usingdata">.
+ </para>
+
+ <para>
+ The <function>read_func</function> function must return the
+ number of bytes written into the <parameter>page</parameter>.
+ </para>
+
+ <para>
+ <xref linkend="example"> shows how to use a read call back
+ function.
+ </para>
+ </sect1>
+
+
+
+
+ <sect1>
+ <title>Writing data</title>
+
+ <para>
+ The write call back function allows a userland process to write
+ data to the kernel, so it has some kind of control over the
+ kernel. The write function should have the following format:
+ </para>
+
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>write_func</function></funcdef>
+ <paramdef>struct file* <parameter>file</parameter></paramdef>
+ <paramdef>const char* <parameter>buffer</parameter></paramdef>
+ <paramdef>unsigned long <parameter>count</parameter></paramdef>
+ <paramdef>void* <parameter>data</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+
+ <para>
+ The write function should read <parameter>count</parameter>
+ bytes at maximum from the <parameter>buffer</parameter>. Note
+ that the <parameter>buffer</parameter> doesn't live in the
+ kernel's memory space, so it should first be copied to kernel
+ space with <function>copy_from_user</function>. The
+ <parameter>file</parameter> parameter is usually
+ ignored. <xref linkend="usingdata"> shows how to use the
+ <parameter>data</parameter> parameter.
+ </para>
+
+ <para>
+ Again, <xref linkend="example"> shows how to use this call back
+ function.
+ </para>
+ </sect1>
+
+
+
+
+ <sect1 id="usingdata">
+ <title>A single call back for many files</title>
+
+ <para>
+ When a large number of almost identical files is used, it's
+ quite inconvenient to use a separate call back function for
+ each file. A better approach is to have a single call back
+ function that distinguishes between the files by using the
+ <structfield>data</structfield> field in <structname>struct
+ proc_dir_entry</structname>. First of all, the
+ <structfield>data</structfield> field has to be initialised:
+ </para>
+
+ <programlisting>
+struct proc_dir_entry* entry;
+struct my_file_data *file_data;
+
+file_data = kmalloc(sizeof(struct my_file_data), GFP_KERNEL);
+entry->data = file_data;
+ </programlisting>
+
+ <para>
+ The <structfield>data</structfield> field is a <type>void
+ *</type>, so it can be initialised with anything.
+ </para>
+
+ <para>
+ Now that the <structfield>data</structfield> field is set, the
+ <function>read_proc</function> and
+ <function>write_proc</function> can use it to distinguish
+ between files because they get it passed into their
+ <parameter>data</parameter> parameter:
+ </para>
+
+ <programlisting>
+int foo_read_func(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ int len;
+
+ if(data == file_data) {
+ /* special case for this file */
+ } else {
+ /* normal processing */
+ }
+
+ return len;
+}
+ </programlisting>
+
+ <para>
+ Be sure to free the <structfield>data</structfield> data field
+ when removing the procfs entry.
+ </para>
+ </sect1>
+ </chapter>
+
+
+
+
+ <chapter id="tips">
+ <title>Tips and tricks</title>
+
+
+
+
+ <sect1 id="convenience">
+ <title>Convenience functions</title>
+
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>struct proc_dir_entry* <function>create_proc_read_entry</function></funcdef>
+ <paramdef>const char* <parameter>name</parameter></paramdef>
+ <paramdef>mode_t <parameter>mode</parameter></paramdef>
+ <paramdef>struct proc_dir_entry* <parameter>parent</parameter></paramdef>
+ <paramdef>read_proc_t* <parameter>read_proc</parameter></paramdef>
+ <paramdef>void* <parameter>data</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+
+ <para>
+ This function creates a regular file in exactly the same way
+ as <function>create_proc_entry</function> from <xref
+ linkend="regularfile"> does, but also allows to set the read
+ function <parameter>read_proc</parameter> in one call. This
+ function can set the <parameter>data</parameter> as well, like
+ explained in <xref linkend="usingdata">.
+ </para>
+ </sect1>
+
+
+
+ <sect1>
+ <title>Modules</title>
+
+ <para>
+ If procfs is being used from within a module, be sure to set
+ the <structfield>owner</structfield> field in the
+ <structname>struct proc_dir_entry</structname> to
+ <constant>THIS_MODULE</constant>.
+ <para>
+
+ <programlisting>
+struct proc_dir_entry* entry;
+
+entry->owner = THIS_MODULE;
+ </programlisting>
+ </sect1>
+
+
+
+
+ <sect1>
+ <title>Mode and ownership</title>
+
+ <para>
+ Sometimes it is useful to change the mode and/or ownership of
+ a procfs entry. Here is an example that shows how to achieve
+ that:
+ </para>
+
+ <programlisting>
+struct proc_dir_entry* entry;
+
+entry->mode = S_IWUSR |S_IRUSR | S_IRGRP | S_IROTH;
+entry->uid = 0;
+entry->gid = 100;
+ </programlisting>
+
+ </sect1>
+ </chapter>
+
+
+
+
+ <chapter id="example">
+ <title>Example</title>
+
+ <!-- be careful with the example code: it shouldn't be wider than
+ approx. 60 columns, or otherwise it won't fit properly on a page
+ -->
+
+&procfsexample;
+
+ </chapter>
+</book>
diff --git a/Documentation/DocBook/procfs_example.c b/Documentation/DocBook/procfs_example.c
new file mode 100644
index 000000000000..4b46e0e003fb
--- /dev/null
+++ b/Documentation/DocBook/procfs_example.c
@@ -0,0 +1,249 @@
+/*
+ * procfs_example.c: an example proc interface
+ *
+ * Copyright (C) 2001, Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
+ *
+ * This file accompanies the procfs-guide in the Linux kernel
+ * source. Its main use is to demonstrate the concepts and
+ * functions described in the guide.
+ *
+ * This software has been developed while working on the LART
+ * computing board (http://www.lart.tudelft.nl/), which is
+ * sponsored by the Mobile Multi-media Communications
+ * (http://www.mmc.tudelft.nl/) and Ubiquitous Communications
+ * (http://www.ubicom.tudelft.nl/) projects.
+ *
+ * The author can be reached at:
+ *
+ * Erik Mouw
+ * Information and Communication Theory Group
+ * Faculty of Information Technology and Systems
+ * Delft University of Technology
+ * P.O. Box 5031
+ * 2600 GA Delft
+ * The Netherlands
+ *
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/proc_fs.h>
+#include <linux/sched.h>
+#include <asm/uaccess.h>
+
+
+#define MODULE_VERSION "1.0"
+#define MODULE_NAME "procfs_example"
+
+#define FOOBAR_LEN 8
+
+struct fb_data_t {
+ char name[FOOBAR_LEN + 1];
+ char value[FOOBAR_LEN + 1];
+};
+
+
+static struct proc_dir_entry *example_dir, *foo_file,
+ *bar_file, *jiffies_file, *tty_device, *symlink;
+
+
+struct fb_data_t foo_data, bar_data;
+
+
+static int proc_read_jiffies(char *page, char **start,
+ off_t off, int count,
+ int *eof, void *data)
+{
+ int len;
+
+ MOD_INC_USE_COUNT;
+
+ len = sprintf(page, "jiffies = %ld\n",
+ jiffies);
+
+ MOD_DEC_USE_COUNT;
+
+ return len;
+}
+
+
+static int proc_read_foobar(char *page, char **start,
+ off_t off, int count,
+ int *eof, void *data)
+{
+ int len;
+ struct fb_data_t *fb_data = (struct fb_data_t *)data;
+
+ MOD_INC_USE_COUNT;
+
+ len = sprintf(page, "%s = '%s'\n",
+ fb_data->name, fb_data->value);
+
+ MOD_DEC_USE_COUNT;
+
+ return len;
+}
+
+
+static int proc_write_foobar(struct file *file,
+ const char *buffer,
+ unsigned long count,
+ void *data)
+{
+ int len;
+ struct fb_data_t *fb_data = (struct fb_data_t *)data;
+
+ MOD_INC_USE_COUNT;
+
+ if(count > FOOBAR_LEN)
+ len = FOOBAR_LEN;
+ else
+ len = count;
+
+ if(copy_from_user(fb_data->value, buffer, len)) {
+ MOD_DEC_USE_COUNT;
+ return -EFAULT;
+ }
+
+ fb_data->value[len] = '\0';
+
+ MOD_DEC_USE_COUNT;
+
+ return len;
+}
+
+
+static int __init init_procfs_example(void)
+{
+ int rv = 0;
+
+ /* create directory */
+ example_dir = proc_mkdir(MODULE_NAME, NULL);
+ if(example_dir == NULL) {
+ rv = -ENOMEM;
+ goto out;
+ }
+
+ example_dir->owner = THIS_MODULE;
+
+ /* create jiffies using convenience function */
+ jiffies_file = create_proc_read_entry("jiffies",
+ 0444, example_dir,
+ proc_read_jiffies,
+ NULL);
+ if(jiffies_file == NULL) {
+ rv = -ENOMEM;
+ goto no_jiffies;
+ }
+
+ jiffies_file->owner = THIS_MODULE;
+
+ /* create foo and bar files using same callback
+ * functions
+ */
+ foo_file = create_proc_entry("foo", 0644, example_dir);
+ if(foo_file == NULL) {
+ rv = -ENOMEM;
+ goto no_foo;
+ }
+
+ strcpy(foo_data.name, "foo");
+ strcpy(foo_data.value, "foo");
+ foo_file->data = &foo_data;
+ foo_file->read_proc = proc_read_foobar;
+ foo_file->write_proc = proc_write_foobar;
+ foo_file->owner = THIS_MODULE;
+
+ bar_file = create_proc_entry("bar", 0644, example_dir);
+ if(bar_file == NULL) {
+ rv = -ENOMEM;
+ goto no_bar;
+ }
+
+ strcpy(bar_data.name, "bar");
+ strcpy(bar_data.value, "bar");
+ bar_file->data = &bar_data;
+ bar_file->read_proc = proc_read_foobar;
+ bar_file->write_proc = proc_write_foobar;
+ bar_file->owner = THIS_MODULE;
+
+ /* create tty device */
+ tty_device = proc_mknod("tty", S_IFCHR | 0666,
+ example_dir, MKDEV(5, 0));
+ if(tty_device == NULL) {
+ rv = -ENOMEM;
+ goto no_tty;
+ }
+
+ tty_device->owner = THIS_MODULE;
+
+ /* create symlink */
+ symlink = proc_symlink("jiffies_too", example_dir,
+ "jiffies");
+ if(symlink == NULL) {
+ rv = -ENOMEM;
+ goto no_symlink;
+ }
+
+ symlink->owner = THIS_MODULE;
+
+ /* everything OK */
+ printk(KERN_INFO "%s %s initialised\n",
+ MODULE_NAME, MODULE_VERSION);
+ return 0;
+
+no_symlink:
+ remove_proc_entry("tty", example_dir);
+no_tty:
+ remove_proc_entry("bar", example_dir);
+no_bar:
+ remove_proc_entry("foo", example_dir);
+no_foo:
+ remove_proc_entry("jiffies", example_dir);
+no_jiffies:
+ remove_proc_entry(MODULE_NAME, NULL);
+out:
+ return rv;
+}
+
+
+static void __exit cleanup_procfs_example(void)
+{
+ remove_proc_entry("jiffies_too", example_dir);
+ remove_proc_entry("tty", example_dir);
+ remove_proc_entry("bar", example_dir);
+ remove_proc_entry("foo", example_dir);
+ remove_proc_entry("jiffies", example_dir);
+ remove_proc_entry(MODULE_NAME, NULL);
+
+ printk(KERN_INFO "%s %s removed\n",
+ MODULE_NAME, MODULE_VERSION);
+}
+
+
+module_init(init_procfs_example);
+module_exit(cleanup_procfs_example);
+
+MODULE_AUTHOR("Erik Mouw");
+MODULE_DESCRIPTION("procfs examples");
+
+EXPORT_NO_SYMBOLS;
diff --git a/Documentation/fb/matroxfb.txt b/Documentation/fb/matroxfb.txt
index a3bbe6b92c64..83b529fd64da 100644
--- a/Documentation/fb/matroxfb.txt
+++ b/Documentation/fb/matroxfb.txt
@@ -173,9 +173,9 @@ nomtrr - disables write combining on frame buffer. This slows down driver but
mtrr - enables write combining on frame buffer. It speeds up video accesses
much. It is default. You must have MTRR support enabled in kernel
and your CPU must have MTRR (f.e. Pentium II have them).
-sgram - tells to driver that you have G200 with SGRAM memory. It has no
+sgram - tells to driver that you have Gxx0 with SGRAM memory. It has no
effect without `init'.
-sdram - tells to driver that you have G200 with SDRAM memory.
+sdram - tells to driver that you have Gxx0 with SDRAM memory.
It is a default.
inv24 - change timings parameters for 24bpp modes on Millenium and
Millenium II. Specify this if you see strange color shadows around
@@ -279,7 +279,7 @@ Currently there are following known bugs:
+ 24bpp does not support correctly XF-FBDev on big-endian architectures.
+ interlaced text mode is not supported; it looks like hardware limitation,
but I'm not sure.
- + G200 SGRAM/SDRAM is not autodetected.
+ + Gxx0 SGRAM/SDRAM is not autodetected.
+ maybe more...
And following misfeatures:
+ SVGALib does not restore screen on exit.
@@ -336,7 +336,7 @@ NOACCEL
ACCEL, nofastfont
8x16 12x22 6x11
- Millennium I G200 Millennium I G200 Millennium I G200
+ Millennium I G200 Millennium I G200 Millennium I G200
8bpp 7.79 7.24 13.55 7.78 30.00 21.01
16bpp 9.13 7.78 16.16 7.78 30.00 21.01
24bpp 14.17 10.72 18.69 10.24 34.99 21.01
@@ -344,7 +344,7 @@ ACCEL, nofastfont
ACCEL, fastfont
8x16 12x22 6x11
- Millennium I G200 Millennium I G200 Millennium I G200
+ Millennium I G200 Millennium I G200 Millennium I G200
8bpp 8.41 6.01 6.54 4.37 16.00 10.51
16bpp 9.54 9.12 8.76 6.17 17.52 14.01
24bpp 15.00 12.36 11.67 10.00 22.01 18.32
@@ -355,6 +355,8 @@ TEXT
Millennium I G200
TEXT 3.29 1.50
+* Yes, it is slower than Millennium I.
+
Dualhead G400
=============
@@ -376,7 +378,22 @@ Driver supports dualhead G400 with some limitations:
+ if you compiled it as module, you must insert i2c-matroxfb, matroxfb_maven
and matroxfb_crtc2 into kernel.
+
+Dualhead G450
+=============
+Driver supports dualhead G450 with some limitations:
+ + secondary head shares videomemory with primary head. It is not problem
+ if you have 32MB of videoram, but if you have only 16MB, you may have
+ to think twice before choosing videomode.
+ + due to hardware limitation, secondary head can use only 16 and 32bpp
+ videomodes.
+ + secondary head is not accelerated.
+ + secondary head always powerups in 640x480@60-32 videomode. You have to use
+ fbset to change this mode.
+ + TV output is not supported
+ + kernel is not fully multihead ready, so some things are impossible to do.
+ + if you compiled it as module, you must insert matroxfb_g450 and matroxfb_crtc2
+ into kernel.
-* Yes, it is slower than Millennium I.
--
Petr Vandrovec <vandrove@vc.cvut.cz>
diff --git a/Documentation/networking/TODO b/Documentation/networking/TODO
index 9106a69c2f1d..66d36ff14bae 100644
--- a/Documentation/networking/TODO
+++ b/Documentation/networking/TODO
@@ -14,3 +14,5 @@ To-do items for network drivers
* Add ETHTOOL_GDRVINFO ioctl support to all ethernet drivers.
+* dmfe PCI DMA is totally wrong and only works on x86
+
diff --git a/Documentation/networking/sk98lin.txt b/Documentation/networking/sk98lin.txt
index 9591c7e396f7..170e3fc40d43 100644
--- a/Documentation/networking/sk98lin.txt
+++ b/Documentation/networking/sk98lin.txt
@@ -1,16 +1,17 @@
-(C)Copyright 1999-2000 SysKonnect.
+(C)Copyright 1999-2001 SysKonnect GmbH.
+All rights reserved
===========================================================================
-sk98lin.txt created 12-Sept-2000
+sk98lin.txt created 28-May-2001
-Readme File for sk98lin.o v3.05
-SK-NET Gigabit Ethernet Adapter SK-98xx Driver for Linux
+Readme File for sk98lin v4.06
+SK-NET Gigabit Ethernet PCI driver for LINUX
This file contains
(1) OVERVIEW
(2) REQUIRED FILES
(3) INSTALLATION
-(4) INCLUSION OF THE ADAPTER AT SYSTEM START
+(4) INCLUSION OF ADAPTER AT SYSTEM START
(5) DRIVER PARAMETERS
(6) LARGE FRAME SUPPORT
(7) TROUBLESHOOTING
@@ -19,13 +20,12 @@ This file contains
===========================================================================
-
(1) OVERVIEW
============
The sk98lin driver supports the SysKonnect SK-NET Gigabit Ethernet
Adapter SK-98xx family on Linux 2.2.x and above.
-It has been tested with Linux on Intel/x86, ALPHA and UltraSPARC machines.
+It has been tested with Linux on Intel/x86 machines.
From v3.02 on, the driver is integrated in the linux kernel source.
***
@@ -64,8 +64,8 @@ NOTE 2: IMPORTANT: In case of problems, please read the section
"make modules_install".
Reboot your system.
-4) Load the module manually by entering:
- insmod sk98lin.o
+2) Load the module manually by entering:
+ modprobe sk98lin
If the SysKonnect SK-98xx adapter is installed in your
computer and you have a /proc filesystem, running the command
'more /proc/net/dev' should produce an output containing a
@@ -75,7 +75,7 @@ NOTE 2: IMPORTANT: In case of problems, please read the section
NOTE 1: If you have more than one SysKonnect SK-98xx adapter, the
adapters will be listed as 'eth0', 'eth1', 'eth2', etc.
- For each adapter, repeat the steps 5) and 6).
+ For each adapter, repeat the steps 3) and 4).
NOTE 2: If you have other Ethernet adapters installed,
your SysKonnect SK-98xx adapter can be mapped to 'eth1' or
'eth2' ...
@@ -84,7 +84,7 @@ NOTE 2: IMPORTANT: In case of problems, please read the section
for each adapter that is found, containing the
corresponding 'ethX'.
-5) Select an IP address and assign it to the respective adapter by
+3) Select an IP address and assign it to the respective adapter by
entering:
ifconfig eth0 <ip-address>
This causes the adapter to connect to the ethernet. The solitary
@@ -99,22 +99,22 @@ NOTE 2: IMPORTANT: In case of problems, please read the section
NOTE: If you are in doubt about IP addresses, ask your network
administrator for assistance.
-6) Your adapter should now be fully operational.
+4) Your adapter should now be fully operational.
Use 'ping <otherstation>' to verify the connection to other
computers on your network.
- By entering 'ifconfig', you can check the number of packets sent
- and received by your adapter and additional some other information
- regarding the adapter configuration.
+ By viewing /proc/net/sk98lin/[devicename], you can check some
+ information regarding to the adapter configuration.
+
-7) The driver module can be stopped and unloaded using the following
+5) The driver module can be stopped and unloaded using the following
commands:
ifconfig eth0 down
rmmod sk98lin
***
-(4) INCLUSION OF THE ADAPTER AT SYSTEM START
-============================================
+(4) INCLUSION OF ADAPTER AT SYSTEM START
+========================================
Since a large number of different Linux distributions are
available, we are unable to describe a general installation procedure
@@ -129,7 +129,7 @@ Refer to the distribution's manual for installation of ethernet adapters.
=====================
Parameters can be set at the command line while loading the
-module with 'insmod'. The configuration tools of some distributions
+module with 'modprobe'. The configuration tools of some distributions
can also give parameters to the driver module.
If you use the kernel module loader, you can set driver parameters
in the file /etc/modules.conf (or old name: /etc/conf.modules).
@@ -138,12 +138,12 @@ Insert a line of the form:
options sk98lin ...
For "...", use the same syntax as described below for the command
-line parameters of insmod.
+line paramaters of modprobe.
You either have to reboot your computer or unload and reload
the driver to activate the new parameters.
The syntax of the driver parameters is:
-insmod sk98lin parameter=value1[,value2[,value3...]]
+modprobe sk98lin parameter=value1[,value2[,value3...]]
value1 is for the first adapter, value2 for the second one etc.
All Parameters are case sensitive, so write them exactly as
@@ -156,7 +156,7 @@ Sample: Suppose you have two adapters. You want to set AutoNegotiation
adapter to FULL and on Port A of the second adapter to HALF.
You must enter:
- insmod sk98lin.o AutoNeg_A=On,Off DupCap_A=Full,Half
+ modprobe sk98lin AutoNeg_A=On,Off DupCap_A=Full,Half
NOTE: The number of adapters that can be configured this way is
limited in the driver (file skge.c, constant SK_MAX_CARD_PARAM).
@@ -187,7 +187,7 @@ which you set the parameter (A or B).
this port is not "Sense". If autonegotiation is "On", all
three values are possible. If it is "Off", only "Full" and
"Half" are allowed.
- It is useful if your link partner does not support all
+ It is usefull if your link partner does not support all
possible combinations.
- Flow Control
@@ -234,7 +234,7 @@ which you set the parameter (A or B).
- RLMT (Redundant Link Management Technology) Mode
Parameter: RlmtMode
- Values: CheckLinkState,CheckLocalPort, CheckSeg
+ Values: CheckLinkState,CheckLocalPort, CheckSeg, DualNet
Default: CheckLinkState
RLMT (the driver part that decides which port to use) knows three
@@ -257,6 +257,13 @@ which you set the parameter (A or B).
Ethernet switches installed in your network that have been configured
to use the Spanning Tree protocol.
+-- DualNet - Both ports A and B are used as separate devices at the same
+ time. So if you have a dual port adapter, port A will show up as eth0
+ and port B as eth1. Both ports can be used independend with distinct
+ IP addresses.
+ The preferred port setting is not used. Rlmt is turned off.
+
+
NOTE: The modes CheckLocalPort and CheckSeg are meant to operate in
configurations where a network path between the ports on one
adapter exists. Especially, they are not designed to work where
@@ -269,7 +276,7 @@ which you set the parameter (A or B).
Large frames (also called jumbo frames) are now supported by the
driver. This can result in a greatly improved throughput if
-transferring large amounts of data.
+transfering large amounts of data.
To enable large frames, set the MTU (maximum transfer unit)
of the interface to the value you wish (up to 9000). The command
for this is:
@@ -285,7 +292,7 @@ it will simply drop them.
You can switch back to the standard ethernet frame size with:
ifconfig eth0 mtu 1500
-To make this setting persistent, add a script with the 'ifconfig'
+To make this setting persitent, add a script with the 'ifconfig'
line to the system startup sequence (named something like "S99sk98lin"
in /etc/rc.d/rc2.d).
***
@@ -373,11 +380,27 @@ following information is available:
(8) HISTORY
===========
-VERSION 3.05 (In-Kernel version)
+VERSION 4.02 (In-Kernel version)
+New Features:
+- Add Kernel 2.4 changes
+Known limitations:
+- None
+
+VERSION 4.01 (In-Kernel version)
Problems fixed:
-- Failed for multiple adapters in kernel 2.4.0
-New features:
-- New versions of several common modules
+- Full statistics support for DualNet mode
+Known limitations:
+- None
+
+VERSION 4.00 (In-Kernel version)
+Problems fixed:
+- Memory leak found
+New Features:
+- Proc filesystem integration
+- DualNet functionality integrated
+- Rlmt networks added
+Known limitations:
+- statistics partially incorrect in DualNet mode
VERSION 3.04 (In-Kernel version)
Problems fixed: