]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoCommit device IDs for the (eventually upcoming) AR9380 HAL.
Adrian Chadd [Tue, 7 Aug 2012 23:45:43 +0000 (23:45 +0000)]
Commit device IDs for the (eventually upcoming) AR9380 HAL.

Obtained from: Qualcomm Atheros, Linux ath9k

12 years agoDuring TSC synchronization test, use rdtsc() rather than rdtsc32(), to
Jim Harris [Tue, 7 Aug 2012 23:16:11 +0000 (23:16 +0000)]
During TSC synchronization test, use rdtsc() rather than rdtsc32(), to
protect against 32-bit TSC overflow while the sync test is running.

On dual-socket Xeon E5-2600 (SNB) systems with up to 32 threads, there
is non-trivial chance (2-3%) that TSC synchronization test fails due to
32-bit TSC overflow while the synchronization test is running.

Sponsored by: Intel
Reviewed by: jkim
Discussed with: jkim, kib

12 years agoClone BIO_ORDERED flag, for disk drivers (namely CAM) that try to
Jim Harris [Tue, 7 Aug 2012 20:16:10 +0000 (20:16 +0000)]
Clone BIO_ORDERED flag, for disk drivers (namely CAM) that try to
 consume it.

Sponsored by: Intel
Discussed with: gibbs, scottl

12 years agoIn g_gate_dumpconf() always check the result of g_gate_hold().
Mikolaj Golub [Tue, 7 Aug 2012 18:50:33 +0000 (18:50 +0000)]
In g_gate_dumpconf() always check the result of g_gate_hold().

This fixes "Negative sc_ref" panic possible when sysctl_kern_geom_confxml()
is run simultaneously with destroying GATE device.

Reviewed by: pjd
MFC after: 3 days

12 years agoMinor style(9) improvement
Ed Maste [Tue, 7 Aug 2012 13:11:47 +0000 (13:11 +0000)]
Minor style(9) improvement

12 years agoDon't try to stop the IPMI watchdog timer if it is not running.
John Baldwin [Tue, 7 Aug 2012 12:40:31 +0000 (12:40 +0000)]
Don't try to stop the IPMI watchdog timer if it is not running.
Starting or stopping the IPMI watchdog is rather expensive with the
current implementation as all IPMI requests are bounced via thread.
This is not viable during shutdown or dumps, and this avoids headache
in the common case that the watchdog is not enabled.  The IPMI watchdog
should probably be reworked to not use a separate thread to fix this
in the case when the watchdog timer is enabled.

MFC after: 2 weeks

12 years agoAs it turned out, there are some installations, where BSD label
Andrey V. Elsukov [Tue, 7 Aug 2012 09:22:46 +0000 (09:22 +0000)]
As it turned out, there are some installations, where BSD label
contains partitions with type zero. And it has worked.
So, allow detect these partitions.

Reported by: glebius

12 years agoFix obvious problem with emulate_fp sysctl.
Warner Losh [Tue, 7 Aug 2012 08:37:35 +0000 (08:37 +0000)]
Fix obvious problem with emulate_fp sysctl.

Submitted by: Paul Ambrose <ambrosehua@gmail.com>

12 years agoDo not apply errata 721 workaround when under hypervisor, since
Konstantin Belousov [Tue, 7 Aug 2012 08:36:10 +0000 (08:36 +0000)]
Do not apply errata 721 workaround when under hypervisor, since
typical hypervisor does not implement access to the required MSR,
causing #GP on boot.

Reported and tested by: olgeni
PR: amd64/170388
MFC after: 3 days

12 years agos/lenght/length/ in comments
Luigi Rizzo [Tue, 7 Aug 2012 07:52:25 +0000 (07:52 +0000)]
s/lenght/length/ in comments

12 years agoRemove duplicate header inclusion of <sys/sysent.h>
Sergey Kandaurov [Tue, 7 Aug 2012 05:46:36 +0000 (05:46 +0000)]
Remove duplicate header inclusion of <sys/sysent.h>

Discussed with: bz

