fp_open Kernel Service for Data Link Control (DLC) Devices

Purpose

Allows kernel to open the generic data link control (GDLC) device manager by its device name.

Syntax

#include <sys/gdlextcb.h>
#include <fcntl.h>
fp_open (path, oflags, cmode, ext, segflag, fpp)

Parameters

Item Description
path Consists of a character string containing the /dev special file name of the GDLC device manager, with the name of the communications device handler appended. The format is shown in the following example:
/dev/dlcether/ent0
oflags Specifies a value to set the file status flag. The GDLC device manager ignores all but the following values:
O_RDWR
Open for reading and writing. This must be set for GDLC or the open will not be successful.
O_NDELAY, O_NONBLOCK
Subsequent writes return immediately if no resources are available. The calling process is not put to sleep.
cmode Specifies the O_CREAT mode parameter. This is ignored by GDLC.
ext Specifies the extended kernel service parameter. This is a pointer to the dlc_open_ext extended I/O structure for open subroutines. The argument for this parameter must be in the kernel space. "open Subroutine Extended Parameters for DLC"AIX® Version 7.1 Technical Reference: Communications, Volume 1provides more information on the extension parameter.
segflag Specifies the segment flag indicating where the path parameter is located:
FP_SYS
The path parameter is stored in kernel memory.
FP_USR
The path parameter is stored in application memory.
fpp Specifies the returned file pointer. This parameter is passed by reference and updated by the file I/O subsystem to be the file pointer for this open subroutine.

Description

The fp_open kernel service allows the kernel user to open a GDLC device manager by specifying the special file names of both the DLC and the communications device handler. Since the GDLC device manager is multiplexed, more than one process can open it (or the same process multiple times) and still have unique channel identifications.

Each open carries the communications device handler's special file name so that the DLC knows which port to transfer data on.

The kernel user must also provide functional entry addresses in order to obtain receive data and exception conditions. Each GDLC supports the fp_open kernel service via its dlcopen entry point. The fp_open kernel service may be called from the process environment only. "Using GDLC Special Kernel Services" in AIX Version 6.1 Communications Programming Concepts provides additional information.

Return Values

Upon successful completion, this service returns a value of 0 and a valid file pointer in the fpp parameter.

Item Description
ECHILD Indicates that the service 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.
EFAULT Indicates that the kernel service, such as the copyin or initp service, has failed.

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