Commit graph

172093 commits

Author SHA1 Message Date
Andrey V. Elsukov a0ff532148 Create the interface to work with various partition tables from the
loader(8). The following partition tables are supported: BSD label, GPT,
MBR, EBR and VTOC8.
2012-08-05 11:29:44 +00:00
Adrian Chadd fffbec8618 Migrate the 802.11n ath_hal_chaintxdesc() API to use a buffer/segment
array, similar to what filltxdesc() uses.

This removes the last reference to ds_data in the TX path outside of
debugging statements.  These need to be adjusted/fixed.

Tested:

* AR9280 STA/AP with iperf TCP traffic
2012-08-05 11:24:21 +00:00
Michael Tuexen 63c6726e05 Fix a refcount issue. The called only decrements is stcb is NULL.
MFC after:	3 days
Discussed with:	rrs
2012-08-05 10:47:18 +00:00
Adrian Chadd 46634305f4 Migrate the ath_hal_filltxdesc() API to take a list of buffer/seglen values.
The existing API only exposes 'seglen' (the current buffer (segment) length)
with the data buffer pointer set in 'ds_data'.  This is fine for the legacy
DMA engine but it won't work for the EDMA engines.

The EDMA engine has a significantly different TX descriptor layout.

* The legacy DMA engine had a ds_data pointer at the same offset in the
  descriptor for both TX and RX buffers;
* The EDMA engine has no ds_data for RX - the data is DMAed after the
  descriptor;
* The EDMA engine has support for 4 TX buffer/segment pairs in the TX
  DMA descriptor;
* The EDMA TX completion is in a different FIFO, and the driver will
  'link' the status completion entry to a QCU by a "QCU ID".
  I don't know why it's just not filled in by the hardware, alas.

So given that, here are the changes:

* Instead of directly fondling 'ds_data' in ath_desc, change the
  ath_hal_filltxdesc() to take an array of buffer pointers as well
  as segment len pointers;
* The EDMA TX completion status wants a descriptor and queue id.
  This (for now) uses bf_state.bfs_txq and will extract the hardware QCU
  ID from that.
* .. and this is ugly and wasteful; it should change to just store
  the QCU in the bf_state and save 3/7 bytes in the process.

Now, the weird crap:

* The aggregate TX path was using bf_state->bfs_txq for the TXQ, rather than
  taking a function argument.  I've tidied that up.
* The multicast queue frames get put on a software TXQ and then that is
  appended to the hardware CABQ when appropriate.  So for now, make sure
  that bf_state->bfs_txq points at the CABQ when adding frames to the
  multicast queue.
* .. but the multicast queue TX path for now doesn't use the software
  queue and instead
  (a) directly sets up the descriptor contents at that point;
  (b) the frames on the vap->avp_mcastq are then just appended wholesale
      to the CABQ.
  So for now, I don't have to worry about making the multicast path
  work with aggregation or the per-TID software queue. Phew.

What's left to do:

* I need to modify the 11n ath_hal_chaintxdesc() API to do the same.
  I'll do that in a subsequent commit.
* Remove bf_state.bfs_txq entirely and store the QCU as appropriate.
* .. then do the runtime "is this going on the right HWQ?" checks using
  that, rather than comparing pointer values.

Tested on:

* AR9280 STA/AP
* AR5416 STA/AP
2012-08-05 10:12:27 +00:00
Hans Petter Selasky 7a27d904bd Minor style nit:
Use the interface number from the USB interface descriptor
like in the other USB serial drivers. These numbers are not
supposed to be different, though in theory they can. Make sure
that the driver then uses the interface number given by the USB
descriptor, and not the logical index of the USB stack.

For the future:
Whenever the term "index" is used in the USB code, it refers to
a number computed by the USB stack.
Whenever the term "number" is used in the USB code, it refers to
a number in a USB descriptor.

MFC after:	2 weeks
2012-08-05 08:56:29 +00:00
Eitan Adler fc1596e68d Use new method of assigning IPv4 addresses
PR:		conf/167648
Submitted by:	Jeff Kletsky <freebsd@wagsky.com>
Approved by:	bcr
MFC after:	3 days
2012-08-05 08:19:52 +00:00
Eitan Adler edfaa73726 Add additional Perle Speed LE serial cards
PR:		kern/168816
Submitted by:	Dennis Oyama <doyama@perle.com>
Approved by:	cperciva
MFC after:	1 week
2012-08-05 08:10:02 +00:00
Eitan Adler 2bd29f8f66 Remove variables which are initialized but never used thereafter
reported by gcc46 warning

