Commit Graph

114881 Commits

Author SHA1 Message Date
Oleksandr Tymoshenko
546fa3ada3 [efi] Fix .rel.data.* being erroneously merged into .data on ARM
Fix section pattern code to exclude .rel.data.* sections from being
merged into .data. Otherwise relocations in those sections are lost
in final binary

Reviewed by:	andrew
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D9108
2017-01-10 20:12:07 +00:00
Oleksandr Tymoshenko
06212e0467 [efi] Fix off-by-one error in ARM .bss zeroing code in loader's _start
__bss_end should not be included in .bss zeroing code. Otherwise first 4
bytes of the section that follows .bss (in loader's case it's .sdata) are
overwritten by zero.

Reviewed by:	andrew
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D9108
2017-01-10 20:08:21 +00:00
Sergey Kandaurov
30007e3fdc Fix build without IEEE80211_DEBUG.
Reported by:	many
2017-01-10 19:28:40 +00:00
Li-Wen Hsu
0a50238935 Replace using of objdump with elfdump
In-tree objdump is too old to dump new ELF headers.  But for example if we
use: `make CROSS_TOOLCHAIN=riscv64-gcc TARGET_ARCH=riscv64` and do not specify
CROSS_BINUTILS_PREFIX in env, embed_mfs.sh cannot find the correct objdump.
This patch just replaces using of objdump with elfdump to collect needed
information.

Later we may also put an ELFDUMP in CROSSENV and use it in embed_mfs.sh .

Reviewed by:	emaste, br
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D9062
2017-01-10 18:46:40 +00:00
Navdeep Parhar
c70c4d71de The iw_cxgb and iw_cxgbe drivers should not use a FreeBSD device_t where
a linuxkpi style device is expected.  If OFED/linuxkpi actually starts
using this field then we'll have to figure out whether to create fake
devices for these drivers or have linuxkpi deal with NULL device.

This mismatch was first reported as part of D6585.
2017-01-10 18:39:53 +00:00
Andrew Rybchenko
e3ef7bb216 sfxge(4): avoid unnecessary mbuf data prefetch
Unnecessary prefetch just loads HW prefetcher and displaces other
cache entries (which could be really useful).

If we parse mbuf for TSO early and use firmware-assisted TSO, we do not
expect mbuf data access when we compose firmware-assisted TSO (v1 or v2)
option descriptors.  If packet header needs to be linearized or finally
FATSO cannot be used because of, for example, too big header, we do not
care about a bit more performance degradation because of prefetch
absence (it is better to optimize more common case).

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D9120
2017-01-10 16:25:39 +00:00
Andrew Turner
ce790c9008 Add acpi_if.h to SRCS so we have it when building ahci_generic.c with ACPI.
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2017-01-10 13:36:33 +00:00
Andrew Turner
2647410d05 Add an ACPI attachment to the existing ahci_generic driver. This is used
in some arm64 hardware, for example the AMD Opteron A1100.

