summaryrefslogtreecommitdiffstats
path: root/sys/contrib
Commit message (Collapse)AuthorAgeFilesLines
* 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
* [ath] ensure the right methods / options get overridden for MCI bluetooth coexadrian2016-05-311-5/+5
| | | | | | | | | | | | | | | It turns out that the srev checks can't be done in the early attach in ar9300_freebsd.c, because the poweron and srev check hasn't yet happened. So: * Re-add the MCI overrides in attach * Add QCA9565 (Aphrodite) check for the LNA diversity stuff. Tested: * QCA9565, STA mode + bluetooth
* Merge ACPICA 20160527.jkim2016-05-2713-59/+112
| | | | Relnotes: yes
* Remove extraneous blank line.cy2016-05-201-1/+0
| | | | | MFC after: 1 month X-MFC with: r300259
* Enable the two ip_frag tuneables. The code is there but the twocy2016-05-202-1/+21
| | | | | | | | ip_frag tuneables aren't registered in the ipf_tuners linked list. This commmit enables the two existing ip_frag tuneables by registering them. MFC after: 1 month
* Make subsequent code reachable.cy2016-05-151-3/+6
| | | | | Reported by: Coverity CID 1354625 MFC after: 3 days
* Revert AccessWidth/BitOffset support for AcpiHwWrite() and AcpiHwRead() forjkim2016-04-301-195/+30
| | | | | | | | | | | | | | | now. The following upstream commits are reverted from hwregs.c: https://github.com/acpica/acpica/commit/96ece05 https://github.com/acpica/acpica/commit/3d8583a https://github.com/acpica/acpica/commit/48eea5e https://github.com/acpica/acpica/commit/0a212c3 https://github.com/acpica/acpica/commit/41f6aef https://github.com/acpica/acpica/commit/26434b9 https://github.com/acpica/acpica/commit/c23034a https://github.com/acpica/acpica/commit/c49a751 Note this commit will be reverted when the upstream fixes the code properly.
* Fix build without ACPI_DEBUG.jkim2016-04-271-0/+1
|
* Merge ACPICA 20160422.jkim2016-04-27334-12777/+19023
|\
* | Zero the newly allocated spinlock.jhibbits2016-04-241-1/+1
| | | | | | | | | | Not sure how this worked testing with DIAGNOSTIC set, but with it disabled this fails due to the spinlock being "initialized" with 0xdeadc0de.
* | Fix for printf() compile warning when fast_reg.length is 64-bit.hselasky2016-04-221-1/+1
| | | | | | | | | | | | | | | | Changing fast_reg.length to 64 bits is planned in the future. Krping uses 32-bit lengths internally. Sponsored by: Mellanox Technologies MFC after: 1 week
* | Use NULL instead of 0 for pointer comparison.cy2016-04-151-2/+2
| | | | | | | | MFC after: 4 weeks
* | Send krping output to the log instead of the tty, as is done upstream.np2016-04-143-72/+63
| | | | | | | | | | | | Reviewed by: hselasky@ Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D5931
* | Add fastreg support to krping (ported from upstream).np2016-04-121-36/+1027
| | | | | | | | | | | | Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D5777
* | Add DTrace probes for packets flagged as bad by ipfilter. All probescy2016-04-074-11/+62
| | | | | | | | | | | | | | | | for bad packets are named ipf_fi_bad_*. An example of its use might be: dtrace -n 'sdt:::ipf_fi_bad_* { stack(); }' Reviewed by: Darren Reed <darrenr@reed.wattle.id.au>
* | Make CloudABI's way of doing TLS more friendly to userspace emulators.ed2016-04-061-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're currently seeing how hard it would be to run CloudABI binaries on operating systems cannot be modified easily (Windows, Mac OS X). The idea is that we want to just run them without any sandboxing. Now that CloudABI executables are PIE, this is already a bit easier, but TLS is still problematic: - CloudABI executables want to write to the %fs, which typically requires extra system calls by the emulator every time it needs to switch between CloudABI's and its own TLS. - If CloudABI executables overwrite the %fs base unconditionally, it also becomes harder for the emulator to store a backup of the old value of %fs. To solve this, let's no longer overwrite %fs, but just %fs:0. As CloudABI's C library does not use a TCB, this space can now be used by an emulator to keep track of its internal state. The executable can now safely overwrite %fs:0, as long as it makes sure that the TCB is copied over to the new TLS area. Ensure that there is an initial TLS area set up when the process starts, only containing a bogus TCB. We don't really care about its contents on FreeBSD. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D5836
* | Sync in the latest CloudABI system call definitions.ed2016-03-313-12/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some time ago I made a change to merge together the memory scope definitions used by mmap (MAP_{PRIVATE,SHARED}) and lock objects (PTHREAD_PROCESS_{PRIVATE,SHARED}). Though that sounded pretty smart back then, it's backfiring. In the case of mmap it's used with other flags in a bitmask, but for locking it's an enumeration. As our plan is to automatically generate bindings for other languages, that looks a bit sloppy. Change all of the locking functions to use separate flags instead. Obtained from: https://github.com/NuxiNL/cloudabi
* | krping wasn't designed to take more than one client. Fail any connectnp2016-03-291-2/+7
| | | | | | | | | | | | | | | | requests if cb->state is not IDLE. Submitted by: Krishnamraju Eraparaju @ Chelsio Reviewed by: Steve Wise @ Open Grid Computing Sponsored by: Chelsio Communications
* | Replace the CloudABI system call table by a machine generated version.ed2016-03-245-731/+996
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The type definitions and constants that were used by COMPAT_CLOUDABI64 are a literal copy of some headers stored inside of CloudABI's C library, cloudlibc. What is annoying is that we can't make use of cloudlibc's system call list, as the format is completely different and doesn't provide enough information. It had to be synced in manually. We recently decided to solve this (and some other problems) by moving the ABI definitions into a separate file: https://github.com/NuxiNL/cloudabi/blob/master/cloudabi.txt This file is processed by a pile of Python scripts to generate the header files like before, documentation (markdown), but in our case more importantly: a FreeBSD system call table. This change discards the old files in sys/contrib/cloudabi and replaces them by the latest copies, which requires some minor changes here and there. Because cloudabi.txt also enforces consistent names of the system call arguments, we have to patch up a small number of system call implementations to use the new argument names. The new header files can also be included directly in FreeBSD kernel space without needing any includes/defines, so we can now remove cloudabi_syscalldefs.h and cloudabi64_syscalldefs.h. Patch up the sources to include the definitions directly from sys/contrib/cloudabi instead.
* | Fix crash in krping when run as a client due to NULL pointer access.hselasky2016-03-161-0/+1
| | | | | | | | | | | | | | | | Initialize pointer in question which is used only when fast registers mode is selected. Sponsored by: Mellanox Technologies MFC after: 1 week
* | Remove redundant NULL pointer comparison.cy2016-03-021-4/+0
| | | | | | | | | | Reported by: PVS-Studio (V595) in D5245 Differential Revision: D5245
OpenPOWER on IntegriCloud