diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-03-22 11:45:13 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-03-22 11:45:13 +0000 |
commit | 676e5a3191976b70611699f226b8447ef2b0ee1a (patch) | |
tree | bf2121ac2635c08eb4f70e8afca1903e73d45ca3 | |
parent | d8fc647be2c6caf34bbf0e0b6990d1d798f0c108 (diff) | |
parent | d6d53e641a3b316390a4230fe98744882d9a4c10 (diff) | |
download | illumos-joyent-676e5a3191976b70611699f226b8447ef2b0ee1a.tar.gz |
[illumos-gate merge]
commit d6d53e641a3b316390a4230fe98744882d9a4c10
10555 fix build race in usr/src/boot/sys/boot/i386/loader
commit 5e06bd59d59926d13427e57eb4e217f32c667310
10090 rt2860_free_rx_ring doesn't need to check for NULL array
commit 1752e73c5b177fe2f2284c58df9d4e11fa24ffdf
10542 spdsock: cast between incompatible function types
commit 2bcc9601e83363d9147978a7616864c880b5c05a
10538 sppp: cast between incompatible function types
commit a484bfa2079bc90573ca9a036def78c0cc8aa809
10537 softmac: cast between incompatible function types
commit 1ef1b39822f02981cf693197a94ee81aa30c1c26
10536 st: cast between incompatible function types
commit a2f10c447c8cfe20ac08f6c287fe67307f2a5175
10481 loader.efi: comconsole needs to identify the port handle better
commit c83793e8beca1f638b19f9fba9570ee705f7a494
10116 mech_dh needs smatch fixes
-rw-r--r-- | usr/src/boot/Makefile.version | 2 | ||||
-rw-r--r-- | usr/src/boot/sys/boot/efi/loader/comconsole.c | 94 | ||||
-rw-r--r-- | usr/src/boot/sys/boot/i386/loader/Makefile | 6 | ||||
-rw-r--r-- | usr/src/lib/gss_mechs/mech_dh/dh_common/dh_template.c | 8 | ||||
-rw-r--r-- | usr/src/uts/common/inet/ip/spdsock.c | 79 | ||||
-rw-r--r-- | usr/src/uts/common/io/ppp/sppp/sppp.c | 31 | ||||
-rw-r--r-- | usr/src/uts/common/io/ppp/sppp/sppp.h | 14 | ||||
-rw-r--r-- | usr/src/uts/common/io/ppp/sppp/sppp_mod.c | 18 | ||||
-rw-r--r-- | usr/src/uts/common/io/rwn/rt2860.c | 10 | ||||
-rw-r--r-- | usr/src/uts/common/io/scsi/targets/st.c | 77 | ||||
-rw-r--r-- | usr/src/uts/common/io/softmac/softmac_dev.c | 45 |
11 files changed, 230 insertions, 154 deletions
diff --git a/usr/src/boot/Makefile.version b/usr/src/boot/Makefile.version index 646545a76c..205b3d6065 100644 --- a/usr/src/boot/Makefile.version +++ b/usr/src/boot/Makefile.version @@ -33,4 +33,4 @@ LOADER_VERSION = 1.1 # Use date like formatting here, YYYY.MM.DD.XX, without leading zeroes. # The version is processed from left to right, the version number can only # be increased. -BOOT_VERSION = $(LOADER_VERSION)-2019.03.07.1 +BOOT_VERSION = $(LOADER_VERSION)-2019.03.07.2 diff --git a/usr/src/boot/sys/boot/efi/loader/comconsole.c b/usr/src/boot/sys/boot/efi/loader/comconsole.c index 6f3eed7aa1..2399d37760 100644 --- a/usr/src/boot/sys/boot/efi/loader/comconsole.c +++ b/usr/src/boot/sys/boot/efi/loader/comconsole.c @@ -43,6 +43,8 @@ static EFI_GUID serial = SERIAL_IO_PROTOCOL; #define COMSPEED 9600 #endif +#define PNP0501 0x501 /* 16550A-compatible COM port */ + struct serial { uint64_t baudrate; uint8_t databits; @@ -119,7 +121,7 @@ struct console ttyd = { .c_private = NULL }; -EFI_STATUS +static EFI_STATUS efi_serial_init(EFI_HANDLE **handlep, int *nhandles) { UINTN bufsz = 0; @@ -138,7 +140,7 @@ efi_serial_init(EFI_HANDLE **handlep, int *nhandles) if ((handles = malloc(bufsz)) == NULL) return (ENOMEM); - *nhandles = (int)(bufsz/sizeof (EFI_HANDLE)); + *nhandles = (int)(bufsz / sizeof (EFI_HANDLE)); /* * get handle array */ @@ -151,28 +153,91 @@ efi_serial_init(EFI_HANDLE **handlep, int *nhandles) return (status); } +/* + * Find serial device number from device path. + * Return -1 if not found. + */ +static int +efi_serial_get_index(EFI_DEVICE_PATH *devpath) +{ + ACPI_HID_DEVICE_PATH *acpi; + + while (!IsDevicePathEnd(devpath)) { + if (DevicePathType(devpath) == ACPI_DEVICE_PATH && + DevicePathSubType(devpath) == ACPI_DP) { + + acpi = (ACPI_HID_DEVICE_PATH *)devpath; + if (acpi->HID == EISA_PNP_ID(PNP0501)) { + return (acpi->UID); + } + } + + devpath = NextDevicePathNode(devpath); + } + return (-1); +} + +/* + * The order of handles from LocateHandle() is not known, we need to + * iterate handles, pick device path for handle, and check the device + * number. + */ +static EFI_HANDLE +efi_serial_get_handle(int port) +{ + EFI_STATUS status; + EFI_HANDLE *handles, handle; + EFI_DEVICE_PATH *devpath; + int index, nhandles; + + if (port == -1) + return (NULL); + + handles = NULL; + nhandles = 0; + status = efi_serial_init(&handles, &nhandles); + if (EFI_ERROR(status)) + return (NULL); + + handle = NULL; + for (index = 0; index < nhandles; index++) { + devpath = efi_lookup_devpath(handles[index]); + if (port == efi_serial_get_index(devpath)) { + handle = (handles[index]); + break; + } + } + + /* + * In case we did fail to identify the device by path, use port as + * array index. Note, we did check port == -1 above. + */ + if (port < nhandles && handle == NULL) + handle = handles[port]; + + free(handles); + return (handle); +} + static void comc_probe(struct console *cp) { EFI_STATUS status; + EFI_HANDLE handle; struct serial *port; char name[20]; char value[20]; char *env; - EFI_HANDLE *handles = NULL; /* array of handles */ - int nhandles = 0; /* number of handles in array */ /* are we already set up? */ if (cp->c_private != NULL) return; - /* make sure the handles are available */ - status = efi_serial_init(&handles, &nhandles); - cp->c_private = malloc(sizeof (struct serial)); port = cp->c_private; port->baudrate = COMSPEED; + port->ioaddr = -1; /* invalid port */ if (strcmp(cp->c_name, "ttya") == 0) port->ioaddr = 0; else if (strcmp(cp->c_name, "ttyb") == 0) @@ -182,9 +247,6 @@ comc_probe(struct console *cp) else if (strcmp(cp->c_name, "ttyd") == 0) port->ioaddr = 3; - if (port->ioaddr >= nhandles) - port->ioaddr = -1; /* invalid port */ - port->databits = 8; /* 8,n,1 */ port->parity = NoParity; /* 8,n,1 */ port->stopbits = OneStopBit; /* 8,n,1 */ @@ -192,16 +254,16 @@ comc_probe(struct console *cp) port->rtsdtr_off = 0; /* rts-dtr is on */ port->sio = NULL; - if (port->ioaddr != -1) { - status = BS->OpenProtocol(handles[port->ioaddr], - &serial, (void**)&port->sio, IH, NULL, + handle = efi_serial_get_handle(port->ioaddr); + + if (handle != NULL) { + status = BS->OpenProtocol(handle, &serial, + (void**)&port->sio, IH, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (EFI_ERROR(status)) - port->ioaddr = -1; /* invalid port */ + port->sio = NULL; } - if (handles != NULL) - free(handles); snprintf(name, sizeof (name), "%s-mode", cp->c_name); env = getenv(name); diff --git a/usr/src/boot/sys/boot/i386/loader/Makefile b/usr/src/boot/sys/boot/i386/loader/Makefile index 1f486e48f8..28e0dfa3e5 100644 --- a/usr/src/boot/sys/boot/i386/loader/Makefile +++ b/usr/src/boot/sys/boot/i386/loader/Makefile @@ -169,13 +169,13 @@ install: all $(ROOT_BOOT_DEFAULTS) $(ROOT_BOOT_FORTH) \ $(FONT).c: $(FONT_DIR)/$(FONT_SRC) $(VTFONTCVT) -f compressed-source -o $@ $(FONT_DIR)/$(FONT_SRC) -$(ROOT_BOOT)/%: ../../forth/% +$(ROOT_BOOT)/%: ../../forth/% $(ROOT_BOOT) $(INS.file) -$(ROOT_BOOT_DEFAULTS)/%: ../../forth/% +$(ROOT_BOOT_DEFAULTS)/%: ../../forth/% $(ROOT_BOOT_DEFAULTS) $(INS.file) -$(ROOT_BOOT_FORTH)/%: ../../forth/% +$(ROOT_BOOT_FORTH)/%: ../../forth/% $(ROOT_BOOT_FORTH) $(INS.file) $(ROOT_BOOT_DEFAULTS) $(ROOT_BOOT_CONF) $(ROOT_BOOT_FORTH): diff --git a/usr/src/lib/gss_mechs/mech_dh/dh_common/dh_template.c b/usr/src/lib/gss_mechs/mech_dh/dh_common/dh_template.c index be8dab28cb..4640cce212 100644 --- a/usr/src/lib/gss_mechs/mech_dh/dh_common/dh_template.c +++ b/usr/src/lib/gss_mechs/mech_dh/dh_common/dh_template.c @@ -26,7 +26,9 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2018, Joyent, Inc. + */ #include <stdlib.h> #include <string.h> @@ -104,7 +106,7 @@ dh_getpublickey(const char *remote, keylen_t keylen, algtype_t algtype, static const char NIS_SYMBOL[] = "__rpcsec_gss_is_server"; if (!init_nis_pubkey) { - mutex_lock(&init_nis_pubkey_lock); + (void) mutex_lock(&init_nis_pubkey_lock); if (!init_nis_pubkey) { void *dlhandle = dlopen(0, RTLD_NOLOAD); if (dlhandle == 0) { @@ -117,7 +119,7 @@ dh_getpublickey(const char *remote, keylen_t keylen, algtype_t algtype, } init_nis_pubkey = 1; } - mutex_unlock(&init_nis_pubkey_lock); + (void) mutex_unlock(&init_nis_pubkey_lock); } if (nis_call && (*nis_call)()) { int key_cached; diff --git a/usr/src/uts/common/inet/ip/spdsock.c b/usr/src/uts/common/inet/ip/spdsock.c index 267bad10ba..5911b45770 100644 --- a/usr/src/uts/common/inet/ip/spdsock.c +++ b/usr/src/uts/common/inet/ip/spdsock.c @@ -154,9 +154,9 @@ static spdsockparam_t lcl_param_arr[] = { static int spdsock_close(queue_t *, int, cred_t *); static int spdsock_open(queue_t *, dev_t *, int, int, cred_t *); -static void spdsock_wput(queue_t *, mblk_t *); -static void spdsock_wsrv(queue_t *); -static void spdsock_rsrv(queue_t *); +static int spdsock_wput(queue_t *, mblk_t *); +static int spdsock_wsrv(queue_t *); +static int spdsock_rsrv(queue_t *); static void *spdsock_stack_init(netstackid_t stackid, netstack_t *ns); static void spdsock_stack_shutdown(netstackid_t stackid, void *arg); static void spdsock_stack_fini(netstackid_t stackid, void *arg); @@ -171,12 +171,12 @@ static struct module_info info = { }; static struct qinit rinit = { - NULL, (pfi_t)spdsock_rsrv, spdsock_open, spdsock_close, + NULL, spdsock_rsrv, spdsock_open, spdsock_close, NULL, &info }; static struct qinit winit = { - (pfi_t)spdsock_wput, (pfi_t)spdsock_wsrv, NULL, NULL, NULL, &info + spdsock_wput, spdsock_wsrv, NULL, NULL, NULL, &info }; struct streamtab spdsockinfo = { @@ -696,23 +696,23 @@ spdsock_ext_to_sel(spd_ext_t **extv, ipsec_selkey_t *sel, int *diag) tc->spd_typecode_code_end; } } -#define ADDR2SEL(sel, extv, field, pfield, extn, bit) \ - if ((extv)[(extn)] != NULL) { \ - uint_t addrlen; \ - struct spd_address *ap = \ - (struct spd_address *)((extv)[(extn)]); \ - addrlen = (ap->spd_address_af == AF_INET6) ? \ - IPV6_ADDR_LEN : IP_ADDR_LEN; \ - if (SPD_64TO8(ap->spd_address_len) < \ - (addrlen + sizeof (*ap))) { \ - *diag = SPD_DIAGNOSTIC_BAD_ADDR_LEN; \ - return (B_FALSE); \ - } \ - bcopy((ap+1), &((sel)->field), addrlen); \ - (sel)->pfield = ap->spd_address_prefixlen; \ - (sel)->ipsl_valid |= (bit); \ - (sel)->ipsl_valid |= (ap->spd_address_af == AF_INET6) ? \ - IPSL_IPV6 : IPSL_IPV4; \ +#define ADDR2SEL(sel, extv, field, pfield, extn, bit) \ + if ((extv)[(extn)] != NULL) { \ + uint_t addrlen; \ + struct spd_address *ap = \ + (struct spd_address *)((extv)[(extn)]); \ + addrlen = (ap->spd_address_af == AF_INET6) ? \ + IPV6_ADDR_LEN : IP_ADDR_LEN; \ + if (SPD_64TO8(ap->spd_address_len) < \ + (addrlen + sizeof (*ap))) { \ + *diag = SPD_DIAGNOSTIC_BAD_ADDR_LEN; \ + return (B_FALSE); \ + } \ + bcopy((ap+1), &((sel)->field), addrlen); \ + (sel)->pfield = ap->spd_address_prefixlen; \ + (sel)->ipsl_valid |= (bit); \ + (sel)->ipsl_valid |= (ap->spd_address_af == AF_INET6) ? \ + IPSL_IPV6 : IPSL_IPV4; \ } ADDR2SEL(sel, extv, ipsl_local, ipsl_local_pfxlen, @@ -2327,9 +2327,9 @@ spdsock_alglist(queue_t *q, mblk_t *mp) attr = (struct spd_attribute *)cur; #define EMIT(tag, value) { \ - attr->spd_attr_tag = (tag); \ - attr->spd_attr_value = (value); \ - attr++; \ + attr->spd_attr_tag = (tag); \ + attr->spd_attr_value = (value); \ + attr++; \ } /* @@ -2337,7 +2337,7 @@ spdsock_alglist(queue_t *q, mblk_t *mp) * ATTRPERALG above to match */ #define EMITALGATTRS(_type) { \ - EMIT(algattr[_type], algid); /* 1 */ \ + EMIT(algattr[_type], algid); /* 1 */ \ EMIT(minbitsattr[_type], minbits); /* 2 */ \ EMIT(maxbitsattr[_type], maxbits); /* 3 */ \ EMIT(defbitsattr[_type], defbits); /* 4 */ \ @@ -2481,9 +2481,9 @@ spdsock_dumpalgs(queue_t *q, mblk_t *mp) attr = (struct spd_attribute *)cur; #define EMIT(tag, value) { \ - attr->spd_attr_tag = (tag); \ - attr->spd_attr_value = (value); \ - attr++; \ + attr->spd_attr_tag = (tag); \ + attr->spd_attr_value = (value); \ + attr++; \ } for (algtype = 0; algtype < IPSEC_NALGTYPES; algtype++) { @@ -3452,7 +3452,7 @@ spdsock_wput_other(queue_t *q, mblk_t *mp) freemsg(mp); } -static void +static int spdsock_wput(queue_t *q, mblk_t *mp) { uint8_t *rptr = mp->b_rptr; @@ -3467,7 +3467,7 @@ spdsock_wput(queue_t *q, mblk_t *mp) if (ss->spdsock_dump_req != NULL) { if (!putq(q, mp)) freemsg(mp); - return; + return (0); } switch (mp->b_datap->db_type) { @@ -3477,7 +3477,7 @@ spdsock_wput(queue_t *q, mblk_t *mp) */ ss2dbg(spds, ("raw M_DATA in spdsock.\n")); freemsg(mp); - return; + return (0); case M_PROTO: case M_PCPROTO: if ((mp->b_wptr - rptr) >= sizeof (struct T_data_req)) { @@ -3487,7 +3487,7 @@ spdsock_wput(queue_t *q, mblk_t *mp) ss2dbg(spds, ("No data after DATA_REQ.\n")); freemsg(mp); - return; + return (0); } freeb(mp); mp = mp1; @@ -3500,11 +3500,12 @@ spdsock_wput(queue_t *q, mblk_t *mp) ss3dbg(spds, ("In default wput case (%d %d).\n", mp->b_datap->db_type, ((union T_primitives *)rptr)->type)); spdsock_wput_other(q, mp); - return; + return (0); } /* I now have a PF_POLICY message in an M_DATA block. */ spdsock_parse(q, mp); + return (0); } /* @@ -3577,7 +3578,7 @@ spdsock_open(queue_t *q, dev_t *devp, int flag, int sflag, cred_t *credp) * Dump another chunk if we were dumping before; when we finish, kick * the write-side queue in case it's waiting for read queue space. */ -void +int spdsock_rsrv(queue_t *q) { spdsock_t *ss = q->q_ptr; @@ -3587,13 +3588,14 @@ spdsock_rsrv(queue_t *q) if (ss->spdsock_dump_req == NULL) qenable(OTHERQ(q)); + return (0); } /* * Write-side service procedure, invoked when we defer processing * if another message is received while a dump is in progress. */ -void +int spdsock_wsrv(queue_t *q) { spdsock_t *ss = q->q_ptr; @@ -3602,20 +3604,21 @@ spdsock_wsrv(queue_t *q) if (ss->spdsock_dump_req != NULL) { qenable(OTHERQ(q)); - return; + return (0); } while ((mp = getq(q)) != NULL) { if (ipsec_loaded(ipss)) { spdsock_wput(q, mp); if (ss->spdsock_dump_req != NULL) - return; + return (0); } else if (!ipsec_failed(ipss)) { (void) putq(q, mp); } else { spdsock_error(q, mp, EPFNOSUPPORT, 0); } } + return (0); } /* ARGSUSED */ diff --git a/usr/src/uts/common/io/ppp/sppp/sppp.c b/usr/src/uts/common/io/ppp/sppp/sppp.c index 1b12b6406b..4cf02abe2e 100644 --- a/usr/src/uts/common/io/ppp/sppp/sppp.c +++ b/usr/src/uts/common/io/ppp/sppp/sppp.c @@ -98,7 +98,7 @@ static void sppp_recv_nondata(queue_t *, mblk_t *, spppstr_t *); static queue_t *sppp_outpkt(queue_t *, mblk_t **, int, spppstr_t *); static spppstr_t *sppp_inpkt(queue_t *, mblk_t *, spppstr_t *); static int sppp_kstat_update(kstat_t *, int); -static void sppp_release_pkts(sppa_t *, uint16_t); +static void sppp_release_pkts(sppa_t *, uint16_t); /* * sps_list contains the list of active per-stream instance state structures @@ -697,7 +697,7 @@ sppp_ioctl(struct queue *q, mblk_t *mp) * Description: * Upper write-side put procedure. Messages from above arrive here. */ -void +int sppp_uwput(queue_t *q, mblk_t *mp) { queue_t *nextq; @@ -739,7 +739,7 @@ sppp_uwput(queue_t *q, mblk_t *mp) } } else { (void) sppp_mproto(q, mp, sps); - return; + return (0); } break; case M_DATA: @@ -762,12 +762,12 @@ sppp_uwput(queue_t *q, mblk_t *mp) case PPPIO_BLOCKNP: case PPPIO_UNBLOCKNP: qwriter(q, mp, sppp_inner_ioctl, PERIM_INNER); - return; + return (0); case I_LINK: case I_UNLINK: case PPPIO_NEWPPA: qwriter(q, mp, sppp_outer_ioctl, PERIM_OUTER); - return; + return (0); case PPPIO_NPMODE: case PPPIO_GIDLE: case PPPIO_GTYPE: @@ -779,7 +779,7 @@ sppp_uwput(queue_t *q, mblk_t *mp) * they're moved off to a separate function. */ sppp_ioctl(q, mp); - return; + return (0); case PPPIO_GETSTAT: break; /* 32 bit interface gone */ default: @@ -802,7 +802,7 @@ sppp_uwput(queue_t *q, mblk_t *mp) error = EAGAIN; break; } - return; + return (0); } else { ppa->ppa_ioctlsfwd++; /* @@ -815,7 +815,7 @@ sppp_uwput(queue_t *q, mblk_t *mp) mutex_exit(&ppa->ppa_sta_lock); } putnext(ppa->ppa_lower_wq, mp); - return; /* don't ack or nak the request */ + return (0); /* don't ack or nak the request */ } /* Failure; send error back upstream. */ miocnak(q, mp, 0, error); @@ -835,6 +835,7 @@ sppp_uwput(queue_t *q, mblk_t *mp) freemsg(mp); break; } + return (0); } /* @@ -851,7 +852,7 @@ sppp_uwput(queue_t *q, mblk_t *mp) * the write-side queue. Therefore, this procedure gets called when * the lower write service procedure qenable() the upper write stream queue. */ -void +int sppp_uwsrv(queue_t *q) { spppstr_t *sps; @@ -900,6 +901,7 @@ sppp_uwsrv(queue_t *q) putnext(nextq, mp); } } + return (0); } void @@ -1759,7 +1761,7 @@ sppp_outpkt(queue_t *q, mblk_t **mpp, int msize, spppstr_t *sps) * the write queue here, this just back-enables all upper write side * service procedures. */ -void +int sppp_lwsrv(queue_t *q) { sppa_t *ppa; @@ -1780,6 +1782,7 @@ sppp_lwsrv(queue_t *q) } } rw_exit(&ppa->ppa_sib_lock); + return (0); } /* @@ -1799,7 +1802,7 @@ sppp_lwsrv(queue_t *q) * In this case, the only thing above us is passthru, and we might as well * discard. */ -void +int sppp_lrput(queue_t *q, mblk_t *mp) { sppa_t *ppa; @@ -1807,7 +1810,7 @@ sppp_lrput(queue_t *q, mblk_t *mp) if ((ppa = q->q_ptr) == NULL) { freemsg(mp); - return; + return (0); } sps = ppa->ppa_ctl; @@ -1819,6 +1822,7 @@ sppp_lrput(queue_t *q, mblk_t *mp) } else if ((q = sppp_recv(q, &mp, sps)) != NULL) { putnext(q, mp); } + return (0); } /* @@ -1832,13 +1836,14 @@ sppp_lrput(queue_t *q, mblk_t *mp) * occurs in order to clean up any packets that came in while we were * transferring in the lower stream. Otherwise, it's not used. */ -void +int sppp_lrsrv(queue_t *q) { mblk_t *mp; while ((mp = getq(q)) != NULL) sppp_lrput(q, mp); + return (0); } /* diff --git a/usr/src/uts/common/io/ppp/sppp/sppp.h b/usr/src/uts/common/io/ppp/sppp/sppp.h index 71911c231e..63108a25e9 100644 --- a/usr/src/uts/common/io/ppp/sppp/sppp.h +++ b/usr/src/uts/common/io/ppp/sppp/sppp.h @@ -322,8 +322,8 @@ typedef struct sppa { spppstr_t *ppa_ip6_cache; /* ptr to PPP_IPV6 upper stream */ kmutex_t ppa_npmutex; /* protects the 2 fields below */ - uint32_t ppa_npflag; /* network protocols blocked */ - uint32_t ppa_holdpkts[3]; /* # of packets blocked per np */ + uint32_t ppa_npflag; /* network protocols blocked */ + uint32_t ppa_holdpkts[3]; /* # of packets blocked per np */ zoneid_t ppa_zoneid; /* zone where PPA is in use */ } sppa_t; @@ -363,13 +363,13 @@ extern int sppp_close(queue_t *, int, cred_t *); extern mblk_t *sppp_dladdud(spppstr_t *, mblk_t *, t_scalar_t, boolean_t); extern void sppp_dlpi_pinfoinit(void); extern void sppp_dlprsendup(spppstr_t *, mblk_t *, t_scalar_t, boolean_t); -extern void sppp_lrput(queue_t *, mblk_t *); -extern void sppp_lrsrv(queue_t *); -extern void sppp_lwsrv(queue_t *); +extern int sppp_lrput(queue_t *, mblk_t *); +extern int sppp_lrsrv(queue_t *); +extern int sppp_lwsrv(queue_t *); extern int sppp_mproto(queue_t *, mblk_t *, spppstr_t *); extern int sppp_open(queue_t *, dev_t *, int, int, cred_t *); -extern void sppp_uwput(queue_t *, mblk_t *); -extern void sppp_uwsrv(queue_t *); +extern int sppp_uwput(queue_t *, mblk_t *); +extern int sppp_uwsrv(queue_t *); extern void sppp_remove_ppa(spppstr_t *sps); extern sppa_t *sppp_find_ppa(uint32_t ppa_id); extern sppa_t *sppp_create_ppa(uint32_t ppa_id, zoneid_t zoneid); diff --git a/usr/src/uts/common/io/ppp/sppp/sppp_mod.c b/usr/src/uts/common/io/ppp/sppp/sppp_mod.c index 168cf17f49..6948032309 100644 --- a/usr/src/uts/common/io/ppp/sppp/sppp_mod.c +++ b/usr/src/uts/common/io/ppp/sppp/sppp_mod.c @@ -93,8 +93,8 @@ static struct qinit sppp_urinit = { }; static struct qinit sppp_uwinit = { - (int (*)())sppp_uwput, /* qi_putp */ - (int (*)())sppp_uwsrv, /* qi_srvp */ + sppp_uwput, /* qi_putp */ + sppp_uwsrv, /* qi_srvp */ NULL, /* qi_qopen */ NULL, /* qi_qclose */ NULL, /* qi_qadmin */ @@ -103,8 +103,8 @@ static struct qinit sppp_uwinit = { }; static struct qinit sppp_lrinit = { - (int (*)())sppp_lrput, /* qi_putp */ - (int (*)())sppp_lrsrv, /* qi_srvp */ + sppp_lrput, /* qi_putp */ + sppp_lrsrv, /* qi_srvp */ NULL, /* qi_qopen */ NULL, /* qi_qclose */ NULL, /* qi_qadmin */ @@ -114,7 +114,7 @@ static struct qinit sppp_lrinit = { static struct qinit sppp_lwinit = { NULL, /* qi_putp */ - (int (*)())sppp_lwsrv, /* qi_srvp */ + sppp_lwsrv, /* qi_srvp */ NULL, /* qi_qopen */ NULL, /* qi_qclose */ NULL, /* qi_qadmin */ @@ -162,10 +162,10 @@ static struct streamtab sppp_tab = { * the system's stability and performance. */ DDI_DEFINE_STREAM_OPS(sppp_ops, \ - nulldev, nulldev, \ - _mi_driver_attach, _mi_driver_detach, nodev, _mi_driver_info, \ - D_NEW | D_MP | D_MTQPAIR | D_MTOUTPERIM | D_MTOCEXCL | D_MTPUTSHARED, \ - &sppp_tab, ddi_quiesce_not_supported); + nulldev, nulldev, \ + _mi_driver_attach, _mi_driver_detach, nodev, _mi_driver_info, \ + D_NEW | D_MP | D_MTQPAIR | D_MTOUTPERIM | D_MTOCEXCL | D_MTPUTSHARED, \ + &sppp_tab, ddi_quiesce_not_supported); static struct modldrv modldrv = { &mod_driverops, /* drv_modops */ diff --git a/usr/src/uts/common/io/rwn/rt2860.c b/usr/src/uts/common/io/rwn/rt2860.c index e3df2a765c..5aaeebb4ac 100644 --- a/usr/src/uts/common/io/rwn/rt2860.c +++ b/usr/src/uts/common/io/rwn/rt2860.c @@ -2,6 +2,7 @@ * Copyright 2017 Gary Mills * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright (c) 2018, Joyent, Inc. */ /* @@ -900,11 +901,10 @@ rt2860_free_rx_ring(struct rt2860_softc *sc, struct rt2860_rx_ring *ring) rt2860_free_dma_mem(&ring->rxdesc_dma); count = RT2860_RX_RING_COUNT; - if (ring->data != NULL) { - for (i = 0; i < count; i++) { - data = &ring->data[i]; - rt2860_free_dma_mem(&data->rxbuf_dma); - } + + for (i = 0; i < count; i++) { + data = &ring->data[i]; + rt2860_free_dma_mem(&data->rxbuf_dma); } } diff --git a/usr/src/uts/common/io/scsi/targets/st.c b/usr/src/uts/common/io/scsi/targets/st.c index ea3283c93c..36768a9bde 100644 --- a/usr/src/uts/common/io/scsi/targets/st.c +++ b/usr/src/uts/common/io/scsi/targets/st.c @@ -48,7 +48,7 @@ * stats maintained only for reads/writes as commands * like rewind etc skew the wait/busy times */ -#define IS_RW(bp) ((bp)->b_bcount > 0) +#define IS_RW(bp) ((bp)->b_bcount > 0) #define ST_DO_KSTATS(bp, kstat_function) \ if ((bp != un->un_sbufp) && un->un_stats && IS_RW(bp)) { \ kstat_function(IOSP); \ @@ -61,7 +61,7 @@ stp->x.value.ul++; \ } -#define FILL_SCSI1_LUN(devp, pkt) \ +#define FILL_SCSI1_LUN(devp, pkt) \ if ((devp)->sd_inq->inq_ansi == 0x1) { \ int _lun; \ _lun = ddi_prop_get_int(DDI_DEV_T_ANY, (devp)->sd_dev, \ @@ -85,19 +85,19 @@ struct contig_mem *tmp_cp = NULL; \ for ((cp) = (un)->un_contig_mem; \ (cp) != NULL; \ - tmp_cp = (cp), (cp) = (cp)->cm_next) { \ - if (((cp)->cm_len >= (len)) || \ - (!(big_enough) && ((cp)->cm_next == NULL))) { \ - if (tmp_cp == NULL) { \ - (un)->un_contig_mem = (cp)->cm_next; \ - } else { \ - tmp_cp->cm_next = (cp)->cm_next; \ - } \ - (cp)->cm_next = NULL; \ - (un)->un_contig_mem_available_num--; \ - break; \ - } \ - } \ + tmp_cp = (cp), (cp) = (cp)->cm_next) { \ + if (((cp)->cm_len >= (len)) || \ + (!(big_enough) && ((cp)->cm_next == NULL))) { \ + if (tmp_cp == NULL) { \ + (un)->un_contig_mem = (cp)->cm_next; \ + } else { \ + tmp_cp->cm_next = (cp)->cm_next; \ + } \ + (cp)->cm_next = NULL; \ + (un)->un_contig_mem_available_num--; \ + break; \ + } \ + } \ } #define ST_NUM_MEMBERS(array) (sizeof (array) / sizeof (array[0])) @@ -454,7 +454,7 @@ static struct cb_ops st_cb_ops = { D_64BIT | D_MP | D_NEW | D_HOTPLUG | D_OPEN_RETURNS_EINTR, /* cb_flag */ CB_REV, /* cb_rev */ - st_aread, /* async I/O read entry point */ + st_aread, /* async I/O read entry point */ st_awrite /* async I/O write entry point */ }; @@ -690,7 +690,7 @@ _NOTE(DATA_READABLE_WITHOUT_LOCK(st_drivetype scsi_address)) static struct modldrv modldrv = { &mod_driverops, /* Type of module. This one is a driver */ - "SCSI tape Driver", /* Name of the module. */ + "SCSI tape Driver", /* Name of the module. */ &st_ops /* driver ops */ }; @@ -863,9 +863,9 @@ st_probe(dev_info_t *devi) static int st_attach(dev_info_t *devi, ddi_attach_cmd_t cmd) { - int instance; + int instance; int wide; - int dev_instance; + int dev_instance; int ret_status; struct scsi_device *devp; int node_ix; @@ -3433,7 +3433,7 @@ st_close(dev_t dev, int flag, int otyp, cred_t *cred_p) (flag & FREAD) && /* reading or at least asked to */ (un->un_mediastate == MTIO_INSERTED) && /* tape loaded */ (un->un_pos.pmode != invalid) && /* XXX position known */ - ((un->un_pos.blkno != 0) && /* inside a file */ + ((un->un_pos.blkno != 0) && /* inside a file */ (un->un_lastop != ST_OP_WRITE) && /* Didn't just write */ (un->un_lastop != ST_OP_WEOF))) { /* or write filemarks */ switch (un->un_pos.eof) { @@ -4968,7 +4968,7 @@ check_commands: * 64 bit ioctl */ struct mtget32 mtg_local32; - struct mtget32 *mtget_32 = &mtg_local32; + struct mtget32 *mtget_32 = &mtg_local32; #endif /* _MULTI_DATAMODEL */ /* Get tape status */ @@ -5073,14 +5073,14 @@ check_commands: * Convert 64 bit back to 32 bit before doing * copyout. This is what the ILP32 app expects. */ - mtget_32->mt_erreg = mtget->mt_erreg; - mtget_32->mt_resid = mtget->mt_resid; - mtget_32->mt_dsreg = mtget->mt_dsreg; - mtget_32->mt_fileno = (daddr32_t)mtget->mt_fileno; - mtget_32->mt_blkno = (daddr32_t)mtget->mt_blkno; - mtget_32->mt_type = mtget->mt_type; - mtget_32->mt_flags = mtget->mt_flags; - mtget_32->mt_bf = mtget->mt_bf; + mtget_32->mt_erreg = mtget->mt_erreg; + mtget_32->mt_resid = mtget->mt_resid; + mtget_32->mt_dsreg = mtget->mt_dsreg; + mtget_32->mt_fileno = (daddr32_t)mtget->mt_fileno; + mtget_32->mt_blkno = (daddr32_t)mtget->mt_blkno; + mtget_32->mt_type = mtget->mt_type; + mtget_32->mt_flags = mtget->mt_flags; + mtget_32->mt_bf = mtget->mt_bf; if (ddi_copyout(mtget_32, (void *)arg, sizeof (struct mtget32), flag)) { @@ -6490,7 +6490,7 @@ st_start(struct scsi_tape *un) un->un_throttle, un->un_ncmds); if (un->un_ncmds == 0) { typedef void (*func)(); - func fnc = (func)st_runout; + func fnc = (func)(uintptr_t)st_runout; scsi_log(ST_DEVINFO, st_label, SCSI_DEBUG, "Sending delayed start to st_runout()\n"); @@ -10120,7 +10120,7 @@ reset_target: */ static int st_handle_intr_busy(struct scsi_tape *un, struct buf *bp, - clock_t timeout_interval) + clock_t timeout_interval) { int queued; @@ -10394,9 +10394,8 @@ ret: */ static void -st_update_error_stack(struct scsi_tape *un, - struct scsi_pkt *pkt, - struct scsi_arq_status *cmd) +st_update_error_stack(struct scsi_tape *un, struct scsi_pkt *pkt, + struct scsi_arq_status *cmd) { struct mterror_entry_stack *err_entry_tmp; uchar_t *cdbp = (uchar_t *)pkt->pkt_cdbp; @@ -12311,7 +12310,7 @@ st_clean_print(dev_info_t *dev, char *label, uint_t level, char *title, char *data, int len) { int i; - int c; + int c; char *format; char buf[256]; uchar_t byte; @@ -13775,9 +13774,9 @@ st_check_sense_clean_bit(struct scsi_tape *un) /* * st_clear_unit_attention * - * run test unit ready's to clear out outstanding - * unit attentions. - * returns zero for SUCCESS or the errno from st_cmd call + * run test unit ready's to clear out outstanding + * unit attentions. + * returns zero for SUCCESS or the errno from st_cmd call */ static int st_clear_unit_attentions(dev_t dev_instance, int max_trys) @@ -16369,7 +16368,7 @@ static const char *mode[] = { static void st_print_position(dev_info_t *dev, char *label, uint_t level, -const char *comment, tapepos_t *pos) + const char *comment, tapepos_t *pos) { ST_FUNC(dev, st_print_position); diff --git a/usr/src/uts/common/io/softmac/softmac_dev.c b/usr/src/uts/common/io/softmac/softmac_dev.c index bbb3e9ad3e..3b9c76a7e2 100644 --- a/usr/src/uts/common/io/softmac/softmac_dev.c +++ b/usr/src/uts/common/io/softmac/softmac_dev.c @@ -45,9 +45,9 @@ static int softmac_cmn_open(queue_t *, dev_t *, int, int, cred_t *); * the softmac module. */ static int softmac_mod_close(queue_t *, int, cred_t *); -static void softmac_mod_rput(queue_t *, mblk_t *); -static void softmac_mod_wput(queue_t *, mblk_t *); -static void softmac_mod_wsrv(queue_t *); +static int softmac_mod_rput(queue_t *, mblk_t *); +static int softmac_mod_wput(queue_t *, mblk_t *); +static int softmac_mod_wsrv(queue_t *); /* * The following softmac_drv_xxx() functions are (9E) entry point functions for @@ -55,8 +55,8 @@ static void softmac_mod_wsrv(queue_t *); */ static int softmac_drv_open(queue_t *, dev_t *, int, int, cred_t *); static int softmac_drv_close(queue_t *, int, cred_t *); -static void softmac_drv_wput(queue_t *, mblk_t *); -static void softmac_drv_wsrv(queue_t *); +static int softmac_drv_wput(queue_t *, mblk_t *); +static int softmac_drv_wsrv(queue_t *); static int softmac_attach(dev_info_t *, ddi_attach_cmd_t); static int softmac_detach(dev_info_t *, ddi_detach_cmd_t); @@ -85,8 +85,8 @@ static struct module_info softmac_dld_modinfo = { }; static struct qinit softmac_urinit = { - (pfi_t)softmac_mod_rput, /* qi_putp */ - (pfi_t)NULL, /* qi_srvp */ + softmac_mod_rput, /* qi_putp */ + NULL, /* qi_srvp */ softmac_cmn_open, /* qi_qopen */ softmac_mod_close, /* qi_qclose */ NULL, /* qi_qadmin */ @@ -94,8 +94,8 @@ static struct qinit softmac_urinit = { }; static struct qinit softmac_uwinit = { - (pfi_t)softmac_mod_wput, /* qi_putp */ - (pfi_t)softmac_mod_wsrv, /* qi_srvp */ + softmac_mod_wput, /* qi_putp */ + softmac_mod_wsrv, /* qi_srvp */ NULL, /* qi_qopen */ NULL, /* qi_qclose */ NULL, /* qi_qadmin */ @@ -117,7 +117,7 @@ static struct qinit softmac_dld_r_qinit = { }; static struct qinit softmac_dld_w_qinit = { - (pfi_t)softmac_drv_wput, (pfi_t)softmac_drv_wsrv, NULL, NULL, NULL, + softmac_drv_wput, softmac_drv_wsrv, NULL, NULL, NULL, &softmac_dld_modinfo }; @@ -304,7 +304,7 @@ softmac_mod_close(queue_t *rq, int flags __unused, cred_t *credp __unused) return (0); } -static void +static int softmac_mod_rput(queue_t *rq, mblk_t *mp) { softmac_lower_t *slp = rq->q_ptr; @@ -336,7 +336,7 @@ softmac_mod_rput(queue_t *rq, mblk_t *mp) */ if (slp->sl_softmac == NULL) { freemsg(mp); - return; + return (0); } /* @@ -346,7 +346,7 @@ softmac_mod_rput(queue_t *rq, mblk_t *mp) */ if (mp->b_flag & MSGNOLOOP) { freemsg(mp); - return; + return (0); } /* @@ -355,7 +355,7 @@ softmac_mod_rput(queue_t *rq, mblk_t *mp) if (DB_REF(mp) == 1) { ASSERT(slp->sl_softmac != NULL); mac_rx(slp->sl_softmac->smac_mh, NULL, mp); - return; + return (0); } else { softmac_rput_process_data(slp, mp); } @@ -386,9 +386,10 @@ softmac_mod_rput(queue_t *rq, mblk_t *mp) softmac_rput_process_notdata(rq, slp->sl_sup, mp); break; } + return (0); } -static void +static int softmac_mod_wput(queue_t *wq, mblk_t *mp) { /* @@ -430,9 +431,10 @@ softmac_mod_wput(queue_t *wq, mblk_t *mp) freemsg(mp); break; } + return (0); } -static void +static int softmac_mod_wsrv(queue_t *wq) { softmac_lower_t *slp = wq->q_ptr; @@ -450,6 +452,7 @@ softmac_mod_wsrv(queue_t *wq) qenable(slp->sl_sup->su_wq); else if (slp->sl_softmac != NULL) mac_tx_update(slp->sl_softmac->smac_mh); + return (0); } static int @@ -609,7 +612,7 @@ softmac_drv_close(queue_t *rq, int flags __unused, cred_t *credp __unused) return (dld_str_close(rq)); } -static void +static int softmac_drv_wput(queue_t *wq, mblk_t *mp) { softmac_upper_t *sup = dld_str_private(wq); @@ -627,13 +630,13 @@ softmac_drv_wput(queue_t *wq, mblk_t *mp) if (MBLKL(mp) < sizeof (t_uscalar_t)) { freemsg(mp); - return; + return (0); } prim = ((union DL_primitives *)mp->b_rptr)->dl_primitive; if (prim == DL_UNITDATA_REQ) { softmac_wput_data(sup, mp); - return; + return (0); } softmac_wput_nondata(sup, mp); @@ -642,9 +645,10 @@ softmac_drv_wput(queue_t *wq, mblk_t *mp) softmac_wput_nondata(sup, mp); break; } + return (0); } -static void +static int softmac_drv_wsrv(queue_t *wq) { softmac_upper_t *sup = dld_str_private(wq); @@ -684,4 +688,5 @@ softmac_drv_wsrv(queue_t *wq) sup->su_tx_busy = B_FALSE; } mutex_exit(&sup->su_mutex); + return (0); } |