diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-05-01 16:15:51 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-05-01 16:15:51 +0000 |
commit | 8e7e01eca971fdbc047386ab33bb63fa0d257a25 (patch) | |
tree | 2473145912d87bc726ead6a26dd48a8aad3e1f1d /sys | |
parent | b7c8e4080855099f9e15b0cb3d0c18fbc94ebf9b (diff) |
make fw images const and fix ti for unneeded type casts; jason@ testing ans ok
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/microcode/tigon/ti_fw.h | 36 | ||||
-rw-r--r-- | sys/dev/microcode/tigon/ti_fw2.h | 36 | ||||
-rw-r--r-- | sys/dev/microcode/typhoon/3c990img.h | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_ti.c | 28 |
4 files changed, 53 insertions, 51 deletions
diff --git a/sys/dev/microcode/tigon/ti_fw.h b/sys/dev/microcode/tigon/ti_fw.h index 68c03d66d2e..e5c4abb7772 100644 --- a/sys/dev/microcode/tigon/ti_fw.h +++ b/sys/dev/microcode/tigon/ti_fw.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ti_fw.h,v 1.1 2001/06/18 19:19:43 deraadt Exp $ */ +/* $OpenBSD: ti_fw.h,v 1.2 2002/05/01 16:15:49 mickey Exp $ */ /* * Firmware for Alteon Tigon 1 chip. @@ -6,21 +6,21 @@ * * $FreeBSD: /c/ncvs/src/sys/pci/ti_fw.h,v 1.9 2000/07/20 22:24:42 wpaul Exp $ */ -static int tigonFwReleaseMajor = 0xc; -static int tigonFwReleaseMinor = 0x4; -static int tigonFwReleaseFix = 0xd; -static u_int32_t tigonFwStartAddr = 0x00004000; -static u_int32_t tigonFwTextAddr = 0x00004000; -static int tigonFwTextLen = 0x11160; -static u_int32_t tigonFwRodataAddr = 0x00015160; -static int tigonFwRodataLen = 0xae0; -static u_int32_t tigonFwDataAddr = 0x00015c60; -static int tigonFwDataLen = 0x180; -static u_int32_t tigonFwSbssAddr = 0x00015de0; -static int tigonFwSbssLen = 0x38; -static u_int32_t tigonFwBssAddr = 0x00015e20; -static int tigonFwBssLen = 0x2080; -static u_int32_t tigonFwText[] = { +static const int tigonFwReleaseMajor = 0xc; +static const int tigonFwReleaseMinor = 0x4; +static const int tigonFwReleaseFix = 0xd; +static const u_int32_t tigonFwStartAddr = 0x00004000; +static const u_int32_t tigonFwTextAddr = 0x00004000; +static const int tigonFwTextLen = 0x11160; +static const u_int32_t tigonFwRodataAddr = 0x00015160; +static const int tigonFwRodataLen = 0xae0; +static const u_int32_t tigonFwDataAddr = 0x00015c60; +static const int tigonFwDataLen = 0x180; +static const u_int32_t tigonFwSbssAddr = 0x00015de0; +static const int tigonFwSbssLen = 0x38; +static const u_int32_t tigonFwBssAddr = 0x00015e20; +static const int tigonFwBssLen = 0x2080; +static const u_int32_t tigonFwText[] = { 0x10000003, 0x0, 0xd, 0xd, 0x3c1d0001, 0x8fbd5c94, 0x3a0f021, 0x3c100000, 0x26104000, @@ -4396,7 +4396,7 @@ static u_int32_t tigonFwText[] = { 0x8fbf0024, 0x8fb40020, 0x8fb3001c, 0x8fb20018, 0x8fb10014, 0x8fb00010, 0x3e00008, 0x27bd0028, 0x0, 0x0, 0x0, 0x0 }; -static u_int32_t tigonFwRodata[] = { +static const u_int32_t tigonFwRodata[] = { 0x24486561, 0x6465723a, 0x202f7072, 0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 0x2f2e2f6e, 0x69632f66, 0x772f636f, 0x6d6d6f6e, @@ -4572,7 +4572,7 @@ static u_int32_t tigonFwRodata[] = { 0x0, 0x14c4c, 0x14c4c, 0x14b94, 0x14bd8, 0x14c4c, 0x14c4c, 0x14b94, 0x0, 0x0 }; -static u_int32_t tigonFwData[] = { +static const u_int32_t tigonFwData[] = { 0x416c7465, 0x6f6e2041, 0x63654e49, 0x43205600, 0x416c7465, 0x6f6e2041, 0x63654e49, 0x43205600, 0x42424242, diff --git a/sys/dev/microcode/tigon/ti_fw2.h b/sys/dev/microcode/tigon/ti_fw2.h index cf6425c8ef7..9b02494a319 100644 --- a/sys/dev/microcode/tigon/ti_fw2.h +++ b/sys/dev/microcode/tigon/ti_fw2.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ti_fw2.h,v 1.1 2001/06/18 19:19:43 deraadt Exp $ */ +/* $OpenBSD: ti_fw2.h,v 1.2 2002/05/01 16:15:50 mickey Exp $ */ /* * Generated by genfw.c @@ -11,21 +11,21 @@ * * $FreeBSD: /c/ncvs/src/sys/pci/ti_fw2.h,v 1.10 2000/07/26 23:55:34 wpaul Exp $ */ -static int tigon2FwReleaseMajor = 0xc; -static int tigon2FwReleaseMinor = 0x4; -static int tigon2FwReleaseFix = 0xd; -static u_int32_t tigon2FwStartAddr = 0x00004000; -static u_int32_t tigon2FwTextAddr = 0x00004000; -static int tigon2FwTextLen = 0x11c80; -static u_int32_t tigon2FwRodataAddr = 0x00015c80; -static int tigon2FwRodataLen = 0x10d0; -static u_int32_t tigon2FwDataAddr = 0x00016d80; -static int tigon2FwDataLen = 0x1c0; -static u_int32_t tigon2FwSbssAddr = 0x00016f40; -static int tigon2FwSbssLen = 0xcc; -static u_int32_t tigon2FwBssAddr = 0x00017010; -static int tigon2FwBssLen = 0x20c0; -static u_int32_t tigon2FwText[] = { +static const int tigon2FwReleaseMajor = 0xc; +static const int tigon2FwReleaseMinor = 0x4; +static const int tigon2FwReleaseFix = 0xd; +static const u_int32_t tigon2FwStartAddr = 0x00004000; +static const u_int32_t tigon2FwTextAddr = 0x00004000; +static const int tigon2FwTextLen = 0x11c80; +static const u_int32_t tigon2FwRodataAddr = 0x00015c80; +static const int tigon2FwRodataLen = 0x10d0; +static const u_int32_t tigon2FwDataAddr = 0x00016d80; +static const int tigon2FwDataLen = 0x1c0; +static const u_int32_t tigon2FwSbssAddr = 0x00016f40; +static const int tigon2FwSbssLen = 0xcc; +static const u_int32_t tigon2FwBssAddr = 0x00017010; +static const int tigon2FwBssLen = 0x20c0; +static const u_int32_t tigon2FwText[] = { 0x0, 0x10000003, 0x0, 0xd, 0xd, 0x3c1d0001, 0x8fbd6de0, 0x3a0f021, 0x3c100000, @@ -4579,7 +4579,7 @@ static u_int32_t tigon2FwText[] = { 0x24020001, 0x8f430328, 0x1021, 0x24630001, 0x3e00008, 0xaf430328, 0x3e00008, 0x0, 0x0, 0x0, 0x0, 0x0 }; -static u_int32_t tigon2FwRodata[] = { +static const u_int32_t tigon2FwRodata[] = { 0x24486561, 0x6465723a, 0x202f7072, 0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 0x2f2e2f6e, 0x69632f66, @@ -4850,7 +4850,7 @@ static u_int32_t tigon2FwRodata[] = { 0x0, 0x14f98, 0x14f98, 0x14c4c, 0x14c98, 0x14ce4, 0x14f98, 0x7365746d, 0x61636163, 0x74000000, 0x0, 0x0 }; -static u_int32_t tigon2FwData[] = { +static const u_int32_t tigon2FwData[] = { 0x1, 0x1, 0x1, 0xc001fc, 0x3ffc, 0xc00000, 0x46726565, 0x42534420, 0x5469676f, diff --git a/sys/dev/microcode/typhoon/3c990img.h b/sys/dev/microcode/typhoon/3c990img.h index 41d44455920..fd9a120591f 100644 --- a/sys/dev/microcode/typhoon/3c990img.h +++ b/sys/dev/microcode/typhoon/3c990img.h @@ -1,4 +1,4 @@ -/* $OpenBSD: 3c990img.h,v 1.2 2001/06/05 02:15:17 jason Exp $ */ +/* $OpenBSD: 3c990img.h,v 1.3 2002/05/01 16:15:50 mickey Exp $ */ /* * Copyright (C) 1999-2001 3Com, Inc. @@ -37,7 +37,7 @@ * microcode SOFTWARE */ -unsigned char tc990image[] = { +const unsigned char tc990image[] = { 0x54, 0x59, 0x50, 0x48, 0x4f, 0x4f, 0x4e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0x01, 0x00, 0x00, 0xd6, 0xbb, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x39, 0x00, 0x00, 0xea, diff --git a/sys/dev/pci/if_ti.c b/sys/dev/pci/if_ti.c index 49d0f0afe8e..8abd02036e0 100644 --- a/sys/dev/pci/if_ti.c +++ b/sys/dev/pci/if_ti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ti.c,v 1.35 2002/03/14 01:26:59 millert Exp $ */ +/* $OpenBSD: if_ti.c,v 1.36 2002/05/01 16:15:49 mickey Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -155,7 +155,7 @@ void ti_add_mcast(struct ti_softc *, struct ether_addr *); void ti_del_mcast(struct ti_softc *, struct ether_addr *); void ti_setmulti(struct ti_softc *); -void ti_mem(struct ti_softc *, u_int32_t, u_int32_t, caddr_t); +void ti_mem(struct ti_softc *, u_int32_t, u_int32_t, const void *); void ti_loadfw(struct ti_softc *); void ti_cmd(struct ti_softc *, struct ti_cmd_desc *); void ti_cmd_ext(struct ti_softc *, struct ti_cmd_desc *, @@ -326,13 +326,15 @@ int ti_read_eeprom(sc, dest, off, cnt) * NIC memory access function. Can be used to either clear a section * of NIC local memory or (if buf is non-NULL) copy data into it. */ -void ti_mem(sc, addr, len, buf) +void +ti_mem(sc, addr, len, buf) struct ti_softc *sc; u_int32_t addr, len; - caddr_t buf; + const void * buf; { int segptr, segsize, cnt; - caddr_t ti_winbase, ptr; + caddr_t ti_winbase; + const void * ptr; segptr = addr; cnt = len; @@ -346,10 +348,10 @@ void ti_mem(sc, addr, len, buf) segsize = TI_WINLEN - (segptr % TI_WINLEN); CSR_WRITE_4(sc, TI_WINBASE, (segptr & ~(TI_WINLEN - 1))); if (buf == NULL) - bzero((char *)ti_winbase + (segptr & + bzero(ti_winbase + (segptr & (TI_WINLEN - 1)), segsize); else { - bcopy((char *)ptr, (char *)ti_winbase + + bcopy(ptr, (char *)ti_winbase + (segptr & (TI_WINLEN - 1)), segsize); ptr += segsize; } @@ -381,11 +383,11 @@ void ti_loadfw(sc) return; } ti_mem(sc, tigonFwTextAddr, tigonFwTextLen, - (caddr_t)tigonFwText); + tigonFwText); ti_mem(sc, tigonFwDataAddr, tigonFwDataLen, - (caddr_t)tigonFwData); + tigonFwData); ti_mem(sc, tigonFwRodataAddr, tigonFwRodataLen, - (caddr_t)tigonFwRodata); + tigonFwRodata); ti_mem(sc, tigonFwBssAddr, tigonFwBssLen, NULL); ti_mem(sc, tigonFwSbssAddr, tigonFwSbssLen, NULL); CSR_WRITE_4(sc, TI_CPU_PROGRAM_COUNTER, tigonFwStartAddr); @@ -402,11 +404,11 @@ void ti_loadfw(sc) return; } ti_mem(sc, tigon2FwTextAddr, tigon2FwTextLen, - (caddr_t)tigon2FwText); + tigon2FwText); ti_mem(sc, tigon2FwDataAddr, tigon2FwDataLen, - (caddr_t)tigon2FwData); + tigon2FwData); ti_mem(sc, tigon2FwRodataAddr, tigon2FwRodataLen, - (caddr_t)tigon2FwRodata); + tigon2FwRodata); ti_mem(sc, tigon2FwBssAddr, tigon2FwBssLen, NULL); ti_mem(sc, tigon2FwSbssAddr, tigon2FwSbssLen, NULL); CSR_WRITE_4(sc, TI_CPU_PROGRAM_COUNTER, tigon2FwStartAddr); |