Commit Graph

1673 Commits

Author SHA1 Message Date
Bernhard Schmidt
4310d6deb2 Add support for Ralink RT2800/RT3000 chipsets.
Thanks to ray@, Sevan and Sergey Dyatko for feedback and testing!

Obtained from:	OpenBSD
MFC after:	3 weeks
2012-05-10 17:41:16 +00:00
Adrian Chadd
4574da7fee Bring over the first part of the etherswitch framework - an MDIO bus and
MDIO/MII rendezvous proxy.

* Add an 'mdio' bus, which is the "IO" side of an MII bus (but by design
  can be anything which implements the underlying register access API.)
* Add 'miiproxy' and 'mdioproxy', which provides a rendezvous mechanism
  for MII busses to appear hanging off arbitrary busses (ie, that aren't
  necessarily a traditional looking MII bus.)

MII busses can now hang off anything that implements an mdiobus.

For the AR71xx SoC, there's one MDIO bus but two MII busses.  So to
properly support two or more real PHYs, this can be done:

  # arge0 MDIO bus - there's no arge1 MDIO bus for AR71xx
  hint.argemdio.0.at="nexus0"
  hint.argemdio.0.maddr=0x19000000
  hint.argemdio.0.msize=0x1000
  hint.argemdio.0.order=0

  # Create two mdioproxy instances
  hint.mdioproxy.0.at="mdio0"
  hint.mdioproxy.1.at="mdio0"

  # .. and with a follow-up patch
  hint.arge.0.mdio=mdioproxy0
  hint.arge.1.mdio=mdioproxy0

TODO:

* Do a sweep or two and add appropriate locking in mdio/mdioproxy/miiproxy.

Submitted by:	Stefan Bethke <stb@lassitu.de>
Reviewed by:	ray
2012-05-01 06:11:38 +00:00
Alexander Motin
00f32ecbd0 Add to GEOM RAID class module, supporting the DDF metadata format, as
defined by the SNIA Common RAID Disk Data Format Specification v2.0.

Supports multiple volumes per array and multiple partitions per disk.
Supports standard big-endian and Adaptec's little-endian byte ordering.
Supports all single-layer RAID levels. Dual-layer RAID levels except
RAID10 are not supported now because of GEOM RAID design limitations.

Some work is still to be done, but the present code already manages basic
interoperation with RAID BIOS of the Adaptec 1430SA SATA RAID controller.

MFC after:	1 month
Sponsored by:	iXsystems, Inc.
2012-04-30 17:53:02 +00:00
Marius Strobl
c9716b3491 Drag in subr_acl_nfs4.c for ZFS automatically, otherwise it's
unintuitive that "options zfs" requires "options ufs_acl".
2012-04-29 16:14:09 +00:00
Alexander Motin
fc1de96060 Add to GEOM RAID class module for reading non-degraded RAID5 volumes and
some environment to differentiate 4 possible RAID5 on-disk layouts.

Tested with Intel and AMD RAID BIOSes.

MFC after:	2 weeks
2012-04-19 12:30:12 +00:00
Marius Strobl
34f4e555b5 Add a driver for the NXP (Philips) PCF8563 RTC.
Obtained from:	NetBSD (pcf8563reg.h)
2012-04-13 23:07:32 +00:00
John Baldwin
ed5a2b61fd Add OFED and the associated options and drivers to x86 LINT builds:
- Mark 'sdp' as requiring 'inet'.
- Always include "opt_inet.h" and "opt_inet6.h" and modify the IB
  driver Makefiles to honor WITH/WITHOUT_INET/INET6/_SUPPORT options
  to determine what should be enabled during a module build.
- Fix the mlxen(4) driver and the core IB code to compile without
  if INET is disabled (including when both INET and INET6 are disabled).

Reviewed by:	bz
MFC after:	2 weeks
2012-04-12 14:01:06 +00:00
Doug Ambrisko
a6ba0fd64d MFhead_mfi r227068
First cut of new HW support from LSI and merge into FreeBSD.
	Supports Drake Skinny and ThunderBolt cards.
MFhead_mfi r227574
	Style
MFhead_mfi r227579
	Use bus_addr_t instead of uintXX_t.
MFhead_mfi r227580
	MSI support
