Source
x
printk(KERN_WARNING "%s: Unknown device on bus refused identification. Ignoring.\n", drive->name);
/*
* Copyright (C) 1994-1998 Linus Torvalds & authors (see below)
* Copyright (C) 2005, 2007 Bartlomiej Zolnierkiewicz
*/
/*
* Mostly written by Mark Lord <mlord@pobox.com>
* and Gadi Oxman <gadio@netvision.net.il>
* and Andre Hedrick <andre@linux-ide.org>
*
* See linux/MAINTAINERS for address of current maintainer.
*
* This is the IDE probe module, as evolved from hd.c and ide.c.
*
* -- increase WAIT_PIDENTIFY to avoid CD-ROM locking at boot
* by Andrea Arcangeli
*/
/**
* generic_id - add a generic drive id
* @drive: drive to make an ID block for
*
* Add a fake id field to the drive we are passed. This allows
* use to skip a ton of NULL checks (which people always miss)
* and make drive properties unconditional outside of this file
*/
static void generic_id(ide_drive_t *drive)
{
u16 *id = drive->id;
id[ATA_ID_CUR_CYLS] = id[ATA_ID_CYLS] = drive->cyl;
id[ATA_ID_CUR_HEADS] = id[ATA_ID_HEADS] = drive->head;
id[ATA_ID_CUR_SECTORS] = id[ATA_ID_SECTORS] = drive->sect;
}
static void ide_disk_init_chs(ide_drive_t *drive)
{
u16 *id = drive->id;
/* Extract geometry if we did not already have one for the drive */
if (!drive->cyl || !drive->head || !drive->sect) {
drive->cyl = drive->bios_cyl = id[ATA_ID_CYLS];
drive->head = drive->bios_head = id[ATA_ID_HEADS];
drive->sect = drive->bios_sect = id[ATA_ID_SECTORS];
}
/* Handle logical geometry translation by the drive */
if (ata_id_current_chs_valid(id)) {
drive->cyl = id[ATA_ID_CUR_CYLS];
drive->head = id[ATA_ID_CUR_HEADS];
drive->sect = id[ATA_ID_CUR_SECTORS];
}
/* Use physical geometry if what we have still makes no sense */
if (drive->head > 16 && id[ATA_ID_HEADS] && id[ATA_ID_HEADS] <= 16) {
drive->cyl = id[ATA_ID_CYLS];
drive->head = id[ATA_ID_HEADS];
drive->sect = id[ATA_ID_SECTORS];
}
}
static void ide_disk_init_mult_count(ide_drive_t *drive)
{
u16 *id = drive->id;
u8 max_multsect = id[ATA_ID_MAX_MULTSECT] & 0xff;
if (max_multsect) {
if ((max_multsect / 2) > 1)