Commit Graph

204557 Commits

Author SHA1 Message Date
Adrian Chadd
d3a4ade3b8 net80211: free node reference in the ieee80211_parent_xmitpkt() when error happened.
Move error handling into ieee80211_parent_xmitpkt() instead of spreading it
between functions.

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3772
2015-10-12 04:30:38 +00:00
Adrian Chadd
940aa8080c wpi(4): add support for TX fragmentation.
Tested:

* Tested with Intel 3945BG, HOSTAP and STA modes

Differential Revision:	https://reviews.freebsd.org/D3770
2015-10-12 04:05:12 +00:00
Adrian Chadd
d07be335a0 net80211: separate mbuf cleanup from ieee80211_fragment()
* Create ieee80211_free_mbuf() which frees a list of mbufs.
* Use it in the fragment transmit path and ath / uath transmit paths.
* Call it in xmit_pkt() if the transmission fails; otherwise fragments
  may be leaked.

This should be a big no-op.

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3769
2015-10-12 03:27:08 +00:00
Pedro F. Giffuni
5668d203ed Revert r289150:
Correct handling of enum attributes with g++

It is causing issues on some platforms.

Reported by:	sbruno (through adrian)
2015-10-12 02:05:25 +00:00
Jilles Tjoelker
8ef0ae8a8f sh: Make struct arglist an array instead of a linked list.
This simplifies the code (e.g. allowing use of qsort(3) instead of a
hand-rolled mergesort) and should have better cache properties.

The waste of unused args arrays after resizes is approximately the same as
the savings from getting rid of the next pointers.

At the same time, remove a piece of global state and move some duplicated
code into a function.
2015-10-11 21:33:00 +00:00
Enji Cooper
da3110ed56 Default TESTSDIR to /usr/tests/${RELDIR:H}
When run from bin/ls/tests, for example, the value of TESTSDIR would be
${TESTSBASE}/${RELDIR:H} -> /usr/tests/bin/ls/tests/.. ->
/usr/tests/bin/ls

Document the new behavior in bsd.README.

While here, also document TESTSBASE

Relnotes: yes
Differential Revision: D1022
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2015-10-11 21:29:24 +00:00
Conrad Meyer
ae92db9ed6 NTB: MFV c336acd3: memcpy lockup workaround
The system will appear to lockup for long periods of time due to the NTB
driver spending too much time in memcpy.  Avoid this by reducing the
number of packets that can be serviced on a given interrupt.

Authored by:	Jon Mason
Obtained from:	Linux
Sponsored by:	EMC / Isilon Storage Division
2015-10-11 21:01:14 +00:00
Conrad Meyer
7ee9e4bc6e NTB: MFV c9d534c8: Correctly handle receive buffers of the minimal size
The ring logic of the NTB receive buffer/transmit memory window requires
there to be at least 2 payload sized allotments.  For the minimal size
case, split the buffer into two and set the transport_mtu to the
appropriate size.

Authored by:	Jon Mason
Obtained from:	Linux
Sponsored by:	EMC / Isilon Storage Division
2015-10-11 21:00:19 +00:00
Conrad Meyer
a30525bf65 NTB: MFV 90f9e934: reset tx_index on link toggle
If the NTB link toggles, the driver could stop receiving due to the
tx_index not being set to 0 on the transmitting size on a link-up event.
This is due to the driver expecting the incoming data to start at the
beginning of the receive buffer and not at a random place.

Authored by:	Jon Mason
Obtained from:	Linux
Sponsored by:	EMC / Isilon Storage Division
2015-10-11 20:59:40 +00:00
Conrad Meyer
0125f2c1af NTB: MFV b77b2637: Link toggle memory leak
Each link-up will allocate a new NTB receive buffer when the NTB
properties are negotiated with the remote system.  These allocations did
not check for existing buffers and thus did not free them.  Now, the
driver will check for an existing buffer and free it if not of the
correct size, before trying to alloc a new one.

Authored by:	Jon Mason
Obtained from:	Linux
Sponsored by:	EMC / Isilon Storage Division
2015-10-11 20:59:02 +00:00
Conrad Meyer
92bbfa507c NTB: MFV 113fc505: Handle 64bit BAR sizes
64bit BAR sizes are permissible with an NTB device.  To support them
various modifications and clean-ups were required, most significantly
using 2 32bit scratch pad registers for each BAR.

