constify command buffer

This commit is contained in:
itohy 2003-02-15 02:36:52 +00:00
parent 9dc8f99b73
commit b1f5bd8e4f
3 changed files with 14 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: maple.c,v 1.24 2003/02/11 01:21:46 itohy Exp $ */
/* $NetBSD: maple.c,v 1.25 2003/02/15 02:36:52 itohy Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -118,9 +118,9 @@ static char * maple_unit_name(char *, int port, int subunit);
static void maple_begin_txbuf(struct maple_softc *);
static int maple_end_txbuf(struct maple_softc *);
static void maple_queue_command(struct maple_softc *, struct maple_unit *,
int command, int datalen, void *dataaddr);
int command, int datalen, const void *dataaddr);
static void maple_write_command(struct maple_softc *, struct maple_unit *,
int, int, void *);
int, int, const void *);
static void maple_start(struct maple_softc *sc);
static void maple_start_poll(struct maple_softc *);
static void maple_check_subunit_change(struct maple_softc *,
@ -427,7 +427,7 @@ static const int8_t subunit_code[] = { 0x20, 0x01, 0x02, 0x04, 0x08, 0x10 };
static void
maple_queue_command(struct maple_softc *sc, struct maple_unit *u,
int command, int datalen, void *dataaddr)
int command, int datalen, const void *dataaddr)
{
int to, from;
u_int32_t *p = sc->sc_txpos;
@ -454,7 +454,7 @@ maple_queue_command(struct maple_softc *sc, struct maple_unit *u,
/* Copy parameter data, if any */
if (datalen > 0) {
u_int32_t *param = dataaddr;
const u_int32_t *param = dataaddr;
int i;
for (i = 0; i < datalen; i++)
*p++ = *param++;
@ -467,7 +467,7 @@ maple_queue_command(struct maple_softc *sc, struct maple_unit *u,
static void
maple_write_command(struct maple_softc *sc, struct maple_unit *u, int command,
int datalen, void *dataaddr)
int datalen, const void *dataaddr)
{
#if defined(MAPLE_DEBUG) && MAPLE_DEBUG > 2
char buf[16];
@ -830,7 +830,7 @@ maple_detach_unit(struct maple_softc *sc, struct maple_unit *u)
*/
void
maple_command(struct device *dev, struct maple_unit *u, int func,
int command, int datalen, void *dataaddr, int flags)
int command, int datalen, const void *dataaddr, int flags)
{
struct maple_softc *sc = (void *) dev;
struct maple_func *fn;
@ -971,7 +971,7 @@ maple_unit_ping(struct maple_softc *sc)
struct maple_unit *u;
struct maple_func *fn;
#ifdef MAPLE_MEMCARD_PING_HACK
static u_int32_t memcard_ping_arg[2] = {
static const u_int32_t memcard_ping_arg[2] = {
0x02000000, /* htonl(MAPLE_FUNC(MAPLE_FN_MEMCARD)) */
0 /* pt (1 byte) and unused 3 bytes */
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: maple.h,v 1.6 2002/12/06 15:47:22 itohy Exp $ */
/* $NetBSD: maple.h,v 1.7 2003/02/15 02:36:52 itohy Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -143,8 +143,8 @@ extern void maple_enable_unit_ping(struct device *, struct maple_unit *,
extern void maple_enable_periodic(struct device *, struct maple_unit *,
int /*func*/, int /*on*/);
extern void maple_command(struct device *, struct maple_unit *,
int /*func*/, int /*command*/, int /*datalen*/, void *,
int /*flags*/);
int /*func*/, int /*command*/, int /*datalen*/,
const void *, int /*flags*/);
extern u_int32_t maple_get_function_data(struct maple_devinfo *, int);
extern void maple_run_polling(struct device *);
extern int maple_unit_ioctl(struct device *, struct maple_unit *,

View File

@ -1,4 +1,4 @@
/* $NetBSD: maplevar.h,v 1.6 2003/02/11 01:21:46 itohy Exp $ */
/* $NetBSD: maplevar.h,v 1.7 2003/02/15 02:36:53 itohy Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -98,7 +98,7 @@ struct maple_func {
/* command request */
int f_command;
int f_datalen;
void *f_dataaddr;
const void *f_dataaddr;
enum maple_command_stat {
MAPLE_CMDSTAT_NONE, /* not in queue */
MAPLE_CMDSTAT_ASYNC, /* process immediately */
@ -148,7 +148,7 @@ struct maple_unit {
/* for restarting command */
int u_command;
int u_datalen;
void *u_dataaddr;
const void *u_dataaddr;
enum maple_dma_stat u_saved_dma_stat;
int u_retrycnt;
#define MAPLE_RETRY_MAX 100 /* ~2s */