diff options
author | simokawa <simokawa@FreeBSD.org> | 2003-06-15 03:22:30 +0000 |
---|---|---|
committer | simokawa <simokawa@FreeBSD.org> | 2003-06-15 03:22:30 +0000 |
commit | 28eeb9781f52d1a33bb090ccdcea307b19ebe732 (patch) | |
tree | 783342fab60db8ba21f0e04c9f5ba9fc9597fc9a /sys/dev/firewire/fwcrom.c | |
parent | e89024c60446ccf7cc2094e278ee4f5cd874c7f8 (diff) | |
download | FreeBSD-src-28eeb9781f52d1a33bb090ccdcea307b19ebe732.zip FreeBSD-src-28eeb9781f52d1a33bb090ccdcea307b19ebe732.tar.gz |
Fix crom_add_simple_text().
Bytewap Configuration ROM image.
Diffstat (limited to 'sys/dev/firewire/fwcrom.c')
-rw-r--r-- | sys/dev/firewire/fwcrom.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/firewire/fwcrom.c b/sys/dev/firewire/fwcrom.c index 19dd37f..bf85ae2 100644 --- a/sys/dev/firewire/fwcrom.c +++ b/sys/dev/firewire/fwcrom.c @@ -434,7 +434,7 @@ crom_add_simple_text(struct crom_src *src, struct crom_chunk *parent, tl->spec_type = 0; tl->lang_id = 0; p = (u_int32_t *) buf; - for (i = 0; i < howmany(len, sizeof(u_int32_t)) / 4; i ++) + for (i = 0; i < howmany(len, sizeof(u_int32_t)); i ++) tl->text[i] = ntohl(*p++); return (crom_add_chunk(src, parent, chunk, CROM_TEXTLEAF)); } @@ -456,8 +456,9 @@ crom_load(struct crom_src *src, u_int32_t *buf, int maxlen) { struct crom_chunk *chunk, *parent; struct csrhdr *hdr; -#if 0 +#ifdef _KERNEL u_int32_t *ptr; + int i; #endif int count, offset; int len; @@ -494,9 +495,9 @@ crom_load(struct crom_src *src, u_int32_t *buf, int maxlen) } hdr = (struct csrhdr *)buf; hdr->crc_len = count - 1; - hdr->crc = crom_crc(buf + 1, hdr->crc_len); + hdr->crc = crom_crc(&buf[1], hdr->crc_len); -#if 0 +#ifdef _KERNEL /* byte swap */ ptr = buf; for (i = 0; i < count; i ++) { |