Also, modify the driver to allow more than 2 Memory Windows.

Authored by:	Jon Mason
Obtained from:	Linux
Sponsored by:	EMC / Isilon Storage Division
2015-10-11 20:58:00 +00:00
Conrad Meyer
262d9f674f NTB: MFV cc0f868d: fix pointer math issues
->remote_rx_info and ->rx_info are struct ntb_rx_info pointers.  If we
add sizeof(struct ntb_rx_info) then it goes too far.

Authored by:	Dan Carpenter
Obtained from:	Linux
Sponsored by:	EMC / Isilon Storage Division
2015-10-11 20:57:09 +00:00
Enji Cooper
dfff069863 Simplify netbsd-tests.test.mk
- projects/bmake and subsequent commits provide SRCTOP; there's no need to
  manually specify it now.
- Compute a sane default for OBJTOP based on .OBJDIR and RELDIR. Manually
  specifying this is probably no longer needed, but it persists just in case
  (supporting commits will need to be made to move it out of some of the meta
  .mk files).
- Compute a sane default for TESTSRC. Error out if the path cannot be found.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2015-10-11 20:02:10 +00:00
Pedro F. Giffuni
e277c15f54 Correct handling of enum attributes with g++
From OpenBSD's commit log:

This was responsible for memory corruption with recent versions
of Mesa where c and c++ code share a header with a packed enum type.

Reference:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39219

Obtained from:	OpenBSD (CVS rev. 1.2)
MFC after:	1 week
2015-10-11 19:58:57 +00:00
Baptiste Daroussin
f98f68bd50 Use existing CONFDIR instead of adding a new CONFIGDIR
Reported by:	jbeich
2015-10-11 19:25:39 +00:00
Sean Bruno
88a1a27261 Correct flash layout (this is a 4M flash unit).
Remove "rootfs" entry and assign the 800K or so to the kernel
partition as this unit boots from usb mass storage.
2015-10-11 18:37:29 +00:00
Alexander Motin
0ac03010f6 Make delete method set via kern.cam.da.X.delete_method persistent.
This allows to set delete method via tunable, before device capabilities
are known.  Also allow ZERO method for devices not reporting LBP, if user
explicitly requests it -- it may be useful if storage supports compression
and WRITE SAME, but does not support UNMAP.

MFC after:	2 weeks
2015-10-11 18:26:06 +00:00
Baptiste Daroussin
eaccd9b323 Fix build with gcc 4.2 2015-10-11 17:45:20 +00:00
Alexander Motin
6854699543 Remove legacy CHS geometry from dmesg and unify capacity outputs. 2015-10-11 13:48:20 +00:00
Alexander Motin
4a3760bae6 Remove compatibility shims for legacy ATA device names.
We got new ATA stack in FreeBSD 8.x, switched to it at 9.x, completely
removed old stack at 10.x, so at 11.x it is time to remove compat shims.
2015-10-11 13:01:51 +00:00
Alexander Motin
361e885315 Remove lock upgrade attempt from ctl_be_block_open_file().
I am not sure what for it was done.  Now open routine should automatically
fall back to read-only if open for writing is impossible.  In such case
attempt to upgrade to write sounds strange.

MFC after:	1 week
2015-10-11 08:28:49 +00:00
Sean Bruno
fc28939612 Use machine specific values cleaned from openwrt for the mac address
location on the TP link mr3020
2015-10-11 03:31:11 +00:00
Adrian Chadd
f7cd3e189c wpi(4): do not count failures twice for ic_raw_xmit().
Tested:

* Tested with Intel 3945BG, STA mode

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3768
2015-10-11 02:00:08 +00:00
Adrian Chadd
823e17dbe1 wpi(4): move error handling upper (wpi_tx_data()/wpi_cmd2() -> wpi_raw_xmit()/wpi_transmit()).
Tested:

* Tested with Intel 3945BG, STA mode

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3767
2015-10-11 01:58:50 +00:00
Adrian Chadd
431ebc90bf wpi(4): fix possible race between TX/RX threads.
Tested:

