CKD(4,F) AIX Technical Reference CKD(4,F) ------------------------------------------------------------------------------- ckd PURPOSE Supports the Count Key Data Direct Access Storage Device driver. SYNOPSIS # include # include DESCRIPTION Fixed disk devices on an AIX/370 system provide block and character access to minidisks on physical disk devices. The ckd special file is unique to AIX/370. The particular device accessed is of the form /dev/chdnnn and /dev/rchdnnn, where nnn is the given device minor number. The driver supports up to 32 separate AIX minidisks (partitions) on a single physical disk. Thus, each physical disk has 32 minor numbers associated with it. The first of these refers to the entire disk and is normally used for disk maintenance only. The other 31 minors are available for user or system AIX minidisks. In raw I/O, the buffer must always be aligned on a 4096 byte boundary, and counts must be a multiple of 4096 bytes (an integral number of physical blocks). lseek system calls should also specify such an aligned address. A number of IOCTL operations are available. In addition to IOCTYPE and IOCINFO, the following calls are defined: IOCSTATS Returns device statistics. ioctl(fd, IOCSTATS, arg); struct fi_status *arg; where fi_stats is declared as: Processed November 7, 1990 CKD(4,F) 1 CKD(4,F) AIX Technical Reference CKD(4,F) struct fi_stats { u_long Fi_nsio; /* number read + write sio's */ u_long Fi_nblksrd; /* number blocks read */ u_long Fi_nblkswr; /* number blocks written */ u_long Fi_nretry; /* number of retries */ u_long Fi_tsio; /* rmtime for last sio */ double Fi_etsio; /* elapsed time for sio */ double Fi_tottsio; /* microsecs from sio to intr */ u_long Fi_nfree; /* number of ckdfree calls */ u_long Fi_tfree; /* rmtime for last ckdfree */ double Fi_etfree; /* elapsed time for ckdfree */ u_long Fi_nrsort; /* number rotate_sort calls */ u_long Fi_trsort; /* rmtime last rotate_sort */ double Fi_etrsort; /* rotate_sort elapsed time */ }; DEVADDR Returns the device address. ioctl(fd, DEVADDR, arg); int *arg; HDIOPAR Returns driver internal structure. ioctl(fd, HDIOPAR, arg); struct ckd_info *arg; where struct ckd_info is declared as: Processed November 7, 1990 CKD(4,F) 2 CKD(4,F) AIX Technical Reference CKD(4,F) struct ckd_info { struct buf fi_tab; /* Queue header, should be a bufhdr? */ ioaddr_t fi_devno; /* Device number for this spindle */ u_char fi_mask; /* Mask byte for set file mask ccw */ char fi_unused; bool_t fi_alive; /* Is it really there ? */ bool_t fi_ro; /* Disk is read-only (How do I know?) */ bool_t fi_countkeyio; /* Open for count key I/O */ short fi_ocount; /* Open count */ short fi_rocount; /* Raw open count */ short fi_recptrk; /* Records per track */ short fi_trkpcyl; /* Tracks per cylinder */ daddr_t fi_curblock; /* Current head position */ daddr_t fi_maxsecno; /* Maximum number of sectors */ short *fi_sectabp; /* Ptr to record->sector table*/ ccw_t *fi_realccw; /* Real address of the ccw's */ ccw_t *fi_ccws; /* Ptr to channel program */ seeklist_t *fi_seek; /* Ptr to seek or search addresses */ paddr_t **fi_idaws; /* Ptr to space for idaws */ ccw_t *fi_insccwp; /* Ptr to sense channel program */ u_char *fi_snsp; /* Ptr to buffer for sense data */ int fi_nsns; /* Number of sense bytes retrieved */ struct fi_stats fi_stats; /* Statistics can be used by sar */ }; HDIORST Reread the VTOC minidisk partition table. ioctl(fd, HDIORST, arg); caddr_t arg; Processed November 7, 1990 CKD(4,F) 3 CKD(4,F) AIX Technical Reference CKD(4,F) The argument is not used. This command only works on the whole partition maintenance minidisk. RELATED INFORMATION In this book: "ioctlx, ioctl, gtty, stty," "open, openx, creat," "read, readv, readx," and "write, writex." Processed November 7, 1990 CKD(4,F) 4