- typo in MBR offset.

- redo the previous change in main.c and wm.c
This commit is contained in:
nisimura 2008-04-09 00:20:35 +00:00
parent 7c716f683a
commit 8ec93217ac
3 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: atawd.c,v 1.2 2008/04/07 13:25:31 nisimura Exp $ */
/* $NetBSD: atawd.c,v 1.3 2008/04/09 00:20:35 nisimura Exp $ */
#include <sys/types.h>
#include <sys/param.h>
@ -228,7 +228,7 @@ wdgetdisklabel(struct wd_softc *wd)
if (wdstrategy(wd, F_READ, MBR_BBSECTOR, DEV_BSIZE, buf, &rsize))
return EOFFSET;
dp = (struct mbr_partition *)&buf[MBR_MAGIC_OFFSET];
dp = (struct mbr_partition *)(buf + MBR_PART_OFFSET);
bsdp = NULL;
for (i = 0; i < MBR_PART_COUNT; i++, dp++) {
if (dp->mbrp_type == MBR_PTYPE_NETBSD) {
@ -236,7 +236,6 @@ wdgetdisklabel(struct wd_softc *wd)
break;
}
}
if (!bsdp) {
/* generate fake disklabel */
lp->d_secsize = DEV_BSIZE;
@ -268,7 +267,7 @@ wdgetdisklabel(struct wd_softc *wd)
dp = (struct mbr_partition *)(buf + MBR_PART_OFFSET);
n = RAW_PART + 1;
for (i = 0; i < MBR_PART_COUNT; i++, dp++) {
if (!dp->mbrp_type)
if (dp->mbrp_type == MBR_PTYPE_UNUSED)
continue;
lp->d_partitions[n].p_offset = bswap32(dp->mbrp_start);
lp->d_partitions[n].p_size = bswap32(dp->mbrp_size);

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.13 2008/04/08 23:59:03 nisimura Exp $ */
/* $NetBSD: main.c,v 1.14 2008/04/09 00:20:35 nisimura Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@ -680,6 +680,7 @@ pcifixup()
pcicfgwrite(ide, 0x08, val);
/* ide: 0x10-20 */
/*
experiment shows writing ide: 0x09 changes these
register behaviour. The pcicfgwrite() above writes
0x8a at ide: 0x09 to make sure legacy IDE. Then

View File

@ -1,4 +1,4 @@
/* $NetBSD: wm.c,v 1.3 2008/04/08 23:59:03 nisimura Exp $ */
/* $NetBSD: wm.c,v 1.4 2008/04/09 00:20:35 nisimura Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@ -144,7 +144,7 @@ wm_init(unsigned tag, void *data)
if (PCI_DEVICE(0x8086, 0x107c) != val)
return NULL;
l = ALLOC(struct local, sizeof(struct desc)); /* desc alignment */
l = ALLOC(struct local, sizeof(struct tdesc)); /* desc alignment */
memset(l, 0, sizeof(struct local));
l->csr = pcicfgread(tag, 0x10); /* use mem space */