Re: svn commit: r311707 - in head/sys/dev/rtwn: . usb

2017-01-09 Thread Hans Petter Selasky

On 01/09/17 00:41, Andriy Voskoboinyk wrote:

Modified: head/sys/dev/rtwn/usb/rtwn_usb_ep.c
==
--- head/sys/dev/rtwn/usb/rtwn_usb_ep.c Sun Jan  8 23:25:46 2017
(r311706)
+++ head/sys/dev/rtwn/usb/rtwn_usb_ep.c Sun Jan  8 23:41:17 2017
(r311707)
@@ -63,7 +63,6 @@ static struct usb_config rtwn_config[RTW
.type = UE_BULK,
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
-   .bufsize = RTWN_RXBUFSZ,
.flags = {
.pipe_bof = 1,
.short_xfer_ok = 1
@@ -222,6 +221,7 @@ rtwn_usb_setup_endpoints(struct rtwn_usb
break;
}

+   rtwn_config[RTWN_BULK_RX].bufsize = sc->rx_dma_size + 1024;


Hi,

You should copy the rtwn_config to the stack/softc, and not write to the 
static struct, which should be made "static const" after this change!


This might lead to a race when multiple adapters are connecting at the 
same time! Remember USB enumeration is multithreaded.


Else your change looks good.

--HPS
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311769 - head/usr.bin/netstat

2017-01-09 Thread Steven Hartland
Author: smh
Date: Mon Jan  9 09:28:03 2017
New Revision: 311769
URL: https://svnweb.freebsd.org/changeset/base/311769

Log:
  Fix rstat: symbol not in namelist from netstat
  
  Load kvm symbols earlier to prevent rstat: symbol not in namelist
  error when running netstat -rs.
  
  Submitted by: Sebastian Huber 
  MFC after:1 week
  Sponsored by: Multiplay

Modified:
  head/usr.bin/netstat/main.c

Modified: head/usr.bin/netstat/main.c
==
--- head/usr.bin/netstat/main.c Mon Jan  9 08:12:22 2017(r311768)
+++ head/usr.bin/netstat/main.c Mon Jan  9 09:28:03 2017(r311769)
@@ -427,6 +427,9 @@ main(int argc, char *argv[])
if (xflag && Tflag)
xo_errx(1, "-x and -T are incompatible, pick one.");
 
+   /* Load all necessary kvm symbols */
+   kresolve_list(nl);
+
if (Bflag) {
if (!live)
usage();
@@ -507,9 +510,6 @@ main(int argc, char *argv[])
exit(0);
}
 
-   /* Load all necessary kvm symbols */
-   kresolve_list(nl);
-
if (tp) {
xo_open_container("statistics");
printproto(tp, tp->pr_name, &first);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311780 - head/lib/libprocstat

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 10:47:20 2017
New Revision: 311780
URL: https://svnweb.freebsd.org/changeset/base/311780

Log:
  Use tab for indent.
  
  Extracted from:   ino64 work by gleb
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/lib/libprocstat/Makefile

Modified: head/lib/libprocstat/Makefile
==
--- head/lib/libprocstat/Makefile   Mon Jan  9 10:31:39 2017
(r311779)
+++ head/lib/libprocstat/Makefile   Mon Jan  9 10:47:20 2017
(r311780)
@@ -9,7 +9,7 @@ SRCS=   cd9660.c\
common_kvm.c\
core.c  \
libprocstat.c   \
-msdosfs.c  \
+   msdosfs.c   \
smbfs.c \
udf.c
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311781 - head/lib/libprocstat

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 11:11:52 2017
New Revision: 311781
URL: https://svnweb.freebsd.org/changeset/base/311781

Log:
  Use standard Versions.def for libprocstat.
  
  This makes the versions inheritance consistent for our versioned libraries.
  
  Extracted from:   ino64
  Discussed with:   kan
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Deleted:
  head/lib/libprocstat/Versions.def
Modified:
  head/lib/libprocstat/Makefile

Modified: head/lib/libprocstat/Makefile
==
--- head/lib/libprocstat/Makefile   Mon Jan  9 10:47:20 2017
(r311780)
+++ head/lib/libprocstat/Makefile   Mon Jan  9 11:11:52 2017
(r311781)
@@ -13,7 +13,7 @@ SRCS= cd9660.c\
smbfs.c \
udf.c
 
-VERSION_DEF=   ${.CURDIR}/Versions.def
+VERSION_DEF=   ${LIBCSRCDIR}/Versions.def
 SYMBOL_MAPS=   ${.CURDIR}/Symbol.map
 
 INCS=  libprocstat.h
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311787 - head/sys/cam/ctl

2017-01-09 Thread Alexander Motin
Author: mav
Date: Mon Jan  9 16:21:06 2017
New Revision: 311787
URL: https://svnweb.freebsd.org/changeset/base/311787

Log:
  Allocate memory for prevent flags only for removable LUs.
  
  This array takes 64KB of RAM now, that was more then half of struct ctl_lun
  size.  If at some point we support more ports, this may need another tune.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_private.h

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Mon Jan  9 14:13:47 2017(r311786)
+++ head/sys/cam/ctl/ctl.c  Mon Jan  9 16:21:06 2017(r311787)
@@ -4585,6 +4585,10 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
lun->ie_reported = 1;
callout_init_mtx(&lun->ie_callout, &lun->lun_lock, 0);
ctl_tpc_lun_init(lun);
+   if (lun->flags & CTL_LUN_REMOVABLE) {
+   lun->prevent = malloc((CTL_MAX_INITIATORS + 31) / 32 * 4,
+   M_CTL, M_WAITOK);
+   }
 
/*
 * Initialize the mode and log page index.
@@ -4666,6 +4670,7 @@ ctl_free_lun(struct ctl_lun *lun)
for (i = 0; i < CTL_MAX_PORTS; i++)
free(lun->pr_keys[i], M_CTL);
free(lun->write_buffer, M_CTL);
+   free(lun->prevent, M_CTL);
if (lun->flags & CTL_LUN_MALLOCED)
free(lun, M_CTL);
 
@@ -5276,7 +5281,7 @@ ctl_prevent_allow(struct ctl_scsiio *cts
 
cdb = (struct scsi_prevent *)ctsio->cdb;
 
-   if ((lun->flags & CTL_LUN_REMOVABLE) == 0) {
+   if ((lun->flags & CTL_LUN_REMOVABLE) == 0 || lun->prevent == NULL) {
ctl_set_invalid_opcode(ctsio);
ctl_done((union ctl_io *)ctsio);
return (CTL_RETVAL_COMPLETE);
@@ -11872,8 +11877,10 @@ ctl_do_lun_reset(struct ctl_lun *lun, un
ctl_clear_mask(lun->have_ca, i);
 #endif
lun->prevent_count = 0;
-   for (i = 0; i < CTL_MAX_INITIATORS; i++)
-   ctl_clear_mask(lun->prevent, i);
+   if (lun->prevent) {
+   for (i = 0; i < CTL_MAX_INITIATORS; i++)
+   ctl_clear_mask(lun->prevent, i);
+   }
mtx_unlock(&lun->lun_lock);
 
return (0);
@@ -12019,7 +12026,7 @@ ctl_i_t_nexus_reset(union ctl_io *io)
 #endif
if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx == 
initidx))
lun->flags &= ~CTL_LUN_RESERVED;
-   if (ctl_is_set(lun->prevent, initidx)) {
+   if (lun->prevent && ctl_is_set(lun->prevent, initidx)) {
ctl_clear_mask(lun->prevent, initidx);
lun->prevent_count--;
}

Modified: head/sys/cam/ctl/ctl_private.h
==
--- head/sys/cam/ctl/ctl_private.h  Mon Jan  9 14:13:47 2017
(r311786)
+++ head/sys/cam/ctl/ctl_private.h  Mon Jan  9 16:21:06 2017
(r311787)
@@ -412,7 +412,7 @@ struct ctl_lun {
uint32_tpr_res_idx;
uint8_t pr_res_type;
int prevent_count;
-   uint32_tprevent[(CTL_MAX_INITIATORS+31)/32];
+   uint32_t*prevent;
uint8_t *write_buffer;
struct ctl_devid*lun_devid;
TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r311736 - head/sys/dev/sdhci

2017-01-09 Thread Shawn Webb
Hey Ian,

On Mon, Jan 09, 2017 at 02:04:54AM +, Ian Lepore wrote:
> Author: ian
> Date: Mon Jan  9 02:04:54 2017
> New Revision: 311736
> URL: https://svnweb.freebsd.org/changeset/base/311736
> 
> Log:
>   Use the new sdhci_fdt_gpio helper functions to add full support for FDT
>   gpio pins for detecting card insert/remove and write protect.

Looks like the new sdhci work causes a kernel panic on the RPI3. It was
reported to me by one of our users. I'll shortly be in the process of
dissecting which exact commit causes it.

Screenshots of the kernel panic:

http://www.zyxst.net/~bofh/rpi3/hbsd/panic0.jpg
http://www.zyxst.net/~bofh/rpi3/hbsd/panic1.jpg

Thanks,

-- 
Shawn Webb
Cofounder and Security Engineer
HardenedBSD

GPG Key ID:  0x6A84658F52456EEE
GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


signature.asc
Description: PGP signature


svn commit: r311793 - head/sys/dev/mmc

2017-01-09 Thread Marius Strobl
Author: marius
Date: Mon Jan  9 17:05:39 2017
New Revision: 311793
URL: https://svnweb.freebsd.org/changeset/base/311793

Log:
  In mmcsd_task(), bio_resid was not being set to 0 on a successful read
  or write, resulting in random short-read and short-write returns for
  requests. Fixing this fixes nominal block I/O via mmcsd(4).
  
  Obtained from:DragonFlyBSD (fd4b97583be1a1e57234713c25f6e81bc0411cb0)
  MFC after:5 days

Modified:
  head/sys/dev/mmc/mmcsd.c

Modified: head/sys/dev/mmc/mmcsd.c
==
--- head/sys/dev/mmc/mmcsd.cMon Jan  9 17:04:51 2017(r311792)
+++ head/sys/dev/mmc/mmcsd.cMon Jan  9 17:05:39 2017(r311793)
@@ -545,6 +545,8 @@ mmcsd_task(void *arg)
bp->bio_error = EIO;
bp->bio_resid = (end - block) * sz;
bp->bio_flags |= BIO_ERROR;
+   } else {
+   bp->bio_resid = 0;
}
biodone(bp);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311794 - head/sys/dev/sdhci

2017-01-09 Thread Marius Strobl
Author: marius
Date: Mon Jan  9 17:07:13 2017
New Revision: 311794
URL: https://svnweb.freebsd.org/changeset/base/311794

Log:
  - Add support for Intel Apollo Lake and Bay Trail eMMC controllers.
Besides slots always having non-removable media, these HCIs require
a custom hardware reset sequence after power-up.
  - Flesh out the support for Intel Braswell eMMC controllers further.
Apart from also requiring said reset code, the timeout clock needs to
be hardcoded to 1 MHz for these.
Both the special reset and timeout clock handlings are implemented as
global sdhci(4) quirks as the same treatment will be necessary for
Intel eMMC controllers attached via ACPI (once sdhci(4) grows such a
front-end).
  - In sdhci_init_slot(), use the right capability field for determining
the announced bus width based on MMC_CAP_*_BIT_DATA.
  - Correct inverted sdhci_pci_softc member comments added in r276469. [1]
  
  Submitted by: Anton Yuzhaninov [1]
  MFC after:5 days

Modified:
  head/sys/dev/sdhci/sdhci.c
  head/sys/dev/sdhci/sdhci.h
  head/sys/dev/sdhci/sdhci_pci.c

Modified: head/sys/dev/sdhci/sdhci.c
==
--- head/sys/dev/sdhci/sdhci.c  Mon Jan  9 17:05:39 2017(r311793)
+++ head/sys/dev/sdhci/sdhci.c  Mon Jan  9 17:07:13 2017(r311794)
@@ -376,6 +376,13 @@ sdhci_set_power(struct sdhci_slot *slot,
/* Turn on the power. */
pwr |= SDHCI_POWER_ON;
WR1(slot, SDHCI_POWER_CONTROL, pwr);
+
+   if (slot->quirks & SDHCI_QUIRK_INTEL_POWER_UP_RESET) {
+   WR1(slot, SDHCI_POWER_CONTROL, pwr | 0x10);
+   DELAY(10);
+   WR1(slot, SDHCI_POWER_CONTROL, pwr);
+   DELAY(300);
+   }
 }
 
 static void
@@ -622,9 +629,11 @@ sdhci_init_slot(device_t dev, struct sdh
device_printf(dev, "Hardware doesn't specify base clock "
"frequency, using %dMHz as default.\n", 
SDHCI_DEFAULT_MAX_FREQ);
}
-   /* Calculate timeout clock frequency. */
+   /* Calculate/set timeout clock frequency. */
if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) {
slot->timeout_clk = slot->max_clk / 1000;
+   } else if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_1MHZ) {
+   slot->timeout_clk = 1000;
} else {
slot->timeout_clk =
(caps & SDHCI_TIMEOUT_CLK_MASK) >> 
SDHCI_TIMEOUT_CLK_SHIFT;
@@ -668,6 +677,8 @@ sdhci_init_slot(device_t dev, struct sdh
slot->opt &= ~SDHCI_HAVE_DMA;
if (slot->quirks & SDHCI_QUIRK_FORCE_DMA)
slot->opt |= SDHCI_HAVE_DMA;
+   if (slot->quirks & SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE)
+   slot->opt |= SDHCI_NON_REMOVABLE;
 
/* 
 * Use platform-provided transfer backend
@@ -680,8 +691,9 @@ sdhci_init_slot(device_t dev, struct sdh
slot_printf(slot, "%uMHz%s %s%s%s%s %s\n",
slot->max_clk / 100,
(caps & SDHCI_CAN_DO_HISPD) ? " HS" : "",
-   (caps & MMC_CAP_8_BIT_DATA) ? "8bits" :
-   ((caps & MMC_CAP_4_BIT_DATA) ? "4bits" : "1bit"),
+   (slot->host.caps & MMC_CAP_8_BIT_DATA) ? "8bits" :
+   ((slot->host.caps & MMC_CAP_4_BIT_DATA) ? "4bits" :
+   "1bit"),
(caps & SDHCI_CAN_VDD_330) ? " 3.3V" : "",
(caps & SDHCI_CAN_VDD_300) ? " 3.0V" : "",
(caps & SDHCI_CAN_VDD_180) ? " 1.8V" : "",

Modified: head/sys/dev/sdhci/sdhci.h
==
--- head/sys/dev/sdhci/sdhci.h  Mon Jan  9 17:05:39 2017(r311793)
+++ head/sys/dev/sdhci/sdhci.h  Mon Jan  9 17:07:13 2017(r311794)
@@ -66,7 +66,13 @@
 /* Alternate clock source is required when supplying a 400 KHz clock. */
 #defineSDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC  (1<<16)
 /* Card insert/remove interrupts don't work, polling required. */
-#define SDHCI_QUIRK_POLL_CARD_PRESENT  (1<<17)
+#defineSDHCI_QUIRK_POLL_CARD_PRESENT   (1<<17)
+/* All controller slots are non-removable. */
+#defineSDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE (1<<18)
+/* Issue custom Intel controller reset sequence after power-up. */
+#defineSDHCI_QUIRK_INTEL_POWER_UP_RESET(1<<19)
+/* Data timeout is invalid, use 1 MHz clock instead. */
+#defineSDHCI_QUIRK_DATA_TIMEOUT_1MHZ   (1<<20)
 
 /*
  * Controller registers

Modified: head/sys/dev/sdhci/sdhci_pci.c
==
--- head/sys/dev/sdhci/sdhci_pci.c  Mon Jan  9 17:05:39 2017
(r311793)
+++ head/sys/dev/sdhci/sdhci_pci.c  Mon Jan  9 17:07:13 2017
(r311794)
@@ -107,8 +107,19 @@ static cons

svn commit: r311797 - head/sys/dev/sdhci

2017-01-09 Thread Ian Lepore
Author: ian
Date: Mon Jan  9 17:10:50 2017
New Revision: 311797
URL: https://svnweb.freebsd.org/changeset/base/311797

Log:
  Add sdhci_handle_card_present_locked() that can be called from the interrupt
  handler which already holds the mutex, and have sdhci_handle_card_present()
  be just a tiny wrapper that does the locking for external callers.
  
  This should fix the recursive locking panics seen on rpi3.
  
  Reported by:  Shawn Webb

Modified:
  head/sys/dev/sdhci/sdhci.c

Modified: head/sys/dev/sdhci/sdhci.c
==
--- head/sys/dev/sdhci/sdhci.c  Mon Jan  9 17:09:53 2017(r311796)
+++ head/sys/dev/sdhci/sdhci.c  Mon Jan  9 17:10:50 2017(r311797)
@@ -521,8 +521,8 @@ sdhci_card_task(void *arg, int pending)
}
 }
 
-void
-sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present)
+static void
+sdhci_handle_card_present_locked(struct sdhci_slot *slot, bool is_present)
 {
bool was_present;
 
@@ -537,7 +537,6 @@ sdhci_handle_card_present(struct sdhci_s
 * because once power is removed, a full card re-init is needed, and
 * that happens by deleting and recreating the child device.
 */
-   SDHCI_LOCK(slot);
was_present = slot->dev != NULL;
if (!was_present && is_present) {
taskqueue_enqueue_timeout(taskqueue_swi_giant,
@@ -545,6 +544,14 @@ sdhci_handle_card_present(struct sdhci_s
} else if (was_present && !is_present) {
taskqueue_enqueue(taskqueue_swi_giant, &slot->card_task);
}
+}
+
+void
+sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present)
+{
+
+   SDHCI_LOCK(slot);
+   sdhci_handle_card_present_locked(slot, is_present);
SDHCI_UNLOCK(slot);
 }
 
@@ -1402,7 +1409,7 @@ sdhci_generic_intr(struct sdhci_slot *sl
WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask);
WR4(slot, SDHCI_INT_STATUS, intmask & 
(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE));
-   sdhci_handle_card_present(slot, present);
+   sdhci_handle_card_present_locked(slot, present);
intmask &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE);
}
/* Handle command interrupts. */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r311667 - in head/sys/contrib/dev/acpica: components/namespace components/tables include

