| |||
| Home > Angel > The Fusion IP stack for Angel > How Angel, Fusion, and the PID hardware fit together | |||
The Ethernet interface for the PID card is provided by an Olicom EtherCom PCMCIA Ethernet card installed in either PCMCIA slot. The Olicom card uses an Intel i82595 Ethernet controller.
The UDP/IP stack is the Pacific Softworks Fusion product, ported to ARM and the Angel environment. The drivers for PCMCIA and the Ethernet card have been implemented, as has the Angel device driver to make the whole stack appear as an Angel device. Figure 13.14 shows how the components fit together.
The stack is initialized in the following sequence:
devclnt.c:angel_InitialiseDevices() calls ethernet.c:ethernet_init()to
open a socket.
fusion:socket() notices
that the fusion stack has not been initialized. Fusion stack initialization
calls:
olicom.c:olicom_init() calls:
pcmcia.c:pcmcia_setup() detects
Olicom card and calls:
olicom.c:olicom_card_handler() with
a card insertion event and then:
olicom.c:read_card_params() to
register olicom_isr() with pcmcia.c.
Fusion stack initialization calls:
olicom.c:olicom_updown() and,
through olicom_state():
82595.c:i595_bringup() to
complete the initialization sequence.
After initialization, the Angel side of the driver is implemented
as a polling device. At every call to Angel_Yield(), angel_EthernetPoll() is
invoked, and non-blocking recv() calls are
made to the Fusion stack to see if data is waiting on any of the
sockets.
Outgoing packets are passed to the Fusion stack in a single
step by calling sendto().
The bottom of the Fusion stack is driven by interrupts from the Olicom card. Interrupts are handled in the following sequence:
suppasm.s:angel_DeviceInterruptHandler() calls
the GETSOURCE macro in pid/target.s to
identify the PCMCIA controller as the source.
pcmcia.c:angel_PCMCIAIntHandler() establishes
that it is an I/O interrupt and calls the routine registered during
initialization.
olicom.c:olicom_isr() checks
the interrupt, switches off interrupts from the Olicom card, and
serializes olicom_process() to do the processing
with all other interrupts enabled.
olicom.c:olicom_process() identifies
the reason for the interrupt and passes it as an event to olicom_state().
olicom.c:olicom_state() calls
an appropriate routine in 82595.c to handle
packet reception and transmission.
82595.c routines control the
i82595 chip and transfer packets in both directions between Fusion
buffers and the chip. Calls are made to Fusion functions as appropriate.
olicom.c:olicom_process() checks
to see whether all interrupt events have been serviced. If so, Olicom
interrupts are re-enabled. If not, olicom_process() re-queues
itself and then exits in case another device is waiting for the
serializer lock.
Additionally, the Fusion stack can make calls to olicom_start() (to
queue a new packet for transmission), olicom_ioctl(),
and olicom_updown() in response to socket calls
from the Angel Ethernet driver or as a result of packet processing.