Reviewed by:	scottl
Approved by:	cperciva
MFC after:	1 week
2012-08-05 08:08:34 +00:00
Andreas Tobler 7f7acad770 Fix typo.
Reviewed by: jhb
2012-08-05 06:15:12 +00:00
Michael Tuexen 832208514f Fix a bug reported by Simon L. B. Nielsen:
If an SCTP endpoint receives an ASCONF with a wildcard
lookup address and incorrect verification tag, the system
crashes.

MFC after:	3 days.
2012-08-04 20:40:36 +00:00
Konstantin Belousov 0055cbd3c5 Reduce code duplication and exposure of direct access to struct
vm_page oflags by providing helper function
vm_page_readahead_finish(), which handles completed reads for pages
with indexes other then the requested one, for VOP_GETPAGES().

Reviewed by:	alc
MFC after:	1 week
2012-08-04 18:16:43 +00:00
Konstantin Belousov 843dcea09e The header uma_int.h is internal uma header, unused by this source
file.  Do not include it needlessly.

Reviewed by:  alc
MFC after:    1 week
2012-08-04 18:12:54 +00:00
Konstantin Belousov 2ddfc13d8d Remove verbose unused commented out debugging printf.
MFC after:	1 week
Reviewed by:	alc
2012-08-04 18:10:04 +00:00
Gavin Atkinson b5ba3bdb25 Support multiple interface devices. The driver had previously hardcoded
support for only the first port, but the CP2105 can have multiple ports.
Although this allowed the first port to mostly work on multi port devices,
there could be issues with this arrangement.

Update the man page to reflect support for both ports and the CP2105.

Many thanks to Silicon Labs (www.silabs.com) for providing a CP2105-EK
dev board for testing.

MFC after:	2 weeks
2012-08-04 15:11:36 +00:00
Alexander Motin 2038943013 Particlly MFcalloutng r238425 (by davide):
Fix an issue related to old periodic timers. The code in kern_clocksource.c
uses interrupt to keep track of time, and this time may not match with
binuptime(). In order to address such incoherency, switch periodic timers
to binuptime().

Except further calloutng it is needed for already present cyclic subsystem.
2012-08-04 08:06:37 +00:00
Michael Tuexen 173be2b6cd Testing an interface property should depend on the interface, not
on an address.

MFC after:	3 days
2012-08-04 08:03:30 +00:00
Alexander Motin 9b71c63a8b Partialy MFcalloutng r236894 (by davide):
...
While here, Bruce Evans told me that "unsigned int" is spelled "u_int" in
KNF, so replace it where needed.
2012-08-04 07:46:58 +00:00
Andrew Turner c75943da26 Correctly return EFAULT in copyin & copyout on a fault. This fixes NFS
when running FreeBSD on QEMU emulating a Gumstix board.

While here remove the use of a magic number in the not-XScale version.

Pointed out by:	kib
Reviewed by:	stas
2012-08-04 05:38:25 +00:00
Andrew Turner bfba812656 Ensure we align the stack to 8 bytes in system calls.
This is not strictly required with the current ABI but will be when we
switch to the ARM EABI. The aapcs requires the stack to be 4 byte aligned
at all times and 8 byte aligned when calling a public subroutine where the
current ABI only requires sp to be a multiple of 4.
2012-08-04 05:31:26 +00:00
Andrew Turner 782b05f96b Ensure we align the stack to 8 bytes in rtld.
This is not strictly required with the current ABI but will be when we
switch to the ARM EABI. The aapcs requires the stack to be 4 byte aligned
at all times and 8 byte aligned when calling a public subroutine where the
current ABI only requires sp to be a multiple of 4.
2012-08-04 05:30:20 +00:00
Justin Hibbits d0ec68d41c Add backlight support for nVidia-based PowerBooks/iBooks/iMacs.
Approved by:	nwhitehorn (mentor)
MFC after:	9.1-RELEASE
2012-08-04 03:05:01 +00:00
Matt Jacob 2468ec31b3 Add detach logic to SBus variant.
Obtained from:	Marius
MFC after:	1 month
2012-08-04 00:00:30 +00:00
Jim Harris ad8131190f Document "destroy" as an alias for "stop". 2012-08-03 20:30:40 +00:00
Jim Harris c1d00eabe8 In virstor_ctl_stop(), check for a valid softc before trying to update
metadata.

