Use (uint8_t *) to specify buffers for hpib xfers.
This commit is contained in:
parent
3b35cc0643
commit
c06815799e
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ct.c,v 1.5 2005/12/11 12:17:19 christos Exp $ */
|
||||
/* $NetBSD: ct.c,v 1.6 2006/06/25 17:37:43 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1990, 1993
|
||||
@ -85,7 +85,7 @@ int
|
||||
ctinit(int ctlr, int unit)
|
||||
{
|
||||
struct ct_softc *rs = &ct_softc[ctlr][unit];
|
||||
u_char stat;
|
||||
uint8_t stat;
|
||||
|
||||
if (hpibrecv(ctlr, unit, C_QSTAT, &stat, 1) != 1 || stat)
|
||||
return 0;
|
||||
@ -98,7 +98,7 @@ ctinit(int ctlr, int unit)
|
||||
ct_ssmc.refm = REF_MASK;
|
||||
ct_ssmc.aefm = AEF_MASK;
|
||||
ct_ssmc.iefm = IEF_MASK;
|
||||
hpibsend(ctlr, unit, C_CMD, (char *)&ct_ssmc, sizeof(ct_ssmc));
|
||||
hpibsend(ctlr, unit, C_CMD, (uint8_t *)&ct_ssmc, sizeof(ct_ssmc));
|
||||
hpibswait(ctlr, unit);
|
||||
hpibrecv(ctlr, unit, C_QSTAT, &stat, 1);
|
||||
rs->sc_alive = 1;
|
||||
@ -109,7 +109,7 @@ int
|
||||
ctident(int ctlr, int unit)
|
||||
{
|
||||
struct ct_describe desc;
|
||||
u_char stat, cmd[3];
|
||||
uint8_t stat, cmd[3];
|
||||
char name[7];
|
||||
int id, i;
|
||||
|
||||
@ -133,7 +133,7 @@ ctident(int ctlr, int unit)
|
||||
cmd[1] = C_SVOL(0);
|
||||
cmd[2] = C_DESC;
|
||||
hpibsend(ctlr, unit, C_CMD, cmd, sizeof(cmd));
|
||||
hpibrecv(ctlr, unit, C_EXEC, (char *)&desc, 37);
|
||||
hpibrecv(ctlr, unit, C_EXEC, (uint8_t *)&desc, 37);
|
||||
hpibrecv(ctlr, unit, C_QSTAT, &stat, sizeof(stat));
|
||||
memset(name, 0, sizeof(name));
|
||||
if (!stat) {
|
||||
@ -220,10 +220,10 @@ ctstrategy(void *devdata, int func, daddr_t dblk, size_t size, void *v_buf,
|
||||
size_t *rsize)
|
||||
{
|
||||
struct ct_softc *rs = devdata;
|
||||
char *buf = v_buf;
|
||||
uint8_t *buf = v_buf;
|
||||
int ctlr = rs->sc_ctlr;
|
||||
int unit = rs->sc_unit;
|
||||
char stat;
|
||||
uint8_t stat;
|
||||
|
||||
if (size == 0 && (func == F_READ || func == F_WRITE))
|
||||
return 0;
|
||||
@ -259,7 +259,7 @@ top:
|
||||
size = 0;
|
||||
}
|
||||
retry:
|
||||
hpibsend(ctlr, unit, C_CMD, (char *)&ct_ioc, sizeof(ct_ioc));
|
||||
hpibsend(ctlr, unit, C_CMD, (uint8_t *)&ct_ioc, sizeof(ct_ioc));
|
||||
if (func != MTREW) {
|
||||
hpibswait(ctlr, unit);
|
||||
hpibgo(ctlr, unit, C_EXEC, buf, size,
|
||||
@ -292,14 +292,14 @@ int
|
||||
cterror(int ctlr, int unit)
|
||||
{
|
||||
struct ct_softc *rs = &ct_softc[ctlr][unit];
|
||||
char stat;
|
||||
uint8_t stat;
|
||||
|
||||
memset(&ct_rsc, 0, sizeof(ct_rsc));
|
||||
memset(&ct_stat, 0, sizeof(ct_stat));
|
||||
ct_rsc.unit = C_SUNIT(rs->sc_punit);
|
||||
ct_rsc.cmd = C_STATUS;
|
||||
hpibsend(ctlr, unit, C_CMD, (char *)&ct_rsc, sizeof(ct_rsc));
|
||||
hpibrecv(ctlr, unit, C_EXEC, (char *)&ct_stat, sizeof(ct_stat));
|
||||
hpibsend(ctlr, unit, C_CMD, (uint8_t *)&ct_rsc, sizeof(ct_rsc));
|
||||
hpibrecv(ctlr, unit, C_EXEC, (uint8_t *)&ct_stat, sizeof(ct_stat));
|
||||
hpibrecv(ctlr, unit, C_QSTAT, &stat, 1);
|
||||
if (stat) {
|
||||
printf("ct%d: request status fail %d\n", unit, stat);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fhpib.c,v 1.5 2005/12/11 12:17:19 christos Exp $ */
|
||||
/* $NetBSD: fhpib.c,v 1.6 2006/06/25 17:37:43 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1990, 1993
|
||||
@ -80,7 +80,7 @@ fhpibreset(int unit)
|
||||
}
|
||||
|
||||
int
|
||||
fhpibsend(int unit, int slave, int sec, char *buf, int cnt)
|
||||
fhpibsend(int unit, int slave, int sec, uint8_t *buf, int cnt)
|
||||
{
|
||||
struct hpib_softc *hs = &hpib_softc[unit];
|
||||
struct fhpibdevice *hd;
|
||||
@ -120,7 +120,7 @@ fhpibsend(int unit, int slave, int sec, char *buf, int cnt)
|
||||
}
|
||||
|
||||
int
|
||||
fhpibrecv(int unit, int slave, int sec, char *buf, int cnt)
|
||||
fhpibrecv(int unit, int slave, int sec, uint8_t *buf, int cnt)
|
||||
{
|
||||
struct hpib_softc *hs = &hpib_softc[unit];
|
||||
struct fhpibdevice *hd;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hpib.c,v 1.6 2005/12/11 12:17:19 christos Exp $ */
|
||||
/* $NetBSD: hpib.c,v 1.7 2006/06/25 17:37:43 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1990, 1993
|
||||
@ -89,16 +89,16 @@ hpibid(int unit, int slave)
|
||||
int rv;
|
||||
|
||||
if (hpib_softc[unit].sc_type == HPIBC)
|
||||
rv = fhpibrecv(unit, 31, slave, (char *)&id, 2);
|
||||
rv = fhpibrecv(unit, 31, slave, (uint8_t *)&id, 2);
|
||||
else
|
||||
rv = nhpibrecv(unit, 31, slave, (char *)&id, 2);
|
||||
rv = nhpibrecv(unit, 31, slave, (uint8_t *)&id, 2);
|
||||
if (rv != 2)
|
||||
return 0;
|
||||
return id;
|
||||
}
|
||||
|
||||
int
|
||||
hpibsend(int unit, int slave, int sec, char *buf, int cnt)
|
||||
hpibsend(int unit, int slave, int sec, uint8_t *buf, int cnt)
|
||||
{
|
||||
|
||||
if (hpib_softc[unit].sc_type == HPIBC)
|
||||
@ -107,7 +107,7 @@ hpibsend(int unit, int slave, int sec, char *buf, int cnt)
|
||||
}
|
||||
|
||||
int
|
||||
hpibrecv(int unit, int slave, int sec, char *buf, int cnt)
|
||||
hpibrecv(int unit, int slave, int sec, uint8_t *buf, int cnt)
|
||||
{
|
||||
|
||||
if (hpib_softc[unit].sc_type == HPIBC)
|
||||
@ -135,7 +135,7 @@ hpibswait(int unit, int slave)
|
||||
}
|
||||
|
||||
void
|
||||
hpibgo(int unit, int slave, int sec, char *addr, int count, int flag)
|
||||
hpibgo(int unit, int slave, int sec, uint8_t *addr, int count, int flag)
|
||||
{
|
||||
|
||||
if (hpib_softc[unit].sc_type == HPIBC)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hpibvar.h,v 1.4 2005/12/11 12:17:19 christos Exp $ */
|
||||
/* $NetBSD: hpibvar.h,v 1.5 2006/06/25 17:37:43 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1990, 1993
|
||||
@ -61,22 +61,22 @@ extern int internalhpib;
|
||||
void hpibinit(void);
|
||||
int hpibalive(int);
|
||||
int hpibid(int, int);
|
||||
int hpibsend(int, int, int, char *, int);
|
||||
int hpibrecv(int, int, int, char *, int);
|
||||
int hpibsend(int, int, int, uint8_t *, int);
|
||||
int hpibrecv(int, int, int, uint8_t *, int);
|
||||
int hpibswait(int, int);
|
||||
void hpibgo(int, int, int, char *, int, int);
|
||||
void hpibgo(int, int, int, uint8_t *, int, int);
|
||||
|
||||
/* fhpib.c */
|
||||
int fhpibinit(int);
|
||||
void fhpibreset(int);
|
||||
int fhpibsend(int, int, int, char *, int);
|
||||
int fhpibrecv(int, int, int, char *, int);
|
||||
int fhpibsend(int, int, int, uint8_t *, int);
|
||||
int fhpibrecv(int, int, int, uint8_t *, int);
|
||||
int fhpibppoll(int);
|
||||
|
||||
/* nhpib.c */
|
||||
int nhpibinit(int);
|
||||
void nhpibreset(int);
|
||||
int nhpibsend(int, int, int, char *, int);
|
||||
int nhpibrecv(int, int, int, char *, int);
|
||||
int nhpibsend(int, int, int, uint8_t *, int);
|
||||
int nhpibrecv(int, int, int, uint8_t *, int);
|
||||
int nhpibppoll(int);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nhpib.c,v 1.5 2005/12/11 12:17:19 christos Exp $ */
|
||||
/* $NetBSD: nhpib.c,v 1.6 2006/06/25 17:37:43 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1990, 1993
|
||||
@ -96,7 +96,7 @@ nhpibreset(int unit)
|
||||
}
|
||||
|
||||
int
|
||||
nhpibsend(int unit, int slave, int sec, char *buf, int cnt)
|
||||
nhpibsend(int unit, int slave, int sec, uint8_t *buf, int cnt)
|
||||
{
|
||||
struct hpib_softc *hs = &hpib_softc[unit];
|
||||
struct nhpibdevice *hd;
|
||||
@ -132,7 +132,7 @@ nhpibsend(int unit, int slave, int sec, char *buf, int cnt)
|
||||
}
|
||||
|
||||
int
|
||||
nhpibrecv(int unit, int slave, int sec, char *buf, int cnt)
|
||||
nhpibrecv(int unit, int slave, int sec, uint8_t *buf, int cnt)
|
||||
{
|
||||
struct hpib_softc *hs = &hpib_softc[unit];
|
||||
struct nhpibdevice *hd;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rd.c,v 1.6 2005/12/11 12:17:19 christos Exp $ */
|
||||
/* $NetBSD: rd.c,v 1.7 2006/06/25 17:37:43 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1990, 1993
|
||||
@ -168,7 +168,7 @@ rdinit(int ctlr, int unit)
|
||||
static void
|
||||
rdreset(int ctlr, int unit)
|
||||
{
|
||||
u_char stat;
|
||||
uint8_t stat;
|
||||
|
||||
rd_ssmc.c_unit = C_SUNIT(0);
|
||||
rd_ssmc.c_cmd = C_SSM;
|
||||
@ -176,7 +176,7 @@ rdreset(int ctlr, int unit)
|
||||
rd_ssmc.c_fefm = FEF_MASK;
|
||||
rd_ssmc.c_aefm = AEF_MASK;
|
||||
rd_ssmc.c_iefm = IEF_MASK;
|
||||
hpibsend(ctlr, unit, C_CMD, (char *)&rd_ssmc, sizeof(rd_ssmc));
|
||||
hpibsend(ctlr, unit, C_CMD, (uint8_t *)&rd_ssmc, sizeof(rd_ssmc));
|
||||
hpibswait(ctlr, unit);
|
||||
hpibrecv(ctlr, unit, C_QSTAT, &stat, 1);
|
||||
}
|
||||
@ -185,7 +185,7 @@ static int
|
||||
rdident(int ctlr, int unit)
|
||||
{
|
||||
struct rd_describe desc;
|
||||
u_char stat, cmd[3];
|
||||
uint8_t stat, cmd[3];
|
||||
char name[7];
|
||||
int id, i;
|
||||
|
||||
@ -203,7 +203,7 @@ rdident(int ctlr, int unit)
|
||||
cmd[1] = C_SVOL(0);
|
||||
cmd[2] = C_DESC;
|
||||
hpibsend(ctlr, unit, C_CMD, cmd, sizeof(cmd));
|
||||
hpibrecv(ctlr, unit, C_EXEC, (char *)&desc, 37);
|
||||
hpibrecv(ctlr, unit, C_EXEC, (uint8_t *)&desc, 37);
|
||||
hpibrecv(ctlr, unit, C_QSTAT, &stat, sizeof(stat));
|
||||
memset(name, 0, sizeof(name));
|
||||
if (!stat) {
|
||||
@ -339,12 +339,12 @@ int
|
||||
rdstrategy(void *devdata, int func, daddr_t dblk, size_t size, void *v_buf,
|
||||
size_t *rsize)
|
||||
{
|
||||
char *buf = v_buf;
|
||||
uint8_t *buf = v_buf;
|
||||
struct rd_softc *rs = devdata;
|
||||
int ctlr = rs->sc_ctlr;
|
||||
int unit = rs->sc_unit;
|
||||
daddr_t blk;
|
||||
char stat;
|
||||
uint8_t stat;
|
||||
|
||||
if (size == 0)
|
||||
return 0;
|
||||
@ -366,7 +366,8 @@ rdstrategy(void *devdata, int func, daddr_t dblk, size_t size, void *v_buf,
|
||||
rd_ioc.c_len = size;
|
||||
rd_ioc.c_cmd = func == F_READ ? C_READ : C_WRITE;
|
||||
retry:
|
||||
hpibsend(ctlr, unit, C_CMD, &rd_ioc.c_unit, sizeof(rd_ioc)-2);
|
||||
hpibsend(ctlr, unit, C_CMD, (uint8_t *)&rd_ioc.c_unit,
|
||||
sizeof(rd_ioc) - 2);
|
||||
hpibswait(ctlr, unit);
|
||||
hpibgo(ctlr, unit, C_EXEC, buf, size, func);
|
||||
hpibswait(ctlr, unit);
|
||||
@ -386,14 +387,14 @@ retry:
|
||||
static int
|
||||
rderror(int ctlr, int unit, int part)
|
||||
{
|
||||
char stat;
|
||||
uint8_t stat;
|
||||
|
||||
rd_rsc.c_unit = C_SUNIT(0);
|
||||
rd_rsc.c_sram = C_SRAM;
|
||||
rd_rsc.c_ram = C_RAM;
|
||||
rd_rsc.c_cmd = C_STATUS;
|
||||
hpibsend(ctlr, unit, C_CMD, (char *)&rd_rsc, sizeof(rd_rsc));
|
||||
hpibrecv(ctlr, unit, C_EXEC, (char *)&rd_stat, sizeof(rd_stat));
|
||||
hpibsend(ctlr, unit, C_CMD, (uint8_t *)&rd_rsc, sizeof(rd_rsc));
|
||||
hpibrecv(ctlr, unit, C_EXEC, (uint8_t *)&rd_stat, sizeof(rd_stat));
|
||||
hpibrecv(ctlr, unit, C_QSTAT, &stat, 1);
|
||||
if (stat) {
|
||||
printf("rd(%d,%d,0,%d): request status fail %d\n",
|
||||
|
Loading…
Reference in New Issue
Block a user