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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [html/] [ref/] [usbseth-intro.html] - Blame information for rev 706

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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