OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [io/] [usb/] [eth/] [slave/] [current/] [doc/] [usbseth-intro.html] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
<!-- Copyright (C) 2001 Free Software Foundation, Inc.                                -->
2
<!-- This material may be distributed only subject to the terms      -->
3
<!-- and conditions set forth in the Open Publication License, v1.0  -->
4
<!-- or later (the latest version is presently available at          -->
5
<!-- http://www.opencontent.org/openpub/).                           -->
6
<!-- Distribution of substantively modified versions of this         -->
7
<!-- document is prohibited without the explicit permission of the   -->
8
<!-- copyright holder.                                               -->
9
<!-- Distribution of the work or derivative of the work in any       -->
10
<!-- standard (paper) book form is prohibited unless prior           -->
11
<!-- permission is obtained from the copyright holder.               -->
12
<HTML
13
><HEAD
14
><TITLE
15
>Introduction</TITLE
16
><META
17
NAME="GENERATOR"
18
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
19
"><LINK
20
REL="HOME"
21
TITLE="eCos Support for Developing USB-ethernet Peripherals"
22
HREF="io-usb-slave-eth.html"><LINK
23
REL="PREVIOUS"
24
TITLE="eCos Support for Developing USB-ethernet Peripherals"
25
HREF="io-usb-slave-eth.html"><LINK
26
REL="NEXT"
27
TITLE="Initializing the USB-ethernet Package"
28
HREF="usbseth-init.html"></HEAD
29
><BODY
30
CLASS="REFENTRY"
31
BGCOLOR="#FFFFFF"
32
TEXT="#000000"
33
LINK="#0000FF"
34
VLINK="#840084"
35
ALINK="#0000FF"
36
><DIV
37
CLASS="NAVHEADER"
38
><TABLE
39
WIDTH="100%"
40
BORDER="0"
41
CELLPADDING="0"
42
CELLSPACING="0"
43
><TR
44
><TH
45
COLSPAN="3"
46
ALIGN="center"
47
>eCos Support for Developing USB-ethernet Peripherals</TH
48
></TR
49
><TR
50
><TD
51
WIDTH="10%"
52
ALIGN="left"
53
VALIGN="bottom"
54
><A
55
HREF="io-usb-slave-eth.html"
56
>Prev</A
57
></TD
58
><TD
59
WIDTH="80%"
60
ALIGN="center"
61
VALIGN="bottom"
62
></TD
63
><TD
64
WIDTH="10%"
65
ALIGN="right"
66
VALIGN="bottom"
67
><A
68
HREF="usbseth-init.html"
69
>Next</A
70
></TD
71
></TR
72
></TABLE
73
><HR
74
ALIGN="LEFT"
75
WIDTH="100%"></DIV
76
><H1
77
><A
78
NAME="USBSETH-INTRO"
79
>Introduction</A
80
></H1
81
><DIV
82
CLASS="REFNAMEDIV"
83
><A
84
NAME="AEN6"
85
></A
86
><H2
87
>Name</H2
88
>Introduction&nbsp;--&nbsp;eCos support for developing USB ethernet peripherals</DIV
89
><DIV
90
CLASS="REFSECT1"
91
><A
92
NAME="AEN9"
93
></A
94
><H2
95
>Introduction</H2
96
><P
97
>The eCos USB-ethernet package provides additional support for USB
98
peripherals that involve some sort of ethernet-style network. This can
99
be a traditional ethernet, or it can involve some other networking
100
technology that uses ethernet frames as a unit of transfer. It
101
provides functions to transfer ethernet frames over the USB bus,
102
handles certain control messages from the host, and optionally it can
103
provide a network device driver for use by the eCos TCP/IP stack.
104
The package comes with an example host-side device driver.</P
105
><P
106
>The USB-ethernet package is not tied to any specific hardware. It
107
requires the presence of USB hardware and a suitable device driver,
108
but not all USB peripherals involve ethernet communications. Hence the
109
configuration system cannot load the package automatically for
110
specific targets, in the way that a USB device driver or an ethernet
111
driver can be loaded automatically. Instead, the package has to be
112
added explicitly. When using the command line tools this will involve
113
an operation like the following:</P
114
><TABLE
115
BORDER="0"
116
BGCOLOR="#E0E0E0"
117
WIDTH="100%"
118
><TR
119
><TD
120
><PRE
121
CLASS="SCREEN"
122
>$ ecosconfig add usbs_eth</PRE
123
></TD
124
></TR
125
></TABLE
126
><P
127
>Typically, this will automatically cause the USB device driver to
128
become active. Loading the USB-ethernet package automatically provides
129
functionality for <A
130
HREF="usbseth-init.html"
131
>initialization</A
132
>,
133
<A
134
HREF="usbseth-data.html"
135
>data transfer</A
136
>, and the handling of
137
<A
138
HREF="usbseth-control.html"
139
>control messages</A
140
> and state
141
changes. If the current configuration includes the eCos TCP/IP stack
142
then the <A
143
HREF="usbseth-netdev.html"
144
>network device driver</A
145
>
146
support will be enabled as well by default, allowing the stack to
147
exchange ethernet frames over the USB bus.</P
148
><P
149
>There is a USB standard for a class of communication devices including
150
ethernet. The package does not implement this standard, due to
151
limitations in the hardware for which the package was first developed.
152
Instead, the package uses its own <A
153
HREF="usbseth-protocol.html"
154
>protocol</A
155
> between USB
156
<A
157
HREF="usbseth-host.html"
158
>host device driver</A
159
> and the
160
peripheral. </P
161
></DIV
162
><DIV
163
CLASS="REFSECT1"
164
><A
165
NAME="AEN22"
166
></A
167
><H2
168
>Usage Scenarios</H2
169
><P
170
>The USB-ethernet package can be used several different scenarios. In
171
a simple scenario, the peripheral serves only to connect the USB host
172
to a suitable network:</P
173
><DIV
174
CLASS="INFORMALFIGURE"
175
><A
176
NAME="AEN25"
177
></A
178
><P
179
></P
180
><DIV
181
CLASS="MEDIAOBJECT"
182
><P
183
><IMG
184
SRC="simple.gif"
185
></IMG
186
></P
187
></DIV
188
><P
189
></P
190
></DIV
191
><P
192
>After initialization, and once the USB connection between host and
193
peripheral has been established, higher-level code needs to detect
194
packets that are intended for the host, and to forward these. This can
195
be achieved by the low-level <TT
196
CLASS="FUNCTION"
197
>usbs_eth_start_tx</TT
198
>
199
function. Similarly, higher-level code needs to detect packets coming
200
from the host, using <TT
201
CLASS="FUNCTION"
202
>usbs_eth_start_rx</TT
203
>, and to
204
forward these using the real network. As far as the host is concerned
205
it is connected directly to the network. In this scenario there is no
206
confusion about addresses: there is a single MAC address for the
207
host/peripheral combination, corresponding to the connection to the
208
real network, and it is this address which should be supplied during
209
<A
210
HREF="usbseth-init.html"
211
>initialization</A
212
>.</P
213
><P
214
>In a more complicated scenario, there is a TCP/IP stack running inside
215
the peripheral.</P
216
><DIV
217
CLASS="INFORMALFIGURE"
218
><A
219
NAME="AEN36"
220
></A
221
><P
222
></P
223
><DIV
224
CLASS="MEDIAOBJECT"
225
><P
226
><IMG
227
SRC="tcpip.gif"
228
></IMG
229
></P
230
></DIV
231
><P
232
></P
233
></DIV
234
><P
235
>This involves the USB-ethernet package providing a service both to the
236
host and to the eCos TCP/IP stack. It achieves the latter by acting as
237
an eCos network device. Typically, the TCP/IP stack will be configured
238
to act as a network bridge. The USB peripheral needs to examine the
239
packets arriving over the real network. Some of these packets will be
240
intended for the host, while others will be intended for the
241
peripheral itself. To distinguish between these two scenarios, two
242
distinct MAC addresses are needed: one for the host, and one for the
243
peripheral. Similarly, packets sent by the host may have to be
244
forwarded via the real network, or they may be intended for the TCP/IP
245
stack inside the peripheral. Packets generated inside the peripheral's
246
TCP/IP stack may need to be sent via the real network or over the USB
247
bus. The network bridge software will have to take care of all these
248
possibilities. Unusually for a network bridge, one of the network
249
segments being bridged will only ever have one machine attached.</P
250
><P
251
>There are other possible usage scenarios. For example, the peripheral
252
might not be attached to a real network at all. Instead it could be
253
the USB host that acts as a network bridge, allowing a TCP/IP stack
254
inside the peripheral to communicate with the outside world. The
255
various details will depend on the exact type of peripheral being
256
developed. </P
257
></DIV
258
><DIV
259
CLASS="NAVFOOTER"
260
><HR
261
ALIGN="LEFT"
262
WIDTH="100%"><TABLE
263
WIDTH="100%"
264
BORDER="0"
265
CELLPADDING="0"
266
CELLSPACING="0"
267
><TR
268
><TD
269
WIDTH="33%"
270
ALIGN="left"
271
VALIGN="top"
272
><A
273
HREF="io-usb-slave-eth.html"
274
>Prev</A
275
></TD
276
><TD
277
WIDTH="34%"
278
ALIGN="center"
279
VALIGN="top"
280
><A
281
HREF="io-usb-slave-eth.html"
282
>Home</A
283
></TD
284
><TD
285
WIDTH="33%"
286
ALIGN="right"
287
VALIGN="top"
288
><A
289
HREF="usbseth-init.html"
290
>Next</A
291
></TD
292
></TR
293
><TR
294
><TD
295
WIDTH="33%"
296
ALIGN="left"
297
VALIGN="top"
298
>eCos Support for Developing USB-ethernet Peripherals</TD
299
><TD
300
WIDTH="34%"
301
ALIGN="center"
302
VALIGN="top"
303
>&nbsp;</TD
304
><TD
305
WIDTH="33%"
306
ALIGN="right"
307
VALIGN="top"
308
>Initializing the USB-ethernet Package</TD
309
></TR
310
></TABLE
311
></DIV
312
></BODY
313
></HTML
314
>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.