Add atap_max_lba member to ataparams for LBA48 Maximum Address. From OpenBSD.

While here, renumber some __reserved member names to be sequential.
Also, add a member for the World Wide Name.

Use atap_max_lba in wd.c instead of offsets into a __reserved member.
This commit is contained in:
jakllsch 2009-06-08 15:09:35 +00:00
parent add168f4d8
commit 5aaada1bec
2 changed files with 12 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: atareg.h,v 1.32 2007/12/25 18:33:36 perry Exp $ */
/* $NetBSD: atareg.h,v 1.33 2009/06/08 15:09:35 jakllsch Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer.
@ -438,7 +438,11 @@ struct ataparams {
u_int16_t atap_seu_time; /* 89: Sec. Erase Unit compl. time */
u_int16_t atap_eseu_time; /* 90: Enhanced SEU compl. time */
u_int16_t atap_apm_val; /* 91: current APM value */
u_int16_t __reserved6[35]; /* 92-126: reserved */
u_int16_t __reserved5[8]; /* 92-99: reserved */
u_int16_t atap_max_lba[4]; /* 100-103: Max. user LBA addr */
u_int16_t __reserved6[4]; /* 104-107: reserved */
u_int16_t atap_wwn[4]; /* 108-111: World Wide Name */
u_int16_t __reserved7[15]; /* 112-126: reserved */
u_int16_t atap_rmsn_supp; /* 127: remov. media status notif. */
#define WDC_RMSN_SUPP_MASK 0x0003
#define WDC_RMSN_SUPP 0x0001

View File

@ -1,4 +1,4 @@
/* $NetBSD: wd.c,v 1.377 2009/05/20 03:26:21 dyoung Exp $ */
/* $NetBSD: wd.c,v 1.378 2009/06/08 15:09:35 jakllsch Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.377 2009/05/20 03:26:21 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.378 2009/06/08 15:09:35 jakllsch Exp $");
#include "opt_ata.h"
@ -375,10 +375,10 @@ wdattach(device_t parent, device_t self, void *aux)
if ((wd->sc_flags & WDF_LBA48) != 0) {
aprint_verbose(" LBA48 addressing\n");
wd->sc_capacity =
((u_int64_t) wd->sc_params.__reserved6[11] << 48) |
((u_int64_t) wd->sc_params.__reserved6[10] << 32) |
((u_int64_t) wd->sc_params.__reserved6[9] << 16) |
((u_int64_t) wd->sc_params.__reserved6[8] << 0);
((u_int64_t) wd->sc_params.atap_max_lba[3] << 48) |
((u_int64_t) wd->sc_params.atap_max_lba[2] << 32) |
((u_int64_t) wd->sc_params.atap_max_lba[1] << 16) |
((u_int64_t) wd->sc_params.atap_max_lba[0] << 0);
} else if ((wd->sc_flags & WDF_LBA) != 0) {
aprint_verbose(" LBA addressing\n");
wd->sc_capacity =