device_openopens the device name and returns a port to it in device. The open count for the device is incremented by one. If the open count was 0, the open handler for the device is invoked.
master_port must hold the master device port. name specifies the device to open, and is a string up to 128 characters long. mode is the open mode. It is a bitwise-or of the following constants:
- Request read access for the device.
- Request write access for the device.
- Do not delay an open.
The function returns
D_SUCCESSif the device was successfully opened,
D_INVALID_OPERATIONif master_port is not the master device port,
D_WOULD_BLOCKis the device is busy and
D_NOWAITwas specified in mode,
D_ALREADY_OPENif the device is already open in an incompatible mode and
D_NO_SUCH_DEVICEif name does not denote a know device.
This is the asynchronous form of the
device_open_requestperforms the open request. The meaning for the parameters is as in
device_open. Additionally, the caller has to supply a reply port to which the
ds_device_open_replymessage is sent by the kernel when the open has been performed. The return value of the open operation is stored in return_code.
As neither function receives a reply message, only message transmission errors apply. If no error occurs,