MFhead_mfi r227612
	More bus_addr_t and remove "#ifdef __amd64__".
MFhead_mfi r227905
	Improved timeout support from Scott.
MFhead_mfi r228108
	Make file.
MFhead_mfi r228208
	Fixed botched merge of Skinny support and enhanced handling
	in call back routine.
MFhead_mfi r228279
	Remove superfluous !TAILQ_EMPTY() checks before TAILQ_FOREACH().
MFhead_mfi r228310
	Move mfi_decode_evt() to taskqueue.
MFhead_mfi r228320
	Implement MFI_DEBUG for 64bit S/G lists.
MFhead_mfi r231988
	Restore structure layout by reverting the array header to
	use [0] instead of [1].
MFhead_mfi r232412
	Put wildcard pattern later in the match table.
MFhead_mfi r232413
	Use lower case for hexadecimal numbers to match surrounding
	style.
MFhead_mfi r232414
	Add more Thunderbolt variants.
MFhead_mfi r232888
	Don't act on events prior to boot or when shutting down.
	Add hw.mfi.detect_jbod_change to enable or disable acting
	on JBOD type of disks being added on insert and removed on
	removing.  Switch hw.mfi.msi to 1 by default since it works
	better on newer cards.
MFhead_mfi r233016
	Release driver lock before taking Giant when deleting children.
	Use TAILQ_FOREACH_SAFE when items can be deleted.  Make code a
	little simplier to follow.  Fix a couple more style issues.
MFhead_mfi r233620
	Update mfi_spare/mfi_array with the actual number of elements
	for array_ref and pd.  Change these max. #define names to avoid
	name space collisions.  This will require an update to mfiutil
	It avoids mfiutil having to do a magic calculation.

	Add a note and #define to state that a "SYSTEM" disk is really
	what the firmware calls a "JBOD" drive.

Thanks to the many that helped, LSI for the initial code drop,
mav, delphij, jhb, sbruno that all helped with code and testing.
2012-03-30 23:05:48 +00:00
Fabien Thomas
f5f9340b98 Add software PMC support.
New kernel events can be added at various location for sampling or counting.
This will for example allow easy system profiling whatever the processor is
with known tools like pmcstat(8).

Simultaneous usage of software PMC and hardware PMC is possible, for example
looking at the lock acquire failure, page fault while sampling on
instructions.

Sponsored by: NETASQ
MFC after:	1 month
2012-03-28 20:58:30 +00:00
Peter Wemm
88c7c4348b Allow (with a license warning) "options ZFS" to work in static kernels.
The 'make depend' rules have to use custom -I paths for the special compat
includes for the opensolaris/zfs headers.

This option will pull in the couple of files that are shared with dtrace,
but they appear to correctly use the MODULE_VERSION/MODULE_DEPEND rules
so loader should do the right thing, as should kldload.

Reviewed by:	pjd (glanced at)
2012-03-27 21:23:56 +00:00
Jayachandran C.
1ab68cbb08 Driver for OpenCores I2C controller.
Add a Simple polled driver iicoc for the OpenCores I2C controller. This
is used in Netlogic XLP processors.

Submitted by:	Sreekanth M. S. (kanthms at netlogicmicro com)
2012-03-27 10:44:32 +00:00
Jayachandran C.
1513a6ff90 Move driver for DS1374 RTC to sys/dev/iicbus
The earlier version of the driver is sys/mips/rmi/dev/iic/ds1374u.c
Convert all references to ds1374u to ds1374, and use DEVMETHOD_END.
Also update the license header as Netlogic is now Broadcom.
2012-03-27 09:48:18 +00:00
Dimitry Andric
3b5683fce6 Work around the following clang warning in mps(4):
sys/dev/mps/mps_sas.c:861:1: error: function 'mpssas_discovery_timeout' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
  mpssas_discovery_timeout(void *data)
  ^

Because the driver is obtained from upstream, we don't want to modify
it; just silence the warning instead, it is harmless.

MFC after:	3 days
2012-03-23 11:35:01 +00:00
Andrey V. Elsukov
e800e2e159 Connect geom_part_ldm to the kernel build.
MFC after:	1 month
2012-03-19 13:16:46 +00:00
Adrian Chadd
3468c30c95 (Re)-make these ACL routines optional.
They're only currently used by ZFS and UFS_ACL.  They're just wasting space
on embedded platforms with neither enabled.
2012-03-13 20:29:56 +00:00
Alexander Motin
e4afd792df Add driver for the RME HDSPe AIO/RayDAT sound cards -- snd_hdspe(4).
Cards are expensive and so rare, so leave the driver as module.

