Index Index for
Section 9
Index Alphabetical
listing for D
Bottom of page Bottom of
page

devsw_del(9r)

NAME

devsw_del - General: Clears entry points from the device switch table

SYNOPSIS

#include <sys/conf.h> int devsw_del( char *driver_name, int driver_reg_instance );

ARGUMENTS

driver_name Specifies a null-terminated string that represents the name of the device driver whose I/O services interfaces you want to clear from the device switch table. You specified this name in a previous call to the devsw_add interface. The driver name must be at least two characters in length not to exceed DEVSW_NAME_LEN characters, including the null terminator. This name is a string that matches the string you specified for the entry_name item in the /etc/sysconfigtab database. Typically, third-party driver writers specify the driver name (followed by a colon) in the sysconfigtab file fragment, which gets appended to the /etc/sysconfigtab database during the driver product installation. driver_reg_instance Specifies an integer that represents a specific reservation instance for this driver. This argument allows a driver to uniquely identify multiple major numbers for the driver. This is the integer you passed to the driver_reg_instance argument in a previous call to the devsw_add interface.

DESCRIPTION

The devsw_del interface clears a device driver's I/O services interfaces (and other information) from the device switch table. The interface continues to reserve the major number associated with the device driver. The devsw_del interface performs appropriate checks on the value passed to the driver_name argument.

NOTES

A device driver calls devsw_del to remove access to its associated I/O services interfaces but retain use of its reserved major number. For example, a device driver about to be unloaded might want to call devsw_del.

EXAMPLE

See Writing Device Drivers: Tutorial for a code example of the devsw_del interface.

RETURN VALUES

Upon successful completion, the devsw_del interface returns the major number associated with the device driver whose I/O services interfaces were cleared from the device switch table. Otherwise, on an error, the devsw_del interface returns the value -1. The following list describes possible error conditions: · The devsw_del interface is not available to be called at this point in the driver. · The name you passed to the driver_name argument is not a valid name. · There is no device switch entry associated with this driver.

SEE ALSO

Kernel Interfaces: devsw_add(9r), devsw_get(9r) Data Structures: dsent(9s)

Index Index for
Section 9
Index Alphabetical
listing for D
Top of page Top of
page