[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Communications, Volume 1

dlcopen Entry Point of the GDLC Device Manager

Purpose

Opens a generic data link control (GDLC) channel.

Syntax

#include <sys/device.h>
#include <sys/gdlextcb.h>


int dlcopen ( devno, devflag, chan, ext)

Note
The dlc prefix is replaced with the three-digit prefix for the specific GDLC device manager being opened.

Description

The dlcopen entry point is called when a user's application program invokes the open or openx subroutine, or when a kernel user calls the fp_open kernel service. The GDLC device manager opens the specified communications device handler and creates a kernel process to catch posted events from that port. Additional opens to the same port share both the device handler open and the GDLC kernel process created on the original open.

Each GDLC supports the dlcopen entry point as its switch table entry for the open and openx subroutines. The file system calls this entry point from the process environment only.

Note
It may be more advantageous to handle the actual device handler open and kernel process creation in the dlcmpx routine. This is left as a specific DLC's option.

Parameters

devno Indicates major and minor device numbers. This is a dev_t device number that specifies both the major and minor device numbers of the GDLC device manager. One dev_t device number exists for each type of GDLC, such as Ethernet, Token-Ring, or SDLC.
devflag Specifies the flag word with the following flags defined:
DKERNEL
Entry point called by kernel routine using the fp_open kernel service. All command extensions and ioctl arguments are in kernel space.
DREAD
Open for reading. This flag is ignored.
DWRITE
Open for writing. This flag is ignored.
DAPPEND
Open for appending. This flag is ignored.
DNDELAY
Device open in nonblocking mode. This flag is ignored.
chan Specifies the channel ID assigned by GDLC in the dlcmpx routine.
ext Specifies the extended subroutine parameter. This is a pointer to the dlc_open_ext extended I/O structure for the open subroutine.

Return Values

The following return values are defined in the /usr/include/sys/errno.h file.

Value Description
0 Indicates a successful operation.
ECHILD Indicates that the device manager cannot create a kernel process.
EINVAL Indicates an invalid value.
ENODEV Indicates that no such device handler is present.
ENOMEM Indicates insufficient resources to satisfy the open subroutine.
EFAULT Indicates that a kernel service, such as the copyin or initp kernel service was unsuccessful.

Related Information

The open or openx subroutine.

The ddopen device entry point.

The dlcclose entry point of the GDLC device manager, dlcmpx entry point of the GDLC device manager.

The fp_open kernel service, copyin kernel service, initp kernel service.

Generic Data Link Control (GDLC) Environment Overview in AIX 5L Version 5.2 Communications Programming Concepts.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]