DLintr(3dlpi) DLintr(3dlpi)
NAME
DLintr - process interrupts
SYNOPSIS
DLintr(int level)
Parameters
level interrupt level
DESCRIPTION
Routine used to process the interrupts. In addition to any
adapter specific processing associated with handling
interrupts, this routine should minimally perform the
following functions:
If an interrupt indicates an incoming packet:
Allocate a STREAMS message based on the size of the
packet.
If unsuccessful:
1 Discard the packet.
2 Increment ifInDiscards.
3 Increment etherRcvResources.
else
1 Copy the entire packet to the STREAMS
message.
2 Increment the ifInOctets field by the size
of the packet.
3 Call the DLrecv function with the
appropriate arguments to parse and process
the packet.
4 Update any board specific statistics.
If an interrupt indicates successful transmission of a packet:
Copyright 1994 Novell, Inc. Page 1
DLintr(3dlpi) DLintr(3dlpi)
Reset the TX_BUSY flag if resources are freed up.
If packets are queued up on internal (non STREAMS
queues)
1 Retrieve a packet.
2 Call DLxmit_packet with appropriate arguments to
send out the packets.
If packets are available on STREAMS queues (TX_QUEUED
bit of the flag field is turned on)
1 Retrieve the packet using getq.
2 Decrement ifOutQlen.
3 Call DLxmit_packet with appropriate arguments to
send out the packets.
The flag field of the board configuration structure serves as
a semaphore between the DLunitdata_req,DLxmit_packet and the
DLintr routines. Following is a summary of the interaction
between the functions.
DLunitdata_req will check the TX_BUSY bit before it tries to
hand over the packet to the DLxmit_packet routine. A busy
condition will force it to enqueue the packets on the write
side queue of the stream controlling the SAP. In addition,
the TX_QUEUED bit is turned on. On the other hand if the
TX_BUSY bit is turned off, the packet is directly handed over
to the DLxmit_packet routine for transmission.
The DLxmit_packet routine will turn on the TX_BUSY bit if it
runs out of resources needed to process transmission requests.
The DLintr routine should reset the TX_BUSY bit if resources
become available following successful transmission of packets.
Drivers are often implemented with internal (non STREAMS)
queues and messages in addition to STREAMS queues and
messages. Since a write side service procedure is not
available, it is the responsibility of the DLintr routines to
retrieve enqueued and ready packets not only from internal
queues but also from the STREAMS queues that control every
SAP. A common technique involves implementing a round-robin
scheduling mechanism to dequeue packets from the STREAMS
Copyright 1994 Novell, Inc. Page 2
DLintr(3dlpi) DLintr(3dlpi)
queue. This provides a certain degree of fairness if multiple
protocol stacks have simultaneous access to the Ethernet
driver.
Layer
Hardware Dependent.
Copyright 1994 Novell, Inc. Page 3