Lines Matching refs:disk
23 static int efi_rdwr_sectors(struct disk *disk, void *buf, in efi_rdwr_sectors() argument
26 struct efi_disk_private *priv = (struct efi_disk_private *)disk->private; in efi_rdwr_sectors()
29 UINTN bytes = count * disk->sector_size; in efi_rdwr_sectors()
32 status = write_blocks(bio, disk->disk_number, lba, bytes, buf); in efi_rdwr_sectors()
34 status = read_blocks(bio, disk->disk_number, lba, bytes, buf); in efi_rdwr_sectors()
41 return count << disk->sector_shift; in efi_rdwr_sectors()
44 struct disk *efi_disk_init(void *private) in efi_disk_init()
46 static struct disk disk; in efi_disk_init() local
66 disk.disk_number = bio->Media->MediaId; in efi_disk_init()
68 disk.sector_size = bio->Media->BlockSize; in efi_disk_init()
69 disk.rdwr_sectors = efi_rdwr_sectors; in efi_disk_init()
70 disk.sector_shift = ilog2(disk.sector_size); in efi_disk_init()
72 dprintf("sector_size=%d, disk_number=%d\n", disk.sector_size, in efi_disk_init()
73 disk.disk_number); in efi_disk_init()
77 disk.private = private; in efi_disk_init()
80 disk.part_start = part_start; in efi_disk_init()
81 disk.secpercyl = disk.h * disk.s; in efi_disk_init()
84 disk.maxtransfer = MaxTransfer; in efi_disk_init()
87 media_id, cdrom, ebios, sector_size, disk.sector_shift, in efi_disk_init()
88 part_start, disk.maxtransfer); in efi_disk_init()
91 return &disk; in efi_disk_init()