12 years agoNever sleep on busy pages in vm_pageout_launder(), always skip them. Long
Alan Cox [Tue, 7 Aug 2012 04:48:14 +0000 (04:48 +0000)]
Never sleep on busy pages in vm_pageout_launder(), always skip them.  Long
ago, sleeping on busy pages in vm_pageout_launder() made sense.  The call
to vm_pageout_flush() specified asynchronous I/O and sleeping on busy pages
blocked vm_pageout_launder() until the flush had completed.  However, in
CVS revision 1.35 of vm/vm_contig.c, the call to vm_pageout_flush() was
changed to request synchronous I/O, but the sleep on busy pages was not
removed.

12 years agoCorrect re-initialise the link pointer to be the final descriptor in
Adrian Chadd [Tue, 7 Aug 2012 00:42:46 +0000 (00:42 +0000)]
Correct re-initialise the link pointer to be the final descriptor in
the last buffer.

This fixes traffic stalls that were occuring with stuck beacon events.

PR: kern/170433

12 years agoRemove unnecessary debugging printf()s.
Adrian Chadd [Mon, 6 Aug 2012 22:54:10 +0000 (22:54 +0000)]
Remove unnecessary debugging printf()s.

12 years agoRemove a spurious bace which cause build fail in case BCE_DEBUG option
Davide Italiano [Mon, 6 Aug 2012 22:53:24 +0000 (22:53 +0000)]
Remove a spurious bace which cause build fail in case BCE_DEBUG option
is turned on.

Reviewed by: delphij
Approved by: gnn (mentor)
Sponsored by: Google Summer of Code 2012
MFC after: 1 week

12 years agoMake the polling interface in igb able to handle
Jack F Vogel [Mon, 6 Aug 2012 22:43:49 +0000 (22:43 +0000)]
Make the polling interface in igb able to handle
multiqueue, and correct the rxdone handling. Update
the polling man page to include igb as well.

Thanks to Mark Johnston for these changes.

12 years agoMFP4 change 214967:
Brooks Davis [Mon, 6 Aug 2012 21:24:43 +0000 (21:24 +0000)]
MFP4 change 214967:
Make the process of embedding MDROOT images less perilous by
makeing the target that links kernel and embedding the image
depend on the image.  This means, if the image doesn't exist you
find out before you try to boot from it and that if you change
the image you don't have to touch some random source file to
cause a rebuild.

Don't hide that we're embedding the image.

12 years agoMake sure the compiler knows g_gate_xvlog() and g_gate_xlog() do not
Dimitry Andric [Mon, 6 Aug 2012 21:02:40 +0000 (21:02 +0000)]
Make sure the compiler knows g_gate_xvlog() and g_gate_xlog() do not
return.  This silences a warning from clang 3.2 about uninitialized use
of the variable 'mediasize' in sbin/ggate/shared/ggate.c.

Reviewed by: pjd
MFC after: 1 week

12 years agoCorrect the mq_start routine to avoid out-of-order
Jack F Vogel [Mon, 6 Aug 2012 20:44:05 +0000 (20:44 +0000)]
Correct the mq_start routine to avoid out-of-order
packet delivery, always enqueue when possible. Also
correct the DEPLETED test as multiple bits might be
set.  Thanks to Randall Stewart for the changes!

12 years agoIn sys/dev/aic7xxx/aic79xx_osm.c, function ahd_attach(), initialize the
Dimitry Andric [Mon, 6 Aug 2012 20:01:32 +0000 (20:01 +0000)]
In sys/dev/aic7xxx/aic79xx_osm.c, function ahd_attach(), initialize the
'path' variable to NULL, to avoid using it uninitialized in certain
cases.

Found by: clang
MFC after: 1 week

12 years agoExplicitly enable busmastering on PCI-PCI bridges. Transactions initiated
John Baldwin [Mon, 6 Aug 2012 19:49:57 +0000 (19:49 +0000)]
Explicitly enable busmastering on PCI-PCI bridges.  Transactions initiated
on the secondary side of a bridge will not be propagated to the primary
bus unless this is enabled.  Busmastering is not enabled by default (we
have relied on firmware to set this bit to date).  The OS needs to set it
for any bridges not configured by system firmware.

Tested by: Steve Polyack  korvus comcast net
MFC after: 2 weeks

