Chapter 4. Attaching Network Interfaces

If you wish to use the network interface facilities of the driver, then you need to attach a network device to each channel that is present and in use. In addition to use the SyncPPP and Cisco HDLC you need to follow some additional plumbing rules. They may seem complex but a look at the example hostess_sv11 driver should reassure you.

The network device used for each channel should be pointed to by the netdevice field of each channel. The dev-> priv field of the network device points to your private data - you will need to be able to find your ppp device from this. In addition to use the sync ppp layer the private data must start with a void * pointer to the syncppp structures.

The way most drivers approach this paticular problem is to create a structure holding the Z8530 device definition and put that and the syncppp pointer into the private field of the network device. The network device fields of the channels then point back to the network devices. The ppp_device can also be put in the private structure conveniently.

If you wish to use the synchronous ppp then you need to attach the syncppp layer to the network device. You should do this before you register the network device. The sppp_attach requires that the first void * pointer in your private data is pointing to an empty struct ppp_device. The function fills in the initial data for the ppp/hdlc layer.

Before you register your network device you will also need to provide suitable handlers for most of the network device callbacks. See the network device documentation for more details on this.