* Tested with Intel 3945BG, STA mode

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3766
2015-10-11 01:56:46 +00:00
Adrian Chadd
19053a5448 wpi(4): do not allocate space for unused rings.
Tested:

* Tested with Intel 3945BG, STA mode

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3765
2015-10-11 01:53:51 +00:00
Adrian Chadd
57c61f5d05 wpi(4): do not override iv_recv_mgmt() in non-adhoc modes.
Tested:

* Tested with Intel 3945BG, IBSS and STA modes

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3764
2015-10-11 01:50:54 +00:00
Adrian Chadd
525a3d47d8 wpi(4): use more correct types.
This change fixes some amount of -Wsign-conversion and -Wconversion warnings
and sets correct sizes for some variables (as a result, some loop counters
were touched too).

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3763
2015-10-11 01:31:18 +00:00
Baptiste Daroussin
e56bad4a94 Update Dragonfly Mail Agent to v0.10 2015-10-10 23:31:47 +00:00
Baptiste Daroussin
21301f7354 Import dma 0.10 2015-10-10 23:22:05 +00:00
Ian Lepore
73440c336d Replace a local sx lock that allowed only one client at a time to access
an eeprom device with iicbus_request/release_bus(), which achieves the
same effect and also keeps other i2c slave drivers from clashing on the bus.
2015-10-10 19:51:00 +00:00
Sean Bruno
6b79bfd0de There's no way a fbsd install + kernel will fit into 4MB of flash.
Assume and enforce the fact that this will always boot a rootfs from
usb.
2015-10-10 19:08:34 +00:00
Poul-Henning Kamp
da382a8c94 Remove a double "as well as" 2015-10-10 17:32:06 +00:00
Baptiste Daroussin
5d8d649803 Fix installing config files as non root
Reported by:	adrian
2015-10-10 14:43:46 +00:00
Baptiste Daroussin
2c9976e37e Install bsd.confs.mk
Rename ETCDIR into CONFIGDIR to avoid conflicts with the ports tree
2015-10-10 10:48:09 +00:00
Edward Tomasz Napierala
d5b0fb47eb Add 'p' postfix to mdconfig(8).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-10-10 09:37:31 +00:00
Edward Tomasz Napierala
92001b9497 Change the default setting of kern.ipc.shm_allow_removed from 0 to 1.
This removes the need for manually changing this flag for Google Chrome
users. It also improves compatibility with Linux applications running under
Linuxulator compatibility layer, and possibly also helps in porting software
from Linux.

Generally speaking, the flag allows applications to create the shared memory
segment, attach it, remove it, and then continue to use it and to reattach it
later. This means that the kernel will automatically "clean up" after the
application exits.

It could be argued that it's against POSIX. However, SUSv3 says this
about IPC_RMID: "Remove the shared memory identifier specified by shmid from
the system and destroy the shared memory segment and shmid_ds data structure
associated with it." From my reading, we break it in any case by deferring
removal of the segment until it's detached; we won't break it any more
by also deferring removal of the identifier.

This is the behaviour exhibited by Linux since... probably always, and
also by OpenBSD since the following commit:

revision 1.54
date: 2011/10/27 07:56:28; author: robert; state: Exp; lines: +3 -8;
Allow segments to be used even after they were marked for deletion with
the IPC_RMID flag.
This is permitted as an extension beyond the standards and this is similar
to what other operating systems like linux do.

MFC after:	1 month
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3603
2015-10-10 09:29:47 +00:00
Edward Tomasz Napierala
b9a5c7b595 Provide better debug message on kernel module name clash.
Reviewed by:	kib@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-10-10 09:21:55 +00:00
Edward Tomasz Napierala
45d7de1d37 Make geom_nop(4) collect statistics on all types of BIOs, not just
reads and writes.

PR:		kern/198405
Submitted by:	Matthew D. Fuller <fullermd at over-yonder dot net>
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3679
2015-10-10 09:03:31 +00:00
Jean-Sébastien Pédron
c165a9c7e6 drm/i915: Remove "Attempting to unbind pinned buffer" message
This error message is removed in later versions of Linux and currently,
it spams users.

