
PCI CD and PCI CDa
Document Number: 008-00965-06 EDT Public Revision: I December 2004
Template: edt.dot
Page 19
edt_parse_unit
Description
Parses an EDT device name string. Fills in the name of the device, with the default_device if specified,
or a default determined by the package, and returns a unit number. Designed to facilitate a flexible
device/unit command line argument scheme for application programs. Most EDT example/utility
programs use this susubroutine to allow users to specify either a unit number alone or a device/unit
number concatenation.
For example, if you are using a PCI CD, then either xtest -u 0 or xtest -u pcd0 could both be used, since
xtest sends the argument to edt_parse_unit, and the subroutine parses the string to returns the device
and unit number separately.
Syntax
int edt_parse_unit(char *str, char *dev, char *default_dev)
Arguments
str
device name string. Should be either a unit number (“0” - “8”) or device/unit
concantenation (“pcd0,” “pcd1,” etc.)
dev
device string, filled in by the routine. For example, “pcd.”
default_dev
device name to use if none is given in the str argument. If NULL, will be filled in
by the default device for the package in use. For example, if the code base is from a
PCI CD package, the default_dev will be set to “pcd.”
Return
Unit number or -1 on error. The first device is unit 0.
See Also
example/utility programs xtest.c, initcam.c, take.c
edt_read
Description
Performs a read on the EDT Product. For those on UNIX systems, the UNIX 2 GB file offset bug is
avoided during large amounts of input or output, that is, reading past 231 bytes does not fail. This call
is not multibuffering, and no transfer is active when it completes.
Syntax
#include "edtinc.h"
int edt_read(EdtDev *edt_p, void *buf, int size);
Arguments
edt_p
device handle returned from edt_open or edt_open_channel
buf
address of buffer to read into
size
size of read in bytes
Comentários a estes Manuais