View | Details | Raw Unified | Return to bug 6840 | Differences between
and this patch

Collapse All | Expand All

(-)linux-2.6.18-rc4-old/include/linux/ide.h (+11 lines)
Lines 1201-1206 Link Here
1201
void ide_register_subdriver(ide_drive_t *, ide_driver_t *);
1201
void ide_register_subdriver(ide_drive_t *, ide_driver_t *);
1202
void ide_unregister_subdriver(ide_drive_t *, ide_driver_t *);
1202
void ide_unregister_subdriver(ide_drive_t *, ide_driver_t *);
1203
1203
1204
/* Bits 10 of command_set_1 and cfs_enable_1 must be equal,
1205
 * so on non-buggy drives we need test only one.
1206
 * However, we should also check whether these fields are valid.
1207
*/
1208
static inline int idedisk_supports_hpa(const struct hd_driveid *id)
1209
{
1210
        return (id->command_set_1 & 0x0400) && (id->cfs_enable_1 & 0x0400);
1211
}
1212
1213
extern void init_idedisk_capacity (ide_drive_t  *drive);
1214
1204
#define ON_BOARD		1
1215
#define ON_BOARD		1
1205
#define NEVER_BOARD		0
1216
#define NEVER_BOARD		0
(-)linux-2.6.18-rc4-old/drivers/ide/ide-disk.c (-11 / +3 lines)
Lines 464-479 Link Here
464
}
464
}
465
465
466
/*
466
/*
467
 * Bits 10 of command_set_1 and cfs_enable_1 must be equal,
468
 * so on non-buggy drives we need test only one.
469
 * However, we should also check whether these fields are valid.
470
 */
471
static inline int idedisk_supports_hpa(const struct hd_driveid *id)
472
{
473
	return (id->command_set_1 & 0x0400) && (id->cfs_enable_1 & 0x0400);
474
}
475
476
/*
477
 * The same here.
467
 * The same here.
478
 */
468
 */
479
static inline int idedisk_supports_lba48(const struct hd_driveid *id)
469
static inline int idedisk_supports_lba48(const struct hd_driveid *id)
Lines 528-534 Link Here
528
 * in above order (i.e., if value of higher priority is available,
518
 * in above order (i.e., if value of higher priority is available,
529
 * reset will be ignored).
519
 * reset will be ignored).
530
 */
520
 */
531
static void init_idedisk_capacity (ide_drive_t  *drive)
521
void init_idedisk_capacity (ide_drive_t  *drive)
532
{
522
{
533
	struct hd_driveid *id = drive->id;
523
	struct hd_driveid *id = drive->id;
534
	/*
524
	/*
Lines 555-560 Link Here
555
	}
545
	}
556
}
546
}
557
547
548
EXPORT_SYMBOL(init_idedisk_capacity);
549
558
static sector_t idedisk_capacity (ide_drive_t *drive)
550
static sector_t idedisk_capacity (ide_drive_t *drive)
559
{
551
{
560
	return drive->capacity64 - drive->sect0;
552
	return drive->capacity64 - drive->sect0;
(-)linux-2.6.18-rc4-old/drivers/ide/ide.c (-1 / +10 lines)
Lines 1232-1237 Link Here
1232
	struct request rq;
1232
	struct request rq;
1233
	struct request_pm_state rqpm;
1233
	struct request_pm_state rqpm;
1234
	ide_task_t args;
1234
	ide_task_t args;
1235
	int ide_cmd;
1235
1236
1236
	memset(&rq, 0, sizeof(rq));
1237
	memset(&rq, 0, sizeof(rq));
1237
	memset(&rqpm, 0, sizeof(rqpm));
1238
	memset(&rqpm, 0, sizeof(rqpm));
Lines 1242-1248 Link Here
1242
	rqpm.pm_step = ide_pm_state_start_resume;
1243
	rqpm.pm_step = ide_pm_state_start_resume;
1243
	rqpm.pm_state = PM_EVENT_ON;
1244
	rqpm.pm_state = PM_EVENT_ON;
1244
1245
1245
	return ide_do_drive_cmd(drive, &rq, ide_head_wait);
1246
	ide_cmd = ide_do_drive_cmd(drive, &rq, ide_head_wait);
1247
1248
	/* check to see if this is a hard drive
1249
	 * if it is then checkhpa needs to be
1250
	 * disabled */
1251
	if(drive->media == ide_disk && idedisk_supports_hpa(drive->id))
1252
		init_idedisk_capacity(drive);
1253
1254
	return ide_cmd;
1246
}
1255
}
1247
1256
1248
int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device *bdev,
1257
int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device *bdev,

Return to bug 6840