diff options
author | 2011-01-02 00:49:05 +0000 | |
---|---|---|
committer | 2011-01-02 00:49:05 +0000 | |
commit | 4334b17883a36d4dc159dce019a08c4608c63c7a (patch) | |
tree | 4fe22dad65b804f0f49e54240e2d147b42db7650 | |
parent | Declare ourselves to be a virtual disk server during the version negotiation (diff) | |
download | wireguard-openbsd-4334b17883a36d4dc159dce019a08c4608c63c7a.tar.xz wireguard-openbsd-4334b17883a36d4dc159dce019a08c4608c63c7a.zip |
Use the session ID passed to use by the virtual disk client, and pass back
a bit more information to the client during the attribute negotiation phase.
Gets us past the attribute negotiation phase against an OpenSolaris virtual
disk client.
-rw-r--r-- | sys/arch/sparc64/dev/vdsp.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/arch/sparc64/dev/vdsp.c b/sys/arch/sparc64/dev/vdsp.c index 0cb3922b5a9..fca04548116 100644 --- a/sys/arch/sparc64/dev/vdsp.c +++ b/sys/arch/sparc64/dev/vdsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vdsp.c,v 1.3 2011/01/02 00:35:23 kettenis Exp $ */ +/* $OpenBSD: vdsp.c,v 1.4 2011/01/02 00:49:05 kettenis Exp $ */ /* * Copyright (c) 2009 Mark Kettenis * @@ -130,6 +130,12 @@ struct vdsk_desc_msg { #define VDSK_MAJOR 1 #define VDSK_MINOR 0 +/* + * And we only support Block Read, Block Write and Flush commands. + */ +#define VD_OP_MASK \ + ((1 << VD_OP_BREAD) | (1 << VD_OP_BWRITE) | (1 << VD_OP_FLUSH)) + struct vdsp_softc { struct device sc_dv; int sc_idx; @@ -477,8 +483,9 @@ vdsp_rx_vio_ver_info(struct vdsp_softc *sc, struct vio_msg_tag *tag) return; } + sc->sc_local_sid = vi->tag.sid; + vi->tag.stype = VIO_SUBTYPE_ACK; - vi->tag.sid = sc->sc_local_sid; vi->minor = VDSK_MINOR; vi->dev_class = VDEV_DISK_SERVER; vdsp_sendmsg(sc, vi, sizeof(*vi)); @@ -823,8 +830,11 @@ vdsp_open(void *arg1, void *arg2) ai.tag.stype_env = VIO_ATTR_INFO; ai.tag.sid = sc->sc_local_sid; ai.xfer_mode = sc->sc_xfer_mode; + ai.vd_type = VD_DISK_TYPE_DISK; ai.vdisk_block_size = sc->sc_vdisk_block_size; + ai.operations = VD_OP_MASK; ai.vdisk_size = sc->sc_vdisk_size; + ai.max_xfer_sz = MAXPHYS / sc->sc_vdisk_block_size; vdsp_sendmsg(sc, &ai, sizeof(ai)); } |