aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/it821x.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:19 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:19 -0400
commit4dde4492d850a4c9bcaa92e5bd7f4eebe3e2f5ab (patch)
treeee3be70390e4c617b44329edef0a05039f59c81a /drivers/ide/pci/it821x.c
parent5b90e990928919ae411a68b865e8a6ecac09a603 (diff)
ide: make drive->id an union (take 2)
Make drive->id an unnamed union so id can be accessed either by using 'u16 *id' or 'struct hd_driveid *driveid'. Then convert all existing drive->id users accordingly (using 'u16 *id' when possible). This is an intermediate step to make ide 'struct hd_driveid'-free. While at it: - Add missing KERN_CONTs in it821x.c. - Use ATA_ID_WORDS and ATA_ID_*_LEN defines. - Remove unnecessary checks for drive->id. - s/drive_table/table/ in ide_in_drive_list(). - Cleanup ide_config_drive_speed() a bit. - s/drive1/dev1/ & s/drive0/dev0/ in ide_undecoded_slave(). v2: Fix typo in drivers/ide/ppc/pmac.c. (From Stephen Rothwell) There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/it821x.c')
-rw-r--r--drivers/ide/pci/it821x.c51
1 files changed, 25 insertions, 26 deletions
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index 4a1508a707cc..31d4e6aef1b8 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -446,8 +446,7 @@ static u8 it821x_cable_detect(ide_hwif_t *hwif)
446static void it821x_quirkproc(ide_drive_t *drive) 446static void it821x_quirkproc(ide_drive_t *drive)
447{ 447{
448 struct it821x_dev *itdev = ide_get_hwifdata(drive->hwif); 448 struct it821x_dev *itdev = ide_get_hwifdata(drive->hwif);
449 struct hd_driveid *id = drive->id; 449 u16 *id = drive->id;
450 u16 *idbits = (u16 *)drive->id;
451 450
452 if (!itdev->smart) { 451 if (!itdev->smart) {
453 /* 452 /*
@@ -466,36 +465,36 @@ static void it821x_quirkproc(ide_drive_t *drive)
466 */ 465 */
467 466
468 /* Check for RAID v native */ 467 /* Check for RAID v native */
469 if(strstr(id->model, "Integrated Technology Express")) { 468 if (strstr((char *)&id[ATA_ID_PROD],
469 "Integrated Technology Express")) {
470 /* In raid mode the ident block is slightly buggy 470 /* In raid mode the ident block is slightly buggy
471 We need to set the bits so that the IDE layer knows 471 We need to set the bits so that the IDE layer knows
472 LBA28. LBA48 and DMA ar valid */ 472 LBA28. LBA48 and DMA ar valid */
473 id->capability |= 3; /* LBA28, DMA */ 473 drive->driveid->capability |= 3; /* LBA28, DMA */
474 id->command_set_2 |= 0x0400; /* LBA48 valid */ 474 id[ATA_ID_COMMAND_SET_2] |= 0x0400; /* LBA48 valid */
475 id->cfs_enable_2 |= 0x0400; /* LBA48 on */ 475 id[ATA_ID_CFS_ENABLE_2] |= 0x0400; /* LBA48 on */
476 /* Reporting logic */ 476 /* Reporting logic */
477 printk(KERN_INFO "%s: IT8212 %sRAID %d volume", 477 printk(KERN_INFO "%s: IT8212 %sRAID %d volume",
478 drive->name, 478 drive->name, id[147] ? "Bootable " : "",
479 idbits[147] ? "Bootable ":"", 479 id[ATA_ID_CSFO]);
480 idbits[129]); 480 if (id[ATA_ID_CSFO] != 1)
481 if(idbits[129] != 1) 481 printk(KERN_CONT "(%dK stripe)", id[146]);
482 printk("(%dK stripe)", idbits[146]); 482 printk(KERN_CONT ".\n");
483 printk(".\n");
484 } else { 483 } else {
485 /* Non RAID volume. Fixups to stop the core code 484 /* Non RAID volume. Fixups to stop the core code
486 doing unsupported things */ 485 doing unsupported things */
487 id->field_valid &= 3; 486 id[ATA_ID_FIELD_VALID] &= 3;
488 id->queue_depth = 0; 487 id[ATA_ID_QUEUE_DEPTH] = 0;
489 id->command_set_1 = 0; 488 id[ATA_ID_COMMAND_SET_1] = 0;
490 id->command_set_2 &= 0xC400; 489 id[ATA_ID_COMMAND_SET_2] &= 0xC400;
491 id->cfsse &= 0xC000; 490 id[ATA_ID_CFSSE] &= 0xC000;
492 id->cfs_enable_1 = 0; 491 id[ATA_ID_CFS_ENABLE_1] = 0;
493 id->cfs_enable_2 &= 0xC400; 492 id[ATA_ID_CFS_ENABLE_2] &= 0xC400;
494 id->csf_default &= 0xC000; 493 id[ATA_ID_CSF_DEFAULT] &= 0xC000;
495 id->word127 = 0; 494 id[127] = 0;
496 id->dlf = 0; 495 id[ATA_ID_DLF] = 0;
497 id->csfo = 0; 496 id[ATA_ID_CSFO] = 0;
498 id->cfa_power = 0; 497 id[ATA_ID_CFA_POWER] = 0;
499 printk(KERN_INFO "%s: Performing identify fixups.\n", 498 printk(KERN_INFO "%s: Performing identify fixups.\n",
500 drive->name); 499 drive->name);
501 } 500 }
@@ -505,8 +504,8 @@ static void it821x_quirkproc(ide_drive_t *drive)
505 * IDE core that DMA is supported (it821x hardware 504 * IDE core that DMA is supported (it821x hardware
506 * takes care of DMA mode programming). 505 * takes care of DMA mode programming).
507 */ 506 */
508 if (id->capability & 1) { 507 if (drive->driveid->capability & 1) {
509 id->dma_mword |= 0x0101; 508 id[ATA_ID_MWDMA_MODES] |= 0x0101;
510 drive->current_speed = XFER_MW_DMA_0; 509 drive->current_speed = XFER_MW_DMA_0;
511 } 510 }
512 } 511 }