12 years agoIn sys/dev/cxgbe/firmware/t4fw_interface.h, change the enum
Dimitry Andric [Mon, 6 Aug 2012 18:54:17 +0000 (18:54 +0000)]
In sys/dev/cxgbe/firmware/t4fw_interface.h, change the enum
'fw_hdr_intfver' into an anonymous enum, which avoids a clang 3.2
warning about all the enum values being the same value.

Reviewed by: np
MFC after: 1 week

12 years agoIn cxgb(4), in function iwch_reregister_phys_mem(), initialize the
Dimitry Andric [Mon, 6 Aug 2012 18:51:14 +0000 (18:51 +0000)]
In cxgb(4), in function iwch_reregister_phys_mem(), initialize the
'npages' variable to zero, to avoid using it uninitialized in certain
cases.

Found by: clang
Reviewed by: np
MFC after: 1 week

12 years agoFix an instance in pam_krb5(8), where the variable 'user' could be used
Dimitry Andric [Mon, 6 Aug 2012 18:44:59 +0000 (18:44 +0000)]
Fix an instance in pam_krb5(8), where the variable 'user' could be used
uninitialized.

Found by: clang 3.2
Reviewed by: des
MFC after: 1 week

12 years agoFix two instances in pam_krb5(8), where the variable 'princ_name' could
Dimitry Andric [Mon, 6 Aug 2012 18:40:14 +0000 (18:40 +0000)]
Fix two instances in pam_krb5(8), where the variable 'princ_name' could
be used uninitialized.

Found by: clang 3.2
Reviewed by: des
MFC after: 1 week

12 years agoDo not add handler to event handlers list until ithread is created.
Alexander Kabaev [Mon, 6 Aug 2012 16:37:43 +0000 (16:37 +0000)]
Do not add handler to event handlers list until ithread is created.

In rare event when fast and ithread interrupts share the same vector
and the fast handler was registered first, we can end up trying to
schedule the ithread that is not created yet. The kernel built with
INVARIANTS then triggers an assertion.

Change the order to create the ithread first and only then add the
handler that needs it to the interrupt event handlers list.

Reviewed by: jhb

12 years agomove functions outside the SYSBEGIN/SYSEND block
Luigi Rizzo [Mon, 6 Aug 2012 11:02:23 +0000 (11:02 +0000)]
move functions outside the SYSBEGIN/SYSEND block

(SYSBEGIN/SYSEND are specific to ipfw/dummynet and are used to
emulate sysctl on platforms that do not have them, and they work
by creating an array which contains all the sysctl-ed symbols.)

12 years agouse FREE_PKT instead of m_freem to free an mbuf.
Luigi Rizzo [Mon, 6 Aug 2012 10:50:43 +0000 (10:50 +0000)]
use FREE_PKT instead of m_freem to free an mbuf.
The former is the standard form used in ipfw/dummynet, so that
it is easier to remap it to different memory managers depending
on the platform.

12 years agoFix a bug found by dim@:
Michael Tuexen [Mon, 6 Aug 2012 10:50:23 +0000 (10:50 +0000)]
Fix a bug found by dim@:
Don't use an uninitilized variable, if INVARIANTS is on and an illegal
packet with destination 0 is received.

MFC after: 3 days
X-MFC with: 238003

12 years agoAdd supported device.
Gleb Smirnoff [Mon, 6 Aug 2012 08:59:39 +0000 (08:59 +0000)]
Add supported device.

12 years ago- Merge from NetBSD:
Marius Strobl [Mon, 6 Aug 2012 08:58:54 +0000 (08:58 +0000)]
- Merge from NetBSD:
  When issuing a non-DMA command, make sure to set the "remaining length of
  command to be transferred via DMA" (sc_cmdlen) to zero up-front, otherwise
  we might get confused on command competition interrupt (no DMA active but
  still data left to transfer).
- Implement handling of MSG_IGN_WIDE_RESIDUE which some targets produce, as
  just rejecting these leads to a resend and disconnect loop.
  Reported and tested by: mjacob

MFC after: 3 days

12 years agoFix start offset calculation for the EBR partitions.
Andrey V. Elsukov [Mon, 6 Aug 2012 08:54:06 +0000 (08:54 +0000)]
Fix start offset calculation for the EBR partitions.