Reviewed by:	mav
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8852
2017-01-10 10:56:33 +00:00
Alexander Motin
7c07ea9aa2 Fix malloc(M_WAITOK) under mutex, introduced at r311787.
MFC after:	13 days
2017-01-10 10:33:36 +00:00
Adrian Chadd
0c67d389f4 [net80211] add VHT mediatype initialisation and update helper functions. 2017-01-10 07:50:21 +00:00
Adrian Chadd
930dc01620 [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.
2017-01-10 07:24:29 +00:00
Adrian Chadd
86fee26330 [net80211] add VHT action frame placeholders for when it's time to implement. 2017-01-10 07:21:07 +00:00
Adrian Chadd
5fd74bfae8 [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.
2017-01-10 05:33:34 +00:00
Adrian Chadd
94338935ee [net80211] add CHAN_VHT2G/CHAN_VHT5G macros. 2017-01-10 05:32:30 +00:00
Adrian Chadd
8fde59a7da [net80211] add VHT EDCA parameters for WME/QoS mode. 2017-01-10 05:32:02 +00:00
Adrian Chadd
791be271f1 [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.
2017-01-10 05:30:15 +00:00
Sean Bruno
d37cece2b0 Add copywrite notices, 2-clause BSD.
Reported by:	jmallett
2017-01-10 04:50:26 +00:00
Mateusz Guzik
bedd46202f cd9660: fix up compilation on sparc after r311665
Reported by:	linimon
2017-01-10 04:17:53 +00:00
Ian Lepore
cfed2e639e 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).
2017-01-10 03:53:38 +00:00
Sean Bruno
f2d6ace4a6 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-net@freebsd.org

Partial review from jhb and suggestions on how to *not* brick folks who
originally would have lost their igbX device.

Submitted by:	mmacy@nextbsd.org
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	Limelight Networks and Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D8299
2017-01-10 03:23:22 +00:00
Navdeep Parhar
e8257dbe43 cxgbe(4): Attach to the 2x25 debug card. This is for internal use only.
MFC after:	3 days
2017-01-10 01:36:50 +00:00
Bruce M Simpson
ae9fd9cccd 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.
2017-01-10 01:31:26 +00:00
Navdeep Parhar
b91f227f60 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
2017-01-10 01:30:41 +00:00
Andriy Voskoboinyk
ae60d856a3 rtwn_pci(4): fix possible race while accessing 'matched_chip' variable. 2017-01-10 01:09:39 +00:00
Bruce M Simpson
5ca4ae8bb7 Add PID for Belkin F5U258 "Windows Easy Transfer Cable", a udbp-like device. 2017-01-10 00:28:01 +00:00
Conrad Meyer
cc2166783b Adjust ACPI_EXPORT_SYMBOL for AcpiGetTableWithSize
Suggested by:	jbeich@
2017-01-10 00:03:43 +00:00
Conrad Meyer
f7da1444fd cd9660: typedef cd_ino_t in preference to #define
Suggested by:	kib@
2017-01-09 23:56:45 +00:00
Conrad Meyer
d5fadb019e 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@
2017-01-09 23:51:31 +00:00
Sean Bruno
46aa753364 White space cleanup from an cut-n-paste.
Submitted by:	mmacy@nextbsd.org
2017-01-09 23:45:40 +00:00
Andriy Voskoboinyk
5c06728ccb 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
2017-01-09 23:42:02 +00:00
Sean Bruno
5b51fcfc7a Remove unused mtx_held() macro. 2017-01-09 23:41:10 +00:00
Navdeep Parhar
87b027ba69 cxgbe(4): Enable automatic cidx flush for all control queues.
MFC after:	3 days
2017-01-09 22:20:09 +00:00
Navdeep Parhar
f50c49cca7 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
2017-01-09 22:18:08 +00:00
Adrian Chadd
129adb62dc [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 <vidwer@gmail.com>
2017-01-09 21:46:24 +00:00
Marius Strobl
0ac43d9728 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
2017-01-09 20:51:51 +00:00
Konstantin Belousov
d72b4d3918 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
2017-01-09 20:14:18 +00:00
Alexander Motin
bb8f9017b3 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)
2017-01-09 18:18:15 +00:00
Ian Lepore
b8bf08b1fa 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
2017-01-09 17:10:50 +00:00
Marius Strobl
a2832f9fce - 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
2017-01-09 17:07:13 +00:00
Marius Strobl
d119f637fc 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
2017-01-09 17:05:39 +00:00
Alexander Motin
0e2d6474ca 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
2017-01-09 16:21:06 +00:00
Sepherosa Ziehau
227bb849d3 hyperv: Add method to read 64bit Hyper-V specific time value.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D9057
2017-01-09 03:38:41 +00:00
Ian Lepore
8adb836cda Use the new sdhci_fdt_gpio helper functions to add full support for FDT
gpio pins for detecting card insert/remove and write protect.
2017-01-09 02:04:54 +00:00
Ian Lepore
e62eb51d5a Use the new sdhci_fdt_gpio helper functions to add full support for FDT
gpio pins for detecting card insert/remove and write protect.
2017-01-09 01:57:51 +00:00
Ian Lepore
78906a722f Add new helper routines for sdhci bridge drivers that use gpio pins for
card presence and write protect switch detection.

A bridge driver just needs to call the setup routine in its attach(), the
teardown in its detach(), and write a couple tiny glue functions to connect
the sdhci interface functions to the new helper functions.  This is not
extensively documented, but multiple examples will exist real soon.
2017-01-09 01:54:36 +00:00
Ian Lepore
639f59f02a Add support for non-removable media, and a quirk to use polling to detect
card insert/remove events on controllers that don't implement the insert
and remove interrupts.

Bridge drivers can set a new slot option, SDHCI_NON_REMOVABLE, to indicate
non-removable media (such as eMMC).  The sdhci driver will not enable
insert/remove interrupts, and sdhci_generic_get_card_present() will always
return true.

Bridge drivers can set a new quirk, SDHCI_QUIRK_POLL_CARD_PRESENT, and the
sdhci driver will not enable insert/remove interrupts, and instead will use
a callout to poll the card-present status at 5 Hz.

For bridge drivers that get notified of card insert/remove via gpio
interrupts, there is a new sdhci_handle_card_present() function they can
call from the gpio interrupt handler to inform the sdhci code of the event.

In addition to adding these new features, the existing code to debounce card
insertions was updated to use taskqueue_enqueue_timeout() instead of
scheduling a callout to do the taskqueue_enqueue().  There is also now a
comment explaining that insertion-debounce is what's going on -- it took me
a long time to realize that's what the old sdhci_card_delay() routine was
really doing.  There is no functional difference between the old and new
debounce code (I hope!).
2017-01-09 01:15:18 +00:00
Andriy Voskoboinyk
0866194cab rtwn_usb(4): fix Rx buffer size calculation.
Use device-specific Rx buffer size to ensure that data will not be
truncated + add a warning if truncation was detected (the driver
cannot handle this case correctly yet).

Tested with:
 - RTL8188CUS, RTL8188EU and RTL8821AU, STA / AP modes.
2017-01-08 23:41:17 +00:00
Justin Hibbits
009dedabb3 Knock a page off VM_MAX_KERNEL_ADDRESS
There are places where checks are made against VM_MAX_KERNEL_ADDRESS, or
virtual_end (set to VM_MAX_KERNEL_ADDRESS).  With 32-bit checks, an address will
always be less than or equal to 0xffffffff.  Drop a page, so those checks can
terminate loops safely.
2017-01-08 21:12:46 +00:00
Luiz Otavio O Souza
4723c14fa9 Convert gpioc to use the make_dev_s(9) KPI. This fix a possible race where
si_drv1 can be accessed before it gets set.

This is inspired on r311700.

MFC after:	3 days
2017-01-08 20:41:32 +00:00
Luiz Otavio O Souza
bca353cacb Convert etherswitch to use the make_dev_s(9) KPI. This fix a possible race
where si_drv1 can be accessed before it gets set.

MFC after:	3 days
Suggested by:	kib
Sponsored by:	Rubicon Communications, LLC (Netgate)
2017-01-08 20:37:41 +00:00