svn commit: r291910 - in user/ngie/make_check: bin/sh/tests/parameters sbin/newfs_msdos sys/amd64/amd64 sys/dev/usb/wlan sys/i386/i386 sys/netinet sys/netinet6 sys/sys sys/vm
Garrett Cooper
ngie at FreeBSD.org
Sun Dec 6 21:31:12 UTC 2015
Author: ngie
Date: Sun Dec 6 21:31:09 2015
New Revision: 291910
URL: https://svnweb.freebsd.org/changeset/base/291910
Log:
MFhead @ r291909
Added:
user/ngie/make_check/bin/sh/tests/parameters/positional9.0
- copied unchanged from r291909, head/bin/sh/tests/parameters/positional9.0
Modified:
user/ngie/make_check/bin/sh/tests/parameters/Makefile
user/ngie/make_check/sbin/newfs_msdos/mkfs_msdos.c
user/ngie/make_check/sys/amd64/amd64/pmap.c
user/ngie/make_check/sys/dev/usb/wlan/if_urtwn.c
user/ngie/make_check/sys/dev/usb/wlan/if_urtwnvar.h
user/ngie/make_check/sys/i386/i386/pmap.c
user/ngie/make_check/sys/netinet/sctp_input.c
user/ngie/make_check/sys/netinet/sctp_output.c
user/ngie/make_check/sys/netinet/sctp_pcb.c
user/ngie/make_check/sys/netinet/sctp_pcb.h
user/ngie/make_check/sys/netinet/sctp_usrreq.c
user/ngie/make_check/sys/netinet/sctputil.c
user/ngie/make_check/sys/netinet/sctputil.h
user/ngie/make_check/sys/netinet6/sctp6_usrreq.c
user/ngie/make_check/sys/sys/elf_common.h
user/ngie/make_check/sys/vm/vm_fault.c
Directory Properties:
user/ngie/make_check/ (props changed)
user/ngie/make_check/sbin/ (props changed)
user/ngie/make_check/sys/ (props changed)
Modified: user/ngie/make_check/bin/sh/tests/parameters/Makefile
==============================================================================
--- user/ngie/make_check/bin/sh/tests/parameters/Makefile Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/bin/sh/tests/parameters/Makefile Sun Dec 6 21:31:09 2015 (r291910)
@@ -21,6 +21,7 @@ FILES+= positional5.0
FILES+= positional6.0
FILES+= positional7.0
FILES+= positional8.0
+FILES+= positional9.0
FILES+= pwd1.0
FILES+= pwd2.0
Copied: user/ngie/make_check/bin/sh/tests/parameters/positional9.0 (from r291909, head/bin/sh/tests/parameters/positional9.0)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ user/ngie/make_check/bin/sh/tests/parameters/positional9.0 Sun Dec 6 21:31:09 2015 (r291910, copy of r291909, head/bin/sh/tests/parameters/positional9.0)
@@ -0,0 +1,18 @@
+# $FreeBSD$
+# Although POSIX leaves the result of expanding ${#@} and ${#*} unspecified,
+# make sure it is at least numeric.
+
+set -- bb cc ddd
+set -f
+lengths=${#*}${#@}"${#*}${#@}"$(echo ${#*}${#@}"${#*}${#@}")
+IFS=
+lengths=$lengths${#*}${#@}"${#*}${#@}"$(echo ${#*}${#@}"${#*}${#@}")
+case $lengths in
+*[!0-9]*)
+ printf 'bad: %s\n' "$lengths"
+ exit 3 ;;
+????????????????*) ;;
+*)
+ printf 'too short: %s\n' "$lengths"
+ exit 3 ;;
+esac
Modified: user/ngie/make_check/sbin/newfs_msdos/mkfs_msdos.c
==============================================================================
--- user/ngie/make_check/sbin/newfs_msdos/mkfs_msdos.c Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/sbin/newfs_msdos/mkfs_msdos.c Sun Dec 6 21:31:09 2015 (r291910)
@@ -242,38 +242,41 @@ mkfs_msdos(const char *fname, const char
ssize_t n;
time_t now;
u_int fat, bss, rds, cls, dir, lsn, x, x1, x2;
- int fd, fd1;
+ int fd, fd1, rv;
struct msdos_options o = *op;
+ img = NULL;
+ rv = -1;
+
if (o.block_size && o.sectors_per_cluster) {
warnx("Cannot specify both block size and sectors per cluster");
- return -1;
+ goto done;
}
if (o.OEM_string && strlen(o.OEM_string) > 8) {
warnx("%s: bad OEM string", o.OEM_string);
- return -1;
+ goto done;
}
if (o.create_size) {
if (o.no_create) {
warnx("create (-C) is incompatible with -N");
- return -1;
+ goto done;
}
fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0644);
if (fd == -1) {
warnx("failed to create %s", fname);
- return -1;
+ goto done;
}
if (ftruncate(fd, o.create_size)) {
warnx("failed to initialize %jd bytes", (intmax_t)o.create_size);
- return -1;
+ goto done;
}
} else if ((fd = open(fname, o.no_create ? O_RDONLY : O_RDWR)) == -1) {
warn("%s", fname);
- return -1;
+ goto done;
}
if (fstat(fd, &sb)) {
warn("%s", fname);
- return -1;
+ goto done;
}
if (o.create_size) {
if (!S_ISREG(sb.st_mode))
@@ -284,15 +287,15 @@ mkfs_msdos(const char *fname, const char
}
if (!o.no_create)
if (check_mounted(fname, sb.st_mode) == -1)
- return -1;
+ goto done;
if (o.offset && o.offset != lseek(fd, o.offset, SEEK_SET)) {
warnx("cannot seek to %jd", (intmax_t)o.offset);
- return -1;
+ goto done;
}
memset(&bpb, 0, sizeof(bpb));
if (o.floppy) {
if (getstdfmt(o.floppy, &bpb) == -1)
- return -1;
+ goto done;
bpb.bpbHugeSectors = bpb.bpbSectors;
bpb.bpbSectors = 0;
bpb.bpbBigFATsecs = bpb.bpbFATsecs;
@@ -334,17 +337,17 @@ mkfs_msdos(const char *fname, const char
}
if (!powerof2(bpb.bpbBytesPerSec)) {
warnx("bytes/sector (%u) is not a power of 2", bpb.bpbBytesPerSec);
- return -1;
+ goto done;
}
if (bpb.bpbBytesPerSec < MINBPS) {
warnx("bytes/sector (%u) is too small; minimum is %u",
bpb.bpbBytesPerSec, MINBPS);
- return -1;
+ goto done;
}
if (o.volume_label && !oklabel(o.volume_label)) {
warnx("%s: bad volume label", o.volume_label);
- return -1;
+ goto done;
}
if (!(fat = o.fat_type)) {
if (o.floppy)
@@ -356,29 +359,29 @@ mkfs_msdos(const char *fname, const char
warnx("-%c is not a legal FAT%s option",
fat == 32 ? 'e' : o.info_sector ? 'i' : 'k',
fat == 32 ? "32" : "12/16");
- return -1;
+ goto done;
}
if (o.floppy && fat == 32)
bpb.bpbRootDirEnts = 0;
if (fat != 0 && fat != 12 && fat != 16 && fat != 32) {
warnx("%d: bad FAT type", fat);
- return -1;
+ goto done;
}
if (o.block_size) {
if (!powerof2(o.block_size)) {
warnx("block size (%u) is not a power of 2", o.block_size);
- return -1;
+ goto done;
}
if (o.block_size < bpb.bpbBytesPerSec) {
warnx("block size (%u) is too small; minimum is %u",
o.block_size, bpb.bpbBytesPerSec);
- return -1;
+ goto done;
}
if (o.block_size > bpb.bpbBytesPerSec * MAXSPC) {
warnx("block size (%u) is too large; maximum is %u",
o.block_size, bpb.bpbBytesPerSec * MAXSPC);
- return -1;
+ goto done;
}
bpb.bpbSecPerClust = o.block_size / bpb.bpbBytesPerSec;
}
@@ -386,7 +389,7 @@ mkfs_msdos(const char *fname, const char
if (!powerof2(o.sectors_per_cluster)) {
warnx("sectors/cluster (%u) is not a power of 2",
o.sectors_per_cluster);
- return -1;
+ goto done;
}
bpb.bpbSecPerClust = o.sectors_per_cluster;
}
@@ -396,7 +399,7 @@ mkfs_msdos(const char *fname, const char
if (o.num_FAT > MAXNFT) {
warnx("number of FATs (%u) is too large; maximum is %u",
o.num_FAT, MAXNFT);
- return -1;
+ goto done;
}
bpb.bpbFATs = o.num_FAT;
}
@@ -405,7 +408,7 @@ mkfs_msdos(const char *fname, const char
if (o.media_descriptor_set) {
if (o.media_descriptor < 0xf0) {
warnx("illegal media descriptor (%#x)", o.media_descriptor);
- return -1;
+ goto done;
}
bpb.bpbMedia = o.media_descriptor;
}
@@ -424,18 +427,18 @@ mkfs_msdos(const char *fname, const char
snprintf(buf, sizeof(buf), "/boot/%s", bname);
if (!(bname = strdup(buf))) {
warn(NULL);
- return -1;
+ goto done;
}
}
if ((fd1 = open(bname, O_RDONLY)) == -1 || fstat(fd1, &sb)) {
warn("%s", bname);
- return -1;
+ goto done;
}
if (!S_ISREG(sb.st_mode) || sb.st_size % bpb.bpbBytesPerSec ||
sb.st_size < bpb.bpbBytesPerSec ||
sb.st_size > bpb.bpbBytesPerSec * MAXU16) {
warnx("%s: inappropriate file type or format", bname);
- return -1;
+ goto done;
}
bss = sb.st_size / bpb.bpbBytesPerSec;
}
@@ -470,7 +473,7 @@ mkfs_msdos(const char *fname, const char
if (!bpb.bpbFSInfo) {
if (x == MAXU16 || x == bpb.bpbBackup) {
warnx("no room for info sector");
- return -1;
+ goto done;
}
bpb.bpbFSInfo = x;
}
@@ -479,12 +482,12 @@ mkfs_msdos(const char *fname, const char
if (!bpb.bpbBackup) {
if (x == MAXU16) {
warnx("no room for backup sector");
- return -1;
+ goto done;
}
bpb.bpbBackup = x;
} else if (bpb.bpbBackup != MAXU16 && bpb.bpbBackup == bpb.bpbFSInfo) {
warnx("backup sector would overwrite info sector");
- return -1;
+ goto done;
}
if (bpb.bpbBackup != MAXU16 && x <= bpb.bpbBackup)
x = bpb.bpbBackup + 1;
@@ -495,7 +498,7 @@ mkfs_msdos(const char *fname, const char
else if (bpb.bpbResSectors < x) {
warnx("too few reserved sectors (need %d have %d)", x,
bpb.bpbResSectors);
- return -1;
+ goto done;
}
if (fat != 32 && !bpb.bpbRootDirEnts)
bpb.bpbRootDirEnts = DEFRDE;
@@ -515,13 +518,13 @@ mkfs_msdos(const char *fname, const char
continue;
if (fat != 32 && bpb.bpbBigFATsecs > MAXU16) {
warnx("too many sectors/FAT for FAT12/16");
- return -1;
+ goto done;
}
x1 = bpb.bpbResSectors + rds;
x = bpb.bpbBigFATsecs ? bpb.bpbBigFATsecs : 1;
if (x1 + (u_int64_t)x * bpb.bpbFATs > bpb.bpbHugeSectors) {
warnx("meta data exceeds file system size");
- return -1;
+ goto done;
}
x1 += x * bpb.bpbFATs;
x = (u_int64_t)(bpb.bpbHugeSectors - x1) * bpb.bpbBytesPerSec * NPB /
@@ -544,7 +547,7 @@ mkfs_msdos(const char *fname, const char
if (cls < mincls(fat)) {
warnx("%u clusters too few clusters for FAT%u, need %u", cls, fat,
mincls(fat));
- return -1;
+ goto done;
}
if (cls > maxcls(fat)) {
cls = maxcls(fat);
@@ -575,7 +578,7 @@ mkfs_msdos(const char *fname, const char
tm = localtime(&now);
if (!(img = malloc(bpb.bpbBytesPerSec))) {
warn(NULL);
- return -1;
+ goto done;
}
dir = bpb.bpbResSectors + (bpb.bpbFATsecs ? bpb.bpbFATsecs :
bpb.bpbBigFATsecs) * bpb.bpbFATs;
@@ -583,7 +586,7 @@ mkfs_msdos(const char *fname, const char
si_sa.sa_handler = infohandler;
if (sigaction(SIGINFO, &si_sa, NULL) == -1) {
warn("sigaction SIGINFO");
- return -1;
+ goto done;
}
for (lsn = 0; lsn < dir + (fat == 32 ? bpb.bpbSecPerClust : rds); lsn++) {
if (got_siginfo) {
@@ -601,17 +604,17 @@ mkfs_msdos(const char *fname, const char
x -= bpb.bpbBackup;
if (!x && lseek(fd1, o.offset, SEEK_SET)) {
warn("%s", bname);
- return -1;
+ goto done;
}
}
if (o.bootstrap && x < bss) {
if ((n = read(fd1, img, bpb.bpbBytesPerSec)) == -1) {
warn("%s", bname);
- return -1;
+ goto done;
}
if ((unsigned)n != bpb.bpbBytesPerSec) {
warnx("%s: can't read sector %u", bname, x);
- return -1;
+ goto done;
}
} else
memset(img, 0, bpb.bpbBytesPerSec);
@@ -701,15 +704,19 @@ mkfs_msdos(const char *fname, const char
}
if ((n = write(fd, img, bpb.bpbBytesPerSec)) == -1) {
warn("%s", fname);
- return -1;
+ goto done;
}
if ((unsigned)n != bpb.bpbBytesPerSec) {
warnx("%s: can't write sector %u", fname, lsn);
- return -1;
+ goto done;
}
}
}
- return 0;
+ rv = 0;
+done:
+ free(img);
+
+ return rv;
}
/*
Modified: user/ngie/make_check/sys/amd64/amd64/pmap.c
==============================================================================
--- user/ngie/make_check/sys/amd64/amd64/pmap.c Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/sys/amd64/amd64/pmap.c Sun Dec 6 21:31:09 2015 (r291910)
@@ -1421,6 +1421,9 @@ pmap_invalidate_page(pmap_t pmap, vm_off
sched_unpin();
}
+/* 4k PTEs -- Chosen to exceed the total size of Broadwell L2 TLB */
+#define PMAP_INVLPG_THRESHOLD (4 * 1024 * PAGE_SIZE)
+
void
pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
{
@@ -1428,6 +1431,11 @@ pmap_invalidate_range(pmap_t pmap, vm_of
vm_offset_t addr;
u_int cpuid, i;
+ if (eva - sva >= PMAP_INVLPG_THRESHOLD) {
+ pmap_invalidate_all(pmap);
+ return;
+ }
+
if (pmap_type_guest(pmap)) {
pmap_invalidate_ept(pmap);
return;
Modified: user/ngie/make_check/sys/dev/usb/wlan/if_urtwn.c
==============================================================================
--- user/ngie/make_check/sys/dev/usb/wlan/if_urtwn.c Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/sys/dev/usb/wlan/if_urtwn.c Sun Dec 6 21:31:09 2015 (r291910)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <sys/lock.h>
#include <sys/mutex.h>
+#include <sys/condvar.h>
#include <sys/mbuf.h>
#include <sys/kernel.h>
#include <sys/socket.h>
@@ -70,6 +71,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
+#include <dev/usb/usb_device.h>
#include "usbdevs.h"
#define USB_DEBUG_VAR urtwn_debug
@@ -265,8 +267,7 @@ static void urtwn_r88e_fw_reset(struct
static int urtwn_fw_loadpage(struct urtwn_softc *, int,
const uint8_t *, int);
static int urtwn_load_firmware(struct urtwn_softc *);
-static int urtwn_r92c_dma_init(struct urtwn_softc *);
-static int urtwn_r88e_dma_init(struct urtwn_softc *);
+static int urtwn_dma_init(struct urtwn_softc *);
static int urtwn_mac_init(struct urtwn_softc *);
static void urtwn_bb_init(struct urtwn_softc *);
static void urtwn_rf_init(struct urtwn_softc *);
@@ -396,7 +397,7 @@ urtwn_attach(device_t self)
struct usb_attach_arg *uaa = device_get_ivars(self);
struct urtwn_softc *sc = device_get_softc(self);
struct ieee80211com *ic = &sc->sc_ic;
- uint8_t iface_index, bands;
+ uint8_t bands;
int error;
device_set_usb_desc(self);
@@ -410,9 +411,9 @@ urtwn_attach(device_t self)
callout_init(&sc->sc_watchdog_ch, 0);
mbufq_init(&sc->sc_snd, ifqmaxlen);
- iface_index = URTWN_IFACE_INDEX;
- error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer,
- urtwn_config, URTWN_N_TRANSFER, sc, &sc->sc_mtx);
+ sc->sc_iface_index = URTWN_IFACE_INDEX;
+ error = usbd_transfer_setup(uaa->device, &sc->sc_iface_index,
+ sc->sc_xfer, urtwn_config, URTWN_N_TRANSFER, sc, &sc->sc_mtx);
if (error) {
device_printf(self, "could not allocate USB transfers, "
"err=%s\n", usbd_errstr(error));
@@ -1471,7 +1472,6 @@ urtwn_read_rom(struct urtwn_softc *sc)
sc->sc_rf_write = urtwn_r92c_rf_write;
sc->sc_power_on = urtwn_r92c_power_on;
- sc->sc_dma_init = urtwn_r92c_dma_init;
return (0);
}
@@ -1503,7 +1503,6 @@ urtwn_r88e_read_rom(struct urtwn_softc *
sc->sc_rf_write = urtwn_r88e_rf_write;
sc->sc_power_on = urtwn_r88e_power_on;
- sc->sc_dma_init = urtwn_r88e_dma_init;
return (0);
}
@@ -2811,86 +2810,103 @@ fail:
return (error);
}
-static __inline int
+static int
urtwn_dma_init(struct urtwn_softc *sc)
{
+ struct usb_endpoint *ep, *ep_end;
usb_error_t usb_err;
- int error;
+ uint32_t reg;
+ int hashq, hasnq, haslq, nqueues, ntx;
+ int error, pagecount, npubqpages, nqpages, nrempages, tx_boundary;
/* Initialize LLT table. */
error = urtwn_llt_init(sc);
if (error != 0)
return (error);
- error = sc->sc_dma_init(sc);
- if (error != 0)
- return (error);
-
- /* Set Tx/Rx transfer page size. */
- usb_err = urtwn_write_1(sc, R92C_PBP,
- SM(R92C_PBP_PSRX, R92C_PBP_128) |
- SM(R92C_PBP_PSTX, R92C_PBP_128));
- if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ /* Determine the number of bulk-out pipes. */
+ ntx = 0;
+ ep = sc->sc_udev->endpoints;
+ ep_end = sc->sc_udev->endpoints + sc->sc_udev->endpoints_max;
+ for (; ep != ep_end; ep++) {
+ if ((ep->edesc == NULL) ||
+ (ep->iface_index != sc->sc_iface_index))
+ continue;
+ if (UE_GET_DIR(ep->edesc->bEndpointAddress) == UE_DIR_OUT)
+ ntx++;
+ }
+ if (ntx == 0) {
+ device_printf(sc->sc_dev,
+ "%d: invalid number of Tx bulk pipes\n", ntx);
return (EIO);
-
- return (0);
-}
-
-static int
-urtwn_r92c_dma_init(struct urtwn_softc *sc)
-{
- int hashq, hasnq, haslq, nqueues, nqpages, nrempages;
- usb_error_t error;
- uint32_t reg;
+ }
/* Get Tx queues to USB endpoints mapping. */
- hashq = hasnq = haslq = 0;
- reg = urtwn_read_2(sc, R92C_USB_EP + 1);
- DPRINTFN(2, "USB endpoints mapping 0x%x\n", reg);
- if (MS(reg, R92C_USB_EP_HQ) != 0)
- hashq = 1;
- if (MS(reg, R92C_USB_EP_NQ) != 0)
- hasnq = 1;
- if (MS(reg, R92C_USB_EP_LQ) != 0)
- haslq = 1;
+ hashq = hasnq = haslq = nqueues = 0;
+ switch (ntx) {
+ case 1: hashq = 1; break;
+ case 2: hashq = hasnq = 1; break;
+ case 3: case 4: hashq = hasnq = haslq = 1; break;
+ }
nqueues = hashq + hasnq + haslq;
if (nqueues == 0)
return (EIO);
- /* Get the number of pages for each queue. */
- nqpages = (R92C_TX_PAGE_COUNT - R92C_PUBQ_NPAGES) / nqueues;
- /* The remaining pages are assigned to the high priority queue. */
- nrempages = (R92C_TX_PAGE_COUNT - R92C_PUBQ_NPAGES) % nqueues;
+
+ npubqpages = nqpages = nrempages = pagecount = 0;
+ if (sc->chip & URTWN_CHIP_88E)
+ tx_boundary = R88E_TX_PAGE_BOUNDARY;
+ else {
+ pagecount = R92C_TX_PAGE_COUNT;
+ npubqpages = R92C_PUBQ_NPAGES;
+ tx_boundary = R92C_TX_PAGE_BOUNDARY;
+ }
/* Set number of pages for normal priority queue. */
- error = urtwn_write_1(sc, R92C_RQPN_NPQ, hasnq ? nqpages : 0);
- if (error != USB_ERR_NORMAL_COMPLETION)
- return (EIO);
- error = urtwn_write_4(sc, R92C_RQPN,
- /* Set number of pages for public queue. */
- SM(R92C_RQPN_PUBQ, R92C_PUBQ_NPAGES) |
- /* Set number of pages for high priority queue. */
- SM(R92C_RQPN_HPQ, hashq ? nqpages + nrempages : 0) |
- /* Set number of pages for low priority queue. */
- SM(R92C_RQPN_LPQ, haslq ? nqpages : 0) |
- /* Load values. */
- R92C_RQPN_LD);
- if (error != USB_ERR_NORMAL_COMPLETION)
- return (EIO);
+ if (sc->chip & URTWN_CHIP_88E) {
+ usb_err = urtwn_write_2(sc, R92C_RQPN_NPQ, 0xd);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+ usb_err = urtwn_write_4(sc, R92C_RQPN, 0x808e000d);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+ } else {
+ /* Get the number of pages for each queue. */
+ nqpages = (pagecount - npubqpages) / nqueues;
+ /*
+ * The remaining pages are assigned to the high priority
+ * queue.
+ */
+ nrempages = (pagecount - npubqpages) % nqueues;
+ usb_err = urtwn_write_1(sc, R92C_RQPN_NPQ, hasnq ? nqpages : 0);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+ usb_err = urtwn_write_4(sc, R92C_RQPN,
+ /* Set number of pages for public queue. */
+ SM(R92C_RQPN_PUBQ, npubqpages) |
+ /* Set number of pages for high priority queue. */
+ SM(R92C_RQPN_HPQ, hashq ? nqpages + nrempages : 0) |
+ /* Set number of pages for low priority queue. */
+ SM(R92C_RQPN_LPQ, haslq ? nqpages : 0) |
+ /* Load values. */
+ R92C_RQPN_LD);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+ }
- error = urtwn_write_1(sc, R92C_TXPKTBUF_BCNQ_BDNY, R92C_TX_PAGE_BOUNDARY);
- if (error != USB_ERR_NORMAL_COMPLETION)
+ usb_err = urtwn_write_1(sc, R92C_TXPKTBUF_BCNQ_BDNY, tx_boundary);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
return (EIO);
- error = urtwn_write_1(sc, R92C_TXPKTBUF_MGQ_BDNY, R92C_TX_PAGE_BOUNDARY);
- if (error != USB_ERR_NORMAL_COMPLETION)
+ usb_err = urtwn_write_1(sc, R92C_TXPKTBUF_MGQ_BDNY, tx_boundary);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
return (EIO);
- error = urtwn_write_1(sc, R92C_TXPKTBUF_WMAC_LBK_BF_HD, R92C_TX_PAGE_BOUNDARY);
- if (error != USB_ERR_NORMAL_COMPLETION)
+ usb_err = urtwn_write_1(sc, R92C_TXPKTBUF_WMAC_LBK_BF_HD, tx_boundary);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
return (EIO);
- error = urtwn_write_1(sc, R92C_TRXFF_BNDY, R92C_TX_PAGE_BOUNDARY);
- if (error != USB_ERR_NORMAL_COMPLETION)
+ usb_err = urtwn_write_1(sc, R92C_TRXFF_BNDY, tx_boundary);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
return (EIO);
- error = urtwn_write_1(sc, R92C_TDECTRL + 1, R92C_TX_PAGE_BOUNDARY);
- if (error != USB_ERR_NORMAL_COMPLETION)
+ usb_err = urtwn_write_1(sc, R92C_TDECTRL + 1, tx_boundary);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
return (EIO);
/* Set queue to USB pipe mapping. */
@@ -2913,72 +2929,21 @@ urtwn_r92c_dma_init(struct urtwn_softc *
reg |= R92C_TRXDMA_CTRL_QMAP_HQ_LQ;
} else
reg |= R92C_TRXDMA_CTRL_QMAP_3EP;
- error = urtwn_write_2(sc, R92C_TRXDMA_CTRL, reg);
- if (error != USB_ERR_NORMAL_COMPLETION)
+ usb_err = urtwn_write_2(sc, R92C_TRXDMA_CTRL, reg);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
return (EIO);
/* Set Tx/Rx transfer page boundary. */
- error = urtwn_write_2(sc, R92C_TRXFF_BNDY + 2, 0x27ff);
- if (error != USB_ERR_NORMAL_COMPLETION)
- return (EIO);
-
- return (0);
-}
-
-static int
-urtwn_r88e_dma_init(struct urtwn_softc *sc)
-{
- struct usb_interface *iface;
- uint32_t reg;
- usb_error_t error;
- int nqueues;
-
- /* Get Tx queues to USB endpoints mapping. */
- iface = usbd_get_iface(sc->sc_udev, 0);
- nqueues = iface->idesc->bNumEndpoints - 1;
- if (nqueues == 0)
- return (EIO);
-
- /* Set number of pages for normal priority queue. */
- error = urtwn_write_2(sc, R92C_RQPN_NPQ, 0x000d);
- if (error != USB_ERR_NORMAL_COMPLETION)
- return (EIO);
- error = urtwn_write_4(sc, R92C_RQPN, 0x808e000d);
- if (error != USB_ERR_NORMAL_COMPLETION)
- return (EIO);
-
- error = urtwn_write_1(sc, R92C_TXPKTBUF_BCNQ_BDNY, R88E_TX_PAGE_BOUNDARY);
- if (error != USB_ERR_NORMAL_COMPLETION)
- return (EIO);
- error = urtwn_write_1(sc, R92C_TXPKTBUF_MGQ_BDNY, R88E_TX_PAGE_BOUNDARY);
- if (error != USB_ERR_NORMAL_COMPLETION)
- return (EIO);
- error = urtwn_write_1(sc, R92C_TXPKTBUF_WMAC_LBK_BF_HD, R88E_TX_PAGE_BOUNDARY);
- if (error != USB_ERR_NORMAL_COMPLETION)
- return (EIO);
- error = urtwn_write_1(sc, R92C_TRXFF_BNDY, R88E_TX_PAGE_BOUNDARY);
- if (error != USB_ERR_NORMAL_COMPLETION)
- return (EIO);
- error = urtwn_write_1(sc, R92C_TDECTRL + 1, R88E_TX_PAGE_BOUNDARY);
- if (error != USB_ERR_NORMAL_COMPLETION)
- return (EIO);
-
- /* Set queue to USB pipe mapping. */
- reg = urtwn_read_2(sc, R92C_TRXDMA_CTRL);
- reg &= ~R92C_TRXDMA_CTRL_QMAP_M;
- if (nqueues == 1)
- reg |= R92C_TRXDMA_CTRL_QMAP_LQ;
- else if (nqueues == 2)
- reg |= R92C_TRXDMA_CTRL_QMAP_HQ_NQ;
- else
- reg |= R92C_TRXDMA_CTRL_QMAP_3EP;
- error = urtwn_write_2(sc, R92C_TRXDMA_CTRL, reg);
- if (error != USB_ERR_NORMAL_COMPLETION)
+ usb_err = urtwn_write_2(sc, R92C_TRXFF_BNDY + 2,
+ (sc->chip & URTWN_CHIP_88E) ? 0x23ff : 0x27ff);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
return (EIO);
- /* Set Tx/Rx transfer page boundary. */
- error = urtwn_write_2(sc, R92C_TRXFF_BNDY + 2, 0x23ff);
- if (error != USB_ERR_NORMAL_COMPLETION)
+ /* Set Tx/Rx transfer page size. */
+ usb_err = urtwn_write_1(sc, R92C_PBP,
+ SM(R92C_PBP_PSRX, R92C_PBP_128) |
+ SM(R92C_PBP_PSTX, R92C_PBP_128));
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
return (EIO);
return (0);
Modified: user/ngie/make_check/sys/dev/usb/wlan/if_urtwnvar.h
==============================================================================
--- user/ngie/make_check/sys/dev/usb/wlan/if_urtwnvar.h Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/sys/dev/usb/wlan/if_urtwnvar.h Sun Dec 6 21:31:09 2015 (r291910)
@@ -139,6 +139,7 @@ struct urtwn_softc {
device_t sc_dev;
struct usb_device *sc_udev;
+ uint8_t sc_iface_index;
int ac2idx[WME_NUM_AC];
u_int sc_flags;
#define URTWN_FLAG_CCK_HIPWR 0x01
@@ -155,7 +156,6 @@ struct urtwn_softc {
void (*sc_rf_write)(struct urtwn_softc *,
int, uint8_t, uint32_t);
int (*sc_power_on)(struct urtwn_softc *);
- int (*sc_dma_init)(struct urtwn_softc *);
uint8_t board_type;
uint8_t regulatory;
Modified: user/ngie/make_check/sys/i386/i386/pmap.c
==============================================================================
--- user/ngie/make_check/sys/i386/i386/pmap.c Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/sys/i386/i386/pmap.c Sun Dec 6 21:31:09 2015 (r291910)
@@ -1032,6 +1032,9 @@ pmap_invalidate_page(pmap_t pmap, vm_off
sched_unpin();
}
+/* 4k PTEs -- Chosen to exceed the total size of Broadwell L2 TLB */
+#define PMAP_INVLPG_THRESHOLD (4 * 1024 * PAGE_SIZE)
+
void
pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
{
@@ -1039,6 +1042,11 @@ pmap_invalidate_range(pmap_t pmap, vm_of
vm_offset_t addr;
u_int cpuid;
+ if (eva - sva >= PMAP_INVLPG_THRESHOLD) {
+ pmap_invalidate_all(pmap);
+ return;
+ }
+
sched_pin();
if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) {
for (addr = sva; addr < eva; addr += PAGE_SIZE)
Modified: user/ngie/make_check/sys/netinet/sctp_input.c
==============================================================================
--- user/ngie/make_check/sys/netinet/sctp_input.c Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/sys/netinet/sctp_input.c Sun Dec 6 21:31:09 2015 (r291910)
@@ -2103,6 +2103,7 @@ sctp_process_cookie_new(struct mbuf *m,
*/
stcb = sctp_aloc_assoc(inp, init_src, &error,
ntohl(initack_cp->init.initiate_tag), vrf_id,
+ ntohs(initack_cp->init.num_outbound_streams),
(struct thread *)NULL
);
if (stcb == NULL) {
Modified: user/ngie/make_check/sys/netinet/sctp_output.c
==============================================================================
--- user/ngie/make_check/sys/netinet/sctp_output.c Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/sys/netinet/sctp_output.c Sun Dec 6 21:31:09 2015 (r291910)
@@ -3652,6 +3652,7 @@ sctp_process_cmsgs_for_init(struct sctp_
#endif
stcb->asoc.strmout[i].stream_no = i;
stcb->asoc.strmout[i].last_msg_incomplete = 0;
+ stcb->asoc.strmout[i].state = SCTP_STREAM_OPENING;
stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL);
}
}
@@ -5841,10 +5842,10 @@ do_a_abort:
his_limit = ntohs(init_chk->init.num_inbound_streams);
/* choose what I want */
if (asoc != NULL) {
- if (asoc->streamoutcnt > inp->sctp_ep.pre_open_stream_count) {
+ if (asoc->streamoutcnt > asoc->pre_open_streams) {
i_want = asoc->streamoutcnt;
} else {
- i_want = inp->sctp_ep.pre_open_stream_count;
+ i_want = asoc->pre_open_streams;
}
} else {
i_want = inp->sctp_ep.pre_open_stream_count;
@@ -12601,6 +12602,7 @@ sctp_lower_sosend(struct socket *so,
}
#endif
stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id,
+ inp->sctp_ep.pre_open_stream_count,
p
);
if (stcb == NULL) {
Modified: user/ngie/make_check/sys/netinet/sctp_pcb.c
==============================================================================
--- user/ngie/make_check/sys/netinet/sctp_pcb.c Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/sys/netinet/sctp_pcb.c Sun Dec 6 21:31:09 2015 (r291910)
@@ -4160,6 +4160,7 @@ try_again:
struct sctp_tcb *
sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr,
int *error, uint32_t override_tag, uint32_t vrf_id,
+ uint16_t o_streams,
struct thread *p
)
{
@@ -4318,7 +4319,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp,
/* setup back pointer's */
stcb->sctp_ep = inp;
stcb->sctp_socket = inp->sctp_socket;
- if ((err = sctp_init_asoc(inp, stcb, override_tag, vrf_id))) {
+ if ((err = sctp_init_asoc(inp, stcb, override_tag, vrf_id, o_streams))) {
/* failed */
SCTP_TCB_LOCK_DESTROY(stcb);
SCTP_TCB_SEND_LOCK_DESTROY(stcb);
Modified: user/ngie/make_check/sys/netinet/sctp_pcb.h
==============================================================================
--- user/ngie/make_check/sys/netinet/sctp_pcb.h Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/sys/netinet/sctp_pcb.h Sun Dec 6 21:31:09 2015 (r291910)
@@ -584,7 +584,7 @@ void sctp_inpcb_free(struct sctp_inpcb *
struct sctp_tcb *
sctp_aloc_assoc(struct sctp_inpcb *, struct sockaddr *,
- int *, uint32_t, uint32_t, struct thread *);
+ int *, uint32_t, uint32_t, uint16_t, struct thread *);
int sctp_free_assoc(struct sctp_inpcb *, struct sctp_tcb *, int, int);
Modified: user/ngie/make_check/sys/netinet/sctp_usrreq.c
==============================================================================
--- user/ngie/make_check/sys/netinet/sctp_usrreq.c Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/sys/netinet/sctp_usrreq.c Sun Dec 6 21:31:09 2015 (r291910)
@@ -1501,6 +1501,7 @@ sctp_do_connect_x(struct socket *so, str
/* We are GOOD to go */
stcb = sctp_aloc_assoc(inp, sa, &error, 0, vrf_id,
+ inp->sctp_ep.pre_open_stream_count,
(struct thread *)p
);
if (stcb == NULL) {
@@ -6929,7 +6930,7 @@ sctp_connect(struct socket *so, struct s
}
vrf_id = inp->def_vrf_id;
/* We are GOOD to go */
- stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, p);
+ stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, p);
if (stcb == NULL) {
/* Gak! no memory */
goto out_now;
Modified: user/ngie/make_check/sys/netinet/sctputil.c
==============================================================================
--- user/ngie/make_check/sys/netinet/sctputil.c Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/sys/netinet/sctputil.c Sun Dec 6 21:31:09 2015 (r291910)
@@ -938,7 +938,7 @@ sctp_map_assoc_state(int kernel_state)
int
sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
- uint32_t override_tag, uint32_t vrf_id)
+ uint32_t override_tag, uint32_t vrf_id, uint16_t o_strms)
{
struct sctp_association *asoc;
@@ -1100,7 +1100,7 @@ sctp_init_asoc(struct sctp_inpcb *inp, s
* that we request by default.
*/
asoc->strm_realoutsize = asoc->streamoutcnt = asoc->pre_open_streams =
- inp->sctp_ep.pre_open_stream_count;
+ o_strms;
SCTP_MALLOC(asoc->strmout, struct sctp_stream_out *,
asoc->streamoutcnt * sizeof(struct sctp_stream_out),
SCTP_M_STRMO);
Modified: user/ngie/make_check/sys/netinet/sctputil.h
==============================================================================
--- user/ngie/make_check/sys/netinet/sctputil.h Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/sys/netinet/sctputil.h Sun Dec 6 21:31:09 2015 (r291910)
@@ -83,7 +83,7 @@ uint32_t sctp_select_initial_TSN(struct
uint32_t sctp_select_a_tag(struct sctp_inpcb *, uint16_t lport, uint16_t rport, int);
-int sctp_init_asoc(struct sctp_inpcb *, struct sctp_tcb *, uint32_t, uint32_t);
+int sctp_init_asoc(struct sctp_inpcb *, struct sctp_tcb *, uint32_t, uint32_t, uint16_t);
void sctp_fill_random_store(struct sctp_pcb *);
Modified: user/ngie/make_check/sys/netinet6/sctp6_usrreq.c
==============================================================================
--- user/ngie/make_check/sys/netinet6/sctp6_usrreq.c Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/sys/netinet6/sctp6_usrreq.c Sun Dec 6 21:31:09 2015 (r291910)
@@ -946,7 +946,7 @@ sctp6_connect(struct socket *so, struct
return (EALREADY);
}
/* We are GOOD to go */
- stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, p);
+ stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, p);
SCTP_ASOC_CREATE_UNLOCK(inp);
if (stcb == NULL) {
/* Gak! no memory */
Modified: user/ngie/make_check/sys/sys/elf_common.h
==============================================================================
--- user/ngie/make_check/sys/sys/elf_common.h Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/sys/sys/elf_common.h Sun Dec 6 21:31:09 2015 (r291910)
@@ -727,6 +727,11 @@ typedef struct {
#define LL_DELAY_LOAD 0x10
#define LL_DELTA 0x20
+/* Values for n_type used in executables. */
+#define NT_FREEBSD_ABI_TAG 1
+#define NT_FREEBSD_NOINIT_TAG 2
+#define NT_FREEBSD_ARCH_TAG 3
+
/* Values for n_type. Used in core files. */
#define NT_PRSTATUS 1 /* Process status. */
#define NT_FPREGSET 2 /* Floating point registers. */
Modified: user/ngie/make_check/sys/vm/vm_fault.c
==============================================================================
--- user/ngie/make_check/sys/vm/vm_fault.c Sun Dec 6 21:16:01 2015 (r291909)
+++ user/ngie/make_check/sys/vm/vm_fault.c Sun Dec 6 21:31:09 2015 (r291910)
@@ -839,7 +839,7 @@ vnode_locked:
* get rid of the unnecessary page
*/
vm_page_lock(fs.first_m);
- vm_page_free(fs.first_m);
+ vm_page_remove(fs.first_m);
vm_page_unlock(fs.first_m);
/*
* grab the page and put it into the
@@ -848,9 +848,13 @@ vnode_locked:
*/
if (vm_page_rename(fs.m, fs.first_object,
fs.first_pindex)) {
+ VM_OBJECT_WUNLOCK(fs.first_object);
unlock_and_deallocate(&fs);
goto RetryFault;
}
+ vm_page_lock(fs.first_m);
+ vm_page_free(fs.first_m);
+ vm_page_unlock(fs.first_m);
#if VM_NRESERVLEVEL > 0
/*
* Rename the reservation.
More information about the svn-src-user
mailing list