2017-01-09 Thread John Baldwin
On Sunday, January 08, 2017 06:26:33 AM Conrad E. Meyer wrote:
> Author: cem
> Date: Sun Jan  8 06:26:33 2017
> New Revision: 311667
> URL: https://svnweb.freebsd.org/changeset/base/311667
> 
> Log:
>   Add some additional ACPI methods for DRM
>   
>   Add AcpiGetDataFull and AcpiGetTableWithSize.
>   
>   Submitted by:   Matt Macy

Have these been submitted upstream?  The Intel folks are generally quite
responsive on freebsd-a...@freebsd.org and this codebase is actively
maintained externally.

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r311667 - in head/sys/contrib/dev/acpica: components/namespace components/tables include

2017-01-09 Thread Jung-uk Kim

On 01/09/2017 12:08, John Baldwin wrote:

On Sunday, January 08, 2017 06:26:33 AM Conrad E. Meyer wrote:

Author: cem
Date: Sun Jan  8 06:26:33 2017
New Revision: 311667
URL: https://svnweb.freebsd.org/changeset/base/311667

Log:
  Add some additional ACPI methods for DRM

  Add AcpiGetDataFull and AcpiGetTableWithSize.

  Submitted by: Matt Macy


Have these been submitted upstream?  The Intel folks are generally quite
responsive on freebsd-a...@freebsd.org and this codebase is actively
maintained externally.


Please submit upstream first.

https://github.com/acpica/acpica

Jung-uk Kim
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311804 - in head: sys/cam/ctl usr.bin/ctlstat

2017-01-09 Thread Alexander Motin
Author: mav
Date: Mon Jan  9 18:18:15 2017
New Revision: 311804
URL: https://svnweb.freebsd.org/changeset/base/311804

Log:
  Rewrite CTL statistics in more simple and scalable way.
  
  Instead of collecting statistics for each combination of ports and logical
  units, that consumed ~45KB per LU with present number of ports, collect
  separate statistics for every port and every logical unit separately, that
  consume only 176 bytes per each single LU/port.  This reduces struct
  ctl_lun size down to just 6KB.
  
  Also new IOCTL API/ABI does not hardcode number of LUs/ports, and should
  allow handling of very large quantities.
  
  MFC after:2 weeks (probably keeping old API enabled for some time)

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_backend.h
  head/sys/cam/ctl/ctl_frontend.c
  head/sys/cam/ctl/ctl_frontend.h
  head/sys/cam/ctl/ctl_ioctl.h
  head/sys/cam/ctl/ctl_private.h
  head/usr.bin/ctlstat/ctlstat.8
  head/usr.bin/ctlstat/ctlstat.c

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Mon Jan  9 17:25:23 2017(r311803)
+++ head/sys/cam/ctl/ctl.c  Mon Jan  9 18:18:15 2017(r311804)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2003-2009 Silicon Graphics International Corp.
  * Copyright (c) 2012 The FreeBSD Foundation
- * Copyright (c) 2015 Alexander Motin 
+ * Copyright (c) 2014-2017 Alexander Motin 
  * All rights reserved.
  *
  * Portions of this software were developed by Edward Tomasz Napierala
