|
ContainerTracer
0.1
|
#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <fcntl.h>#include <errno.h>#include <string.h>#include <sys/ioctl.h>#include <sys/stat.h>#include <sys/types.h>#include <linux/fs.h>#include <scsi/scsi.h>#include <scsi/sg.h>#include <hdparm.h>
Macros | |
| #define | SG_READ 0 |
| #define | SG_WRITE 1 |
| #define | SG_CHECK_CONDITION 0x02 |
| #define | SG_DRIVER_SENSE 0x08 |
| #define | SG_ATA_16 0x85 |
| #define | SG_ATA_16_LEN 16 |
| #define | SG_ATA_LBA48 1 |
| #define | SG_ATA_PROTO_NON_DATA (3 << 1) |
| #define | SG_ATA_PROTO_PIO_IN (4 << 1) |
| #define | SG_ATA_PROTO_PIO_OUT (5 << 1) |
| #define | SG_ATA_PROTO_DMA (6 << 1) |
| #define | SG_ATA_PROTO_UDMA_IN (11 << 1) /* not yet supported in libata */ |
| #define | SG_ATA_PROTO_UDMA_OUT (12 << 1) /* not yet supported in libata */ |
| #define | ATA_USING_LBA (1 << 6) |
Enumerations | |
| enum | { SG_CDB2_TLEN_NODATA = 0 << 0, SG_CDB2_TLEN_FEAT = 1 << 0, SG_CDB2_TLEN_NSECT = 2 << 0, SG_CDB2_TLEN_BYTES = 0 << 2, SG_CDB2_TLEN_SECTORS = 1 << 2, SG_CDB2_TDIR_TO_DEV = 0 << 3, SG_CDB2_TDIR_FROM_DEV = 1 << 3, SG_CDB2_CHECK_COND = 1 << 5 } |
Functions | |
| void | tf_init (struct ata_tf *tf, __u8 ata_op, __u64 lba, unsigned int nsect) |
| __u64 | tf_to_lba (struct ata_tf *tf) |
| static void | dump_bytes (const char *prefix, unsigned char *p, int len) |
| static int | bad_sense (unsigned char *sb, int len) |
| int | sg16 (int fd, int rw, struct ata_tf *tf, void *data, unsigned int data_bytes, unsigned int timeout_secs) |
| int | do_drive_cmd (int fd, unsigned char *args) |
Variables | |
| int | verbose |
| #define ATA_USING_LBA (1 << 6) |
| #define SG_ATA_16 0x85 |
| #define SG_ATA_16_LEN 16 |
| #define SG_ATA_LBA48 1 |
| #define SG_ATA_PROTO_DMA (6 << 1) |
| #define SG_ATA_PROTO_NON_DATA (3 << 1) |
| #define SG_ATA_PROTO_PIO_IN (4 << 1) |
| #define SG_ATA_PROTO_PIO_OUT (5 << 1) |
| #define SG_ATA_PROTO_UDMA_IN (11 << 1) /* not yet supported in libata */ |
| #define SG_ATA_PROTO_UDMA_OUT (12 << 1) /* not yet supported in libata */ |
| #define SG_CHECK_CONDITION 0x02 |
| #define SG_DRIVER_SENSE 0x08 |
| #define SG_READ 0 |
| #define SG_WRITE 1 |
| anonymous enum |
|
static |

| int do_drive_cmd | ( | int | fd, |
| unsigned char * | args | ||
| ) |

|
static |
| int sg16 | ( | int | fd, |
| int | rw, | ||
| struct ata_tf * | tf, | ||
| void * | data, | ||
| unsigned int | data_bytes, | ||
| unsigned int | timeout_secs | ||
| ) |

| int verbose |
1.8.13