Sponsored by:		Intel
Reported and tested by:	Marcelo Gondim <gondim at bsdinfo dot com dot br>
PR:			kern/170199
MFC after:		3 days
2012-08-03 20:24:16 +00:00
John Baldwin 0046805a58 Correct function name in comment.
Submitted by:	alc
2012-08-03 18:40:44 +00:00
Alexander Kabaev d958a71be2 Parse notes only after object structure had been allocated.
Reported by: kargl
Reviewed by: kib (sans whitespace)
2012-08-03 17:04:41 +00:00
Alexander Motin b19ee1c6ef Microoptimize LAPIC timer routines to avoid reading from hardware during
programming using earlier cached values. This makes respective routines to
disappear from PMC top and reduces total number of active CPU cycles on idle
24-core system by 10%.
2012-08-03 15:19:59 +00:00
Thomas Quinot 71ee4ef0d9 New command "gmultipath prefer" to force selection of a specified
provider in an Active/Passive configuration.

Reviewed by:	mav
MFC after:	4 weeks
2012-08-03 14:55:35 +00:00
Matt Jacob de0627d021 Oops. We only do allocate room for extended commands
and responses for 2300 cards are newer.

Sponsored by:	Spectralogic
Noticed by:	Our Friend Manfred
MFC after:	1 month
X-MFC: 238869
2012-08-03 14:25:35 +00:00
Luigi Rizzo 1463ca4a8f support building vtnet as an embedded driver 2012-08-03 14:00:26 +00:00
John Baldwin 2db99100a4 Improve the handling of static DMA buffers that use non-default memory
attributes (currently just BUS_DMA_NOCACHE):
- Don't call pmap_change_attr() on the returned address, instead use
  kmem_alloc_contig() to ask the VM system for memory with the requested
  attribute.
- As a result, always use kmem_alloc_contig() for non-default memory
  attributes, even for sub-page allocations.  This requires adjusting
  bus_dmamem_free()'s logic for determining which free routine to use.
- For x86, add a new dummy bus_dmamap that is used for static DMA
  buffers allocated via kmem_alloc_contig().  bus_dmamem_free() can then
  use the map pointer to determine which free routine to use.
- For powerpc, add a new flag to the allocated map (bus_dmamem_alloc()
  always creates a real map on powerpc) to indicate which free routine
  should be used.

Note that the BUS_DMA_NOCACHE handling in powerpc is currently #ifdef'd out.
I have left it disabled but updated it to match x86.

Reviewed by:	scottl
MFC after:	1 month
2012-08-03 13:50:29 +00:00
Alexander Motin 2c2e2be746 Remove duplicate check.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2012-08-03 12:55:31 +00:00
Alexander Motin c0722d20d3 Microoptimize time math. As soon as our event periods are always below ome
second we may not add intereger parts by using bintime_addx() instead of
bintime_add().  Profiling shows handleevents() time redction by 15%.
2012-08-03 09:08:20 +00:00
Alan Cox 369763e31a Inline vm_page_aflags_clear() and vm_page_aflags_set().
Add comments stating that neither these functions nor the flags that they
are used to manipulate are part of the KBI.
2012-08-03 01:48:15 +00:00
Xin LI 0f3fae6159 Correct a typo.
Reported by:	Sascha Wildner <swildner dragonflybsd org>
Reviewed by:	scottl
MFC after:	3 days
2012-08-03 00:11:13 +00:00
Adrian Chadd a6e829596d Fix an issue that crept in with the previous descriptor tidyup.
When forming aggregates, the last descriptor was now not being
correctly setup - instead, the "setuplasttxdesc" call was being
handed the first descriptor in the last subframe, rather than the
last descriptor in the last subframe.

This showed up as "bad series0 hwrate" messages, as the final
descriptor just didn't have any of the rate control information
squirreled away.

Tested:
	* AR9280 STA -> 11n AP, iperf TCP
2012-08-02 20:14:45 +00:00
Jaakko Heinonen 8cb51643e4 Disallow sectorsize larger than MAXPHYS and mediasize smaller than
sectorsize.

PR:		169947
Submitted by:	Filip Palian (original version)
Reviewed by:	kib
2012-08-02 15:05:34 +00:00
Gleb Smirnoff ea53792942 Fix races between in_lltable_prefix_free(), lla_lookup(),
llentry_free() and arptimer():

o Use callout_init_rw() for lle timeout, this allows us safely
  disestablish them.
  - This allows us to simplify the arptimer() and make it
    race safe.
o Consistently use ifp->if_afdata_lock to lock access to
  linked lists in the lle hashes.
o Introduce new lle flag LLE_LINKED, which marks an entry that
  is attached to the hash.
  - Use LLE_LINKED to avoid double unlinking via consequent
    calls to llentry_free().
  - Mark lle with LLE_DELETED via |= operation istead of =,
    so that other flags won't be lost.
