Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking /
Chapter 11 - Ethernet, Token Ring, and Fiber Distributed Data Interface / Using Ethernet, Token Ring, and FDDI Drivers


Using the FDDI Driver

You can write an application implementing a protocol other than AppleTalk that processes 802.2 packets and that sends and receives data over a Fiber Distributed Data Interface (FDDI) network. To do this, you read data from and write it to the FDDI driver defined by Apple. Your application can run on a node that is also running AppleTalk.

To write data to the FDDI driver and to perform other functions such as adding a multicast address for the FDDI hardware, you use the Ethernet functions described earlier in this chapter. To receive 802.2 packets from the FDDI driver, you attach your protocol handler to the LAP Manager using the interface to the LAP Manager.

The Apple FDDI driver implementation support allows for the attachment of only one protocol handler. The Apple FDDI driver specification requires that an FDDI driver handle 802.2 packets to service access points (SAP) other than SAP $AA.

Although it is possible to attach your own protocol handler at the hardware device driver level, Apple Computer, Inc. recommends that you not do this because it excludes AppleTalk from using the FDDI driver. So that more than one protocol can receive packets from the FDDI driver concurrently, Apple recommends that you attach your protocol handler to the LAP Manager. The LAP Manager attaches its own protocol handler to the FDDI driver, and when it receives a packet for your protocol, the LAP Manager calls your protocol handler. When it receives a packet for another protocol, such as AppleTalk, the LAP Manager calls that application's protocol handler.

For a description of how to attach and detach your protocol handler for FDDI, see the chapter "Link-Access Protocol (LAP) Manager" included in this book and the discussion of token ring and FDDI in "About Ethernet, Token Ring, and FDDI Support" beginning on page 11-3 in this chapter. The chapter "Link-Access Protocol (LAP) Manager" also explains the concept and use of the SAP field value for 802.2 Type 1 packets.

Applying Ethernet Functions

The Apple FDDI driver implements many but not all of the functions that the Apple Ethernet driver implements.

For those Ethernet functions that do apply to FDDI, you use the function for FDDI in the same way that you do for Ethernet: you pass parameters in a parameter block and you use the Ethernet control code in the csCode field to call the function. The only difference is that instead of specifying the Ethernet driver reference number in the parameter block's ioRefNum field, you specify the FDDI driver reference number. Here are the Ethernet functions that apply to FDDI:

Here are the Ethernet functions that do not apply to FDDI:

There are some other differences between Ethernet and FDDI:

Note
Although you can use the EAttachPH function to attach a protocol handler to the FDDI driver and the EDetachPH function to remove
one, Apple recommends that you not use these functions. Instead,
you should use the LAP Manager's L802Attach and L802Detach routines.

Sending and Receiving Data

The tasks involved in sending data to and receiving it from an FDDI driver are similar to those that you use for Ethernet. The primary difference is that you use the LAP Manager to attach your protocol handler. Any vendor implementing an FDDI driver to run on a Macintosh computer must follow rules that direct them to return packet information in the same manner as does the Ethernet driver for 802.2 packets. From the perspective of an application that uses the FDDI driver, this means that when the LAP Manager calls your protocol handler, you can expect the FDDI hardware addresses that you reference from register A3 to follow the same format that is used for Ethernet addresses, regardless of how the FDDI address might appear in the packet. The chapter "Link-Access Protocol (LAP) Manager" in this book explains this in detail.

Here are the steps that you follow to send data to and receive it from an FDDI driver:

  1. Locate the FDDI cards that are installed in the system. Use the Slot Manager to identify installed FDDI cards. Use the SGetTypeSRsrc function described in the Slot Manager chapter of Inside Macintosh: Devices to determine which NuBus slots contain FDDI cards. To find FDDI cards, use the value catNetwork (0x4) in the spCategory field and the value typeFDDI (0x11) in the spCType field. You should provide a user interface that allows the user to select a specific FDDI card in the case that more than one is present.
  2. Use the OpenSlot function to open the FDDI driver. Set the ioNamePtr field to .FDDI. If you did not locate any NuBus FDDI cards in step 1, you should also attempt to open the .FDDI0 driver in case non-NuBus FDDI hardware is attached to the system. Use the Device Manager's OpenDriver function to open the .FDDI0 driver. (For information on the OpenSlot and OpenDriver functions, see the chapter "Device Manager" in Inside Macintosh: Devices.)

    Note that this section refers to the .FDDI driver shell, which facilitates multivendor support, as the .FDDI driver. Opening the .FDDI driver shell, which loads and opens the card's driver, is effectively the same as directly opening the FDDI driver.

  3. If your application requires a multicast address, use the EAddMulti function to register a multicast address. (For information on multicast addresses, see Inside AppleTalk, second edition. For a description of multicast addresses, see "About Multicast Addressing" on page 11-7.)
  4. Use the LAP Manager's L802Attach routine to install your protocol handler. (See the chapter "Link-Access Protocol [LAP] Manager" in this book for more information.)
  5. Use the EWrite function to send packets to the FDDI driver for transmission across the network. To use the EWrite function, you provide a pointer to a write-data structure. The first buffer in the write-data structure must be at least 14 bytes long: the first 6 bytes of that buffer must contain the destination address. Bytes 13 and 14 must contain the packet length, which must not exceed 1500 bytes. The FDDI driver fills in bytes 7-12 with the source address. (For more information on the write-data structure, see "Using a Write-Data Structure to Transmit Ethernet Data" on page 11-10.)
  6. When you are finished using the FDDI driver, use the LAP Manager's L802Detach routine to remove your protocol handler.
  7. When you are finished using a multicast address, use the EDelMulti function to remove it.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996