12 years agoAdd to the debug output the offset from the parent partitioning scheme.
Andrey V. Elsukov [Mon, 6 Aug 2012 08:39:29 +0000 (08:39 +0000)]
Add to the debug output the offset from the parent partitioning scheme.

12 years agoAdd PCI IDs for various new High Point RocketRAID 43xx and 3xxx devices.
Xin LI [Mon, 6 Aug 2012 05:27:26 +0000 (05:27 +0000)]
Add PCI IDs for various new High Point RocketRAID 43xx and 3xxx devices.

Obtained from: FreeNAS
MFC after: 3 days

12 years agoMerge r236494 from x86:
Marius Strobl [Sun, 5 Aug 2012 22:03:13 +0000 (22:03 +0000)]
Merge r236494 from x86:

Isolate the global TTE list lock from data and other locks to prevent false
sharing within the cache.

MFC after: 3 days

12 years agoAdd interactive option to override portsnap's automagical detection of
Eitan Adler [Sun, 5 Aug 2012 21:13:21 +0000 (21:13 +0000)]
Add interactive option to override portsnap's automagical detection of
a terminal.

Submitted by: Hannes h2+fbsdports@fsfe.org
Approved by: cperciva
MFC after: 1 week

12 years agoInclude <vm/vm_param.h> for PA_LOCK_COUNT in order to fix kernel build
Marius Strobl [Sun, 5 Aug 2012 20:19:27 +0000 (20:19 +0000)]
Include <vm/vm_param.h> for PA_LOCK_COUNT in order to fix kernel build
with options ZFS after r239065.

12 years agoAdd support for SIIG Cyber Serial Dual PCI 16C850
Eitan Adler [Sun, 5 Aug 2012 19:37:18 +0000 (19:37 +0000)]
Add support for SIIG Cyber Serial Dual PCI 16C850

Submitted by: David Boyd David.Boyd@insightbb.com
Approved by: cperciva
MFC after: 3 days

12 years agoIn tcp timers, check INP_DROPPED flag a little later, after
Mikolaj Golub [Sun, 5 Aug 2012 17:30:17 +0000 (17:30 +0000)]
In tcp timers, check INP_DROPPED flag a little later, after
callout_deactivate(), so if INP_DROPPED is set we return with the
timer active flag cleared.

