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

Subversion Repositories openrisc_me

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

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
>Communication Protocol</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="Example Host-side Device Driver"
26
HREF="usbseth-host.html"><LINK
27
REL="NEXT"
28
TITLE="eCos Synthetic Target"
29
HREF="hal-synth-arch.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="usbseth-host.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="hal-synth-arch.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-PROTOCOL">Communication Protocol</H1
83
><DIV
84
CLASS="REFNAMEDIV"
85
><A
86
NAME="AEN17632"
87
></A
88
><H2
89
>Name</H2
90
>Communication Protocol&nbsp;--&nbsp;Protocol used between the host-side device driver and the eCos
91
USB-ethernet package </DIV
92
><DIV
93
CLASS="REFSECT1"
94
><A
95
NAME="AEN17635"
96
></A
97
><H2
98
>Description</H2
99
><P
100
>There is a USB standard for the protocol to be used between the host
101
and a class of communication devices, including ethernet. However, the
102
eCos USB-ethernet package does not implement this protocol: the target
103
hardware for which the package was first developed had certain
104
limitations, and could not implement the standard. Instead, the package
105
implements a simple new protocol.</P
106
><P
107
>A USB-ethernet peripheral involves bulk transfers on two endpoints:
108
one endpoint will be used for packets from host to peripheral and the
109
other will be used for the opposite direction. Transfers in both
110
directions are variable length, with a lower limit of 16 bytes and an
111
upper limit of 1516 bytes. The first two bytes of each transfer
112
constitute a header specific to USB-ethernet. The next 14 bytes form
113
the normal header for an ethernet frame: destination MAC address,
114
source MAC address, and a protocol field. The remaining data, up to
115
1500 bytes, are the payload. The first two bytes give the size of the
116
ethernet frame, least significant byte first, with a value between 14
117
and 1514.</P
118
><P
119
>For example an ARP request from host to peripheral involves an
120
ethernet frame of 42 bytes (0x002A), with the usual 14-byte header and
121
a 28-byte payload. The destination is the broadcast address
122
0xFFFFFFFFFFFF. The source depends on the MAC address specified for
123
the host in the call to <A
124
HREF="usbseth-init.html"
125
><TT
126
CLASS="FUNCTION"
127
>usbs_eth_init</TT
128
></A
129
>, e.g.
130
0x405D90A9BC02. The remaining data is as specified by the appropriate
131
<A
132
HREF="http://www.ietf.org"
133
TARGET="_top"
134
>IETF RFC's</A
135
>. The actual bulk
136
USB transfer involves the following sequence of 44 bytes:</P
137
><TABLE
138
BORDER="5"
139
BGCOLOR="#E0E0F0"
140
WIDTH="70%"
141
><TR
142
><TD
143
><PRE
144
CLASS="SCREEN"
145
>2a 00 ff ff ff ff ff ff 40 5d 90 a9 bc 02 08 06
146
00 01 08 00 06 04 00 01 40 5d 90 a9 bc 02 0a 00
147
00 01 00 00 00 00 00 00 0a 00 00 02</PRE
148
></TD
149
></TR
150
></TABLE
151
><P
152
>In addition there are two control messages. These will be sent by the
153
host to endpoint 0, the control endpoint, and by default they will
154
be handled by <A
155
HREF="usbseth-control.html"
156
><TT
157
CLASS="FUNCTION"
158
>usbs_eth_class_control_handler</TT
159
></A
160
>. If class-specific
161
control messages are intercepted by other code then it is the
162
responsibility of that code to invoke the USB-ethernet handler when
163
appropriate.</P
164
><P
165
>The first control message can be used by the host to obtain a MAC
166
address:</P
167
><TABLE
168
BORDER="5"
169
BGCOLOR="#E0E0F0"
170
WIDTH="70%"
171
><TR
172
><TD
173
><PRE
174
CLASS="PROGRAMLISTING"
175
>#define ECOS_USBETH_CONTROL_GET_MAC_ADDRESS         0x01</PRE
176
></TD
177
></TR
178
></TABLE
179
><P
180
>The control message's type field should specify IN as the direction.
181
The request field should be <TT
182
CLASS="LITERAL"
183
>0x01</TT
184
>. The length fields
185
should specify a size of 6 bytes. The remaining fields of the control
186
message will be ignored by the USB-ethernet package. The response
187
consists of the 6-byte MAC address supplied by the initialization call
188
<A
189
HREF="usbseth-init.html"
190
><TT
191
CLASS="FUNCTION"
192
>usbs_eth_init</TT
193
></A
194
>.</P
195
><P
196
>The second control message can be used by the host to enable or
197
disable promiscuous mode.</P
198
><TABLE
199
BORDER="5"
200
BGCOLOR="#E0E0F0"
201
WIDTH="70%"
202
><TR
203
><TD
204
><PRE
205
CLASS="PROGRAMLISTING"
206
>#define ECOS_USBETH_CONTROL_SET_PROMISCUOUS_MODE    0x02</PRE
207
></TD
208
></TR
209
></TABLE
210
><P
211
>This control message involves no further data so the length field
212
should be set to 0. The value field should be non-zero to enable
213
promiscuous mode, zero to disable it. The request field should be
214
<TT
215
CLASS="LITERAL"
216
>0x02</TT
217
>. The remaining fields in the control message
218
will be ignored. It is the responsibility of the host-side device
219
driver to keep track of whether or not promiscuous mode is currently
220
enabled. It will be disabled when the peripheral changes to
221
Configured state, typically at the point where the host-side device
222
driver has been activated.</P
223
></DIV
224
><DIV
225
CLASS="NAVFOOTER"
226
><HR
227
ALIGN="LEFT"
228
WIDTH="100%"><TABLE
229
SUMMARY="Footer navigation table"
230
WIDTH="100%"
231
BORDER="0"
232
CELLPADDING="0"
233
CELLSPACING="0"
234
><TR
235
><TD
236
WIDTH="33%"
237
ALIGN="left"
238
VALIGN="top"
239
><A
240
HREF="usbseth-host.html"
241
ACCESSKEY="P"
242
>Prev</A
243
></TD
244
><TD
245
WIDTH="34%"
246
ALIGN="center"
247
VALIGN="top"
248
><A
249
HREF="ecos-ref.html"
250
ACCESSKEY="H"
251
>Home</A
252
></TD
253
><TD
254
WIDTH="33%"
255
ALIGN="right"
256
VALIGN="top"
257
><A
258
HREF="hal-synth-arch.html"
259
ACCESSKEY="N"
260
>Next</A
261
></TD
262
></TR
263
><TR
264
><TD
265
WIDTH="33%"
266
ALIGN="left"
267
VALIGN="top"
268
>Example Host-side Device Driver</TD
269
><TD
270
WIDTH="34%"
271
ALIGN="center"
272
VALIGN="top"
273
><A
274
HREF="io-usb-slave-eth.html"
275
ACCESSKEY="U"
276
>Up</A
277
></TD
278
><TD
279
WIDTH="33%"
280
ALIGN="right"
281
VALIGN="top"
282
>eCos Synthetic Target</TD
283
></TR
284
></TABLE
285
></DIV
286
></BODY
287
></HTML
288
>

powered by: WebSVN 2.1.0

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