📄 howto_build_usb_drivers.html
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.6 [en] (WinNT; I) [Netscape]">
<meta name="Author" content="Juro Bystricky">
<meta name="KeyWords" content="USB client, linux, device driver, s1d13a03, s1d13a04, s1d13a05">
<title>EPSON USB Client Driver</title>
</head>
<body>
<div align="center">
<table border="0" width="600" id="table1">
<tr>
<td>
<img SRC="images\nc.jpg" height=153 width=131></td>
<td>
<p align="center"><b><font size="6" color="#3333FF">Building the<br>
</b><font face="Arial Black">EPSON</font><b><br>
USB Client Driver</b></font></td>
<td><img SRC="images\nc.jpg" height=153 width=131></td>
</tr>
</table>
<table border="0" width="500" id="table2">
<tr>
<td>
<p align="justify">Several EPSON LCD Controllers/Companion Chips contain a USB client core.
The chips are typically used in PDAs where the USB connection can be used
to connect to a PC and thus allow the PDA to share files
with the PC or share internet connection.<br>
<p align="justify">The driver in this package allows an Ethernet over USB cable
link between two Linux machines connected by a standard USB cable. Compiling and installing the
drivers permits the EPSON LCD/USB
chips to setup an Ethernet over USB link between a client computer (containing
the EPSON chip) and a host computer using a standard USB cable.
<p>The drivers themselves can be found in the following files:
<br>
<div align="center">
<table border="0" width="500" id="table3">
<tr>
<td><b>epson2888usb.c</b></td>
<td width="400" align="justify">Low level USB driver code.<br>
This driver is completely unaware of Ethernet.</td>
</tr>
<tr>
<td><b>epson2888usb.h</b></td>
<td width="400" align="justify">ublic interface to low level USB driver module</td>
</tr>
<tr>
<td><b>epson2888usb-eth.c</b></td>
<td width="400" align="justify">Ethernet/over/USB code.<br>
This driver is completely unaware of USB.</td>
</tr>
<tr>
<td><b>usbnet.c </b></td>
<td width="400" align="justify">The only file that goes
on the Host machine. (see below)</td>
</tr>
</table>
</div>
<p><b><font size=+1 color="#3333FF">Compilation Instructions</font></b><p align="justify">In the following we assume your Linux kernel sources are in <b>/usr/src/linux</b>.
We also assume you are familiar with the Linux kernel build process. In
the detailed instructions below we use the patch file <b>epson2888usb-2.4.19.diff.gz</b>.
<p><b><font size=+1>Host computer</font></b><font size="4"> </font>
<p align="justify">The goal is to build the module usbnet.o. When running <b>menuconfig</b>, we
must make sure that USB is enabled, networking is enabled, loadable module
support is enabled. These options are normally enabled by default.
<ol>
<li>If your kernel is linux-2.4.20 or later, skip to step 2, otherwise,
you must apply the patch file. Copy the file <b>epson2888usb-2.4.19.diff.gz</b>
in the directory <b>/usr/src/linux</b> and issue the commands:<b><br>
<br>
cd /usr/src/linux</b> <b><br>
gzip -cd epson2888usb-2.4.19.diff.gz | patch
-Np1<br>
</b></li>
<li>Run<b><br>
make menuconfig<br>
<br>
</b>select<br>
<b> Code maturity level options ---></b> <br>
<b> [*] Prompt for development and/or incomplete
code/drivers<br>
<br>
USB Support ---><br>
<*> Support for USB<br>
---USB Host controller drivers<br>
<*> UHCI </b><i>(or whatever other controller
you have installed)</i><b><br>
USB Network adaptors</b> <b><br>
<M> USB-to-USB networking cable device
support (EXPERIMENTAL)</b> <br>
</li>
<li>Run <b>make dep<br>
</b></li>
<li>Run <b>make modules</b> <br>
</li>
<li>Run <b>make modules_install</b> </li>
</ol>
<p> <p><b><font size=+1>Client computer</font></b>
<p align="justify">The goal is to compile the file epson2888usb.c into a loadable module
epson2888usb.o and the file epson2888usb-eth.c into a loadable module epson2888usb-eth.o.<p align="justify">Follow these steps:
<ol>
<li>First, you must apply the patch file. Copy the file <b>epson2888usb-2.4.19.diff.gz</b>
in the directory <b>/usr/src/linux</b> and issue the commands:<b><br>
<br>
cd /usr/src/linux</b> <b><br>
gzip -cd epson2888usb-2.4.19.diff.gz | patch
-Np1<br>
</b></li>
<li>In the directory /usr/src/linux run the command<br>
<br>
<b> make menuconfig<br>
<br>
</b>Select<b><br>
<br>
USB support ---></b> <b><br>
EPSON USB Client
drivers ---></b> <b><br>
<M> EPSON2888 USB function support</b> <b><br>
[*]
Support for EPSON S1D13A0X</b> <b><br>
[*]
Support for PCI B00C series evaluation board</b> <b><br>
[*]
Enable debug messages</b> <b><br>
<M>
Support for EPSON USB network link function<br>
</b> <br>
<b>NOTE:</b> you don't have to enable the <> Support for USB in the
main USB configuration menu at all. Debug messages can be normally
retrieved from the file /var/log/messages. They can be quite useful in
the initial stages of development.<br>
</li>
<li>Run <b>make dep</b> <br>
</li>
<li>Run <b>make modules</b> <br>
</li>
<li>Run <b>make modules_install</b> </li>
</ol>
<p> <p><b><font size=+1 color="#3333FF">Testing the Connection</font></b>
<p>For testing purposes, we will assign the IP address 1.1.1.1 to the client, 1.1.1.2
to the host.<ol>
<li>Connect the host and the client computers with a USB cable.<br>
</li>
<li>On client run the following commands:<b><br>
<br>
modprobe epson2888usb-eth</b> <b><br>
ifconfig usbf 1.1.1.1 netmask 255.255.255.0
up<br>
route add default gw 1.1.1.2<br>
</b></li>
<li>On host run the following commands:<b><br>
<br>
insmod usbnet</b> <b><br>
ifconfig usb0 1.1.1.2 netmask 255.255.255.0</b> <br>
<br>
If you want to share the host network connection, also issue the following
commands:<b><br>
<br>
echo 1 > /proc/sys/net/ipv4/ip_forward<br>
iptables -t nat -I POSTROUTING -j
MASQUERADE -s 1.1.1.1/32<br>
iptables -I FORWARD -s 1.1.1.1/32
-j ACCEPT<br>
iptables -I FORWARD -d 1.1.1.1/32
-j ACCEPT</b> <br>
<br>
At this point, providing the above commands were successful, the connection
should be up and running.<br>
</li>
<li>On the client run the command:<br>
<br>
<b> ping 1.1.1.2 -c 10<br>
<br>
</b>If you successfully ping the host, you can test network sharing
by running Netscape on the client (providing the host has internet
connection). You can also share the host drives by executing the command:<br>
<br>
<b> mount -t nfs 1.1.1.1:/ /mnt/host<br>
<br>
</b>The mount command assumes you have NFS file support, you have a directory
/mnt/host and the host is running an NFS Server. (for a very good
description see <a href="http://nfs.sourceforge.net/nfs-howto">http://nfs.sourceforge.net/nfs-howto</a>)
<br>
</li>
</ol>
<p><b><font size=+1 color="#3333FF">Hardware Configuration</font></b>
<p>The driver were tested using the following hardware configurations:<blockquote>
<p>Host computer (running usbnet): <br>Pentium II @ 350MHz, ASUS MB P28
<br>Linux 2.4.19<p>Client computer (running epson2888usb,
epson2888usb-eth): <br>Pentium II @ 350MHz, ASUS MB P28
<br>Linux 2.4.19
</blockquote>
<p>This driver has been tested with three different controllers:
<p> <div align="center">
<table border="1" width="500" id="table4" style="border-collapse: collapse">
<tr>
<td> </td>
<td align="center"><b>S1D13A03</b></td>
<td align="center" width="153"><b>S1D13A04</b></td>
<td width="215" align="center"><b>S1D13A05</b></td>
</tr>
<tr>
<td><b>Board </b></td>
<td align="center">S5U13A03/4/5B00C<br>
Rev 1.0 </td>
<td width="153" align="center">
S5U13A03/4/5B00C<br>
Rev 1.0 </td>
<td width="215" align="center">S5U13A05B00C<br>
Rev 1.0</td>
</tr>
<tr>
<td><b>Switches</b></td>
<td> </td>
<td width="153"> </td>
<td width="215"> </td>
</tr>
<tr>
<td align="center">1</td>
<td align="center">Closed</td>
<td width="153" align="center">Closed</td>
<td align="center">Closed</td>
</tr>
<tr>
<td align="center">2</td>
<td align="center">Closed</td>
<td width="153" align="center">Closed</td>
<td align="center">Closed</td>
</tr>
<tr>
<td align="center">3</td>
<td align="center">Open</td>
<td width="153" align="center">Open</td>
<td align="center">Open</td>
</tr>
<tr>
<td align="center">4</td>
<td align="center">Open</td>
<td width="153" align="center">Open</td>
<td align="center">Closed</td>
</tr>
<tr>
<td align="center">5</td>
<td align="center">Open</td>
<td width="153" align="center">Open</td>
<td align="center">Open</td>
</tr>
<tr>
<td align="center">6</td>
<td align="center">Open</td>
<td width="153" align="center">Open</td>
<td align="center">Open</td>
</tr>
<tr>
<td align="center">7</td>
<td align="center">Open</td>
<td width="153" align="center">Open</td>
<td align="center">Open</td>
</tr>
<tr>
<td align="center">8</td>
<td align="center">Open</td>
<td width="153" align="center">Open</td>
<td align="center">Open</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td width="153"> </td>
<td width="215"> </td>
</tr>
<tr>
<td><b>Jumpers</b></td>
<td> </td>
<td width="153"> </td>
<td width="215"> </td>
</tr>
<tr>
<td align="center">JP1</td>
<td align="center">2-3</td>
<td width="153" align="center">2-3</td>
<td align="center">2-3</td>
</tr>
<tr>
<td align="center">JP2</td>
<td align="center">2-3</td>
<td width="153" align="center">2-3</td>
<td align="center">2-3</td>
</tr>
<tr>
<td align="center">JP3</td>
<td align="center">2-3</td>
<td width="153" align="center">2-3</td>
<td align="center">1-2</td>
</tr>
<tr>
<td align="center">JP4</td>
<td align="center">1-2</td>
<td width="153" align="center">1-2</td>
<td align="center">1-2 (IN)</td>
</tr>
<tr>
<td align="center">JP5</td>
<td align="center"> </td>
<td width="153" align="center"> </td>
<td width="215" align="center">OUT</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td width="153"> </td>
<td width="215"> </td>
</tr>
<tr>
<td align="center">U6</td>
<td align="center">empty</td>
<td width="153" align="center">empty</td>
<td align="center">40 MHz</td>
</tr>
<tr>
<td align="center">U7</td>
<td align="center">40 MHz</td>
<td width="153" align="center">40 MHz</td>
<td align="center">empty</td>
</tr>
<tr>
<td>
<p align="center">U18</td>
<td align="center">BEM 5.0</td>
<td width="153" align="center">BEM 5.0</td>
<td align="center">BEM 5.0</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
<p>
<br>
<br>
<br>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -