DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5 and SCO OpenServer

Intro(D3mdi)


Intro -- MDI callable functions

Synopsis

   #include <sys/types.h>
   #include <sys/stream.h>
   #include <sys/stropt.h>
   #include <sys/mdi.h>
   #include <sys/ddi.h>

Description

This section describes the kernel functions available for use in MDI device drivers. These functions supplement the DDI functions that are documented in Section D3 manual pages in Section D3 manual pages and the STREAMS functions that are documented in Section D3str manual pages in Section D3str manual pages.

The MDI functions can be grouped as follows:


General purpose functions

mdi_htons(D3mdi)
Changes the byte-ordering of the argument from host ordering (Intel ordering is little-endian) to network ordering (big-endian).

mdi_ntohs(D3mdi)
Changes the byte-ordering of the argument from network ordering (big-endian) to host ordering (Intel ordering is little-endian).

mdi_addrs_equal(D3mdi)
Compares the two MAC addresses and returns 1 if they are equal, 0 otherwise.

mdi_do_loopback(D3mdi)
Loop back convenience routine. Loops the message back to the next module's read queue, if it is not blocked by flow control.

mdi_get_unit(D3mdi)
Determine if device has been configured.

mdi_macokack(D3mdi)
Allocates, fills in, and sends a MAC_OK_ACK message.

mdi_macerrorack(D3mdi)
Allocates, fills in, and sends a MAC_ERROR_ACK message.

mdi_printcfg(D3mdi)
Print configuration information for MDI drivers.

Multicast related functions

mdi_valid_mca(D3mdi)
Verify that the multicast address has been set for this adapter.

mdi_get_mctable(D3mdi)
Retrieve multicast address state information.

MP-aware locking functions

mdi_tx_if_init(D3mdi)
Initialize an MP-aware lock structure, called from a driver's _load(D2mdi) entry point routine.

mdi_tx_if_enable(D3mdi)
Enable an MP-aware lock structure, called from a driver's open(D2mdi) entry point routine.

mdi_tx_if(D3mdi)
Flush the driver's write queue, using an MP-aware lock structure. Called from a driver's uwput(D2mdi), srv(D2str), and intr(D2mdi) routines to service the driver's write queue, and, for the uwput( ) routine, to issue a new transmit request to the adapter.

mdi_tx_if_disable(D3mdi)
Disable an MP-aware lock structure, called from a driver's close(D2mdi) entry point routine.

mdi_tx_if_deinit(D3mdi)
Deinitialize an MP-aware lock structure, called from a driver's _unload(D2mdi) entry point routine.

File access to download code or message catalogs

mdi_open_file(D3mdi)
Open file for reading.

mdi_read_file(D3mdi)
Read file.

mdi_close_file(D3mdi)
Close file.

ISA autodetection support

mdi_AT_verify(D3mdi)
Set autodetection parameters for an ISA driver.


NOTE: All functions that operate on MAC addresses depend upon the MAC address size being 6 bytes. Therefore, it is not appropriate to use these functions if the MAC address size for your network media is not 6 bytes.

Usage

Beginning with MDI version 2.1, all MDI drivers must include a version-identifying line at the top of the source code, before the #include lines. For MDI version 2.1, this line is:
   #define _MDI=21
This definition can instead be given as an argument to the -D option of the cc command when the driver is compiled:
   cc -d_MDI=20
This definition is optional for MDI drivers prior to MDI version 2.1.

References

Section D3 manual pages in Section D3 manual pages, Section D3str manual pages in Section D3str manual pages

``MDI driver structure'' in Developing MDI network adapter drivers,
``MAC addresses'' in HDK Technical Reference

``DDI interface versioning'' in HDK Technical Reference
``Context of a driver'' in HDK Technical Reference


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005