PR:		200712
MFC after:	1 week
2015-10-10 07:43:02 +00:00
Adrian Chadd
27b3a39a8f Update the AP135 reference design flash layout to be more useful.
* Shuffle the kernel to be at the beginning
* Give the kernel 2mb, the rootfs 6mb, and 'mib0' the rest
* put the cfg parition just before the ART calibration data for the
  wifi part in the SoC
* .. and make sure ART points to the right 64k region.

I've updated the freebsd-wifi-build wiki the instructions on using this.

If someone has an AP135 with 8MB SPI flash then this won't work; everything
minus the big mib0 partition is just a bit over 8MB.  Come see me if this
ever happens (you'll likely just have to shrink the rootfs and the kernel
a little in order to make it fit.)

Tested:

* AP135 reference board.
2015-10-10 05:00:18 +00:00
Ian Lepore
b16c6d237b Translate iic hardware layer status values to errno return values. 2015-10-10 02:29:02 +00:00
Ian Lepore
d0b70953fb Add a short name, IIC_INTRWAIT, for the common case (IIC_INTR | IIC_WAIT). 2015-10-10 02:06:07 +00:00
Navdeep Parhar
0d18010dec iw_cxgbe: fix for page fault in cm_close_handler().
This is roughly the iw_cxgbe equivalent of
be13b2dff8
-----------------
RDMA/cxgb4: Connect_request_upcall fixes

When processing an MPA Start Request, if the listening endpoint is
DEAD, then abort the connection.

If the IWCM returns an error, then we must abort the connection and
release resources.  Also abort_connection() should not post a CLOSE
event, so clean that up too.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
-----------------

Submitted by:	Krishnamraju Eraparaju at chelsio dot com.
2015-10-10 01:41:07 +00:00
Enji Cooper
c62b746339 Remove all of the syncs
They're unnecessary as shown by further testing on my VM

Requested by: jhb
2015-10-10 01:31:39 +00:00
Adrian Chadd
dc809fc15f Flip on fast frames support for AR5416 and AR9300 series NICs.
This was off because the net80211 aggregation code was using the same
state pointers for both fast frames and ampdu tx support which led to some
pretty unfortunate panic-y behaviour.

Now that net80211 doesn't panic, let's flip this back on.

It doesn't (yet) do the horrific sounding thing of A-MPDU aggregates
of fast frames; that'll come next.  It's a pre-requisite to supporting
AMSDU + AMPDU anyway, which actually speeds things up quite considerably
(think packing lots of little ACK frames into a single AMSDU.)

Tested:

* QCA955x SoC, AP mode
* AR5416, STA mode
* AR9170, STA mode (with local fast frame patches)
2015-10-10 00:13:45 +00:00
Ian Lepore
4006520bea Fix more cases of iicbus-layer functions that must return IIC_Exxxx values. 2015-10-10 00:12:03 +00:00
Ian Lepore
48e5b4261a Return only IIC_Exxxx status values from iicbus-layer functions. Most of
these functions are thin wrappers around calling the hardware-layer driver,
but some of them do sanity checks and return an error.  Since the hardware
layer can only return IIC_Exxxxx status values, the iicbus helper functions
must also adhere to that, so that drivers at higher layers can assume that
any non-zero status value is an IIC_Exxxx value that provides details about
what happened at the hardware layer (sometimes those details are important
for certain slave drivers).
2015-10-09 23:58:19 +00:00
Baptiste Daroussin
23c7816115 Move ppp.conf into the ppp sources 2015-10-09 23:57:07 +00:00
Ian Lepore
df38292a85 Add iic2errno(), a helper function to translate IIC_Exxxxx status values to
errno values that are at least vaguely equivelent.  Also add a new status
value, IIC_ERESOURCE, to indicate a failure to acquire memory or other
required resources to complete a transaction.

The IIC_Exxxxxx values are supposed to communicate low-level details of the
i2c transaction status between the lowest-layer hardware driver and
higher-layer bus protocol and device drivers for slave devices on the bus.
Most of those slave drivers just return all status values from the lower
layers directly to their callers, resulting in crazy error reporting from a
user's point of view (things like timeouts being reported as "no such
process").  Now there's a helper function to make it easier to start
cleaning up all those drivers.
2015-10-09 23:20:08 +00:00