Submitted by:	Ruslan Bukin <br@bsdpad.com>
MFC after:	2 weeks
2012-03-01 13:10:18 +00:00
Dimitry Andric
102a319895 Revert r231978, so I can apply a more proper fix to silence unneeded
internal declaration warnings in several sys/cam/ctl files.

MFC after:	1 week
2012-02-23 21:32:32 +00:00
Dimitry Andric
8508b79835 When building with clang, disable -Wunneeded-internal-declaration for
several sys/cam/ctl files, since these get the following warnings:

In file included from sys/cam/ctl/ctl_backend.c:60:
sys/cam/ctl/ctl_private.h:300:30: error: variable 'page_index_template' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
static struct ctl_page_index page_index_template[] = {
                             ^

These warnings are tricky to fix without a lot of overhaul, and they are
harmless, so disable them for now.

MFC after:	1 week
2012-02-21 20:55:43 +00:00
Adrian Chadd
7b1144d245 Break out the radar code into a separate source file.
This mirrors the internal HAL organisation and reduces the differences
between the HAL codebases slightly.

Obtained from:	Atheros
2012-02-20 03:07:07 +00:00
Jung-uk Kim
a159c266a9 Merge ACPICA 20120215. 2012-02-16 22:59:29 +00:00
Luigi Rizzo
93f902635b properly sort dev/oce entries 2012-02-14 10:11:53 +00:00
Luigi Rizzo
2f345d8ed5 Add a driver for Emulex OneConnect ethernet cards (10 Gbit PCIe)
A manpage will come in a future commit.

Submitted by:   Naresh Raju Gottumukkala (emulex)
2012-02-10 21:03:04 +00:00
Dimitry Andric
5e0a19bdee Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessor
set via ${CPP} is used, instead of always using hardcoded /usr/bin/cpp.

MFC after:	1 week
2012-02-07 09:27:07 +00:00
Pawel Jakub Dawidek
c6708f73b9 After multiple requests for back out, after multiple promisses from adrian@
to fix it (without fixing it), after making one of my servers unbootable,
after now making also my laptop unbootable and after running out of patiance
back out r229800 until better solution is found.
2012-02-04 20:17:07 +00:00
Kenneth D. Merry
048a50f354 Fix the netback driver build for i386.
netback.c:	Add missing VM includes.

xen/xenvar.h,
xen/xenpmap.h:	Move some XENHVM macros from <machine/xen/xenpmap.h> to
		<machine/xen/xenvar.h> on i386 to match the amd64 headers.

conf/files:	Add netback to the build.

Submitted by:	jhb
MFC after:	3 days
2012-02-02 17:54:35 +00:00
Kenneth D. Merry
fc2e7eec24 Unbreak the i386 full PV (XEN kernel) build by reverting rev 230878 and
taking the netback driver out of the build temporarily.
2012-02-02 07:38:40 +00:00
Pedro F. Giffuni
7106ed257d Use new OSS-based BSD-licensed header for cs sound driver.
The cs driver requires a table with firmware values. An
alternative firmware is available in a similar Open Sound
System driver. This is actually a partial revert of
Revision 77504.

Special thanks to joel@ for patiently testing several
replacement attempts.

The csa driver and the complete sound system are now free
of the GPL.

Tested by:	joel
Approved by:	jhb (mentor)
MFC after:	3 weeks
2012-02-01 21:38:01 +00:00
Kenneth D. Merry
22ea1313de Add the netback driver to the build.
MFC after:	3 days
2012-02-01 20:18:57 +00:00
Jack F Vogel
85d0a26ed4 New hardware support: Intel X540 adapter support added.
Some shared code reorganization along with the new adapter.
Sync changes to OACTIVE in igb into this driver.
Misc small fixes.
2012-01-30 16:42:02 +00:00
Kenneth D. Merry
d043c56453 Bring in the LSI-supported version of the mps(4) driver.
This involves significant changes to the mps(4) driver, but is not a
complete rewrite.

Some of the changes in this version of the driver:
 - Integrated RAID (IR) support.
 - Support for WarpDrive controllers.
 - Support for SCSI protection information (EEDP).
 - Support for TLR (Transport Level Retries), needed for tape drives.
 - Improved error recovery code.
 - ioctl interface compatible with LSI utilities.

mps.4:		Update the mps(4) driver man page somewhat for the driver
		changes.  The list of supported hardware still needs to be
		updated to reflect the full list of supported cards.

conf/files:	Add the new driver files.

mps/mpi/*:	Updated version of the MPI header files, with a BSD style
		copyright.

mps/*:		See above for a description of the new driver features.

modules/mps/Makefile:
		Add the new mps(4) driver files.

Submitted by:	Kashyap Desai <Kashyap.Desai@lsi.com>
Reviewed by:	ken
MFC after:	1 week
2012-01-26 18:17:21 +00:00
Pedro F. Giffuni
5dcd37b17d Replace GPLd headers from the Maestro3 driver with BSD licensed
versions derived from /usr/ports/audio/oss.

The particular headers used were taken from the
attic/drv/oss_allegro directory and are mostly identical
to the previous files.

The Maestro3 driver is now free from the GPL.

NOTE: due to lack of testers this driver is being
considered for deprecation and removal.

PR:		kern/153920
Approved by:	jhb (mentor)
MFC after:	2 weeks
2012-01-20 22:37:10 +00:00
Alexander Motin
7c6b05d280 Major snd_hda driver rewrite:
- Huge old hdac driver was split into three independent pieces: HDA
controller driver (hdac), HDA CODEC driver (hdacc) and HDA sudio function
driver (hdaa).
 - Support for multichannel recording was added. Now, as specification
defines, driver checks input associations for pins with sequence numbers
14 and 15, and if found (usually) -- works as before, mixing signals
together. If it doesn't, it configures input association as multichannel.
 - Signal tracer was improved to look for cases where several DACs/ADCs in
CODEC can work with the same audio signal. If such case found, driver
registers additional playback/record stream (channel) for the pcm device.
 - New controller streams reservation mechanism was implemented. That
allows to have more pcm devices then streams supported by the controller
(usually 4 in each direction). Now it limits only number of simultaneously
transferred audio streams, that is rarely reachable and properly reported
if happens.
 - Codec pins and GPIO signals configuration was exported via set of
writable sysctls. Another sysctl dev.hdaa.X.reconfig allows to trigger
driver reconfiguration in run-time.
 - Driver now decodes pins location and connector type names. In some cases
it allows to hint user where on the system case connectors, related to the
pcm device, are located. Number of channels supported by pcm device,
reported now (if it is not 2), should also make search easier.
 - Added workaround for digital mic on some Asus laptops/netbooks.

MFC after:	2 months
Sponsored by:	iXsystems, Inc.
2012-01-15 13:21:36 +00:00
Kenneth D. Merry
130f4520cb Add the CAM Target Layer (CTL).
CTL is a disk and processor device emulation subsystem originally written
for Copan Systems under Linux starting in 2003.  It has been shipping in
Copan (now SGI) products since 2005.

It was ported to FreeBSD in 2008, and thanks to an agreement between SGI
(who acquired Copan's assets in 2010) and Spectra Logic in 2010, CTL is
available under a BSD-style license.  The intent behind the agreement was
that Spectra would work to get CTL into the FreeBSD tree.

Some CTL features:

 - Disk and processor device emulation.
 - Tagged queueing
 - SCSI task attribute support (ordered, head of queue, simple tags)
 - SCSI implicit command ordering support.  (e.g. if a read follows a mode
   select, the read will be blocked until the mode select completes.)
 - Full task management support (abort, LUN reset, target reset, etc.)
 - Support for multiple ports
 - Support for multiple simultaneous initiators
 - Support for multiple simultaneous backing stores
 - Persistent reservation support
 - Mode sense/select support
 - Error injection support
 - High Availability support (1)
 - All I/O handled in-kernel, no userland context switch overhead.

(1) HA Support is just an API stub, and needs much more to be fully
    functional.

ctl.c:			The core of CTL.  Command handlers and processing,
			character driver, and HA support are here.

ctl.h:			Basic function declarations and data structures.

ctl_backend.c,
ctl_backend.h:		The basic CTL backend API.

ctl_backend_block.c,
ctl_backend_block.h:	The block and file backend.  This allows for using
			a disk or a file as the backing store for a LUN.
			Multiple threads are started to do I/O to the
			backing device, primarily because the VFS API
			requires that to get any concurrency.

ctl_backend_ramdisk.c:	A "fake" ramdisk backend.  It only allocates a
			small amount of memory to act as a source and sink
			for reads and writes from an initiator.  Therefore
			it cannot be used for any real data, but it can be
			used to test for throughput.  It can also be used
			to test initiators' support for extremely large LUNs.

ctl_cmd_table.c:	This is a table with all 256 possible SCSI opcodes,
			and command handler functions defined for supported
			opcodes.

ctl_debug.h:		Debugging support.

ctl_error.c,
ctl_error.h:		CTL-specific wrappers around the CAM sense building
			functions.

ctl_frontend.c,
ctl_frontend.h:		These files define the basic CTL frontend port API.

ctl_frontend_cam_sim.c:	This is a CTL frontend port that is also a CAM SIM.
			This frontend allows for using CTL without any
			target-capable hardware.  So any LUNs you create in
			CTL are visible in CAM via this port.

ctl_frontend_internal.c,
ctl_frontend_internal.h:
			This is a frontend port written for Copan to do
			some system-specific tasks that required sending
			commands into CTL from inside the kernel.  This
			isn't entirely relevant to FreeBSD in general,
			but can perhaps be repurposed.

ctl_ha.h:		This is a stubbed-out High Availability API.  Much
			more is needed for full HA support.  See the
			comments in the header and the description of what
			is needed in the README.ctl.txt file for more
			details.

ctl_io.h:		This defines most of the core CTL I/O structures.
			union ctl_io is conceptually very similar to CAM's
			union ccb.

ctl_ioctl.h:		This defines all ioctls available through the CTL
			character device, and the data structures needed
			for those ioctls.

ctl_mem_pool.c,
ctl_mem_pool.h:		Generic memory pool implementation used by the
			internal frontend.

ctl_private.h:		Private data structres (e.g. CTL softc) and
			function prototypes.  This also includes the SCSI
			vendor and product names used by CTL.

ctl_scsi_all.c,
ctl_scsi_all.h:		CTL wrappers around CAM sense printing functions.

ctl_ser_table.c:	Command serialization table.  This defines what
			happens when one type of command is followed by
			another type of command.

ctl_util.c,
ctl_util.h:		CTL utility functions, primarily designed to be
			used from userland.  See ctladm for the primary
			consumer of these functions.  These include CDB
			building functions.

scsi_ctl.c:		CAM target peripheral driver and CTL frontend port.
			This is the path into CTL for commands from
			target-capable hardware/SIMs.

README.ctl.txt:		CTL code features, roadmap, to-do list.

usr.sbin/Makefile:	Add ctladm.

ctladm/Makefile,
ctladm/ctladm.8,
ctladm/ctladm.c,
ctladm/ctladm.h,
ctladm/util.c:		ctladm(8) is the CTL management utility.
			It fills a role similar to camcontrol(8).
			It allow configuring LUNs, issuing commands,
			injecting errors and various other control
			functions.

usr.bin/Makefile:	Add ctlstat.

ctlstat/Makefile
ctlstat/ctlstat.8,
ctlstat/ctlstat.c:	ctlstat(8) fills a role similar to iostat(8).
			It reports I/O statistics for CTL.

sys/conf/files:		Add CTL files.

sys/conf/NOTES:		Add device ctl.

sys/cam/scsi_all.h:	To conform to more recent specs, the inquiry CDB
			length field is now 2 bytes long.

			Add several mode page definitions for CTL.

sys/cam/scsi_all.c:	Handle the new 2 byte inquiry length.

sys/dev/ciss/ciss.c,
sys/dev/ata/atapi-cam.c,
sys/cam/scsi/scsi_targ_bh.c,
scsi_target/scsi_cmds.c,
mlxcontrol/interface.c:	Update for 2 byte inquiry length field.

scsi_da.h:		Add versions of the format and rigid disk pages
			that are in a more reasonable format for CTL.

amd64/conf/GENERIC,
i386/conf/GENERIC,
ia64/conf/GENERIC,
sparc64/conf/GENERIC:	Add device ctl.

i386/conf/PAE:		The CTL frontend SIM at least does not compile
			cleanly on PAE.

Sponsored by:	Copan Systems, SGI and Spectra Logic
MFC after:	1 month
2012-01-12 00:34:33 +00:00
Jung-uk Kim
ec3fc72f94 Merge ACPICA 20120111. 2012-01-11 23:06:37 +00:00
Pedro F. Giffuni
70e0bbedef Replace GPL'd headers in the emu10kx snd driver code.
This uses the emuxkireg.h already used in the emu10k1
snd driver. Special thanks go to Alexander Motin as
he was able to find some errors and reverse engineer
some wrong values in the emuxkireg header.

The emu10kx driver is now free from the GPL.

PR:		153901
Tested by:	mav, joel
Approved by:	jhb (mentor)
MFC after:	2 weeks
2012-01-11 21:17:14 +00:00
Adrian Chadd
3da972f77c Make these two files conditionally build on UFS_ACL, as it doesn't
seem to be used elsewhere.

Since UFS_ACL is enabled by default for GENERIC kernels, this shouldn't
break anything - but please beat me to fix things if it does.

This reduces the footprint of the kernel on small embedded systems
(think <1MB flash for the compressed kernel image) just enough to
actually fit.
2012-01-08 00:55:22 +00:00
Aleksandr Rybalko
ce96bb7942 GEOM_UNCOMPRESS module, can be used with uzip images and with new ulzma images.
Approved by:	adrian (mentor)
2012-01-04 23:39:11 +00:00
Aleksandr Rybalko
e11f2b8243 Update contrib/xz-embedded to build with new GEOM_UNCOMPRESS module.
Approved by:	adrian (mentor)
2012-01-04 23:26:22 +00:00
Pedro F. Giffuni
c7e0c9db2b Replace a GPL'd header in the emu10k1 snd driver code.
This brings in the emuxkireg.h from NetBSD (dev/pci) which
is used for the same purpose but is smaller. The emu10k1
is now free from the GPL.

PR:		153901
Obtained from:	NetBSD
Approved by:	core (mentor implicit)
MFC after:	2 weeks
2012-01-03 21:04:54 +00:00
Ed Schouten
22fec34a57 Implement extensions on top of standards instead of the other way around.
Now that index() and rindex() have become unused, simply turn them into
wrappers around strchr() and strrchr(), respectively.
2012-01-03 07:05:30 +00:00
Ed Schouten
41adcfa1d0 Remove the now unused skpc() function.
It was only used by ufs and ext2 and I have really strong doubts that
there are other pieces of code that also use this function. If it turns
out that external drivers use this code as well, I'd be happy to migrate
or revert.

Bump __FreeBSD_version while there.
2012-01-01 20:54:44 +00:00
Ed Schouten
de85bfc508 Introducing memcchr(3).
It seems two of the file system drivers we have in the tree, namely ufs
and ext3, use a function called `skpc()'. The meaning of this function
does not seem to be documented in FreeBSD, but it turns out one needs to
be a VAX programmer to understand what it does.

SPKC is an instruction on the VAX that does the opposite of memchr(). It
searches for the non-equal character. Add a new function called
memcchr() to the tree that has the following advantages over skpc():

- It has a name that makes more sense than skpc(). Just like strcspn()
  matches the complement of strspn(), memcchr() is the complement of
  memchr().

- It is faster than skpc(). Similar to our strlen() in libc, it compares
  entire words, instead of single bytes. It seems that for this routine
  this yields a sixfold performance increase on amd64.

- It has a man page.
2012-01-01 20:26:11 +00:00
Dimitry Andric
97a15669a0 Disable several instances instances of clang's -Wself-assign warning.
All of these are harmless, and are in fact used to shut up warnings from
lint.

While here, remove -Wno-missing-prototypes from the xfs module
Makefile, as I could not reproduce those warnings either with gcc or
clang.

MFC after:	1 week
2011-12-30 13:16:59 +00:00
Dimitry Andric
874fb554f7 For several files in sys/dev/drm, disable -Wunused-value when building
with clang.  There are several macros in these files that return values,
and in some cases nothing is done with them, but it is completely
harmless.  For some other files, also disable -Wconstant-conversion,
since that triggers a false positive with the DMA_BIT_MASK() macro.

MFC after:	1 week
2011-12-30 01:54:45 +00:00
Adrian Chadd
c65ee21d46 First pass of LED related code changes.
Migrate the LED code out of if_ath.c and into if_ath_led.c.
These routines are _all_ software based LED blinking.
2011-12-26 05:37:09 +00:00
Dimitry Andric
6f7651b9b6 When building with clang, disable -Wshift-count-negative and
-Wshift-count-overflow for sys/dev/ath/ath_hal/ah_regdomain.c, as it
gets multiple instances of the following warnings:

In file included from sys/dev/ath/ath_hal/ah_regdomain.c:99:
sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:69:15: warning: shift count is negative [-Wshift-count-negative]
         .chan11a               = BM4(F1_4950_4980,
                                  ^~~~~~~~~~~~~~~~~
sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:41:4: note: expanded from:
          W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) }
          ^
sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:34:45: note: expanded from:
        (((_a) > 63 && (_a) < 128 ? (((uint64_t) 1)<<((_a)-64)) : (uint64_t) 0))
                                                   ^ ~~~~~~~~~

and:

In file included from sys/dev/ath/ath_hal/ah_regdomain.c:99:
sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:629:15: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
         .chan11a               = BM4(W2_5260_5320,
                                  ^~~~~~~~~~~~~~~~~
sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:40:34: note: expanded from:
        { W0(_fa) | W0(_fb) | W0(_fc) | W0(_fd),                        \
                                        ^
sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:32:44: note: expanded from:
        (((_a) >= 0 && (_a) < 64 ? (((uint64_t) 1)<<(_a)) : (uint64_t) 0))
                                                  ^ ~~~~

Both warnings are false positives, caused by LLVM PR 10030.  For global
initializations, clang fails to detect that the branch of the ternary
operator causing the warning is dead.

MFC after:	1 week
2011-12-21 17:01:13 +00:00
Dimitry Andric
fea858696e When building with clang, disable -Warray-bounds for sys/dev/asr/asr.c,
as it gets the following warning:

sys/dev/asr/asr.c:1836:29: warning: array index of '58' indexes past the end of an array (that contains 1 element) [-Warray-bounds]
        while ((len > 0) && (sg < &((PPRIVATE_SCSI_SCB_EXECUTE_MESSAGE)
                                   ^
sys/dev/asr/i2omsg.h:934:8: note: array 'Simple' declared here
       I2O_SGE_SIMPLE_ELEMENT              Simple[1];
       ^

This is a false positive, since I2O_SG_ELEMENT::Simple is not declared
as a C99 flexible array member, but in the old (but more portable) way.
At run-time, the proper number of array elements will hopefully have
been allocated.

MFC after:	1 week
2011-12-21 16:38:37 +00:00
Dimitry Andric
a380d07b92 Start selectively disabling a few kernel build warnings for clang, since
there are some places in the kernel where fixing them is too disruptive,
or where there is a false positive.

In this case, disable -Wconstant-conversion for two aic7xxx-related
files, as they get the following warning on i386 (and possibly on other
32-bit arches):

sys/dev/aic7xxx/ahc_pci.c:112:10: warning: implicit conversion from 'long long' to 'bus_addr_t' (aka 'unsigned int') changes value from 549755813887 to 4294967295 [-Wconstant-conversion]
                                   ? 0x7FFFFFFFFFLL
                                   ~~^~~~~~~~~~~~~~

This is a false positive, since the code only passes the 0x7FFFFFFFFFLL
argument, if sizeof(bus_addr_t) is larger than 4 (e.g. on 64 bit arches,
or when PAE is enabled on i386).  The code could be refactored to do
compile-time checks, but that is more disruptive.

MFC after:	1 week
2011-12-21 15:59:18 +00:00
Andriy Gapon
6aa40c0146 retire libkern gets
Inspired by:	bde
MFC after:	2 months
X-MFC-Note:	if deemed a part of KPI, just call cngets internally
2011-12-17 15:48:55 +00:00
Jung-uk Kim
3f0275a033 Merge ACPICA 20111123. 2011-11-28 23:36:48 +00:00