o Make LLE_ADDREF(), LLE_REMREF() and LLE_FREE_LOCKED() more
  consistent and provide more informative KASSERTs.

The patch is a collaborative work of all submitters and myself.

PR:		kern/165863
Submitted by:	Andrey Zonov <andrey zonov.org>
Submitted by:	Ryan Stone <rysto32 gmail.com>
Submitted by:	Eric van Gyzen <eric_van_gyzen dell.com>
2012-08-02 13:57:49 +00:00
Gleb Smirnoff b1d86af706 The llentry_update() is used only by flowtable and the latter
always passes NULL pointer to it. Thus, code can be simplified
and function renamed to llentry_alloc() to match rtalloc().
2012-08-02 13:20:44 +00:00
Luigi Rizzo 46f2f751e1 replace __unused with a portable construct;
fix a couple of signed/unsigned warnings.
2012-08-02 12:45:13 +00:00
Joel Dahl bda8f16fe8 Remove trailing whitespace. 2012-08-02 12:17:52 +00:00
Joel Dahl 02a7f9c149 mdoc: remove superfluous paragraph macro. 2012-08-02 12:16:46 +00:00
Luigi Rizzo b3d5301688 fix some signed/unsigned warnings in the netmap code.
Unfortunately the original drivers still have a lot of
sign conversion/comparison warnings.
2012-08-02 11:59:43 +00:00
Konstantin Belousov 2db8baa956 fsck_ffs shall accept the configured journal size, and not refuse to
operate on it if journal size is greater then SUJ_MAX. The later
constant is only to select maximal journal size when user did not
specified size explicitely.

Submitted by:	Andrey Zonov <andrey@zonov.org>
Reviewed by:	mckusick
MFC after:	1 week
2012-08-02 10:39:54 +00:00
Luigi Rizzo 13a5d88f1a Update netmap page, fixing the API documentation and usage example.
Add a new manpage for the vale switch
2012-08-02 08:46:08 +00:00
Luigi Rizzo 42a3a5bd91 Add a newline on an error message;
rename linux functions to avoid confusion;
fix error reporting on linux
2012-08-02 07:35:40 +00:00
Sean Bruno 8844c80848 CPU_NEXT() already handles wrapping around to the beginning. Also, in a
system with sparse CPU IDs, you can have a valid CPU ID > mp_ncpus (e.g. if
you have two CPUs 0 and 4, with mp_maxid == 4 and mp_ncpus == 2).

Introduced at svn r235210

Submitted by:	jhb@
Reviewed by:	jfv@
2012-08-02 00:00:34 +00:00
Tai-hwa Liang 50e91f8ce1 Just like the other file systems found in /sys/fs, g_vfs_open()
should be paried with g_vfs_close().  Though g_vfs_close() is a wrapper
around g_wither_geom_close(), r206130 added the following test in
g_vfs_open():

	if (bo->bo_private != vp)
		return (EBUSY);

  Which will cause a 'Device busy' error inside reiserfs_mountfs() if
the same file system is re-mounted again after umount or mounting failure:

	(case 1, /dev/ad4s3 is not a valid REISERFS partition)
	# mount -t reiserfs -o ro /dev/ad4s3 /mnt
	mount: /dev/ad4s3: Invalid argument
	# mount -t msdosfs -o ro /dev/ad4s3 /mnt
	mount: /dev/ad4s3: Device busy

	(case 2, /dev/ad4s3 is a valid REISERFS partition)
	# mount -t reiserfs -o ro /dev/ad4s3 /mnt
	# umount /mnt
	# mount -t reiserfs -o ro /dev/ad4s3 /mnt
	mount: /dev/ad4s3: Device busy

  On the other hand, g_vfs_close() 'fixed' the above cases by doing an
extra step to keep 'sc->sc_bo->bo_private' and 'cp->private' pointers
synchronised.

Reviewed by:	kib
MFC after:	1 month
2012-08-01 23:05:57 +00:00
George V. Neville-Neil 26d121f5df When we return with an error we cannot unlock the mutex, because
it's been freed.  Protect against that, hopefully unlikely, case.

Reviewed by:	rpaulo
MFC after: 2 weeks
2012-08-01 19:27:12 +00:00
Luigi Rizzo f5705b527d replace inet_ntoa_r with the more standard inet_ntop().
As discussed on -current, inet_ntoa_r() is non standard,
has different arguments in userspace and kernel, and
almost unused (no clients in userspace, only
net/flowtable.c, net/if_llatbl.c, netinet/in_pcb.c, netinet/tcp_subr.c
in the kernel)
2012-08-01 18:52:07 +00:00