@@ -2567,6 +2567,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
  struct thread *td)
 {
struct ctl_softc *softc = dev->si_drv1;
+   struct ctl_port *port;
struct ctl_lun *lun;
int retval;
 
@@ -2778,6 +2779,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 #endif /* CTL_IO_DELAY */
break;
}
+#ifdef CTL_LEGACY_STATS
case CTL_GETSTATS: {
struct ctl_stats *stats = (struct ctl_stats *)addr;
int i;
@@ -2790,26 +2792,26 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
stats->status = CTL_SS_OK;
stats->fill_len = 0;
STAILQ_FOREACH(lun, &softc->lun_list, links) {
-   if (stats->fill_len + sizeof(lun->stats) >
+   if (stats->fill_len + sizeof(lun->legacy_stats) >
stats->alloc_len) {
stats->status = CTL_SS_NEED_MORE_SPACE;
break;
}
-   retval = copyout(&lun->stats, &stats->lun_stats[i++],
-sizeof(lun->stats));
+   retval = copyout(&lun->legacy_stats, 
&stats->lun_stats[i++],
+sizeof(lun->legacy_stats));
if (retval != 0)
break;
-   stats->fill_len += sizeof(lun->stats);
+   stats->fill_len += sizeof(lun->legacy_stats);
}
stats->num_luns = softc->num_luns;
-#ifdef CTL_TIME_IO
-   stats->flags = CTL_STATS_FLAG_TIME_VALID;
-#else
stats->flags = CTL_STATS_FLAG_NONE;
+#ifdef CTL_TIME_IO
+   stats->flags |= CTL_STATS_FLAG_TIME_VALID;
 #endif
getnanouptime(&stats->timestamp);
break;
}
+#endif /* CTL_LEGACY_STATS */
case CTL_ERROR_INJECT: {
struct ctl_error_desc *err_desc, *new_err_desc;
 
@@ -3397,6 +3399,72 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
ctl_isc_announce_port(port);
break;
}
+   case CTL_GET_LUN_STATS: {
+   struct ctl_get_io_stats *stats = (struct ctl_get_io_stats 
*)addr;
+   int i;
+
+   /*
+* XXX KDM no locking here.  If the LUN list changes,
+* things can blow up.
+*/
+   i = 0;
+   stats->status = CTL_SS_OK;
+   stats->fill_len = 0;
+   STAILQ_FOREACH(lun, &softc->lun_list, links) {
+   if (lun->lun < stats->first_item)
+   continue;
+   if (stats->fill_len + sizeof(lun->stats) >
+   stats->alloc_len) {
+   stats->status = CTL_SS_NEED_MORE_SPACE;
+   break;
+   }
+   retval = copyout(&lun->stats, &stats->stats[i++],
+sizeof(lun->stats));
+   if (retval != 0)
+   break;
+   stats->fill_len += sizeof(lun->stats);
+   }
+   stats->num_items = softc->num_luns;
+   stats->flags = CTL_STATS_FLAG_NONE;
+#ifdef CTL_TIME_IO
+   sta

svn commit: r311806 - head

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 19:12:41 2017
New Revision: 311806
URL: https://svnweb.freebsd.org/changeset/base/311806

Log:
  After r311565, also remove llvm-ranlib from ObsoleteFiles.inc.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Mon Jan  9 18:35:41 2017(r311805)
+++ head/ObsoleteFiles.inc  Mon Jan  9 19:12:41 2017(r311806)
@@ -2260,7 +2260,6 @@ OLD_LIBS+=usr/lib32/private/libyaml.so.1
 OLD_FILES+=usr/lib32/private/libyaml_p.a
 # 20140216: new clang import which bumps version from 3.3 to 3.4.
 OLD_FILES+=usr/bin/llvm-prof
-OLD_FILES+=usr/bin/llvm-ranlib
 OLD_FILES+=usr/include/clang/3.3/__wmmintrin_aes.h
 OLD_FILES+=usr/include/clang/3.3/__wmmintrin_pclmul.h
 OLD_FILES+=usr/include/clang/3.3/altivec.h
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311807 - head/tools/build/mk

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 19:22:29 2017
New Revision: 311807
URL: https://svnweb.freebsd.org/changeset/base/311807

Log:
  Add recently added libc++ headers to OptionalObsoleteFiles.inc.
  
  MFC after:3 days

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Jan  9 19:12:41 
2017(r311806)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Jan  9 19:22:29 
2017(r311807)
@@ -4438,6 +4438,8 @@ OLD_FILES+=usr/lib/libcxxrt.a
 OLD_FILES+=usr/lib/libcxxrt.so
 OLD_FILES+=usr/lib/libcxxrt_p.a
 OLD_FILES+=usr/include/c++/v1/__bit_reference
+OLD_FILES+=usr/include/c++/v1/__bsd_locale_defaults.h
+OLD_FILES+=usr/include/c++/v1/__bsd_locale_fallbacks.h
 OLD_FILES+=usr/include/c++/v1/__config
 OLD_FILES+=usr/include/c++/v1/__debug
 OLD_FILES+=usr/include/c++/v1/__functional_03
@@ -4446,10 +4448,12 @@ OLD_FILES+=usr/include/c++/v1/__function
 OLD_FILES+=usr/include/c++/v1/__hash_table
 OLD_FILES+=usr/include/c++/v1/__locale
 OLD_FILES+=usr/include/c++/v1/__mutex_base
+OLD_FILES+=usr/include/c++/v1/__nullptr
 OLD_FILES+=usr/include/c++/v1/__refstring
 OLD_FILES+=usr/include/c++/v1/__split_buffer
 OLD_FILES+=usr/include/c++/v1/__sso_allocator
 OLD_FILES+=usr/include/c++/v1/__std_stream
+OLD_FILES+=usr/include/c++/v1/__threading_support
 OLD_FILES+=usr/include/c++/v1/__tree
 OLD_FILES+=usr/include/c++/v1/__tuple
 OLD_FILES+=usr/include/c++/v1/__undef___deallocate
@@ -4485,30 +4489,51 @@ OLD_FILES+=usr/include/c++/v1/cstdlib
 OLD_FILES+=usr/include/c++/v1/cstring
 OLD_FILES+=usr/include/c++/v1/ctgmath
 OLD_FILES+=usr/include/c++/v1/ctime
+OLD_FILES+=usr/include/c++/v1/ctype.h
 OLD_FILES+=usr/include/c++/v1/cwchar
 OLD_FILES+=usr/include/c++/v1/cwctype
 OLD_FILES+=usr/include/c++/v1/cxxabi.h
 OLD_FILES+=usr/include/c++/v1/deque
+OLD_FILES+=usr/include/c++/v1/errno.h
 OLD_FILES+=usr/include/c++/v1/exception
 OLD_FILES+=usr/include/c++/v1/experimental/__config
+OLD_FILES+=usr/include/c++/v1/experimental/__memory
+OLD_FILES+=usr/include/c++/v1/experimental/algorithm
+OLD_FILES+=usr/include/c++/v1/experimental/any
 OLD_FILES+=usr/include/c++/v1/experimental/chrono
+OLD_FILES+=usr/include/c++/v1/experimental/deque
 OLD_FILES+=usr/include/c++/v1/experimental/dynarray
-OLD_FILES+=usr/include/c++/v1/experimental/dynarray
+OLD_FILES+=usr/include/c++/v1/experimental/filesystem
+OLD_FILES+=usr/include/c++/v1/experimental/forward_list
+OLD_FILES+=usr/include/c++/v1/experimental/functional
+OLD_FILES+=usr/include/c++/v1/experimental/iterator
+OLD_FILES+=usr/include/c++/v1/experimental/list
+OLD_FILES+=usr/include/c++/v1/experimental/map
+OLD_FILES+=usr/include/c++/v1/experimental/memory_resource
 OLD_FILES+=usr/include/c++/v1/experimental/optional
+OLD_FILES+=usr/include/c++/v1/experimental/propagate_const
 OLD_FILES+=usr/include/c++/v1/experimental/ratio
+OLD_FILES+=usr/include/c++/v1/experimental/regex
+OLD_FILES+=usr/include/c++/v1/experimental/set
+OLD_FILES+=usr/include/c++/v1/experimental/string
 OLD_FILES+=usr/include/c++/v1/experimental/string_view
 OLD_FILES+=usr/include/c++/v1/experimental/system_error
 OLD_FILES+=usr/include/c++/v1/experimental/tuple
 OLD_FILES+=usr/include/c++/v1/experimental/type_traits
+OLD_FILES+=usr/include/c++/v1/experimental/unordered_map
+OLD_FILES+=usr/include/c++/v1/experimental/unordered_set
 OLD_FILES+=usr/include/c++/v1/experimental/utility
+OLD_FILES+=usr/include/c++/v1/experimental/vector
 OLD_FILES+=usr/include/c++/v1/ext/__hash
 OLD_FILES+=usr/include/c++/v1/ext/hash_map
 OLD_FILES+=usr/include/c++/v1/ext/hash_set
+OLD_FILES+=usr/include/c++/v1/float.h
 OLD_FILES+=usr/include/c++/v1/forward_list
 OLD_FILES+=usr/include/c++/v1/fstream
 OLD_FILES+=usr/include/c++/v1/functional
 OLD_FILES+=usr/include/c++/v1/future
 OLD_FILES+=usr/include/c++/v1/initializer_list
+OLD_FILES+=usr/include/c++/v1/inttypes.h
 OLD_FILES+=usr/include/c++/v1/iomanip
 OLD_FILES+=usr/include/c++/v1/ios
 OLD_FILES+=usr/include/c++/v1/iosfwd
@@ -4519,6 +4544,7 @@ OLD_FILES+=usr/include/c++/v1/limits
 OLD_FILES+=usr/include/c++/v1/list
 OLD_FILES+=usr/include/c++/v1/locale
 OLD_FILES+=usr/include/c++/v1/map
+OLD_FILES+=usr/include/c++/v1/math.h
 OLD_FILES+=usr/include/c++/v1/memory
 OLD_FILES+=usr/include/c++/v1/mutex
 OLD_FILES+=usr/include/c++/v1/new
@@ -4530,17 +4556,25 @@ OLD_FILES+=usr/include/c++/v1/ratio
 OLD_FILES+=usr/include/c++/v1/regex
 OLD_FILES+=usr/include/c++/v1/scoped_allocator
 OLD_FILES+=usr/include/c++/v1/set
+OLD_FILES+=usr/include/c++/v1/setjmp.h
 OLD_FILES+=usr/include/c++/v1/shared_mutex
 OLD_FILES+=usr/include/c++/v1/sstream
 OLD_FILES+=usr/include/c++/v1/stack
+OLD_FILES+=usr/include/c++/v1/stdbool.h
+OLD_FILES+=usr/include/c++/v1/stddef.h
 OLD_FILES+=usr/include/c++/v1/stdexcept
+OLD_FILES+=usr/include/c++/v1/stdio.h
+OLD_FILES+=usr/include/c++/v1/stdlib.h
 OLD_FILES+=

svn commit: r311811 - head/usr.sbin/mfiutil

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 19:39:35 2017
New Revision: 311811
URL: https://svnweb.freebsd.org/changeset/base/311811

Log:
  Avoid taking the address of a packed struct member in mfiutil
  
  Fix a clang 4.0.0 warning about taking the address of a packed member of
  struct mfi_evt in mfiutil:
  
  usr.sbin/mfiutil/mfi_evt.c:583:30: error: taking address of packed
  member 'members' of class or structure 'mfi_evt' may result in an
  unaligned pointer value [-Werror,-Waddress-of-packed-member]
  if (parse_locale(optarg, &filter.members.locale) 
< 0) {
^
  
  Use a local variable instead, and copy that into the struct.
  
  Reviewed by:  jhb
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D9069

Modified:
  head/usr.sbin/mfiutil/mfi_evt.c

Modified: head/usr.sbin/mfiutil/mfi_evt.c
==
--- head/usr.sbin/mfiutil/mfi_evt.c Mon Jan  9 19:37:17 2017
(r311810)
+++ head/usr.sbin/mfiutil/mfi_evt.c Mon Jan  9 19:39:35 2017
(r311811)
@@ -540,6 +540,7 @@ show_events(int ac, char **av)
char *cp;
ssize_t size;
uint32_t seq, start, stop;
+   uint16_t locale;
uint8_t status;
int ch, error, fd, num_events, verbose;
u_int i;
@@ -580,12 +581,13 @@ show_events(int ac, char **av)
}
break;
case 'l':
-   if (parse_locale(optarg, &filter.members.locale) < 0) {
+   if (parse_locale(optarg, &locale) < 0) {
error = errno;
warn("Error parsing event locale");
close(fd);
return (error);
}
+   filter.members.locale = locale;
break;
case 'n':
val = strtol(optarg, &cp, 0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311815 - head/sys/fs/pseudofs

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 20:14:18 2017
New Revision: 311815
URL: https://svnweb.freebsd.org/changeset/base/311815

Log:
  Forcibly remove the cached items from pseudofs vncache on module unload.
  
  If some process' nodes were accessed using procfs and the process
  cannot exit properly at the time modunload event is reported to the
  pseudofs-backed filesystem, the assertion in pfs_vncache_unload() is
  triggered.  Assertion is correct, the cache should be cleaned.
  
  Approved by:  des (pseudofs maintainer)
  Reported and tested by:   pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/fs/pseudofs/pseudofs_vncache.c

Modified: head/sys/fs/pseudofs/pseudofs_vncache.c
==
--- head/sys/fs/pseudofs/pseudofs_vncache.c Mon Jan  9 20:14:02 2017
(r311814)
+++ head/sys/fs/pseudofs/pseudofs_vncache.c Mon Jan  9 20:14:18 2017
(r311815)
@@ -51,6 +51,7 @@ static struct mtx pfs_vncache_mutex;
 static struct pfs_vdata *pfs_vncache;
 static eventhandler_tag pfs_exit_tag;
 static void pfs_exit(void *arg, struct proc *p);
+static void pfs_purge_locked(struct pfs_node *pn, bool force);
 
 static SYSCTL_NODE(_vfs_pfs, OID_AUTO, vncache, CTLFLAG_RW, 0,
 "pseudofs vnode cache");
@@ -97,6 +98,9 @@ pfs_vncache_unload(void)
 {
 
EVENTHANDLER_DEREGISTER(process_exit, pfs_exit_tag);
+   mtx_lock(&pfs_vncache_mutex);
+   pfs_purge_locked(NULL, true);
+   mtx_unlock(&pfs_vncache_mutex);
KASSERT(pfs_vncache_entries == 0,
("%d vncache entries remaining", pfs_vncache_entries));
mtx_destroy(&pfs_vncache_mutex);
@@ -272,7 +276,7 @@ pfs_vncache_free(struct vnode *vp)
  * used to implement the cache.
  */
 static void
-pfs_purge_locked(struct pfs_node *pn)
+pfs_purge_locked(struct pfs_node *pn, bool force)
 {
struct pfs_vdata *pvd;
struct vnode *vnp;
@@ -280,7 +284,8 @@ pfs_purge_locked(struct pfs_node *pn)
mtx_assert(&pfs_vncache_mutex, MA_OWNED);
pvd = pfs_vncache;
while (pvd != NULL) {
-   if (pvd->pvd_dead || (pn != NULL && pvd->pvd_pn == pn)) {
+   if (force || pvd->pvd_dead ||
+   (pn != NULL && pvd->pvd_pn == pn)) {
vnp = pvd->pvd_vnode;
vhold(vnp);
mtx_unlock(&pfs_vncache_mutex);
@@ -301,7 +306,7 @@ pfs_purge(struct pfs_node *pn)
 {
 
mtx_lock(&pfs_vncache_mutex);
-   pfs_purge_locked(pn);
+   pfs_purge_locked(pn, false);
mtx_unlock(&pfs_vncache_mutex);
 }
 
@@ -321,6 +326,6 @@ pfs_exit(void *arg, struct proc *p)
if (pvd->pvd_pid == p->p_pid)
dead = pvd->pvd_dead = 1;
if (dead)
-   pfs_purge_locked(NULL);
+   pfs_purge_locked(NULL, false);
mtx_unlock(&pfs_vncache_mutex);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311817 - head/sys/netpfil/ipfw

2017-01-09 Thread Marius Strobl
Author: marius
Date: Mon Jan  9 20:51:51 2017
New Revision: 311817
URL: https://svnweb.freebsd.org/changeset/base/311817

Log:
  In dummynet(4), random chunks of memory are casted to struct dn_*,
  potentially leading to fatal unaligned accesses on architectures with
  strict alignment requirements. This change fixes dummynet(4) as far
  as accesses to 64-bit members of struct dn_* are concerned, tripping
  up on sparc64 with accesses to 32-bit members happening to be correctly
  aligned there. In other words, this only fixes the tip of the iceberg;
  larger parts of dummynet(4) still need to be rewritten in order to
  properly work on all of !x86.
  In principle, considering the amount of code in dummynet(4) that needs
  this erroneous pattern corrected, an acceptable workaround would be to
  declare all struct dn_* packed, forcing compilers to do byte-accesses
  as a side-effect. However, given that the structs in question aren't
  laid out well either, this would break ABI/KBI.
  While at it, replace all existing bcopy(9) calls with memcpy(9) for
  performance reasons, as there is no need to check for overlap in these
  cases.
  
  PR:   189219
  MFC after:5 days

Modified:
  head/sys/netpfil/ipfw/ip_dummynet.c

Modified: head/sys/netpfil/ipfw/ip_dummynet.c
==
--- head/sys/netpfil/ipfw/ip_dummynet.c Mon Jan  9 20:14:20 2017
(r311816)
+++ head/sys/netpfil/ipfw/ip_dummynet.c Mon Jan  9 20:51:51 2017
(r311817)
@@ -931,29 +931,35 @@ delete_schk(int i)
 static int
 copy_obj(char **start, char *end, void *_o, const char *msg, int i)
 {
-   struct dn_id *o = _o;
+   struct dn_id o;
+   union {
+   struct dn_link l;
+   struct dn_schk s;
+   } dn;
int have = end - *start;
 
-   if (have < o->len || o->len == 0 || o->type == 0) {
+   memcpy(&o, _o, sizeof(o));
+   if (have < o.len || o.len == 0 || o.type == 0) {
D("(WARN) type %d %s %d have %d need %d",
-   o->type, msg, i, have, o->len);
+   o.type, msg, i, have, o.len);
return 1;
}
-   ND("type %d %s %d len %d", o->type, msg, i, o->len);
-   bcopy(_o, *start, o->len);
-   if (o->type == DN_LINK) {
+   ND("type %d %s %d len %d", o.type, msg, i, o.len);
+   if (o.type == DN_LINK) {
+   memcpy(&dn.l, _o, sizeof(dn.l));
/* Adjust burst parameter for link */
-   struct dn_link *l = (struct dn_link *)*start;
-   l->burst =  div64(l->burst, 8 * hz);
-   l->delay = l->delay * 1000 / hz;
-   } else if (o->type == DN_SCH) {
-   /* Set id->id to the number of instances */
-   struct dn_schk *s = _o;
-   struct dn_id *id = (struct dn_id *)(*start);
-   id->id = (s->sch.flags & DN_HAVE_MASK) ?
-   dn_ht_entries(s->siht) : (s->siht ? 1 : 0);
-   }
-   *start += o->len;
+   dn.l.burst = div64(dn.l.burst, 8 * hz);
+   dn.l.delay = dn.l.delay * 1000 / hz;
+   memcpy(*start, &dn.l, sizeof(dn.l));
+   } else if (o.type == DN_SCH) {
+   /* Set dn.s.sch.oid.id to the number of instances */
+   memcpy(&dn.s, _o, sizeof(dn.s));
+   dn.s.sch.oid.id = (dn.s.sch.flags & DN_HAVE_MASK) ?
+   dn_ht_entries(dn.s.siht) : (dn.s.siht ? 1 : 0);
+   memcpy(*start, &dn.s, sizeof(dn.s));
+   } else
+   memcpy(*start, _o, o.len);
+   *start += o.len;
return 0;
 }
 
@@ -974,7 +980,7 @@ copy_obj_q(char **start, char *end, void
return 1;
}
ND("type %d %s %d len %d", o->type, msg, i, len);
-   bcopy(_o, *start, len);
+   memcpy(*start, _o, len);
((struct dn_id*)(*start))->len = len;
*start += len;
return 0;
@@ -1022,7 +1028,7 @@ copy_profile(struct copy_args *a, struct
D("error have %d need %d", have, profile_len);
return 1;
}
-   bcopy(p, *a->start, profile_len);
+   memcpy(*a->start, p, profile_len);
((struct dn_id *)(*a->start))->len = profile_len;
*a->start += profile_len;
return 0;
@@ -1584,6 +1590,9 @@ config_fs(struct dn_fs *nfs, struct dn_i
 {
int i;
struct dn_fsk *fs;
+#ifdef NEW_AQM
+   struct dn_extra_parms *ep;
+#endif
 
if (nfs->oid.len != sizeof(*nfs)) {
D("invalid flowset len %d", nfs->oid.len);
@@ -1592,6 +1601,15 @@ config_fs(struct dn_fs *nfs, struct dn_i
i = nfs->fs_nr;
if (i <= 0 || i >= 3*DN_MAX_ID)
return NULL;
+#ifdef NEW_AQM
+   ep = NULL;
+   if (arg != NULL) {
+   ep = malloc(sizeof(*ep), M_TEMP, locked ? M_NOWAIT : M_WAITOK);
+   if (ep == NULL)
+   return (NULL);
+   memcpy(ep,

svn commit: r311830 - head/sys/dev/usb/wlan

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Mon Jan  9 21:46:24 2017
New Revision: 311830
URL: https://svnweb.freebsd.org/changeset/base/311830

Log:
  [rsu] add support for the "green" rsu NICs.
  
  They're still a 1T2R NIC, so reuse the same rfconfig and
  nstream configuration.
  
  Submitted by: Idwer Vollering 

Modified:
  head/sys/dev/usb/wlan/if_rsu.c

Modified: head/sys/dev/usb/wlan/if_rsu.c
==
--- head/sys/dev/usb/wlan/if_rsu.c  Mon Jan  9 21:24:02 2017
(r311829)
+++ head/sys/dev/usb/wlan/if_rsu.c  Mon Jan  9 21:46:24 2017
(r311830)
@@ -523,6 +523,12 @@ rsu_attach(device_t self)
sc->sc_ntxstream = 2;
rft = "2T2R";
break;
+   case 0x3:   /* "green" NIC */
+   sc->sc_rftype = RTL8712_RFCONFIG_1T2R;
+   sc->sc_nrxstream = 2;
+   sc->sc_ntxstream = 1;
+   rft = "1T2R ('green')";
+   break;
default:
device_printf(sc->sc_dev,
"%s: unknown board type (rfconfig=0x%02x)\n",
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311831 - head/sys/dev/cxgbe

2017-01-09 Thread Navdeep Parhar
Author: np
Date: Mon Jan  9 22:18:08 2017
New Revision: 311831
URL: https://svnweb.freebsd.org/changeset/base/311831

Log:
  cxgbe(4): The wraparound logic in start_wrq_wr() should not get involved
  in work requests that end at the end of the descriptor ring, even though
  the pidx wraps around to 0.
  
  MFC after:3 days

Modified:
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Mon Jan  9 21:46:24 2017(r311830)
+++ head/sys/dev/cxgbe/t4_sge.c Mon Jan  9 22:18:08 2017(r311831)
@@ -2298,7 +2298,7 @@ slowpath:
 
w = &eq->desc[eq->pidx];
IDXINCR(eq->pidx, ndesc, eq->sidx);
-   if (__predict_false(eq->pidx < ndesc - 1)) {
+   if (__predict_false(cookie->pidx + ndesc > eq->sidx)) {
w = &wrq->ss[0];
wrq->ss_pidx = cookie->pidx;
wrq->ss_len = len16 * 16;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311832 - head/sys/dev/cxgbe

2017-01-09 Thread Navdeep Parhar
Author: np
Date: Mon Jan  9 22:20:09 2017
New Revision: 311832
URL: https://svnweb.freebsd.org/changeset/base/311832

Log:
  cxgbe(4): Enable automatic cidx flush for all control queues.
  
  MFC after:3 days

Modified:
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Mon Jan  9 22:18:08 2017(r311831)
+++ head/sys/dev/cxgbe/t4_sge.c Mon Jan  9 22:20:09 2017(r311832)
@@ -3305,12 +3305,13 @@ ctrl_eq_alloc(struct adapter *sc, struct
c.cmpliqid_eqid = htonl(V_FW_EQ_CTRL_CMD_CMPLIQID(eq->iqid));
c.physeqid_pkd = htobe32(0);
c.fetchszm_to_iqid =
-   htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) |
+   htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) |
V_FW_EQ_CTRL_CMD_PCIECHN(eq->tx_chan) |
F_FW_EQ_CTRL_CMD_FETCHRO | V_FW_EQ_CTRL_CMD_IQID(eq->iqid));
c.dcaen_to_eqsize =
htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) |
V_FW_EQ_CTRL_CMD_FBMAX(X_FETCHBURSTMAX_512B) |
+   V_FW_EQ_CTRL_CMD_CIDXFTHRESH(X_CIDXFLUSHTHRESH_32) |
V_FW_EQ_CTRL_CMD_EQSIZE(qsize));
c.eqaddr = htobe64(eq->ba);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311837 - head/sys/net

2017-01-09 Thread Sean Bruno
Author: sbruno
Date: Mon Jan  9 23:41:10 2017
New Revision: 311837
URL: https://svnweb.freebsd.org/changeset/base/311837

Log:
  Remove unused mtx_held() macro.

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cMon Jan  9 22:49:35 2017(r311836)
+++ head/sys/net/iflib.cMon Jan  9 23:41:10 2017(r311837)
@@ -447,10 +447,6 @@ struct iflib_rxq {
 
 static int enable_msix = 1;
 
-#define mtx_held(m)(((m)->mtx_lock & ~MTX_FLAGMASK) != (uintptr_t)0)
-
-
-
 #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING))
 
 #define CTX_LOCK_INIT(_sc, _name)  mtx_init(&(_sc)->ifc_mtx, _name, "iflib ctx 
lock", MTX_DEF)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311838 - head/sys/dev/rtwn/usb

2017-01-09 Thread Andriy Voskoboinyk
Author: avos
Date: Mon Jan  9 23:42:02 2017
New Revision: 311838
URL: https://svnweb.freebsd.org/changeset/base/311838

Log:
  rtwn_usb(4): do not try to modify global static structure.
  
  Use a local copy for modifications instead.
  
  Tested with RTL8821AU (AP) + RTL8188EU (STA).
  
  Reported by:  hselasky

Modified:
  head/sys/dev/rtwn/usb/rtwn_usb_ep.c

Modified: head/sys/dev/rtwn/usb/rtwn_usb_ep.c
==
--- head/sys/dev/rtwn/usb/rtwn_usb_ep.c Mon Jan  9 23:41:10 2017
(r311837)
+++ head/sys/dev/rtwn/usb/rtwn_usb_ep.c Mon Jan  9 23:42:02 2017
(r311838)
@@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 
-static struct usb_config rtwn_config[RTWN_N_TRANSFER] = {
+static const struct usb_config rtwn_config_common[RTWN_N_TRANSFER] = {
[RTWN_BULK_RX] = {
.type = UE_BULK,
.endpoint = UE_ADDR_ANY,
@@ -161,6 +161,7 @@ rtwn_usb_setup_queues(struct rtwn_usb_so
 int
 rtwn_usb_setup_endpoints(struct rtwn_usb_softc *uc)
 {
+   struct usb_config *rtwn_config;
struct rtwn_softc *sc = &uc->uc_sc;
const uint8_t iface_index = RTWN_IFACE_INDEX;
struct usb_endpoint *ep, *ep_end;
@@ -197,6 +198,9 @@ rtwn_usb_setup_endpoints(struct rtwn_usb
return (EINVAL);
}
 
+   rtwn_config = malloc(sizeof(rtwn_config_common), M_TEMP, M_WAITOK);
+   memcpy(rtwn_config, rtwn_config_common, sizeof(rtwn_config_common));
+
/* NB: keep in sync with rtwn_dma_init(). */
rtwn_config[RTWN_BULK_TX_VO].endpoint = addr[0];
switch (uc->ntx) {
@@ -224,6 +228,8 @@ rtwn_usb_setup_endpoints(struct rtwn_usb
rtwn_config[RTWN_BULK_RX].bufsize = sc->rx_dma_size + 1024;
error = usbd_transfer_setup(uc->uc_udev, &iface_index,
uc->uc_xfer, rtwn_config, RTWN_N_TRANSFER, uc, &sc->sc_mtx);
+   free(rtwn_config, M_TEMP);
+
if (error) {
device_printf(sc->sc_dev, "could not allocate USB transfers, "
"err=%s\n", usbd_errstr(error));
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311840 - head/sys/conf

2017-01-09 Thread Sean Bruno
Author: sbruno
Date: Mon Jan  9 23:45:40 2017
New Revision: 311840
URL: https://svnweb.freebsd.org/changeset/base/311840

Log:
  White space cleanup from an cut-n-paste.
  
  Submitted by: mm...@nextbsd.org

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Mon Jan  9 23:43:42 2017(r311839)
+++ head/sys/conf/files Mon Jan  9 23:45:40 2017(r311840)
@@ -3905,9 +3905,9 @@ net/if_tun.c  optional tun
 net/if_tap.c   optional tap
 net/if_vlan.c  optional vlan
 net/if_vxlan.c optional vxlan inet | vxlan inet6
-net/ifdi_if.m  optional ether pci
-net/iflib.coptional ether pci
-net/mp_ring.c  optional ether
+net/ifdi_if.m  optional ether pci
+net/iflib.coptional ether pci
+net/mp_ring.c  optional ether
 net/mppcc.coptional netgraph_mppc_compression
 net/mppcd.coptional netgraph_mppc_compression
 net/netisr.c   standard
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311841 - head/sys/fs/cd9660

2017-01-09 Thread Conrad E. Meyer
Author: cem
Date: Mon Jan  9 23:51:31 2017
New Revision: 311841
URL: https://svnweb.freebsd.org/changeset/base/311841

Log:
  cd9660: Add a prototype for cd9660_vfs_hash_cmp
  
  GCC warns (and errors, with -Werror) about it otherwise.  Clang doesn't care.
  
  Introduced in r311665.
  
  Reported by:  np@

Modified:
  head/sys/fs/cd9660/cd9660_vfsops.c

Modified: head/sys/fs/cd9660/cd9660_vfsops.c
==
--- head/sys/fs/cd9660/cd9660_vfsops.c  Mon Jan  9 23:45:40 2017
(r311840)
+++ head/sys/fs/cd9660/cd9660_vfsops.c  Mon Jan  9 23:51:31 2017
(r311841)
@@ -88,6 +88,7 @@ static struct vfsops cd9660_vfsops = {
 VFS_SET(cd9660_vfsops, cd9660, VFCF_READONLY);
 MODULE_VERSION(cd9660, 1);
 
+static int cd9660_vfs_hash_cmp(struct vnode *vp, cd_ino_t *pino);
 static int iso_mountfs(struct vnode *devvp, struct mount *mp);
 
 /*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311842 - head/sys/fs/cd9660

2017-01-09 Thread Conrad E. Meyer
Author: cem
Date: Mon Jan  9 23:56:45 2017
New Revision: 311842
URL: https://svnweb.freebsd.org/changeset/base/311842

Log:
  cd9660: typedef cd_ino_t in preference to #define
  
  Suggested by: kib@

Modified:
  head/sys/fs/cd9660/iso.h

Modified: head/sys/fs/cd9660/iso.h
==
--- head/sys/fs/cd9660/iso.hMon Jan  9 23:51:31 2017(r311841)
+++ head/sys/fs/cd9660/iso.hMon Jan  9 23:56:45 2017(r311842)
@@ -222,7 +222,7 @@ enum ISO_FTYPE  { ISO_FTYPE_DEFAULT, ISO_
 /*
  * When ino_t becomes 64-bit, we can remove this definition in favor of ino_t.
  */
-#define cd_ino_t   uint64_t
+typedef __uint64_t cd_ino_t;
 
 struct iso_mnt {
uint64_t im_flags;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311843 - head/sys/contrib/dev/acpica/components/tables

2017-01-09 Thread Conrad E. Meyer
Author: cem
Date: Tue Jan 10 00:03:43 2017
New Revision: 311843
URL: https://svnweb.freebsd.org/changeset/base/311843

Log:
  Adjust ACPI_EXPORT_SYMBOL for AcpiGetTableWithSize
  
  Suggested by: jbeich@

Modified:
  head/sys/contrib/dev/acpica/components/tables/tbxface.c

Modified: head/sys/contrib/dev/acpica/components/tables/tbxface.c
==
--- head/sys/contrib/dev/acpica/components/tables/tbxface.c Mon Jan  9 
23:56:45 2017(r311842)
+++ head/sys/contrib/dev/acpica/components/tables/tbxface.c Tue Jan 10 
00:03:43 2017(r311843)
@@ -386,7 +386,7 @@ AcpiGetTableWithSize (
 return (Status);
 }
 
-ACPI_EXPORT_SYMBOL (AcpiGetTable)
+ACPI_EXPORT_SYMBOL (AcpiGetTableWithSize)
 
 
 
/***
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r311707 - in head/sys/dev/rtwn: . usb

2017-01-09 Thread Andriy Voskoboinyk
Mon, 09 Jan 2017 10:08:13 +0200 було написано Hans Petter Selasky  
:


Hi,

The race should be fixed in r311838.


On 01/09/17 00:41, Andriy Voskoboinyk wrote:

Modified: head/sys/dev/rtwn/usb/rtwn_usb_ep.c
==
--- head/sys/dev/rtwn/usb/rtwn_usb_ep.c	Sun Jan  8 23:25:46  
2017	(r311706)
+++ head/sys/dev/rtwn/usb/rtwn_usb_ep.c	Sun Jan  8 23:41:17  
2017	(r311707)

@@ -63,7 +63,6 @@ static struct usb_config rtwn_config[RTW
.type = UE_BULK,
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
-   .bufsize = RTWN_RXBUFSZ,
.flags = {
.pipe_bof = 1,
.short_xfer_ok = 1
@@ -222,6 +221,7 @@ rtwn_usb_setup_endpoints(struct rtwn_usb
break;
}

+   rtwn_config[RTWN_BULK_RX].bufsize = sc->rx_dma_size + 1024;


Hi,

You should copy the rtwn_config to the stack/softc, and not write to the  
static struct, which should be made "static const" after this change!


This might lead to a race when multiple adapters are connecting at the  
same time! Remember USB enumeration is multithreaded.


Else your change looks good.

--HPS

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r311844 - head/sys/dev/usb

2017-01-09 Thread Bruce M Simpson
Author: bms
Date: Tue Jan 10 00:28:01 2017
New Revision: 311844
URL: https://svnweb.freebsd.org/changeset/base/311844

Log:
  Add PID for Belkin F5U258 "Windows Easy Transfer Cable", a udbp-like device.

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsTue Jan 10 00:03:43 2017(r311843)
+++ head/sys/dev/usb/usbdevsTue Jan 10 00:28:01 2017(r311844)
@@ -1318,6 +1318,7 @@ product BELKIN RTL8188CU  0x1102  RTL8188
 product BELKIN F9L1103 0x1103  F9L1103 Wireless Adapter
 product BELKIN RTL8192CU   0x2102  RTL8192CU Wireless Adapter
 product BELKIN F7D2102 0x2103  F7D2102 Wireless Adapter
+product BELKIN F5U258  0x258A  F5U258 Host to Host cable
 product BELKIN ZD1211B 0x4050  ZD1211B
 product BELKIN F5D5055 0x5055  F5D5055
 product BELKIN F5D7050 0x7050  F5D7050 Wireless Adapter
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311845 - head/sys/dev/rtwn/pci

2017-01-09 Thread Andriy Voskoboinyk
Author: avos
Date: Tue Jan 10 01:09:39 2017
New Revision: 311845
URL: https://svnweb.freebsd.org/changeset/base/311845

Log:
  rtwn_pci(4): fix possible race while accessing 'matched_chip' variable.

Modified:
  head/sys/dev/rtwn/pci/rtwn_pci_attach.c

Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.c
==
--- head/sys/dev/rtwn/pci/rtwn_pci_attach.c Tue Jan 10 00:28:01 2017
(r311844)
+++ head/sys/dev/rtwn/pci/rtwn_pci_attach.c Tue Jan 10 01:09:39 2017
(r311845)
@@ -94,20 +94,31 @@ static void rtwn_pci_beacon_update_end(s
 static voidrtwn_pci_attach_methods(struct rtwn_softc *);
 
 
-static int matched_chip = RTWN_CHIP_MAX_PCI;
+static const struct rtwn_pci_ident *
+rtwn_pci_probe_sub(device_t dev)
+{
+   const struct rtwn_pci_ident *ident;
+   int vendor_id, device_id;
+
+   vendor_id = pci_get_vendor(dev);
+   device_id = pci_get_device(dev);
+
+   for (ident = rtwn_pci_ident_table; ident->name != NULL; ident++)
+   if (vendor_id == ident->vendor && device_id == ident->device)
+   return (ident);
+
+   return (NULL);
+}
 
 static int
 rtwn_pci_probe(device_t dev)
 {
const struct rtwn_pci_ident *ident;
 
-   for (ident = rtwn_pci_ident_table; ident->name != NULL; ident++) {
-   if (pci_get_vendor(dev) == ident->vendor &&
-   pci_get_device(dev) == ident->device) {
-   matched_chip = ident->chip;
-   device_set_desc(dev, ident->name);
-   return (BUS_PROBE_DEFAULT);
-   }
+   ident = rtwn_pci_probe_sub(dev);
+   if (ident != NULL) {
+   device_set_desc(dev, ident->name);
+   return (BUS_PROBE_DEFAULT);
}
return (ENXIO);
 }
@@ -591,13 +602,15 @@ rtwn_pci_attach_methods(struct rtwn_soft
 static int
 rtwn_pci_attach(device_t dev)
 {
+   const struct rtwn_pci_ident *ident;
struct rtwn_pci_softc *pc = device_get_softc(dev);
struct rtwn_softc *sc = &pc->pc_sc;
struct ieee80211com *ic = &sc->sc_ic;
uint32_t lcsr;
int cap_off, i, error, rid;
 
-   if (matched_chip >= RTWN_CHIP_MAX_PCI)
+   ident = rtwn_pci_probe_sub(dev);
+   if (ident == NULL)
return (ENXIO);
 
/*
@@ -649,8 +662,7 @@ rtwn_pci_attach(device_t dev)
mtx_init(&sc->sc_mtx, ic->ic_name, MTX_NETWORK_LOCK, MTX_DEF);
 
rtwn_pci_attach_methods(sc);
-   /* XXX something similar to USB_GET_DRIVER_INFO() */
-   rtwn_pci_attach_private(pc, matched_chip);
+   rtwn_pci_attach_private(pc, ident->chip);
 
/* Allocate Tx/Rx buffers. */
error = rtwn_pci_alloc_rx_list(sc);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311846 - head/sys/dev/cxgbe/common

2017-01-09 Thread Navdeep Parhar
Author: np
Date: Tue Jan 10 01:30:41 2017
New Revision: 311846
URL: https://svnweb.freebsd.org/changeset/base/311846

Log:
  cxgbe(4): Refresh t4_msg.h, mainly for definitions related to the crypto
  engine.
  
  Obtained from:Chelsio Communications
  MFC after:2 weeks
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/common/t4_msg.h

Modified: head/sys/dev/cxgbe/common/t4_msg.h
==
--- head/sys/dev/cxgbe/common/t4_msg.h  Tue Jan 10 01:09:39 2017
(r311845)
+++ head/sys/dev/cxgbe/common/t4_msg.h  Tue Jan 10 01:30:41 2017
(r311846)
@@ -106,6 +106,7 @@ enum {
CPL_RX_FCOE_DIF   = 0x4A,
CPL_RX_DATA_DIF   = 0x4B,
CPL_ERR_NOTIFY= 0x4D,
+   CPL_RX_TLS_CMP= 0x4E,
 
CPL_RDMA_READ_REQ = 0x60,
CPL_RX_ISCSI_DIF  = 0x60,
@@ -113,6 +114,11 @@ enum {
CPL_SET_LE_REQ= 0x80,
CPL_PASS_OPEN_REQ6= 0x81,
CPL_ACT_OPEN_REQ6 = 0x83,
+   CPL_TX_TLS_PDU= 0x88,
+   CPL_TX_TLS_SFO= 0x89,
+
+   CPL_TX_SEC_PDU= 0x8A,
+   CPL_TX_TLS_ACK= 0x8B,
 
CPL_RDMA_TERMINATE= 0xA2,
CPL_RDMA_WRITE= 0xA4,
@@ -129,6 +135,7 @@ enum {
 
CPL_TRACE_PKT = 0xB0,
CPL_RX2TX_DATA= 0xB1,
+   CPL_TLS_DATA  = 0xB1,
CPL_ISCSI_DATA= 0xB2,
CPL_FCOE_DATA = 0xB3,
 
@@ -136,6 +143,7 @@ enum {
CPL_FW4_PLD   = 0xC1,
CPL_FW4_ACK   = 0xC3,
CPL_SRQ_TABLE_RPL = 0xCC,
+   CPL_RX_PHYS_DSGL  = 0xD0,
 
CPL_FW6_MSG   = 0xE0,
CPL_FW6_PLD   = 0xE1,
@@ -200,6 +208,7 @@ enum {
ULP_MODE_RDMA  = 4,
ULP_MODE_TCPDDP= 5,
ULP_MODE_FCOE  = 6,
+   ULP_MODE_TLS   = 8,
 };
 
 enum {
@@ -993,6 +1002,23 @@ struct cpl_abort_req_rss {
__u8  status;
 };
 
+struct cpl_abort_req_rss6 {
+   RSS_HDR
+   union opcode_tid ot;
+   __u32 srqidx_status;
+};
+
+#define S_ABORT_RSS_STATUS0
+#define M_ABORT_RSS_STATUS0xff
+#define V_ABORT_RSS_STATUS(x) ((x) << S_ABORT_RSS_STATUS)
+#define G_ABORT_RSS_STATUS(x) (((x) >> S_ABORT_RSS_STATUS) & 
M_ABORT_RSS_STATUS)
+
+#define S_ABORT_RSS_SRQIDX8
+#define M_ABORT_RSS_SRQIDX0xff
+#define V_ABORT_RSS_SRQIDX(x) ((x) << S_ABORT_RSS_SRQIDX)
+#define G_ABORT_RSS_SRQIDX(x) (((x) >> S_ABORT_RSS_SRQIDX) & 
M_ABORT_RSS_SRQIDX)
+
+
 /* cpl_abort_req status command code in case of T6,
  * bit[0] specifies whether to send RST (0) to remote peer or suppress it (1)
  * bit[1] indicates ABORT_REQ was sent after a CLOSE_CON_REQ
@@ -1014,6 +1040,12 @@ struct cpl_abort_rpl_rss {
__u8  status;
 };
 
+struct cpl_abort_rpl_rss6 {
+   RSS_HDR
+   union opcode_tid ot;
+   __u32 srqidx_status;
+};
+
 struct cpl_abort_rpl {
WR_HDR;
union opcode_tid ot;
@@ -2612,6 +2644,7 @@ enum {
FW_TYPE_RSSCPL = 4,
FW_TYPE_WRERR_RPL = 5,
FW_TYPE_PI_ERR = 6,
+   FW_TYPE_TLS_KEY = 7,
 };
 
 struct cpl_fw2_pld {
@@ -2712,7 +2745,8 @@ enum {
ULP_TX_SC_IMM  = 0x81,
ULP_TX_SC_DSGL = 0x82,
ULP_TX_SC_ISGL = 0x83,
-   ULP_TX_SC_PICTRL = 0x84
+   ULP_TX_SC_PICTRL = 0x84,
+   ULP_TX_SC_MEMRD = 0x86
 };
 
 #define S_ULPTX_CMD24
@@ -2763,6 +2797,12 @@ struct ulptx_idata {
 #define S_ULPTX_NSGE0
 #define M_ULPTX_NSGE0x
 #define V_ULPTX_NSGE(x) ((x) << S_ULPTX_NSGE)
+#define G_ULPTX_NSGE(x) (((x) >> S_ULPTX_NSGE) & M_ULPTX_NSGE)
+
+struct ulptx_sc_memrd {
+   __be32 cmd_to_len;
+   __be32 addr;
+};
 
 struct ulp_mem_io {
WR_HDR;
@@ -2817,6 +2857,21 @@ struct ulp_txpkt {
 };
 
 /* ulp_txpkt.cmd_dest fields */
+#define S_ULP_TXPKT_DATAMODIFY   23
+#define M_ULP_TXPKT_DATAMODIFY   0x1
+#define V_ULP_TXPKT_DATAMODIFY(x)((x) << S_ULP_TXPKT_DATAMODIFY)
+#define G_ULP_TXPKT_DATAMODIFY(x)\
+   (((x) >> S_ULP_TXPKT_DATAMODIFY) & M_ULP_TXPKT_DATAMODIFY_)
+#define F_ULP_TXPKT_DATAMODIFY   V_ULP_TXPKT_DATAMODIFY(1U)
+
+#define S_ULP_TXPKT_CHANNELID22
+#define M_ULP_TXPKT_CHANNELID0x1
+#define V_ULP_TXPKT_CHANNELID(x) ((x) << S_ULP_TXPKT_CHANNELID)
+#define G_ULP_TXPKT_CHANNELID(x) \
+   (((x) >> S_ULP_TXPKT_CHANNELID) & M_ULP_TXPKT_CHANNELID)
+#define F_ULP_TXPKT_CHANNELIDV_ULP_TXPKT_CHANNELID(1U)
+
+/* ulp_txpkt.cmd_dest fields */
 #define S_ULP_TXPKT_DEST16
 #define M_ULP_TXPKT_DEST0x3
 #define V_ULP_TXPKT_DEST(x) ((x) << S_ULP_TXPKT_DEST)
@@ -3044,4 +3099,542 @@ struct cpl_rx_mps_pkt {
 #define X_CPL_RX_MPS_PKT_TYPE_QFC  (1 << 2)
 #define X_CPL_RX_MPS_PKT_TYPE_PTP  (1 << 3)
 
+struct cpl_tx_tls_sfo {
+   __be32 op_to_seg_len;
+   __be32 pld_len;
+   __be64 rsvd;
+   __be32 seqno_numivs;
+   __be32 ivgen_hdrlen;
+   __be64 scmd1;
+};
+
+/

svn commit: r311847 - head/sys/dev/usb/misc

2017-01-09 Thread Bruce M Simpson
Author: bms
Date: Tue Jan 10 01:31:26 2017
New Revision: 311847
URL: https://svnweb.freebsd.org/changeset/base/311847

Log:
  Allow udbp(4) to claim Belkin "Windows Easy Transfer Cable" for Netgraph use.
  
  These have been tested back-to-back with Linux 3.x and a similar attachment
  at the other end; a CDC EEM-like encapsulation can be used for emulated
  Ethernet over udbp(4) with ng_ether.

Modified:
  head/sys/dev/usb/misc/udbp.c

Modified: head/sys/dev/usb/misc/udbp.c
==
--- head/sys/dev/usb/misc/udbp.cTue Jan 10 01:30:41 2017
(r311846)
+++ head/sys/dev/usb/misc/udbp.cTue Jan 10 01:31:26 2017
(r311847)
@@ -259,6 +259,7 @@ static driver_t udbp_driver = {
 };
 
 static const STRUCT_USB_HOST_ID udbp_devs[] = {
+   {USB_VPI(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5U258, 0)},
{USB_VPI(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_TURBOCONNECT, 0)},
{USB_VPI(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_GADGETZERO, 0)},
{USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2301, 0)},
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311848 - head/sys/dev/cxgbe

2017-01-09 Thread Navdeep Parhar
Author: np
Date: Tue Jan 10 01:36:50 2017
New Revision: 311848
URL: https://svnweb.freebsd.org/changeset/base/311848

Log:
  cxgbe(4): Attach to the 2x25 debug card.  This is for internal use only.
  
  MFC after:3 days

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cTue Jan 10 01:31:26 2017
(r311847)
+++ head/sys/dev/cxgbe/t4_main.cTue Jan 10 01:36:50 2017
(r311848)
@@ -623,6 +623,7 @@ struct {
 #endif
 }, t6_pciids[] = {
{0xc006, "Chelsio Terminator 6 FPGA"},  /* T6 PE10K6 FPGA (PF0) */
+   {0x6400, "Chelsio T6225-DBG"},  /* 2 x 10/25G, debug */
{0x6401, "Chelsio T6225-CR"},   /* 2 x 10/25G */
{0x6402, "Chelsio T6225-SO-CR"},/* 2 x 10/25G, nomem */
{0x6407, "Chelsio T62100-LP-CR"},   /* 2 x 40/50/100G */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-01-09 Thread Sean Bruno
Author: sbruno
Date: Tue Jan 10 03:23:22 2017
New Revision: 311849
URL: https://svnweb.freebsd.org/changeset/base/311849

Log:
  Migrate e1000 to the IFLIB framework:
  - em(4) igb(4) and lem(4)
  - deprecate the igb device from kernel configurations
  - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko
  
  Devices tested:
  - 82574L
  - I218-LM
  - 82546GB
  - 82579LM
  - I350
  - I217
  
  Please report problems to freebsd-...@freebsd.org
  
  Partial review from jhb and suggestions on how to *not* brick folks who
  originally would have lost their igbX device.
  
  Submitted by: mm...@nextbsd.org
  MFC after:2 weeks
  Relnotes: yes
  Sponsored by: Limelight Networks and Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D8299

Added:
  head/sys/dev/e1000/em_txrx.c   (contents, props changed)
  head/sys/dev/e1000/igb_txrx.c   (contents, props changed)
Deleted:
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_igb.h
  head/sys/dev/e1000/if_lem.c
  head/sys/dev/e1000/if_lem.h
  head/sys/modules/igb/
Modified:
  head/UPDATING
  head/sys/amd64/conf/GENERIC
  head/sys/arm64/conf/GENERIC
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/makeLINT.mk
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_em.h
  head/sys/i386/conf/GENERIC
  head/sys/mips/conf/OCTEON1
  head/sys/modules/Makefile
  head/sys/modules/em/Makefile
  head/sys/powerpc/conf/GENERIC64

Modified: head/UPDATING
==
--- head/UPDATING   Tue Jan 10 01:36:50 2017(r311848)
+++ head/UPDATING   Tue Jan 10 03:23:22 2017(r311849)
@@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12
 
 ** SPECIAL WARNING: **
 
+20170109:
+   The igb(4), em(4) and lem(4) ethernet drivers are now implemented via
+   IFLIB.  If you have a custom kernel configuration that excludes em(4)
+   but you use igb(4), you need to re-add em(4) to your custom 
configuration.
+
 20161217:
Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 3.9.1.
Please see the 20141231 entry below for information about prerequisites

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Tue Jan 10 01:36:50 2017(r311848)
+++ head/sys/amd64/conf/GENERIC Tue Jan 10 03:23:22 2017(r311849)
@@ -230,7 +230,6 @@ device  puc # Multi I/O 
cards and mult
 device bxe # Broadcom NetXtreme II 
BCM5771X/BCM578XX 10GbE
 device de  # DEC/Intel DC21x4x (``Tulip'')
 device em  # Intel PRO/1000 Gigabit Ethernet Family
-device igb # Intel PRO/1000 PCIE Server Gigabit 
Family
 device ix  # Intel PRO/10GbE PCIE PF Ethernet
 device ixv # Intel PRO/10GbE PCIE VF Ethernet
 device ixl # Intel XL710 40Gbe PCIE Ethernet

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Tue Jan 10 01:36:50 2017(r311848)
+++ head/sys/arm64/conf/GENERIC Tue Jan 10 03:23:22 2017(r311849)
@@ -120,7 +120,6 @@ device  mii
 device miibus  # MII bus support
 device awg # Allwinner EMAC Gigabit Ethernet
 device em  # Intel PRO/1000 Gigabit Ethernet Family
-device igb # Intel PRO/1000 PCIE Server Gigabit Family
 device ix  # Intel 10Gb Ethernet Family
 device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet
 device smc # SMSC LAN91C111

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Tue Jan 10 01:36:50 2017(r311848)
+++ head/sys/conf/NOTES Tue Jan 10 03:23:22 2017(r311849)
@@ -1972,7 +1972,6 @@ devicexmphy   # XaQti XMAC II
 #   KNE110TX.
 # de:   Digital Equipment DC21040
 # em:   Intel Pro/1000 Gigabit Ethernet 82542, 82543, 82544 based adapters.
-# igb:  Intel Pro/1000 PCI Express Gigabit Ethernet: 82575 and later adapters.
 # ep:   3Com 3C509, 3C529, 3C556, 3C562D, 3C563D, 3C572, 3C574X, 3C579, 3C589
 #   and PC Card devices using these chipsets.
 # ex:   Intel EtherExpress Pro/10 and other i82595-based adapters,
@@ -2145,7 +2144,6 @@ devicecxgbe   # Chelsio T4-T6 
1/10/25/4
 device cxgbev  # Chelsio T4-T6 Virtual Functions
 device de  # DEC/Intel DC21x4x (``Tulip'')
 device em  # Intel Pro/1000 Gigabit Ethernet
-device igb # Intel Pro/1000 PCIE Giga

svn commit: r311850 - head/sys/dev/usb/controller

2017-01-09 Thread Ian Lepore
Author: ian
Date: Tue Jan 10 03:53:38 2017
New Revision: 311850
URL: https://svnweb.freebsd.org/changeset/base/311850

Log:
  Use the post-reset hook to force the controller to host mode.  This will
  make both usb ports work on imx6 systems (the OTG port of course will only
  work in host mode).

Modified:
  head/sys/dev/usb/controller/ehci_imx.c

Modified: head/sys/dev/usb/controller/ehci_imx.c
==
--- head/sys/dev/usb/controller/ehci_imx.c  Tue Jan 10 03:23:22 2017
(r311849)
+++ head/sys/dev/usb/controller/ehci_imx.c  Tue Jan 10 03:53:38 2017
(r311850)
@@ -157,6 +157,18 @@ struct imx_ehci_softc {
struct resource *ehci_irq_res;  /* EHCI core IRQ. */ 
 };
 
+static void
+imx_ehci_post_reset(struct ehci_softc *ehci_softc)
+{
+uint32_t usbmode;
+
+/* Force HOST mode */
+usbmode = EOREAD4(ehci_softc, EHCI_USBMODE_NOLPM);
+usbmode &= ~EHCI_UM_CM;
+usbmode |= EHCI_UM_CM_HOST;
+EOWRITE4(ehci_softc, EHCI_USBMODE_NOLPM, usbmode);
+}
+
 static int
 imx_ehci_probe(device_t dev)
 {
@@ -282,8 +294,13 @@ imx_ehci_attach(device_t dev)
esc->sc_id_vendor = USB_VENDOR_FREESCALE;
strlcpy(esc->sc_vendor, "Freescale", sizeof(esc->sc_vendor));
 
-   /* Set flags that affect ehci_init() behavior. */
-   esc->sc_flags |= EHCI_SCFLG_DONTRESET | EHCI_SCFLG_NORESTERM;
+   /*
+* Set flags that affect ehci_init() behavior, and hook our post-reset
+* code into the standard controller code.
+*/
+   esc->sc_flags |= EHCI_SCFLG_NORESTERM;
+   esc->sc_vendor_post_reset = imx_ehci_post_reset;
+
err = ehci_init(esc);
if (err != 0) {
device_printf(dev, "USB init failed, usb_err_t=%d\n", 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311851 - head/sys/fs/cd9660

2017-01-09 Thread Mateusz Guzik
Author: mjg
Date: Tue Jan 10 04:17:53 2017
New Revision: 311851
URL: https://svnweb.freebsd.org/changeset/base/311851

Log:
  cd9660: fix up compilation on sparc after r311665
  
  Reported by:  linimon

Modified:
  head/sys/fs/cd9660/cd9660_vfsops.c

Modified: head/sys/fs/cd9660/cd9660_vfsops.c
==
--- head/sys/fs/cd9660/cd9660_vfsops.c  Tue Jan 10 03:53:38 2017
(r311850)
+++ head/sys/fs/cd9660/cd9660_vfsops.c  Tue Jan 10 04:17:53 2017
(r311851)
@@ -88,7 +88,7 @@ static struct vfsops cd9660_vfsops = {
 VFS_SET(cd9660_vfsops, cd9660, VFCF_READONLY);
 MODULE_VERSION(cd9660, 1);
 
-static int cd9660_vfs_hash_cmp(struct vnode *vp, cd_ino_t *pino);
+static int cd9660_vfs_hash_cmp(struct vnode *vp, void *pino);
 static int iso_mountfs(struct vnode *devvp, struct mount *mp);
 
 /*
@@ -650,12 +650,14 @@ cd9660_vget(mp, ino, flags, vpp)
 static int
 cd9660_vfs_hash_cmp(vp, pino)
struct vnode *vp;
-   cd_ino_t *pino;
+   void *pino;
 {
struct iso_node *ip;
+   cd_ino_t ino;
 
ip = VTOI(vp);
-   return (ip->i_number != *pino);
+   ino = *(cd_ino_t *)pino;
+   return (ip->i_number != ino);
 }
 
 int
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311852 - head/share/misc

2017-01-09 Thread Larry Rosenman
Author: ler (ports committer)
Date: Tue Jan 10 04:31:56 2017
New Revision: 311852
URL: https://svnweb.freebsd.org/changeset/base/311852

Log:
  Add myself to committers-ports.dot
  
  Approved by:  adamw (mentor)
  Differential Revision:https://reviews.freebsd.org/D9117

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotTue Jan 10 04:17:53 2017
(r311851)
+++ head/share/misc/committers-ports.dotTue Jan 10 04:31:56 2017
(r311852)
@@ -144,6 +144,7 @@ laszlof [label="Frank Laszlo\nlaszlof@Fr
 lawrance [label="Sam Lawrance\nlawra...@freebsd.org\n2005/04/11\n2007/02/21"]
 lbr [label="Lars Balker Rasmussen\n...@freebsd.org\n2006/04/30"]
 leeym [label="Yen-Ming Lee\nle...@freebsd.org\n2002/08/14"]
+ler [label="Larry Rosenman\n...@freebsd.org\n2017/01/09"]
 lev [label="Lev Serebryakov\n...@freebsd.org\n2003/06/17"]
 lifanov [label="Nikolai Lifanov\nlifa...@freebsd.org\n2016/12/11"]
 linimon [label="Mark Linimon\nlini...@freebsd.org\n2003/10/23"]
@@ -252,6 +253,7 @@ znerd [label="Ernst de Haan\nznerd@FreeB
 
 adamw -> ahze
 adamw -> jylefort
+adamw -> ler
 adamw -> mezz
 adamw -> pav
 adamw -> woodsb02
@@ -554,6 +556,7 @@ rene -> bar
 rene -> cmt
 rene -> crees
 rene -> jgh
+rene -> ler
 rene -> olivierd
 
 rm -> koobs
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311853 - head/share/misc

2017-01-09 Thread Adam Weinberger
Author: adamw (ports committer)
Date: Tue Jan 10 04:49:59 2017
New Revision: 311853
URL: https://svnweb.freebsd.org/changeset/base/311853

Log:
  As much as I've enjoyed being listed as emeritus for the last 10+ years,
  it's probably time to admit that I am an active committer.

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotTue Jan 10 04:31:56 2017
(r311852)
+++ head/share/misc/committers-ports.dotTue Jan 10 04:49:59 2017
(r311853)
@@ -29,7 +29,6 @@ node [color=grey62, style=filled, bgcolo
 
 # Alumni go here.. Try to keep things sorted.
 
-adamw [label="Adam Weinberger\nad...@freebsd.org\n2002/10/16\n2006/09/25"]
 asami [label="Satoshi Asami\nas...@freebsd.org\n1994/11/18\n2001/09/11"]
 billf [label="Bill Fumerola\nbi...@freebsd.org\n1998/11/11\n2006/12/14"]
 jmallett [label="Juli Mallett\njmall...@freebsd.org\n2003/01/16\n2006/08/10"]
@@ -43,6 +42,7 @@ node [color=lightblue2, style=filled, bg
 
 ache [label="Andrey Chernov\na...@freebsd.org\n1994/11/15"]
 acm [label="Jose Alonso Cardenas Marquez\n...@freebsd.org\n2006/07/18"]
+adamw [label="Adam Weinberger\nad...@freebsd.org\n2002/10/16"]
 ahze [label="Michael Johnson\na...@freebsd.org\n2004/10/29"]
 ak [label="Alex Kozlov\n...@freebsd.org\n2012/02/29"]
 ale [label="Alex Dupre\n...@freebsd.org\n2004/01/12"]
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311854 - head/sys/dev/e1000

2017-01-09 Thread Sean Bruno
Author: sbruno
Date: Tue Jan 10 04:50:26 2017
New Revision: 311854
URL: https://svnweb.freebsd.org/changeset/base/311854

Log:
  Add copywrite notices, 2-clause BSD.
  
  Reported by:  jmallett

Modified:
  head/sys/dev/e1000/em_txrx.c
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_em.h
  head/sys/dev/e1000/igb_txrx.c

Modified: head/sys/dev/e1000/em_txrx.c
==
--- head/sys/dev/e1000/em_txrx.cTue Jan 10 04:49:59 2017
(r311853)
+++ head/sys/dev/e1000/em_txrx.cTue Jan 10 04:50:26 2017
(r311854)
@@ -1,3 +1,29 @@
+/*-
+ * Copyright (c) 2016 Matt Macy 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
 /* $FreeBSD$ */
 #include "if_em.h"
 

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Tue Jan 10 04:49:59 2017(r311853)
+++ head/sys/dev/e1000/if_em.c  Tue Jan 10 04:50:26 2017(r311854)
@@ -1,3 +1,29 @@
+/*-
+ * Copyright (c) 2016 Matt Macy 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
 /* $FreeBSD$ */
 #include "if_em.h"
 #include 

Modified: head/sys/dev/e1000/if_em.h
==
--- head/sys/dev/e1000/if_em.h  Tue Jan 10 04:49:59 2017(r311853)
+++ head/sys/dev/e1000/if_em.h  Tue Jan 10 04:50:26 2017(r311854)
@@ -1,3 +1,29 @@
+/*-
+ * Copyright (c) 2016 Matt Macy 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CON

svn commit: r311855 - head/sys/net80211

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 10 05:30:15 2017
New Revision: 311855
URL: https://svnweb.freebsd.org/changeset/base/311855

Log:
  [net80211] create a helper function to calculate the station facing VHT 
capabilities.
  
  This is needed for two reasons:
  
  * Drivers will need to know what the negotiated set of VHT capabilities
and rates are in order to configure (and reconfigure for opmode/chanwidth
changes) how to speak to a given peer; and
  * Because some vendors are "special", we should be careful in what we announce
to them during peer association.
  
  This isn't the complete solution, as I still need to make sure that when
  sending out probe requests before we know what we want, we don't limit
  the capabilities being announced.  This is important for IBSS/mesh work
  later on as probe request/response exchanges are the first hint at what
  a peer supports.  I'll look at adding that to the API soon.

Modified:
  head/sys/net80211/ieee80211_vht.c
  head/sys/net80211/ieee80211_vht.h

Modified: head/sys/net80211/ieee80211_vht.c
==
--- head/sys/net80211/ieee80211_vht.c   Tue Jan 10 04:50:26 2017
(r311854)
+++ head/sys/net80211/ieee80211_vht.c   Tue Jan 10 05:30:15 2017
(r311855)
@@ -71,6 +71,15 @@ __FBSDID("$FreeBSD$");
 } while (0)
 
 /*
+ * Immediate TODO:
+ *
+ * + handle WLAN_ACTION_VHT_OPMODE_NOTIF and other VHT action frames
+ * + ensure vhtinfo/vhtcap parameters correctly use the negotiated
+ *   capabilities and ratesets
+ * + group ID management operation
+ */
+
+/*
  * XXX TODO: handle WLAN_ACTION_VHT_OPMODE_NOTIF
  *
  * Look at mac80211/vht.c:ieee80211_vht_handle_opmode() for further details.
@@ -153,9 +162,9 @@ ieee80211_vht_announce(struct ieee80211c
 
/* Channel width */
ic_printf(ic, "[VHT] Channel Widths: 20MHz, 40MHz, 80MHz");
-   if (ic->ic_vhtcaps & IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
+   if (MS(ic->ic_vhtcaps, IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) == 2)
printf(" 80+80MHz");
-   if (ic->ic_vhtcaps & IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ)
+   if (MS(ic->ic_vhtcaps, IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) >= 1)
printf(" 160MHz");
printf("\n");
 
@@ -280,38 +289,357 @@ ieee80211_vht_node_leave(struct ieee8021
"%s: called", __func__);
 }
 
-uint8_t *
-ieee80211_add_vhtcap(uint8_t *frm, struct ieee80211_node *ni)
+/*
+ * Calculate the VHTCAP IE for a given node.
+ *
+ * This includes calculating the capability intersection based on the
+ * current operating mode and intersection of the TX/RX MCS maps.
+ *
+ * The standard only makes it clear about MCS rate negotiation
+ * and MCS basic rates (which must be a subset of the general
+ * negotiated rates).  It doesn't make it clear that the AP should
+ * figure out the minimum functional overlap with the STA and
+ * support that.
+ *
+ * Note: this is in host order, not in 802.11 endian order.
+ *
+ * TODO: ensure I re-read 9.7.11 Rate Selection for VHT STAs.
+ *
+ * TODO: investigate what we should negotiate for MU-MIMO beamforming
+ *   options.
+ *
+ * opmode is '1' for "vhtcap as if I'm a STA", 0 otherwise.
+ */
+void
+ieee80211_vht_get_vhtcap_ie(struct ieee80211_node *ni,
+struct ieee80211_ie_vhtcap *vhtcap, int opmode)
 {
-   uint32_t cap;
+   struct ieee80211vap *vap = ni->ni_vap;
+// struct ieee80211com *ic = vap->iv_ic;
+   uint32_t val, val1, val2;
+   uint32_t new_vhtcap;
+   int i;
 
-   memset(frm, '\0', sizeof(struct ieee80211_ie_vhtcap));
+   vhtcap->ie = IEEE80211_ELEMID_VHT_CAP;
+   vhtcap->len = sizeof(struct ieee80211_ie_vhtcap) - 2;
 
-   frm[0] = IEEE80211_ELEMID_VHT_CAP;
-   frm[1] = sizeof(struct ieee80211_ie_vhtcap) - 2;
-   frm += 2;
+   /*
+* Capabilities - it depends on whether we are a station
+* or not.
+*/
+   new_vhtcap = 0;
 
/*
-* For now, don't do any configuration.
-* Just populate the node configuration.
-* We can worry about making it configurable later.
+* Station - use our desired configuration based on
+* local config, local device bits and the already-learnt
+* vhtcap/vhtinfo IE in the node.
 */
 
-   cap = ni->ni_vhtcap;
+   /* Limit MPDU size to the smaller of the two */
+   val2 = val1 = MS(vap->iv_vhtcaps, IEEE80211_VHTCAP_MAX_MPDU_MASK);
+   if (opmode == 1) {
+   val2 = MS(ni->ni_vhtcap, IEEE80211_VHTCAP_MAX_MPDU_MASK);
+   }
+   val = MIN(val1, val2);
+   new_vhtcap |= SM(val, IEEE80211_VHTCAP_MAX_MPDU_MASK);
+
+   /* Limit supp channel config */
+   val2 = val1 = MS(vap->iv_vhtcaps,
+   IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK);
+   if (opmode == 1) {
+   val2 = MS(ni->ni_vhtcap,
+   IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK);
+   }
+   if ((val2 == 2) &&

svn commit: r311856 - head/sys/net80211

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 10 05:32:02 2017
New Revision: 311856
URL: https://svnweb.freebsd.org/changeset/base/311856

Log:
  [net80211] add VHT EDCA parameters for WME/QoS mode.

Modified:
  head/sys/net80211/ieee80211_proto.c

Modified: head/sys/net80211/ieee80211_proto.c
==
--- head/sys/net80211/ieee80211_proto.c Tue Jan 10 05:30:15 2017
(r311855)
+++ head/sys/net80211/ieee80211_proto.c Tue Jan 10 05:32:02 2017
(r311856)
@@ -842,6 +842,9 @@ setbasicrates(struct ieee80211_rateset *
[IEEE80211_MODE_11NA]   = { 3, { 12, 24, 48 } },
/* NB: mixed b/g */
[IEEE80211_MODE_11NG]   = { 4, { 2, 4, 11, 22 } },
+   /* NB: mixed b/g */
+   [IEEE80211_MODE_VHT_2GHZ]   = { 4, { 2, 4, 11, 22 } },
+   [IEEE80211_MODE_VHT_5GHZ]   = { 3, { 12, 24, 48 } },
};
int i, j;
 
@@ -906,6 +909,8 @@ static const struct phyParamType phyPara
[IEEE80211_MODE_QUARTER]= { 3, 4,  6,  0, 0 },
[IEEE80211_MODE_11NA]   = { 3, 4,  6,  0, 0 },
[IEEE80211_MODE_11NG]   = { 3, 4,  6,  0, 0 },
+   [IEEE80211_MODE_VHT_2GHZ]   = { 3, 4,  6,  0, 0 },
+   [IEEE80211_MODE_VHT_5GHZ]   = { 3, 4,  6,  0, 0 },
 };
 static const struct phyParamType phyParamForAC_BK[IEEE80211_MODE_MAX] = {
[IEEE80211_MODE_AUTO]   = { 7, 4, 10,  0, 0 },
@@ -920,6 +925,8 @@ static const struct phyParamType phyPara
[IEEE80211_MODE_QUARTER]= { 7, 4, 10,  0, 0 },
[IEEE80211_MODE_11NA]   = { 7, 4, 10,  0, 0 },
[IEEE80211_MODE_11NG]   = { 7, 4, 10,  0, 0 },
+   [IEEE80211_MODE_VHT_2GHZ]   = { 7, 4, 10,  0, 0 },
+   [IEEE80211_MODE_VHT_5GHZ]   = { 7, 4, 10,  0, 0 },
 };
 static const struct phyParamType phyParamForAC_VI[IEEE80211_MODE_MAX] = {
[IEEE80211_MODE_AUTO]   = { 1, 3, 4,  94, 0 },
@@ -934,6 +941,8 @@ static const struct phyParamType phyPara
[IEEE80211_MODE_QUARTER]= { 1, 3, 4,  94, 0 },
[IEEE80211_MODE_11NA]   = { 1, 3, 4,  94, 0 },
[IEEE80211_MODE_11NG]   = { 1, 3, 4,  94, 0 },
+   [IEEE80211_MODE_VHT_2GHZ]   = { 1, 3, 4,  94, 0 },
+   [IEEE80211_MODE_VHT_5GHZ]   = { 1, 3, 4,  94, 0 },
 };
 static const struct phyParamType phyParamForAC_VO[IEEE80211_MODE_MAX] = {
[IEEE80211_MODE_AUTO]   = { 1, 2, 3,  47, 0 },
@@ -948,6 +957,8 @@ static const struct phyParamType phyPara
[IEEE80211_MODE_QUARTER]= { 1, 2, 3,  47, 0 },
[IEEE80211_MODE_11NA]   = { 1, 2, 3,  47, 0 },
[IEEE80211_MODE_11NG]   = { 1, 2, 3,  47, 0 },
+   [IEEE80211_MODE_VHT_2GHZ]   = { 1, 2, 3,  47, 0 },
+   [IEEE80211_MODE_VHT_5GHZ]   = { 1, 2, 3,  47, 0 },
 };
 
 static const struct phyParamType bssPhyParamForAC_BE[IEEE80211_MODE_MAX] = {
@@ -1123,6 +1134,8 @@ ieee80211_wme_updateparams_locked(struct
[IEEE80211_MODE_QUARTER]= { 2, 4, 10, 64, 0 },
[IEEE80211_MODE_11NA]   = { 2, 4, 10, 64, 0 },  /* XXXcheck*/
[IEEE80211_MODE_11NG]   = { 2, 4, 10, 64, 0 },  /* XXXcheck*/
+   [IEEE80211_MODE_VHT_2GHZ]   = { 2, 4, 10, 64, 0 },  /* XXXcheck*/
+   [IEEE80211_MODE_VHT_5GHZ]   = { 2, 4, 10, 64, 0 },  /* XXXcheck*/
};
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211_wme_state *wme = &ic->ic_wme;
@@ -1243,6 +1256,8 @@ ieee80211_wme_updateparams_locked(struct
[IEEE80211_MODE_QUARTER]= 3,
[IEEE80211_MODE_11NA]   = 3,
[IEEE80211_MODE_11NG]   = 3,
+   [IEEE80211_MODE_VHT_2GHZ]   = 3,
+   [IEEE80211_MODE_VHT_5GHZ]   = 3,
};
chanp = &wme->wme_chanParams.cap_wmeParams[WME_AC_BE];
bssp = &wme->wme_bssChanParams.cap_wmeParams[WME_AC_BE];
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311857 - head/sys/net80211

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 10 05:32:30 2017
New Revision: 311857
URL: https://svnweb.freebsd.org/changeset/base/311857

Log:
  [net80211] add CHAN_VHT2G/CHAN_VHT5G macros.

Modified:
  head/sys/net80211/_ieee80211.h

Modified: head/sys/net80211/_ieee80211.h
==
--- head/sys/net80211/_ieee80211.h  Tue Jan 10 05:32:02 2017
(r311856)
+++ head/sys/net80211/_ieee80211.h  Tue Jan 10 05:32:30 2017
(r311857)
@@ -313,6 +313,12 @@ struct ieee80211_channel {
 
 #defineIEEE80211_IS_CHAN_VHT(_c) \
(((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0)
+#defineIEEE80211_IS_CHAN_VHT_2GHZ(_c) \
+   (IEEE80211_IS_CHAN_2GHZ(_c) && \
+((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0)
+#defineIEEE80211_IS_CHAN_VHT_5GHZ(_c) \
+   (IEEE80211_IS_CHAN_5GHZ(_c) && \
+((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0)
 #defineIEEE80211_IS_CHAN_VHT20(_c) \
(((_c)->ic_flags & IEEE80211_CHAN_VHT20) != 0)
 #defineIEEE80211_IS_CHAN_VHT40(_c) \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311858 - head/sys/net80211

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 10 05:33:34 2017
New Revision: 311858
URL: https://svnweb.freebsd.org/changeset/base/311858

Log:
  [net80211] add missing VHTCAP declaration changes.
  
  These are required for the recent ieee80211_vht.[ch] changes -
  they make things start to work with MS() / SM() macros.

Modified:
  head/sys/net80211/ieee80211.h

Modified: head/sys/net80211/ieee80211.h
==
--- head/sys/net80211/ieee80211.h   Tue Jan 10 05:32:30 2017
(r311857)
+++ head/sys/net80211/ieee80211.h   Tue Jan 10 05:33:34 2017
(r311858)
@@ -798,37 +798,73 @@ struct ieee80211_ie_vht_operation {
 #defineIEEE80211_VHTCAP_MAX_MPDU_LENGTH_7991   0x0001
 #defineIEEE80211_VHTCAP_MAX_MPDU_LENGTH_11454  0x0002
 #defineIEEE80211_VHTCAP_MAX_MPDU_MASK  0x0003
-#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ 0x0004
-#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ
0x0008
+#defineIEEE80211_VHTCAP_MAX_MPDU_MASK_S0
+
 #defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK   0x000C
+#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S 2
+#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_NONE   0
+#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ 1
+#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80P80MHZ   2
+#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_RESERVED   3
+
 #defineIEEE80211_VHTCAP_RXLDPC 0x0010
+#defineIEEE80211_VHTCAP_RXLDPC_S   4
+
 #defineIEEE80211_VHTCAP_SHORT_GI_800x0020
+#defineIEEE80211_VHTCAP_SHORT_GI_80_S  5
+
 #defineIEEE80211_VHTCAP_SHORT_GI_160   0x0040
+#defineIEEE80211_VHTCAP_SHORT_GI_160_S 6
+
 #defineIEEE80211_VHTCAP_TXSTBC 0x0080
+#defineIEEE80211_VHTCAP_TXSTBC_S   7
+
 #defineIEEE80211_VHTCAP_RXSTBC_1   0x0100
 #defineIEEE80211_VHTCAP_RXSTBC_2   0x0200
 #defineIEEE80211_VHTCAP_RXSTBC_3   0x0300
 #defineIEEE80211_VHTCAP_RXSTBC_4   0x0400
 #defineIEEE80211_VHTCAP_RXSTBC_MASK0x0700
+#defineIEEE80211_VHTCAP_RXSTBC_MASK_S  8
+
 #defineIEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE  0x0800
+#defineIEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE_S11
+
 #defineIEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE  0x1000
+#defineIEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE_S12
+
 #defineIEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT   13
 #defineIEEE80211_VHTCAP_BEAMFORMEE_STS_MASK \
(7 << IEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT)
+#defineIEEE80211_VHTCAP_BEAMFORMEE_STS_MASK_S  13
+
 #defineIEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT  16
 #defineIEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK \
(7 << IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT)
+#defineIEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK_S 16
+
 #defineIEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE  0x0008
+#defineIEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE_S19
 #defineIEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE  0x0010
+#defineIEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE_S20
 #defineIEEE80211_VHTCAP_VHT_TXOP_PS0x0020
+#defineIEEE80211_VHTCAP_VHT_TXOP_PS_S  21
 #defineIEEE80211_VHTCAP_HTC_VHT0x0040
+#defineIEEE80211_VHTCAP_HTC_VHT_S  22
+
 #defineIEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT   23
 #defineIEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \
(7 << IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT)
+#defineIEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK_S  23
+
+#defineIEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MASK   0x0c00
 #defineIEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB  
0x0800
 #defineIEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB
0x0c00
+#defineIEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MASK_S 26
+
 #defineIEEE80211_VHTCAP_RX_ANTENNA_PATTERN 0x1000
+#defineIEEE80211_VHTCAP_RX_ANTENNA_PATTERN_S   28
 #defineIEEE80211_VHTCAP_TX_ANTENNA_PATTERN 0x2000
+#defineIEEE80211_VHTCAP_TX_ANTENNA_PATTERN_S   29
 
 /*
  * XXX TODO: add the rest of the bits
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311859 - head/usr.bin/calendar/calendars

2017-01-09 Thread Larry Rosenman
Author: ler (ports committer)
Date: Tue Jan 10 05:37:53 2017
New Revision: 311859
URL: https://svnweb.freebsd.org/changeset/base/311859

Log:
  Add my birthday to calendar.freebsd
  
  Approved by:  adamw (Mentor)
  Differential Revision:https://reviews.freebsd.org/D9119

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdTue Jan 10 05:33:34 
2017(r311858)
+++ head/usr.bin/calendar/calendars/calendar.freebsdTue Jan 10 05:37:53 
2017(r311859)
@@ -310,6 +310,7 @@
 09/20  Kevin Lo  born in Taipei, Taiwan, Republic of China, 
1972
 09/21  Gleb Kurtsou  born in Minsk, Belarus, 1984
 09/22  Bryan Drewery  born in San Diego, California, 
United States, 1984
+09/24  Larry Rosenman  born in Queens, New York, United 
States, 1957
 09/27  Neil Blakey-Milner  born in Port Elizabeth, South 
Africa, 1978
 09/27  Renato Botelho  born in Araras, Sao Paulo, Brazil, 
1979
 09/28  Greg Lehey  born in Melbourne, Victoria, Australia, 
1948
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311860 - head/sys/net80211

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 10 07:21:07 2017
New Revision: 311860
URL: https://svnweb.freebsd.org/changeset/base/311860

Log:
  [net80211] add VHT action frame placeholders for when it's time to implement.

Modified:
  head/sys/net80211/ieee80211_vht.c

Modified: head/sys/net80211/ieee80211_vht.c
==
--- head/sys/net80211/ieee80211_vht.c   Tue Jan 10 05:37:53 2017
(r311859)
+++ head/sys/net80211/ieee80211_vht.c   Tue Jan 10 07:21:07 2017
(r311860)
@@ -85,9 +85,49 @@ __FBSDID("$FreeBSD$");
  * Look at mac80211/vht.c:ieee80211_vht_handle_opmode() for further details.
  */
 
+static int
+vht_recv_action_placeholder(struct ieee80211_node *ni,
+const struct ieee80211_frame *wh,
+const uint8_t *frm, const uint8_t *efrm)
+{
+
+   ieee80211_note(ni->ni_vap, "%s: called; fc=0x%.2x/0x%.2x",
+   __func__,
+   wh->i_fc[0],
+   wh->i_fc[1]);
+
+   return (0);
+}
+
+static int
+vht_send_action_placeholder(struct ieee80211_node *ni,
+int category, int action, void *arg0)
+{
+
+   ieee80211_note(ni->ni_vap, "%s: called; category=%d, action=%d",
+   __func__,
+   category,
+   action);
+   return (EINVAL);
+}
+
 static void
 ieee80211_vht_init(void)
 {
+
+   ieee80211_recv_action_register(IEEE80211_ACTION_CAT_VHT,
+   WLAN_ACTION_VHT_COMPRESSED_BF, vht_recv_action_placeholder);
+   ieee80211_recv_action_register(IEEE80211_ACTION_CAT_VHT,
+   WLAN_ACTION_VHT_GROUPID_MGMT, vht_recv_action_placeholder);
+   ieee80211_recv_action_register(IEEE80211_ACTION_CAT_VHT,
+   WLAN_ACTION_VHT_OPMODE_NOTIF, vht_recv_action_placeholder);
+
+   ieee80211_send_action_register(IEEE80211_ACTION_CAT_VHT,
+   WLAN_ACTION_VHT_COMPRESSED_BF, vht_send_action_placeholder);
+   ieee80211_send_action_register(IEEE80211_ACTION_CAT_VHT,
+   WLAN_ACTION_VHT_GROUPID_MGMT, vht_send_action_placeholder);
+   ieee80211_send_action_register(IEEE80211_ACTION_CAT_VHT,
+   WLAN_ACTION_VHT_OPMODE_NOTIF, vht_send_action_placeholder);
 }
 
 SYSINIT(wlan_vht, SI_SUB_DRIVERS, SI_ORDER_FIRST, ieee80211_vht_init, NULL);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311861 - head/sys/net80211

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 10 07:24:29 2017
New Revision: 311861
URL: https://svnweb.freebsd.org/changeset/base/311861

Log:
  [net80211] Add default parameters for 11ac.
  
  I doubt TDMA code will ever work for 11ac, but you never know, someone
  may one day make it happen.

Modified:
  head/sys/net80211/ieee80211_tdma.c

Modified: head/sys/net80211/ieee80211_tdma.c
==
--- head/sys/net80211/ieee80211_tdma.c  Tue Jan 10 07:21:07 2017
(r311860)
+++ head/sys/net80211/ieee80211_tdma.c  Tue Jan 10 07:24:29 2017
(r311861)
@@ -176,6 +176,8 @@ ieee80211_tdma_vattach(struct ieee80211v
settxparms(vap, IEEE80211_MODE_11NG, TDMA_TXRATE_11NG_DEFAULT);
settxparms(vap, IEEE80211_MODE_HALF, TDMA_TXRATE_HALF_DEFAULT);
settxparms(vap, IEEE80211_MODE_QUARTER, TDMA_TXRATE_QUARTER_DEFAULT);
+   settxparms(vap, IEEE80211_MODE_VHT_2GHZ, TDMA_TXRATE_11NG_DEFAULT);
+   settxparms(vap, IEEE80211_MODE_VHT_5GHZ, TDMA_TXRATE_11NA_DEFAULT);
 
setackpolicy(vap->iv_ic, 1);/* disable ACK's */
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r311862 - head/sys/net80211

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 10 07:50:21 2017
New Revision: 311862
URL: https://svnweb.freebsd.org/changeset/base/311862

Log:
  [net80211] add VHT mediatype initialisation and update helper functions.

Modified:
  head/sys/net80211/ieee80211.c

Modified: head/sys/net80211/ieee80211.c
==
--- head/sys/net80211/ieee80211.c   Tue Jan 10 07:24:29 2017
(r311861)
+++ head/sys/net80211/ieee80211.c   Tue Jan 10 07:50:21 2017
(r311862)
@@ -70,6 +70,8 @@ const char *ieee80211_phymode_name[IEEE8
[IEEE80211_MODE_QUARTER]  = "quarter",
[IEEE80211_MODE_11NA] = "11na",
[IEEE80211_MODE_11NG] = "11ng",
+   [IEEE80211_MODE_VHT_2GHZ] = "11acg",
+   [IEEE80211_MODE_VHT_5GHZ] = "11ac",
 };
 /* map ieee80211_opmode to the corresponding capability bit */
 const int ieee80211_opcap[IEEE80211_OPMODE_MAX] = {
@@ -181,6 +183,10 @@ ieee80211_chan_init(struct ieee80211com 
setbit(ic->ic_modecaps, IEEE80211_MODE_11NA);
if (IEEE80211_IS_CHAN_HTG(c))
setbit(ic->ic_modecaps, IEEE80211_MODE_11NG);
+   if (IEEE80211_IS_CHAN_VHTA(c))
+   setbit(ic->ic_modecaps, IEEE80211_MODE_VHT_5GHZ);
+   if (IEEE80211_IS_CHAN_VHTG(c))
+   setbit(ic->ic_modecaps, IEEE80211_MODE_VHT_2GHZ);
}
/* initialize candidate channels to all available */
memcpy(ic->ic_chan_active, ic->ic_chan_avail,
@@ -208,6 +214,8 @@ ieee80211_chan_init(struct ieee80211com 
DEFAULTRATES(IEEE80211_MODE_QUARTER, ieee80211_rateset_quarter);
DEFAULTRATES(IEEE80211_MODE_11NA,ieee80211_rateset_11a);
DEFAULTRATES(IEEE80211_MODE_11NG,ieee80211_rateset_11g);
+   DEFAULTRATES(IEEE80211_MODE_VHT_2GHZ,ieee80211_rateset_11g);
+   DEFAULTRATES(IEEE80211_MODE_VHT_5GHZ,ieee80211_rateset_11a);
 
/*
 * Setup required information to fill the mcsset field, if driver did
@@ -1492,6 +1500,8 @@ addmedia(struct ifmedia *media, int caps
[IEEE80211_MODE_QUARTER]= IFM_IEEE80211_11A,/* XXX */
[IEEE80211_MODE_11NA]   = IFM_IEEE80211_11NA,
[IEEE80211_MODE_11NG]   = IFM_IEEE80211_11NG,
+   [IEEE80211_MODE_VHT_2GHZ]   = IFM_IEEE80211_VHT2G,
+   [IEEE80211_MODE_VHT_5GHZ]   = IFM_IEEE80211_VHT5G,
};
u_int mopt;
 
@@ -1604,6 +1614,19 @@ ieee80211_media_setup(struct ieee80211co
if (rate > maxrate)
maxrate = rate;
}
+
+   /*
+* Add VHT media.
+*/
+   for (; mode <= IEEE80211_MODE_VHT_5GHZ; mode++) {
+   if (isclr(ic->ic_modecaps, mode))
+   continue;
+   addmedia(media, caps, addsta, mode, IFM_AUTO);
+   addmedia(media, caps, addsta, mode, IFM_IEEE80211_VHT);
+
+   /* XXX TODO: VHT maxrate */
+   }
+
return maxrate;
 }
 
@@ -1883,7 +1906,11 @@ enum ieee80211_phymode
 ieee80211_chan2mode(const struct ieee80211_channel *chan)
 {
 
-   if (IEEE80211_IS_CHAN_HTA(chan))
+   if (IEEE80211_IS_CHAN_VHT_2GHZ(chan))
+   return IEEE80211_MODE_VHT_2GHZ;
+   else if (IEEE80211_IS_CHAN_VHT_5GHZ(chan))
+   return IEEE80211_MODE_VHT_5GHZ;
+   else if (IEEE80211_IS_CHAN_HTA(chan))
return IEEE80211_MODE_11NA;
else if (IEEE80211_IS_CHAN_HTG(chan))
return IEEE80211_MODE_11NG;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r311585 - in head: crypto/openssh secure/usr.sbin/sshd

2017-01-09 Thread Xin Li

On 1/7/17 00:08, Ngie Cooper wrote:
> Author: ngie
> Date: Sat Jan  7 08:08:35 2017
> New Revision: 311585
> URL: https://svnweb.freebsd.org/changeset/base/311585
> 
> Log:
>   Conditionalize building libwrap support into sshd
>   
>   Only build libwrap support into sshd if MK_TCP_WRAPPERS != no
>   
>   This will unbreak the build if libwrap has been removed from the system
>   
>   MFC after:  2 weeks
>   PR: 210141
>   Submitted by:   kp...@protonmail.com
>   Differential Revision:  D9049

I didn't see this approved by maintainer, did you ping him?

[delphij@saturn] /usr/src> grep ssh MAINTAINERS
openssh des Pre-commit review requested.

(Not that the change itself is bad, though, but it's important to keep
everyone on the same page).

> Modified:
>   head/crypto/openssh/config.h
>   head/secure/usr.sbin/sshd/Makefile
> 
> Modified: head/crypto/openssh/config.h
> ==
> --- head/crypto/openssh/config.h  Sat Jan  7 07:54:23 2017
> (r311584)
> +++ head/crypto/openssh/config.h  Sat Jan  7 08:08:35 2017
> (r311585)
> @@ -1408,7 +1408,7 @@
>  /* #undef LASTLOG_WRITE_PUTUTXLINE */
>  
>  /* Define if you want TCP Wrappers support */
> -#define LIBWRAP 1
> +/* #undef LIBWRAP */
>  
>  /* Define to whatever link() returns for "not supported" if it doesn't return
> EOPNOTSUPP. */
> 
> Modified: head/secure/usr.sbin/sshd/Makefile
> ==
> --- head/secure/usr.sbin/sshd/MakefileSat Jan  7 07:54:23 2017
> (r311584)
> +++ head/secure/usr.sbin/sshd/MakefileSat Jan  7 08:08:35 2017
> (r311585)
> @@ -27,7 +27,7 @@ CFLAGS+=-I${SSHDIR} -include ssh_namespa
>  SRCS+=   ssh_namespace.h
>  
>  # pam should always happen before ssh here for static linking
> -LIBADD=  pam ssh util wrap
> +LIBADD=  pam ssh util
>  
>  .if ${MK_LDNS} != "no"
>  CFLAGS+= -DHAVE_LDNS=1
> @@ -53,6 +53,11 @@ SRCS+= krb5_config.h
>  LIBADD+= gssapi_krb5 gssapi krb5
>  .endif
>  
> +.if ${MK_TCP_WRAPPERS} != "no"
> +CFLAGS+= -DLIBWRAP
> +LIBADD+= wrap
> +.endif
> +
>  LIBADD+= crypto
>  
>  .if defined(LOCALBASE)
> 



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r311585 - in head: crypto/openssh secure/usr.sbin/sshd

2017-01-09 Thread Ngie Cooper (yaneurabeya)

> On Jan 9, 2017, at 11:56 PM, Xin Li  wrote:
> 
> 
> On 1/7/17 00:08, Ngie Cooper wrote:
>> Author: ngie
>> Date: Sat Jan  7 08:08:35 2017
>> New Revision: 311585
>> URL: https://svnweb.freebsd.org/changeset/base/311585
>> 
>> Log:
>>  Conditionalize building libwrap support into sshd
>> 
>>  Only build libwrap support into sshd if MK_TCP_WRAPPERS != no
>> 
>>  This will unbreak the build if libwrap has been removed from the system
>> 
>>  MFC after:  2 weeks
>>  PR: 210141
>>  Submitted by:   kp...@protonmail.com
>>  Differential Revision:  D9049
> 
> I didn't see this approved by maintainer, did you ping him?
> 
> [delphij@saturn] /usr/src> grep ssh MAINTAINERS
> openssh des Pre-commit review requested.
> 
> (Not that the change itself is bad, though, but it's important to keep
> everyone on the same page).

I waited 3 days for a reply on the review: https://reviews.freebsd.org/D9049 
 . Admittedly, it was a bit short of a 
timeout.
-Ngie
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"