Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(ARM).Porting TCP-IP programmer's guide.Ver 1.6.pdf
Скачиваний:
43
Добавлен:
23.08.2013
Размер:
2.64 Mб
Скачать

Sample Applications

C.4 Descriptions of the examples

The following sections contain detailed descriptions of each sample application. The demonstration projects shipped with the sources are:

chargen A simple server application.

maildemo An implementation of a simple SMTP client that sends an email message.

menus An interactive menus system that is useful for debugging during porting.

C.4.1 chargen

The chargen project provides a simple demonstration of how to implement a server. The chargen server listens for connections on TCP port 19. When a connection is established, chargen continuously sends lines of test data (a swirling printer test pattern, with line numbers).

When the connection is closed, the chargen server returns to waiting for connections.

C.4.2 maildemo

The maildemo project demonstrates how to write a simple client program. The client:

connects to the SMTP port (TCP port 25) of a known mail server

exchanges some messages with the sendmail that is listening on that port

sends an email message to a preconfigured destination.

To configure the mail server IP address and the To: and From: addresses of the email message, modify the values defined near the top of \maildemo\main.c before you build the project.

C.4.3 menus

The menus project is intended as a debugging aid during porting. It presents a menu of options that allow you to exercise different sections of the stack in a controlled manner.

The menus project cannot be used with the debug console because menus relies on being able to poll the keyboard for data and RDI does not support this operation. To work around this limitation, the UART driver is used as a debug interface by including ttyio.c and uart.c in the project, and by configuring ipport.h to map the print functions onto those implemented as functions in ttyio.c and uart.c.

ARM DUI 0144B

Copyright © 1998-2001 ARM Limited. All rights reserved.

C5

Sample Applications

C6

Copyright © 1998-2001 ARM Limited. All rights reserved.

ARM DUI 0144B

Appendix D

The i8255x Ethernet Driver

This appendix describes the i8255x Ethernet Driver for the ARM Network Protocol Suite. It contains the following sections:

About the i8255x driver on page D-2

Build options on page D-4

Porting the i8255x driver on page D-6.

ARM DUI 0144B

Copyright © 1998-2001 ARM Limited. All rights reserved.

D-1

The i8255x Ethernet Driver

D.1 About the i8255x driver

The Intel 10/100 Mbit Ethernet Family is a common, embeddable, PCI Ethernet chip set, that is also used in the Intel PRO/100+ series of PCI Ethernet cards. The range includes the 82557, 82558, and 82559 controllers, that can be coupled with various PHY parts.

The ARM i8255x driver interfaces between any of these controllers and the ARM Network Protocol Suite. It was developed on the Integrator/AP development platform, using several different 8255x cards, version 1.1 of the Intel 8255x documentation, and the ARM Firmware Suite, version 1.1.

It is intended to be easily portable to target hardware.

This section describes particular features of the i8255x driver.

Compatibility

The i8255x driver uses none of the additional features of the

 

i82558 and i82559 controllers, and is therefore compatible with

 

the whole range.

PCI bus

The PCI Library from the ARM Firmware Suite is used to find all

 

the i8255x devices on the Integrator PCI bus. Multiple devices are

 

allowed, and each device is mapped to a separate interface in the

 

TCP/IP stack.

Note

Early builds of the FPGAs on the Integrator had problems that affected the PCI bus. Ensure that up-to-date versions are used.

Memory structure

Both receive and transmit are performed in flexible mode, meaning that the descriptors for the frames are separate from the descriptors for the data buffers. There is one data buffer for each frame.

Contrary to the documentation for the controllers, the end-of-list bits are not set in either the frame descriptors or the buffer descriptors. Rather, the descriptors are linked together as a circular FIFO, and the device never enters a No Resources condition. If there are no free descriptors, frames are simply discarded.

Missing features

No power-management features are implemented, TCO functionality is not used, and there is no support for the Intel Adaptive Technology. The checksum offload feature of the 82559 is not used.

D-2

Copyright © 1998-2001 ARM Limited. All rights reserved.

ARM DUI 0144B

The i8255x Ethernet Driver

Other features

The Intel-suggested workaround for a receiver lock-up problem with some controllers is implemented. This requires a call-back every second from the timer tick handler. This also updates the statistics.

There is a function to put a particular device into promiscuous mode, but this is not currently used.

ARM DUI 0144B

Copyright © 1998-2001 ARM Limited. All rights reserved.

D-3