2017-12-13 00:32:26 +00:00
|
|
|
//
|
|
|
|
|
// Created by claunia on 12/12/17.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#include <malloc.h>
|
|
|
|
|
#include <string.h>
|
2017-12-18 18:28:33 +00:00
|
|
|
#include <stdint.h>
|
2017-12-13 00:32:26 +00:00
|
|
|
#include "ata.h"
|
|
|
|
|
#include "atapi.h"
|
|
|
|
|
|
|
|
|
|
int IdentifyPacket(int fd, unsigned char **buffer, AtaErrorRegistersCHS **errorRegisters)
|
|
|
|
|
{
|
|
|
|
|
*buffer = malloc(512);
|
|
|
|
|
memset(*buffer, 0, 512);
|
|
|
|
|
AtaRegistersCHS registers;
|
|
|
|
|
memset(®isters, 0, sizeof(AtaRegistersCHS));
|
|
|
|
|
|
|
|
|
|
registers.command = ATA_IDENTIFY_PACKET_DEVICE;
|
|
|
|
|
|
2017-12-18 18:28:33 +00:00
|
|
|
int error = SendAtaCommandChs(fd, registers, errorRegisters, ATA_PROTOCOL_PIO_IN, ATA_TRANSFER_NONE, *buffer, 512,
|
|
|
|
|
0);
|
2017-12-13 00:32:26 +00:00
|
|
|
|
|
|
|
|
return error;
|
|
|
|
|
}
|