diff options
Diffstat (limited to 'usr/src/uts/common')
-rw-r--r-- | usr/src/uts/common/io/ib/ibnex/ibnex_hca.c | 4 | ||||
-rw-r--r-- | usr/src/uts/common/io/openprom.c | 72 | ||||
-rw-r--r-- | usr/src/uts/common/krtld/kobj_bootflags.c | 2 | ||||
-rw-r--r-- | usr/src/uts/common/net/pfkeyv2.h | 4 | ||||
-rw-r--r-- | usr/src/uts/common/sys/Makefile | 1 | ||||
-rw-r--r-- | usr/src/uts/common/sys/wanboot_impl.h | 78 | ||||
-rw-r--r-- | usr/src/uts/common/xen/io/xdf.c | 51 | ||||
-rw-r--r-- | usr/src/uts/common/xen/io/xdf.h | 3 |
8 files changed, 23 insertions, 192 deletions
diff --git a/usr/src/uts/common/io/ib/ibnex/ibnex_hca.c b/usr/src/uts/common/io/ib/ibnex/ibnex_hca.c index bc08108c6e..a314f9cc5d 100644 --- a/usr/src/uts/common/io/ib/ibnex/ibnex_hca.c +++ b/usr/src/uts/common/io/ib/ibnex/ibnex_hca.c @@ -299,7 +299,7 @@ ibnex_hca_bus_unconfig(dev_info_t *parent, * Configures a particular port node for a IP over IB communication * service. * The format of the input string "devname" is - * port=x,pkey=y,protocol=ip,<wanboot options> + * port=x,pkey=y,protocol=ip * Thr format of the node name created here is * ibport@<Port#>,<pkey>,<service name> * where pkey = 0 for port communication service nodes @@ -469,7 +469,7 @@ ibnex_get_cdip_info(dev_info_t *parent, static int ibnex_hca_bus_config_one(dev_info_t *parent, void *devname, -ddi_bus_config_op_t op, uint_t *flag, dev_info_t **child) + ddi_bus_config_op_t op, uint_t *flag, dev_info_t **child) { int ret = IBNEX_SUCCESS, len, circ, need_bus_config; char *device_name, *caddr, *cname; diff --git a/usr/src/uts/common/io/openprom.c b/usr/src/uts/common/io/openprom.c index f541037450..1b2ef95f51 100644 --- a/usr/src/uts/common/io/openprom.c +++ b/usr/src/uts/common/io/openprom.c @@ -53,7 +53,6 @@ #include <sys/promif.h> #include <sys/sysmacros.h> /* offsetof */ #include <sys/nvpair.h> -#include <sys/wanboot_impl.h> #include <sys/zone.h> #include <sys/consplat.h> #include <sys/bootconf.h> @@ -498,13 +497,6 @@ opromioctl_cb(void *avp, int has_changed) } break; -#if !defined(__i386) && !defined(__amd64) - case WANBOOT_SETKEY: - if (!(mode & FWRITE)) - return (EPERM); - break; -#endif /* !__i386 && !defined(__amd64) */ - default: return (EINVAL); } @@ -1017,68 +1009,6 @@ opromioctl_cb(void *avp, int has_changed) break; } /* case OPROMREADY64 */ - - case WANBOOT_SETKEY: { - struct wankeyio *wp; - int reslen; - int status; - int rv; - int i; - - /* - * The argument is a struct wankeyio. Validate it as best - * we can. - */ - if (userbufsize != (sizeof (struct wankeyio))) { - error = EINVAL; - break; - } - if (copyin(((caddr_t)arg + sizeof (uint_t)), - opp->oprom_array, sizeof (struct wankeyio)) != 0) { - error = EFAULT; - break; - } - wp = (struct wankeyio *)opp->oprom_array; - - /* check for key name and key size overflow */ - for (i = 0; i < WANBOOT_MAXKEYNAMELEN; i++) - if (wp->wk_keyname[i] == '\0') - break; - if ((i == WANBOOT_MAXKEYNAMELEN) || - (wp->wk_keysize > WANBOOT_MAXKEYLEN)) { - error = EINVAL; - break; - } - - rv = prom_set_security_key(wp->wk_keyname, wp->wk_u.key, - wp->wk_keysize, &reslen, &status); - if (rv) - error = EIO; - else - switch (status) { - case 0: - error = 0; - break; - - case -2: /* out of key storage space */ - error = ENOSPC; - break; - - case -3: /* key name or value too long */ - error = EINVAL; - break; - - case -4: /* can't delete: no such key */ - error = ENOENT; - break; - - case -1: /* unspecified error */ - default: /* this should not happen */ - error = EIO; - break; - } - break; - } /* case WANBOOT_SETKEY */ #endif /* !__i386 && !__amd64 */ } /* switch (cmd) */ @@ -1089,7 +1019,7 @@ opromioctl_cb(void *avp, int has_changed) /*ARGSUSED*/ static int opromioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *credp, int *rvalp) + cred_t *credp, int *rvalp) { struct oprom_state *st; struct opromioctl_args arg_block; diff --git a/usr/src/uts/common/krtld/kobj_bootflags.c b/usr/src/uts/common/krtld/kobj_bootflags.c index f94096539a..699f0a1114 100644 --- a/usr/src/uts/common/krtld/kobj_bootflags.c +++ b/usr/src/uts/common/krtld/kobj_bootflags.c @@ -151,7 +151,7 @@ bootflags(struct bootops *ops) (void) strlcat(initargs, " ", sizeof (initargs)); break; #if defined(_OBP) - /* Ignore argument meant for wanboot standalone */ + /* Ignore legacy wanboot argument meant for standalone */ case 'o': break; #endif diff --git a/usr/src/uts/common/net/pfkeyv2.h b/usr/src/uts/common/net/pfkeyv2.h index df8d72c58c..02092cc99c 100644 --- a/usr/src/uts/common/net/pfkeyv2.h +++ b/usr/src/uts/common/net/pfkeyv2.h @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright 2018 Joyent, Inc. + * Copyright (c) 2018, Joyent, Inc. */ #ifndef _NET_PFKEYV2_H @@ -845,7 +845,7 @@ typedef struct sadb_x_edump { #define SADB_X_KMP_KINK 2 #define SADB_X_KMP_IKEV2 3 -#define SADB_X_KMP_MAX 3 +#define SADB_X_KMP_MAX SADB_X_KMP_IKEV2 /* * Handy conversion macros. Not part of the PF_KEY spec... diff --git a/usr/src/uts/common/sys/Makefile b/usr/src/uts/common/sys/Makefile index 0d2076821f..0fa800d39e 100644 --- a/usr/src/uts/common/sys/Makefile +++ b/usr/src/uts/common/sys/Makefile @@ -679,7 +679,6 @@ CHKHDRS= \ vxlan.h \ wait.h \ waitq.h \ - wanboot_impl.h \ watchpoint.h \ winlockio.h \ zcons.h \ diff --git a/usr/src/uts/common/sys/wanboot_impl.h b/usr/src/uts/common/sys/wanboot_impl.h deleted file mode 100644 index b953593fa1..0000000000 --- a/usr/src/uts/common/sys/wanboot_impl.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _SYS_WANBOOT_IMPL_H -#define _SYS_WANBOOT_IMPL_H - -#include <sys/types.h> -#include <aes.h> -#include <des3.h> -#include <hmac_sha1.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * PKCS12 passphrase used by WAN boot - */ -#define WANBOOT_PASSPHRASE "boy with goldfish" - -/* - * Key names used by OBP. - */ -#define WANBOOT_DES3_KEY_NAME "wanboot-3des" -#define WANBOOT_AES_128_KEY_NAME "wanboot-aes" -#define WANBOOT_HMAC_SHA1_KEY_NAME "wanboot-hmac-sha1" -#define WANBOOT_MAXKEYNAMELEN sizeof (WANBOOT_HMAC_SHA1_KEY_NAME) - -#define WANBOOT_MAXKEYLEN 1024 /* sized for RSA */ - -#define WANBOOT_MAXBLOCKLEN AES_BLOCK_SIZE -#define WANBOOT_HMAC_KEY_SIZE 20 /* size of key we use for HMAC SHA-1 */ - -struct wankeyio { - char wk_keyname[WANBOOT_MAXKEYNAMELEN]; - uint_t wk_keysize; - union { - char hmac_sha1_key[WANBOOT_HMAC_KEY_SIZE]; - char des3key[DES3_KEY_SIZE]; - char aeskey[AES_128_KEY_SIZE]; - char key[WANBOOT_MAXKEYLEN]; - } wk_u; -}; - -#define wk_hmac_sha1_key wk_u.hmac_sha1_key -#define wk_3des_key wk_u.3des_key -#define wk_aes_key wk_u.aeskey - -#define WANBOOT_SETKEY (('W' << 24) | ('A' << 16) | ('N' << 8) | 0) - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_WANBOOT_IMPL_H */ diff --git a/usr/src/uts/common/xen/io/xdf.c b/usr/src/uts/common/xen/io/xdf.c index 7dfffaed41..71e9a17ae7 100644 --- a/usr/src/uts/common/xen/io/xdf.c +++ b/usr/src/uts/common/xen/io/xdf.c @@ -599,15 +599,9 @@ xdf_cmlb_attach(xdf_t *vdp) return (cmlb_attach(dip, &xdf_lb_ops, XD_IS_CD(vdp) ? DTYPE_RODIRECT : DTYPE_DIRECT, - XD_IS_RM(vdp), - B_TRUE, + XD_IS_RM(vdp), B_TRUE, XD_IS_CD(vdp) ? DDI_NT_CD_XVMD : DDI_NT_BLOCK_XVMD, -#ifdef XPV_HVM_DRIVER - (XD_IS_CD(vdp) ? 0 : CMLB_CREATE_ALTSLICE_VTOC_16_DTYPE_DIRECT), -#else /* XPV_HVM_DRIVER */ - 0, -#endif /* XPV_HVM_DRIVER */ - vdp->xdf_vd_lbl, NULL)); + 0, vdp->xdf_vd_lbl, NULL)); } static void @@ -1665,23 +1659,20 @@ xdf_get_flush_block(xdf_t *vdp) static void xdf_setstate_ready(void *arg) { - xdf_t *vdp = (xdf_t *)arg; + xdf_t *vdp = (xdf_t *)arg; + dev_info_t *dip = vdp->xdf_dip; vdp->xdf_ready_tq_thread = curthread; - /* - * We've created all the minor nodes via cmlb_attach() using default - * value in xdf_attach() to make it possible to block in xdf_open(), - * in case there's anyone (say, booting thread) ever trying to open - * it before connected to backend. We will refresh all those minor - * nodes w/ latest info we've got now when we are almost connected. - */ + /* Create minor nodes now when we are almost connected */ mutex_enter(&vdp->xdf_dev_lk); - if (vdp->xdf_cmbl_reattach) { - vdp->xdf_cmbl_reattach = B_FALSE; - + if (vdp->xdf_cmlb_reattach) { + vdp->xdf_cmlb_reattach = B_FALSE; mutex_exit(&vdp->xdf_dev_lk); if (xdf_cmlb_attach(vdp) != 0) { + cmn_err(CE_WARN, + "xdf@%s: cmlb attach failed", + ddi_get_name_addr(dip)); xdf_disconnect(vdp, XD_UNKNOWN, B_FALSE); return; } @@ -1863,7 +1854,7 @@ xdf_setstate_connected(xdf_t *vdp) if ((vdp->xdf_dinfo != dinfo) || (!vdp->xdf_pgeom_fixed && (memcmp(&vdp->xdf_pgeom, &pgeom, sizeof (pgeom)) != 0))) { - vdp->xdf_cmbl_reattach = B_TRUE; + vdp->xdf_cmlb_reattach = B_TRUE; vdp->xdf_dinfo = dinfo; if (!vdp->xdf_pgeom_fixed) @@ -3476,7 +3467,7 @@ xdf_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) mutex_init(&vdp->xdf_dev_lk, NULL, MUTEX_DRIVER, (void *)ibc); mutex_init(&vdp->xdf_cb_lk, NULL, MUTEX_DRIVER, (void *)ibc); mutex_init(&vdp->xdf_iostat_lk, NULL, MUTEX_DRIVER, (void *)ibc); - vdp->xdf_cmbl_reattach = B_TRUE; + vdp->xdf_cmlb_reattach = B_TRUE; if (dev_iscd) { vdp->xdf_dinfo |= VDISK_CDROM; vdp->xdf_mstate = DKIO_EJECTED; @@ -3510,21 +3501,10 @@ xdf_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) vdp->xdf_pgeom_fixed = B_FALSE; /* - * Create default device minor nodes: non-removable disk. - * We will adjust minor nodes after we are connected w/ backend. - * - * FIXME creating device minor nodes is currently disabled for CD - * devices, re-enable once the issues with xdf CD devices are fixed. + * Allocate the cmlb handle, minor nodes will be created once + * the device is connected with backend. */ - if (!dev_iscd) { - cmlb_alloc_handle(&vdp->xdf_vd_lbl); - if (xdf_cmlb_attach(vdp) != 0) { - cmn_err(CE_WARN, - "xdf@%s: attach failed, cmlb attach failed", - ddi_get_name_addr(dip)); - goto errout0; - } - } + cmlb_alloc_handle(&vdp->xdf_vd_lbl); /* We ship with cache-enabled disks */ vdp->xdf_wce = B_TRUE; @@ -3653,7 +3633,6 @@ errout1: xvdi_remove_event_handler(dip, XS_OE_STATE); errout0: if (vdp->xdf_vd_lbl != NULL) { - cmlb_detach(vdp->xdf_vd_lbl, NULL); cmlb_free_handle(&vdp->xdf_vd_lbl); vdp->xdf_vd_lbl = NULL; } diff --git a/usr/src/uts/common/xen/io/xdf.h b/usr/src/uts/common/xen/io/xdf.h index dbe012c30c..49dedb590f 100644 --- a/usr/src/uts/common/xen/io/xdf.h +++ b/usr/src/uts/common/xen/io/xdf.h @@ -26,6 +26,7 @@ /* * Copyright (c) 2014 by Delphix. All rights reserved. + * Copyright 2017 Nexenta Systems, Inc. */ #ifndef _SYS_XDF_H @@ -243,7 +244,7 @@ typedef struct xdf { boolean_t xdf_flush_supported; boolean_t xdf_media_req_supported; boolean_t xdf_wce; - boolean_t xdf_cmbl_reattach; + boolean_t xdf_cmlb_reattach; char *xdf_flush_mem; char *xdf_cache_flush_block; int xdf_evtchn; |