#include <stdint.h>
#include <gpxe/blockdev.h>
#include <gpxe/uaccess.h>
#include <gpxe/refcnt.h>
Go to the source code of this file.
Data Structures | |
| union | ata_lba |
| An ATA Logical Block Address. More... | |
| union | ata_fifo |
| An ATA 2-byte FIFO register. More... | |
| struct | ata_cb |
| ATA command block. More... | |
| struct | ata_command |
| An ATA command. More... | |
| struct | ata_identity |
| Structure returned by ATA IDENTIFY command. More... | |
| struct | ata_device |
| An ATA device. More... | |
Defines | |
| #define | ATA_DEV_OBSOLETE 0xa0 |
| Obsolete bits in the ATA device register. | |
| #define | ATA_DEV_LBA 0x40 |
| LBA flag in the ATA device register. | |
| #define | ATA_DEV_SLAVE 0x10 |
| Slave ("device 1") flag in the ATA device register. | |
| #define | ATA_DEV_MASTER 0x00 |
| Master ("device 0") flag in the ATA device register. | |
| #define | ATA_DEV_MASK 0xf0 |
| Mask of non-LBA portion of device register. | |
| #define | ATA_CMD_READ 0x20 |
| "Read sectors" command | |
| #define | ATA_CMD_READ_EXT 0x24 |
| "Read sectors (ext)" command | |
| #define | ATA_CMD_WRITE 0x30 |
| "Write sectors" command | |
| #define | ATA_CMD_WRITE_EXT 0x34 |
| "Write sectors (ext)" command | |
| #define | ATA_CMD_IDENTIFY 0xec |
| "Identify" command | |
| #define | ATA_SUPPORTS_LBA48 ( 1 << 10 ) |
| Supports LBA48 flag. | |
| #define | ATA_SECTOR_SIZE 512 |
| ATA sector size. | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER) | |
| int | init_atadev (struct ata_device *ata) |
| Initialise ATA device. | |
Definition in file ata.h.
| #define ATA_DEV_OBSOLETE 0xa0 |
Obsolete bits in the ATA device register.
Definition at line 112 of file ata.h.
Referenced by ata_identify(), ata_read(), and ata_write().
| #define ATA_DEV_LBA 0x40 |
LBA flag in the ATA device register.
Definition at line 115 of file ata.h.
Referenced by ata_identify(), ata_read(), and ata_write().
| #define ATA_DEV_SLAVE 0x10 |
Slave ("device 1") flag in the ATA device register.
Definition at line 118 of file ata.h.
Referenced by aoe_send_command().
| #define ATA_DEV_MASTER 0x00 |
| #define ATA_DEV_MASK 0xf0 |
Mask of non-LBA portion of device register.
Definition at line 124 of file ata.h.
Referenced by aoe_send_command().
| #define ATA_CMD_READ 0x20 |
| #define ATA_CMD_READ_EXT 0x24 |
| #define ATA_CMD_WRITE 0x30 |
| #define ATA_CMD_WRITE_EXT 0x34 |
| #define ATA_CMD_IDENTIFY 0xec |
| #define ATA_SUPPORTS_LBA48 ( 1 << 10 ) |
| #define ATA_SECTOR_SIZE 512 |
ATA sector size.
Definition at line 181 of file ata.h.
Referenced by aoe_rx_ata(), aoe_send_command(), and ata_identify().
| FILE_LICENCE | ( | GPL2_OR_LATER | ) |
| int init_atadev | ( | struct ata_device * | ata | ) |
Initialise ATA device.
| ata | ATA device |
| rc | Return status code |
ATA_FL_SLAVE portion of the ata_device::flags field must already be filled in. This function will configure ata_device::blockdev, including issuing an IDENTIFY DEVICE call to determine the block size and total device size.
Fill in read and write methods, and get device capacity
Definition at line 184 of file ata.c.
References ata_identify(), ata_device::blockdev, and block_device::op.
Referenced by aoeboot().
00184 { 00185 /** Fill in read and write methods, and get device capacity */ 00186 ata->blockdev.op = &ata_operations; 00187 return ata_identify ( &ata->blockdev ); 00188 }
1.5.7.1