For me this fixes negative keep timer values reported by `netstat -x'
for connections in CLOSE state.

Approved by: net (silence)
MFC after: 2 weeks

12 years agoIn usr.sbin/ctladm/ctladm.c, function cctl_error_inject(), initialize
Dimitry Andric [Sun, 5 Aug 2012 17:23:47 +0000 (17:23 +0000)]
In usr.sbin/ctladm/ctladm.c, function cctl_error_inject(), initialize
the 'retval' variable to zero, to avoid returning garbage in several
cases.

This fixes the following clang 3.2 warnings:

  usr.sbin/ctladm/ctladm.c:1234:6: error: variable 'retval' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
          if (ioctl(fd, CTL_ERROR_INJECT, &err_desc) == -1) {
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  usr.sbin/ctladm/ctladm.c:1243:10: note: uninitialized use occurs here
          return (retval);
                  ^~~~~~
  usr.sbin/ctladm/ctladm.c:1234:2: note: remove the 'if' if its condition is always true
          if (ioctl(fd, CTL_ERROR_INJECT, &err_desc) == -1) {
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  usr.sbin/ctladm/ctladm.c:1161:7: error: variable 'retval' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
                  if (ioctl(fd, CTL_ERROR_INJECT_DELETE, &err_desc) == -1) {
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  usr.sbin/ctladm/ctladm.c:1243:10: note: uninitialized use occurs here
          return (retval);
                  ^~~~~~
  usr.sbin/ctladm/ctladm.c:1161:3: note: remove the 'if' if its condition is always true
                  if (ioctl(fd, CTL_ERROR_INJECT_DELETE, &err_desc) == -1) {
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  usr.sbin/ctladm/ctladm.c:1029:12: note: initialize the variable 'retval' to silence this warning
          int retval;
                    ^
                     = 0

MFC after:      1 week

12 years agoBump USERBOOT_VERSION.
Andrey V. Elsukov [Sun, 5 Aug 2012 17:04:58 +0000 (17:04 +0000)]
Bump USERBOOT_VERSION.

Requested by: dfr

12 years agoShave off a few more cycles from the average execution time of pmap_enter()
Alan Cox [Sun, 5 Aug 2012 16:59:02 +0000 (16:59 +0000)]
Shave off a few more cycles from the average execution time of pmap_enter()
by simplifying the control flow and reducing the live range of "om".

12 years agoIn usr.bin/make/var.c, function ParseModifier(), initialize the 'error'
Dimitry Andric [Sun, 5 Aug 2012 15:55:36 +0000 (15:55 +0000)]
In usr.bin/make/var.c, function ParseModifier(), initialize the 'error'
variable to NULL, to avoid using it uninitialized in certain cases.

This fixes the following clang 3.2 warning:

  usr.bin/make/var.c:1770:10: error: variable 'error' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
                                          if (vp->execute) {
                                              ^~~~~~~~~~~
  usr.bin/make/var.c:1777:10: note: uninitialized use occurs here
                                          if (error)
                                              ^~~~~
  usr.bin/make/var.c:1770:6: note: remove the 'if' if its condition is always true
                                          if (vp->execute) {
                                          ^~~~~~~~~~~~~~~~~
  usr.bin/make/var.c:1768:23: note: initialize the variable 'error' to silence this warning
                                          const char      *error;
                                                                ^
                                                                 = NULL

MFC after:      1 week

12 years agoAdd simple test program that uses the partition tables handling code.
Andrey V. Elsukov [Sun, 5 Aug 2012 15:40:16 +0000 (15:40 +0000)]
Add simple test program that uses the partition tables handling code.
It is useful to test and debug how boot loader handles partition tables
metadata.

12 years agoReduce diffs against i386.
Yoshihiro Takahashi [Sun, 5 Aug 2012 14:48:55 +0000 (14:48 +0000)]
Reduce diffs against i386.

12 years agoTeach the ZFS use new partitions API when probing.
Andrey V. Elsukov [Sun, 5 Aug 2012 14:48:28 +0000 (14:48 +0000)]
Teach the ZFS use new partitions API when probing.
Note: now ZFS does probe only for partitions with type "freebsd-zfs"
and "freebsd".

12 years agoRemove unneeded flag.
Andrey V. Elsukov [Sun, 5 Aug 2012 14:38:53 +0000 (14:38 +0000)]
Remove unneeded flag.

12 years agoAdd offset field to the i386_devdesc structure to be compatible with
Andrey V. Elsukov [Sun, 5 Aug 2012 14:37:48 +0000 (14:37 +0000)]
Add offset field to the i386_devdesc structure to be compatible with
disk_devdesc structure. Update biosdisk driver to the new disk API.

12 years agoAfter the PHYS_TO_VM_PAGE() function was de-inlined, the main reason
Konstantin Belousov [Sun, 5 Aug 2012 14:11:42 +0000 (14:11 +0000)]
After the PHYS_TO_VM_PAGE() function was de-inlined, the main reason
to pull vm_param.h was removed.  Other big dependency of vm_page.h on
vm_param.h are PA_LOCK* definitions, which are only needed for
in-kernel code, because modules use KBI-safe functions to lock the
pages.

Stop including vm_param.h into vm_page.h. Include vm_param.h
explicitely for the kernel code which needs it.

Suggested and reviewed by: alc
MFC after:    2 weeks

12 years agoReduce diffs against i386.
Yoshihiro Takahashi [Sun, 5 Aug 2012 14:11:07 +0000 (14:11 +0000)]
Reduce diffs against i386.

12 years agoMFi386: the part of r219452 and r236405.
Yoshihiro Takahashi [Sun, 5 Aug 2012 14:05:11 +0000 (14:05 +0000)]
MFi386: the part of r219452 and r236405.

  - bunch of variables are turned into uint8_t.
  - Remove unnecessary initializations.

12 years agoAdd an option for pam_krb5 to allow it to authenticate users which don't have
Doug Rabson [Sun, 5 Aug 2012 13:40:35 +0000 (13:40 +0000)]
Add an option for pam_krb5 to allow it to authenticate users which don't have
a local account.

PR: 76678
Submitted by: daved at tamu.edu
MFC after: 2 weeks

12 years agoReduce namespace pollution from gssapi.h
Doug Rabson [Sun, 5 Aug 2012 13:38:15 +0000 (13:38 +0000)]
Reduce namespace pollution from gssapi.h

MFC after: 2 weeks

12 years agoWhen GPT signature is invalid in the primary GPT header, then try to
Andrey V. Elsukov [Sun, 5 Aug 2012 12:57:38 +0000 (12:57 +0000)]
When GPT signature is invalid in the primary GPT header, then try to
read backup GPT header.

Submitted by: hrs (previous version)

12 years agoIn sbin/camcontrol/camcontrol.c, function smpcmd(), initialize the
Dimitry Andric [Sun, 5 Aug 2012 12:16:11 +0000 (12:16 +0000)]
In sbin/camcontrol/camcontrol.c, function smpcmd(), initialize the
'error' variable to zero, to avoid returning garbage in several cases.

This fixes the following clang 3.2 warnings:

  sbin/camcontrol/camcontrol.c:4634:8: warning: variable 'error' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                          if (amt_written == -1) {
                              ^~~~~~~~~~~~~~~~~
  sbin/camcontrol/camcontrol.c:4656:10: note: uninitialized use occurs here
          return (error);
                  ^~~~~

  sbin/camcontrol/camcontrol.c:4619:7: warning: variable 'error' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
                  if (fd_response == 0) {
                      ^~~~~~~~~~~~~~~~
  sbin/camcontrol/camcontrol.c:4656:10: note: uninitialized use occurs here
          return (error);
                  ^~~~~

  sbin/camcontrol/camcontrol.c:4617:6: warning: variable 'error' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
          if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  sbin/camcontrol/camcontrol.c:4656:10: note: uninitialized use occurs here
          return (error);
                  ^~~~~

MFC after: 1 week

12 years agoIntroduce new API to work with disks from the loader's drivers.
Andrey V. Elsukov [Sun, 5 Aug 2012 12:15:15 +0000 (12:15 +0000)]
Introduce new API to work with disks from the loader's drivers.
It uses new API from the part.c to work with partition tables.

Update userboot's disk driver to use new API. Note that struct
loader_callbacks_v1 has changed.

12 years agoRemove unused variables.
Andrey V. Elsukov [Sun, 5 Aug 2012 11:59:46 +0000 (11:59 +0000)]
Remove unused variables.

12 years agoRegenerate usb.conf
Hans Petter Selasky [Sun, 5 Aug 2012 11:53:16 +0000 (11:53 +0000)]
Regenerate usb.conf

MFC after: 2 weeks

12 years agoUpdate the list of devices supported by the FTDI driver. It might be
Hans Petter Selasky [Sun, 5 Aug 2012 11:50:56 +0000 (11:50 +0000)]
Update the list of devices supported by the FTDI driver. It might be
that the wrong UART reference clock will be used for a few of the IDs.
It is currently not possible to figure that out because the Linux FTDI
driver detects this run-time and not compile time based on the bcdDevice
field of the USB device descriptor. Some of the ID's in usbdevs are not
sorted according to the product ID value. Please feel free to fix this.
I'm out of my xemacs magic today.

This syncronises us with the linux kernel at kernel.org (HEAD).

MFC after: 2 weeks

12 years agoCreate the interface to work with various partition tables from the
Andrey V. Elsukov [Sun, 5 Aug 2012 11:29:44 +0000 (11:29 +0000)]
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.

12 years agoMigrate the 802.11n ath_hal_chaintxdesc() API to use a buffer/segment
Adrian Chadd [Sun, 5 Aug 2012 11:24:21 +0000 (11:24 +0000)]
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

12 years agoFix a refcount issue. The called only decrements is stcb is NULL.
Michael Tuexen [Sun, 5 Aug 2012 10:47:18 +0000 (10:47 +0000)]
Fix a refcount issue. The called only decrements is stcb is NULL.

MFC after: 3 days
Discussed with: rrs

12 years agoMigrate the ath_hal_filltxdesc() API to take a list of buffer/seglen values.
Adrian Chadd [Sun, 5 Aug 2012 10:12:27 +0000 (10:12 +0000)]
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

12 years agoMinor style nit:
Hans Petter Selasky [Sun, 5 Aug 2012 08:56:29 +0000 (08:56 +0000)]
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

12 years agoUse new method of assigning IPv4 addresses
Eitan Adler [Sun, 5 Aug 2012 08:19:52 +0000 (08:19 +0000)]
Use new method of assigning IPv4 addresses

PR: conf/167648
Submitted by: Jeff Kletsky <freebsd@wagsky.com>
Approved by: bcr
MFC after: 3 days

12 years agoAdd additional Perle Speed LE serial cards
Eitan Adler [Sun, 5 Aug 2012 08:10:02 +0000 (08:10 +0000)]
Add additional Perle Speed LE serial cards

PR: kern/168816
Submitted by: Dennis Oyama <doyama@perle.com>
Approved by: cperciva
MFC after: 1 week

12 years agoRemove variables which are initialized but never used thereafter
Eitan Adler [Sun, 5 Aug 2012 08:08:34 +0000 (08:08 +0000)]
Remove variables which are initialized but never used thereafter
reported by gcc46 warning

Reviewed by: scottl
Approved by: cperciva
MFC after: 1 week

12 years agoFix typo.
Andreas Tobler [Sun, 5 Aug 2012 06:15:12 +0000 (06:15 +0000)]
Fix typo.

Reviewed by: jhb

12 years agoFix a bug reported by Simon L. B. Nielsen:
Michael Tuexen [Sat, 4 Aug 2012 20:40:36 +0000 (20:40 +0000)]
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.

12 years agoReduce code duplication and exposure of direct access to struct
Konstantin Belousov [Sat, 4 Aug 2012 18:16:43 +0000 (18:16 +0000)]
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

12 years agoThe header uma_int.h is internal uma header, unused by this source
Konstantin Belousov [Sat, 4 Aug 2012 18:12:54 +0000 (18:12 +0000)]
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

12 years agoRemove verbose unused commented out debugging printf.
Konstantin Belousov [Sat, 4 Aug 2012 18:10:04 +0000 (18:10 +0000)]
Remove verbose unused commented out debugging printf.

MFC after: 1 week
Reviewed by: alc

12 years agoSupport multiple interface devices. The driver had previously hardcoded
Gavin Atkinson [Sat, 4 Aug 2012 15:11:36 +0000 (15:11 +0000)]
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

12 years agoParticlly MFcalloutng r238425 (by davide):
Alexander Motin [Sat, 4 Aug 2012 08:06:37 +0000 (08:06 +0000)]
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.

12 years agoTesting an interface property should depend on the interface, not
Michael Tuexen [Sat, 4 Aug 2012 08:03:30 +0000 (08:03 +0000)]
Testing an interface property should depend on the interface, not
on an address.

MFC after: 3 days

12 years agoPartialy MFcalloutng r236894 (by davide):
Alexander Motin [Sat, 4 Aug 2012 07:46:58 +0000 (07:46 +0000)]
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.

12 years agoCorrectly return EFAULT in copyin & copyout on a fault. This fixes NFS
Andrew Turner [Sat, 4 Aug 2012 05:38:25 +0000 (05:38 +0000)]
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

12 years agoEnsure we align the stack to 8 bytes in system calls.
Andrew Turner [Sat, 4 Aug 2012 05:31:26 +0000 (05:31 +0000)]
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.

12 years agoEnsure we align the stack to 8 bytes in rtld.
Andrew Turner [Sat, 4 Aug 2012 05:30:20 +0000 (05:30 +0000)]
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.

12 years agoAdd backlight support for nVidia-based PowerBooks/iBooks/iMacs.
Justin Hibbits [Sat, 4 Aug 2012 03:05:01 +0000 (03:05 +0000)]
Add backlight support for nVidia-based PowerBooks/iBooks/iMacs.

Approved by: nwhitehorn (mentor)
MFC after: 9.1-RELEASE

12 years agoAdd detach logic to SBus variant.
Matt Jacob [Sat, 4 Aug 2012 00:00:30 +0000 (00:00 +0000)]
Add detach logic to SBus variant.

Obtained from: Marius
MFC after: 1 month

12 years agoDocument "destroy" as an alias for "stop".
Jim Harris [Fri, 3 Aug 2012 20:30:40 +0000 (20:30 +0000)]
Document "destroy" as an alias for "stop".

12 years agoIn virstor_ctl_stop(), check for a valid softc before trying to update
Jim Harris [Fri, 3 Aug 2012 20:24:16 +0000 (20:24 +0000)]
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

12 years agoCorrect function name in comment.
John Baldwin [Fri, 3 Aug 2012 18:40:44 +0000 (18:40 +0000)]
Correct function name in comment.

Submitted by: alc

12 years agoParse notes only after object structure had been allocated.
Alexander Kabaev [Fri, 3 Aug 2012 17:04:41 +0000 (17:04 +0000)]
Parse notes only after object structure had been allocated.

Reported by: kargl
Reviewed by: kib (sans whitespace)

12 years agoMicrooptimize LAPIC timer routines to avoid reading from hardware during
Alexander Motin [Fri, 3 Aug 2012 15:19:59 +0000 (15:19 +0000)]
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%.

12 years agoNew command "gmultipath prefer" to force selection of a specified
Thomas Quinot [Fri, 3 Aug 2012 14:55:35 +0000 (14:55 +0000)]
New command "gmultipath prefer" to force selection of a specified
provider in an Active/Passive configuration.

Reviewed by: mav
MFC after: 4 weeks

12 years agoOops. We only do allocate room for extended commands
Matt Jacob [Fri, 3 Aug 2012 14:25:35 +0000 (14:25 +0000)]
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

12 years agosupport building vtnet as an embedded driver
Luigi Rizzo [Fri, 3 Aug 2012 14:00:26 +0000 (14:00 +0000)]
support building vtnet as an embedded driver

12 years agoImprove the handling of static DMA buffers that use non-default memory
John Baldwin [Fri, 3 Aug 2012 13:50:29 +0000 (13:50 +0000)]
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

12 years agoRemove duplicate check.
Alexander Motin [Fri, 3 Aug 2012 12:55:31 +0000 (12:55 +0000)]
Remove duplicate check.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

12 years agoMicrooptimize time math. As soon as our event periods are always below ome
Alexander Motin [Fri, 3 Aug 2012 09:08:20 +0000 (09:08 +0000)]
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%.

12 years agoInline vm_page_aflags_clear() and vm_page_aflags_set().
Alan Cox [Fri, 3 Aug 2012 01:48:15 +0000 (01:48 +0000)]
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.

12 years agoCorrect a typo.
Xin LI [Fri, 3 Aug 2012 00:11:13 +0000 (00:11 +0000)]
Correct a typo.

Reported by: Sascha Wildner <swildner dragonflybsd org>
Reviewed by: scottl
MFC after: 3 days

12 years agoFix an issue that crept in with the previous descriptor tidyup.
Adrian Chadd [Thu, 2 Aug 2012 20:14:45 +0000 (20:14 +0000)]
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

12 years agoDisallow sectorsize larger than MAXPHYS and mediasize smaller than
Jaakko Heinonen [Thu, 2 Aug 2012 15:05:34 +0000 (15:05 +0000)]
Disallow sectorsize larger than MAXPHYS and mediasize smaller than
sectorsize.

PR: 169947
Submitted by: Filip Palian (original version)
Reviewed by: kib

12 years agoFix races between in_lltable_prefix_free(), lla_lookup(),
Gleb Smirnoff [Thu, 2 Aug 2012 13:57:49 +0000 (13:57 +0000)]
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>

12 years agoThe llentry_update() is used only by flowtable and the latter
Gleb Smirnoff [Thu, 2 Aug 2012 13:20:44 +0000 (13:20 +0000)]
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().

12 years agoreplace __unused with a portable construct;
Luigi Rizzo [Thu, 2 Aug 2012 12:45:13 +0000 (12:45 +0000)]
replace __unused with a portable construct;
fix a couple of signed/unsigned warnings.

12 years agoRemove trailing whitespace.
Joel Dahl [Thu, 2 Aug 2012 12:17:52 +0000 (12:17 +0000)]
Remove trailing whitespace.