summaryrefslogtreecommitdiffstats
path: root/sys/contrib
Commit message (Collapse)AuthorAgeFilesLines
* MF11 r320731,320749,320759: Add Amazon Elastic Network Adapter drivercperciva2017-07-079-0/+7426
| | | | | | | | | and turn it on in EC2 AMI builds Approved by: re (gjb) Relnotes: FreeBSD now supports "next generation" Enhanced Networking in the Amazon EC2 cloud Sponsored by: Amazon.com Inc. (original work)
* MFC r317928jhibbits2017-06-182-1/+6
| | | | | | | | | | | | Add necessary bits to get FreeBSD booting on the Unifi Security Gateway Summary: The Ubiquiti Unifi Security Gateway is virtually identical to the EdgeRouter Lite, with a smaller PCB and apparently a different board identifier. Simply adding the new board identifier alongside the ERL identifier, FreeBSD boots successfully, and can access the needed peripherals. Approved by: re(bdrewery)
* MFC r318998:cy2017-06-061-2/+2
| | | | | | | | Fix return value of ip_sync_nat. Previously, regardless of error it always returned a return code of 0. Obtained from: NetBSD ip_sync.c r1.5 Approved by: re (delphij)
* MFC r318606:cy2017-05-301-14/+2
| | | | | Refactor & compact struct i6addr_t #ifdef: remove redundant structure definintion when USE_INET6 is false.
* MFC r318745:cy2017-05-301-4/+0
| | | | Remove redundant variable declaration.
* MFC efivar(8) (by imp):kib2017-05-2037-0/+37542
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | List of revisions merged: r307070 r307071 r307072 r307074 r307189 r307224 r307339 r307390 r307391 r309776 r314231 r314232 r314615 r314616 r314617 r314618 r314619 r314620 r314621 r314623 r314890 r314925 r314926 r314927 r314928 r315770 r315771 Discussed with: gjb (re), imp Sponsored by: The FreeBSD Foundation
* MFC r310560:gonzo2017-05-081-2/+2
| | | | | | | | | | | | [vchi] replace non-reproducible __DATE__/__TIME__ with hardcoded string Although vchiq_build_date and vchiq_build_time are not used in current vchi driver at the moment, make sure these value will not leak into build later on if at some point they will be refered in some new imported code PR: 215494 Reported by: emaste
* MFC r316810, r316814, r316816, r316991:cy2017-04-262-2/+3
| | | | | | | | | | | | | | | | | | Keep state incorrectly assumes keep frags. This is counter to the ipfilter man pages. This also currently restricts keep frags to only when keep state is used, which is redundant because keep state currently assumes keep frags. This commit fixes this. To the user this change means that to maintain the current behaviour one must add keep frags to any ipfilter keep state rule (as documented in the man pages). This patch also allows the flexability to specify and use keep frags separate from keep state, as documented in an example in ipf.conf.5, instead of the currently broken behaviour. MFC suggested by: rgrimes Relnotes: yes
* MFC r316811, r317139:cy2017-04-211-0/+4
| | | | | | | Add missing free()'s after calls to randomize(). PR: NetBSD PR/50559 Obtained from: Netbsd radix_ipf.c r1.6
* MFC r316809:cy2017-04-211-1/+1
| | | | | | | | | | | | Fix a use after free panic in ipfilter's fragment processing. Memory is malloc'd, then a search for a match in the fragment table is made and if the fragment matches, the wrong fragment table is freed, causing a use after free panic. This commit fixes this. A symptom of the problem is a kernel page fault in bcopy() called by ipf_frag_lookup() at line 715 in ip_frag.c. Another symptom is a kernel page fault in ipf_frag_delete() when called by ipf_frag_expire() via ipf_slowtimer().
* Bring kernel space CloudABI code in sync with HEAD.ed2017-04-065-462/+401
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC r312353, r312354 and r312355: Sync in the latest CloudABI generated source files. Languages like C++17 and Go provide direct support for slice types: pointer/length pairs. The CloudABI generator now has more complete for this, meaning that for the C binding, pointer/length pairs now use an automatic naming scheme of ${name} and ${name}_len. Apart from this change and some reformatting, the ABI definitions are identical. Binary compatibility is preserved entirely. MFC r315700: Make file descriptor passing work for CloudABI's sendmsg(). Reduce the potential amount of code duplication between cloudabi32 and cloudabi64 by creating a cloudabi_sock_recv() utility function. The cloudabi32 and cloudabi64 modules will then only contain code to convert the iovecs to the native pointer size. In cloudabi_sock_recv(), we can now construct an SCM_RIGHTS cmsghdr in an mbuf and pass that on to kern_sendit(). MFC r315736: Make file descriptor passing for CloudABI's recvmsg() work. Similar to the change for sendmsg(), create a pointer size independent implementation of recvmsg() and let cloudabi32 and cloudabi64 call into it. In case userspace requests one or more file descriptors, call kern_recvit() in such a way that we get the control message headers in an mbuf. Iterate over all of the headers and copy the file descriptors to userspace.
* MFC: r306686, r308953, r311462, r311529, r312438, r314611jkim2017-03-30344-10889/+53667
| | | | | | | - Merge ACPICA 20170303. - Remove '-vd' option to make iasl(8) reproducible. Relnotes: yes
* MFC r312886:cy2017-03-112-4/+4
| | | | | | | Fix lookup of original destination address when using a redirect rule. Transparent proxying, e.g. to squid, is an example of this. Obtained from: NetBSD ip_nat.c r1.17, ip_nat6.c r1.10
* MFC r312292, r313573:ian2017-03-021-1/+1
| | | | | | | | | | | | | | | Stop including sys/types.h from arm's machine/atomic.h, fix the places where atomic.h was being included without ensuring that types.h (via param.h) was included first, as required by atomic(9). Remove arm's cpuconf.h, and references to it, after moving a few lines from it into pmap-v4.h where they are used. Other than those few lines of support for different MMU types, nothing in cpuconf.h has been used in our code for quite a while. The file existed to set up a variety of symbols to describe the architecture. Over the past few years we have converted all of our source to use the new architecture symbols standardized by ARM Inc, and predefined by both clang and gcc.
* MFC r312787:cy2017-02-252-1/+6
| | | | | | | | | | | | | | | | | | Currently the fragment info is placed at the top of the linked list under a shared read lock. This patch attempts to upgrade the lock to an exclusive write lock. If the exclusive write lock fails to be obtained, the current fragment is not placed at the head of the list. This portion of the patch was inspired by NetBSD ip_frag.c r1.4 (which effectively removed the section of code that performed the reordering). The patch to sys/contrib/ipfilter/netinet/ip_compat.h adds the MUTEX_TRY_UPGRADE macro to support the patch to ip_frag.c. The patch to contrib/ipfilter/lib/rwlock_emul.c supports this patch by emulating the mutex in userspace when exercised by ipftest(1). Inspired by: NetBSD ip_frag.c r1.4
* MFC r311950:bz2017-01-191-4/+4
| | | | | | | | Get rid of a compiler warning which I saw too often. Include netinet/in.h before ip_compat.t which will then check if IPPROTO_IPIP is defined or not. Doing it the other way round, ip_compat.h would not find it defined and netinet/in.h then redefine it.
* MFC r308659:loos2016-12-301-1/+0
| | | | Reduce dmesg verbosity.
* MFC r307067, r307068, r307087, r307088, r307089,gonzo2016-10-181-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r307091, r307092, r307093, r307095, r307098, r307115: r307067: Make intc driver compatible with upstream DTS - Fix compatibility strings - Properly decode upstream's two-cell interrupt specs. Our home-made dts does not have two-cell interrupts so no need to preserve backward compatibility r307068: Make Rapsberry Pi watchdog driver compatible with upstream DTS - Fix compatibility strings - Compensate the difference in base address for our custom DTS and upstream one (for backward compatibility) r307087: Make sure intc is attached before interrupt consumers If pass order is not specified devices are attached in the order they are defined in dts. Some interrupt consumers may be defined before intc. Also make sure intc interrupt-parent local_intc is attached before intc itself. r307088: Add compatible strings used in upstream dts files r307089: Make framebuffer driver compatible with upstream DT - Add compatibility string - Add simplebus as possible parent bus r307091: Add compatibility string from upstream DT r307092: Make BCM2835 GPIO driver compatible with upstream DT - Add compatibility string - Make reserverd and read-only properties optional r307093: Make BCM283x USB driver compatible with upstream DT - Make resource allocation logic depend on compatibility string to check what format of DTS node should be used - FreeBSD's or upstream r307095: Make VCHI driver compatible with upstream DT - Add compatibility string - Compensate difference in base address between our custom DTB and upstream one r307098: Make BCM28x USB driver compatible with upstream device tree This should have been committed in r307093: resource allocation depends on source of the device tree. upstream dts has extra interrupt that we can ignore r307115: Fix typo in comment Spotted by: loos
* MFC r303818, r303833, r303941, r304478, r304481, r304483, r304484, r304554,ed2016-10-1210-421/+4180
| | | | | | | | | | | | | | | | | | r304555, r304556, r304557, r304558, r304559, r304561, r304563, r304564, r304565, r304615, r304742, r304743, r304744, r304745, r304748, r304886, r304991, r305928, r305938, r305987, r306185: Bring CloudABI support back in sync with HEAD. - Add support for running 32-bit executables on amd64, armv6 and i386. - As these new architectures require the use of the vDSO, merge back vDSO support for 64-bit executables running on amd64 and arm64 as well. This has the advantage that support for vDSO-less execution can be phased out when 11.0 becomes unsupported, as opposed to 11.x. This change has been tested by running the cloudlibc unit tests on all supported architectures, which seems to work fine.
* MFC r305104:gonzo2016-09-022-51/+69
| | | | | | | Update VCHIQ driver to upstream version 4eda74f2 PR: 211525 Submitted by: Sylvain Garrigues <sylvain@sylvaingarrigues.com>
* MFC r304953:dim2016-08-315-7/+29
| | | | | | | | | | | | | | | | | | | | | Define ipfilter's SOLARIS macro in a defined and portable way. Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D7671 MFC r304959 (by kib): Complete r304953. Sponsored by: The FreeBSD Foundation MFC r304964: Follow-up to r304953, in which I broke the build: apparently the SOLARIS macro is defined in lots of different places in ipfilter, so replace all of the nonportable definitions with portable ones. Pointy hat to: dim
* MFC r302966:oshogbo2016-08-081-2/+4
| | | | | | | | | | | Fix nvlist array memory leak. When we change nvl_array_next to NULL it means that we want to destroy or take nvlist_array. The nvpair, which stores next nvlist of nvlist_array element is no longer needed and can be freed. Submitted by: Adam Starak <starak.adam@gmail.com> Approved by: re (gjb)
* MFC r302965:oshogbo2016-08-081-0/+1
| | | | | | | Fix memory leak in the nvlist string array. Submitted by: Adam Starak <starak.adam@gmail.com> Approved by: re (gjb)
* MFC r303322,303326,303327,303345,303413,303416,303418,303557sbruno2016-08-017-45527/+122225
| | | | | | | Update iwm(4) and iwmfw(4) to current in order to stabilize and improve functionality. Approved by: re (gjb)
* Only set the ipfilter running state to 'not running' if we arebz2016-07-061-2/+3
| | | | | | | | | | | doing the teardown. ipf_destroy_all() may free ipfmain in case of ipf_dynamic_softc being true, thus we are avoiding a possible memory modified after free as well. Reported by: Coverity Coverity CID: 1357320 Approved by: re (hrs) MFC after: 10 days
* Remove SoC-specific integrations from dTSEC, to make it SoC agnostic.jhibbits2016-07-0513-3702/+32
| | | | | | This will allow a single kernel to run on all SoCs supported by the dTSEC driver. Approved by: re@(gjb)
* Virtualise ipfilter.bz2016-06-305-159/+345
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split initializzation an teardown into module (global state) and VNET (per virtual network stack) parts. Virtualise global state, which is not "const". Cleanup eventhandlers, so that we can make use of the passed in argument to get the vnet state from the ifp; disable the "cloner" event as it is too early, has no state, and can fire before initialisation (see comment in the source). Handle the dynamic sysctls specially. The problem is that "ipmain" is the virtualized struct, but the fields used for the sysctls are hanging off memory allocated and attached to the virtualized "ipmain" thus standard VNET macros and sysctl handling do not work. We still say it is VNET sysctls to get the proper protection checks in the VIMAGE case; to solve the problem of accessing the right bit of memory hanging of each per-VNET ipmain, we use a dedicated handler function wrapping around sysctl_ipf_int() undoing the base calculation from kern_sysctl.c and then adding the passed-in offset into the right struct depending on handler. A bit of a mess exposing VNET-internals this way but the only way to keep the code without having to massively restructure ipf internals. Approved by: re (hrs) Sponsored by: The FreeBSD Foundation Obtained from: projects/vnet MFC after: 2 weeks Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D7000
* Remove unused global variables as well as unused memorybz2016-06-303-23/+0
| | | | | | | | | allocations from ipfilter in preparation for VNET support. Suggested by: cy (see D7000) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Approved by: re (gjb)
* Get closer to a VIMAGE network stack teardown from top to bottom ratherbz2016-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | than removing the network interfaces first. This change is rather larger and convoluted as the ordering requirements cannot be separated. Move the pfil(9) framework to SI_SUB_PROTO_PFIL, move Firewalls and related modules to their own SI_SUB_PROTO_FIREWALL. Move initialization of "physical" interfaces to SI_SUB_DRIVERS, move virtual (cloned) interfaces to SI_SUB_PSEUDO. Move Multicast to SI_SUB_PROTO_MC. Re-work parts of multicast initialisation and teardown, not taking the huge amount of memory into account if used as a module yet. For interface teardown we try to do as many of them as we can on SI_SUB_INIT_IF, but for some this makes no sense, e.g., when tunnelling over a higher layer protocol such as IP. In that case the interface has to go along (or before) the higher layer protocol is shutdown. Kernel hhooks need to go last on teardown as they may be used at various higher layers and we cannot remove them before we cleaned up the higher layers. For interface teardown there are multiple paths: (a) a cloned interface is destroyed (inside a VIMAGE or in the base system), (b) any interface is moved from a virtual network stack to a different network stack ("vmove"), or (c) a virtual network stack is being shut down. All code paths go through if_detach_internal() where we, depending on the vmove flag or the vnet state, make a decision on how much to shut down; in case we are destroying a VNET the individual protocol layers will cleanup their own parts thus we cannot do so again for each interface as we end up with, e.g., double-frees, destroying locks twice or acquiring already destroyed locks. When calling into protocol cleanups we equally have to tell them whether they need to detach upper layer protocols ("ulp") or not (e.g., in6_ifdetach()). Provide or enahnce helper functions to do proper cleanup at a protocol rather than at an interface level. Approved by: re (hrs) Obtained from: projects/vnet Reviewed by: gnn, jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6747
* [ath] implement TX queue configuration extensions for the AR9380 HAL.adrian2016-06-201-13/+33
| | | | | | | | | | | | Among other things, this introduces the idea of DBA-gated queues that aren't the CABQ. The TDMA support requires this. Tested: * AR9580 (hostap mode) * AR9380 (sta mode) Approved by: re (gjb)
* [ath_hal] modify the xmit code to use temporary variables for setting ↵adrian2016-06-081-38/+23
| | | | | | | | | qmisc/dmisc. This is in preparation for some other TDMA fixes which will hopefully end with having working TDMA. But, it does avoid lots of read/modify/writes in the txq setup path.
* [ath_hal] add a _S so FSP (frame scheduling policy) can be set/read via ↵adrian2016-06-081-0/+1
| | | | SM/MS macros.
* [ath_hal] correctly initialise the CAB queue default valueadrian2016-06-081-5/+23
| | | | | | | * Allow readyTime to just be programmed in directly * The beacon interval and all of the beacon timing sysctl's are in TU, not TSF. So, we were doing the wrong math on the CAB programming in the first place.
* [ath_hal] initialise ah_beaconInterval when the AP/IBSS/TDMA beacon is setup.adrian2016-06-082-2/+3
|
* [ath_hal] add AR9462 (jupiter) RX gain / XLNA programming.adrian2016-06-053-0/+60
| | | | | | | | | | | | | | This seems to make 5G work better. It doesn't fix powersave handling though, that still sees the PHY get stuck during initial calibration and everything goes pear shaped. I'll look into that later. Tested: * QCAFN222 NIC, STA mode, 5GHz Obtained from: Linux ath9k
* [ath_hal] Add Jupiter 2.1 (AR9462 mac 640.3) support.adrian2016-06-051-3/+32
| | | | | | | | | | | | | | | Turns out I wasn't even initialising or programming a lot of stuff for the AR9462 2.1 chip. Oops. This mostly gets it working. powersave scan results in some pretty hilarious NFcal hangs and I don't see beacons reliably. There are still some xlna gain tables missing that ath9k has; I'll follow up with some fixes and then see if the QCAFN222 NIC I have tests this path. Tested: * QCAFN222 NIC, STA mode, 2GHz and 5GHz
* [ath_hal] teach the reset path(s) about Jupiter 2.1.adrian2016-06-051-3/+4
| | | | | This was just .. not programming in things, and thus large chunks of the radio wouldn't work. Notably, 5GHz didn't work.
* [ath_hal] convert the MCI code over to work on Jupiter 2.1.adrian2016-06-051-7/+7
| | | | | (Note: jupiter 1.0 was emulation / test silicon, and was never released in production. So, yes, AR_SREV_JUPITER() would really be fine.)
* [ath_hal] Make the AR9462 2.0 initvals from ath9k compile.adrian2016-06-051-19/+20
| | | | | The (upcoming) semi-working AR9462 2.1 support uses the 2.0 initvals where appropriate, and those need to at least compile under freebsd.
* [ath_hal] add STOMP_AUDIO for AR9462/QCA9565.adrian2016-06-041-0/+6
| | | | Obtained from: Linux ath9k
* [ath_hal] add azimuth timestamp payload marking for AR9380 and later chips.adrian2016-06-011-0/+1
|
* [ath_hal] implement shared PA handling checks, based on ath9k.adrian2016-06-011-8/+16
| | | | | | | | | | | | | | These are apparently conditional on there being a shared PA/LNA, which at least on AR9462/QCA9535 devices I have isn't a thing. I'm .. not yet sure which devices it /is/ a thing, so I'll come back to that. Tested: * QCA9565 STA + bluetooth Obtained from: Linux ath9k
* [ath_hal] add MCI bits from ath9k for QCA9565adrian2016-06-011-21/+106
| | | | | | | | | | | | | | | | | | | | | * Add extra debugging - the weights debugging is really useful to ensure things are programmed into the wlan coexistence table. The weights are what traffic priority each of the various modes get (tx, tx-high-priority, rx-beacon, etc) if they're all zero, things work very poorly. * Add in coex init routines from ath9k for AR9462 and QCA9565 1ANT and 2ANT. This control things like beacon stomping, ACK handling, antennas, PA/LNA shared, etc. * Some ancillary bits. TODO: * There's some conditional stuff around MCI_ANT_ARCH_PA_LNA_SHARED() in ath9k which doesn't always enable force-on LNA. That'll have to be examined and merged in as appropriate. Obtained from: linux ath9k
* [ath_hal] add support for QCA9565 for configuring the bluetooth antenna LNA ↵adrian2016-06-011-3/+34
| | | | | | | | | | | | | diversity. Notably, this also sets AR_BTCOEX_WL_LNADIV to FORCE_ON, so LNA diversity is always enabled and under control of the wifi chip. Tested: * QCA9565, STA + bluetooth mode Obtained from: Linux ath9k
* [ath_hal] Allow the BT antenna diversity option to be enabled for QCA9565.adrian2016-06-011-2/+4
| | | | Obtained from: Linux ath9k
* [ath_hal] add QCA9565 bluteooth antenna control.adrian2016-06-011-2/+30
| | | | | | | | | | | | This configures the LNA antenna diversity control, which should be on if wlan owns the LNA for bluetooth coexistence. Otherwise, make sure it's off. I think this is eventually intended to allow 1-antenna bluetooth + wifi setups for QCA9565, but I'm not sure where that's actually configured in ath9k. Obtained from: Linux ath9k
* [ath_hal] add extra debugging for MCI interrupts.adrian2016-06-011-0/+2
|
* [ath_hal] rename the MCI state info routine.adrian2016-05-311-1/+10
| | | | It's not /really/ "get state".
* [ath_hal] add QCA9565 and MCI related registers.adrian2016-05-311-0/+29
| | | | | | This is required for upcoming MCI fixes. Obtained from: Linux ath9k
* [ath_hal] migrate the bluetooth definitions out from ah.h / ↵adrian2016-05-311-357/+0
| | | | | | | | | | | ar9300_freebsd_inc.h. The eventual MCI driver side of things needs the MCI bits to live in the HAL API so we can get to them. Tested: * QCA9565, STA mode + bluetooth
OpenPOWER on IntegriCloud