Commit Graph

23028 Commits

Author SHA1 Message Date
John Baldwin
b02a80a7c5 Update recently added drivers to use the if_*addr_r*lock() wrapper
functions instead of using the IF_ADDR_LOCK directly.  The wrapper
functions are the supported interface for device drivers.

Reviewed by:	bz, philip
MFC after:	1 week
2012-01-05 18:32:37 +00:00
Robert Watson
19d52de5f4 When extracting the VLAN tag from if_em and if_lem receive descriptor
rings, copy the whole VLAN tag, not just the VLAN ID.  This fixes a
problem in which VLAN priority information was dropped when using
offloaded VLAN processing with these drivers.

Discussed with:	jfv, rrs
Sponsored by:	ADARA Networks, Inc.
MFC after:	3 days
2012-01-05 17:30:15 +00:00
John Baldwin
e0636bc0ca Remove use of explicit bus space tags and handles and use methods that
operate on resource objects instead.

MFC after:	1 week
2012-01-05 16:27:32 +00:00
Fabien Thomas
ba89031aea Update PMC events from October 2011 Intel documentation.
Submitted by:	Davide Italiano <davide.italiano@gmail.com>
MFC after:	3 days
2012-01-04 07:58:36 +00:00
Fabien Thomas
3444c31af6 Add missing MSR programming for some events.
Submitted by:	Davide Italiano <davide.italiano@gmail.com>
MFC after:	3 days
2012-01-04 07:33:06 +00:00
Adrian Chadd
450a186c06 Add a couple more SPI flash device IDs found in commercial
consumer wireless kit.

Submitted by:	Stefan Bethke <stb@lassitu.de>
2012-01-04 04:17:03 +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
Dimitry Andric
7c864d7df9 In sys/dev/qlxgb/qla_misc.c, fix a copy/paste issue. Clang complained
the variable 'val' was uninitialized when used.  Instead, 'sig' should
have been printed.

Reviewed by:	davidcs
MFC after:	1 week
2012-01-03 20:51:26 +00:00
Xin LI
3093cb15fb Don't forget to release queue lock when allocation of memory failed.
Submitted by:	Sascha Wildner <saw online de>
Obtained from:	DragonFly
MFC after:	2 weeks
2012-01-03 20:17:35 +00:00
Dimitry Andric
54a55725a3 In sys/dev/if_ndis/if_ndis_pccard.c, fix a bug where a garbage rid was
passed to resource_list_add().  The rid that was just returned by
bus_alloc_resource_any() should have been used instead.

Reviewed by:	jhb
MFC after:	1 week
2012-01-03 18:40:41 +00:00
Kevin Lo
1a74905fee Add support for Intel EG20T serial ports 2012-01-03 10:01:12 +00:00
Bernhard Schmidt
3e51210689 Don't rely on MCS7 being at index 7 while determining the amount
of antennas to use. Not all APs enable all MCS rates.

Poked by:	Lucius Windschuh <lwindschuh at googlemail dot com>
MFC after:	1 week
2012-01-03 09:42:31 +00:00
Hans Petter Selasky
6bbe7cdfb2 Make sure we probe and attach the root HUB after
resume else no devices will appear again.

MFC after:	1 day
2012-01-02 20:28:33 +00:00
Ed Schouten
dc15eac046 Use strchr() and strrchr().
It seems strchr() and strrchr() are used more often than index() and
rindex(). Therefore, simply migrate all kernel code to use it.

For the XFS code, remove an empty line to make the code identical to
the code in the Linux kernel.
2012-01-02 12:12:10 +00:00
Adrian Chadd
c0711b9756 If frames are dumped out of the queue, let's at least see what they are.
This shows that the majority of the weird traffic I see here are probe
frames that haven't been sent out, but I can also trigger this condition
by doing ICMP w/ -i 0.3 - enough to trigger the TX during actual scanning,
but not fast enough to stop scanning from occuring.

PR:		kern/163689
2012-01-01 01:08:51 +00:00
Hans Petter Selasky
c2d0465a9b Add missing change to XHCI driver similar to changes in r228483.
MFC after:	0 days
2011-12-31 13:34:42 +00:00
Dimitry Andric
b38c0519c5 In sys/dev/hwpmc/hwpmc_amd.c, fix a clang warning about invalid enum
conversions.

Reviewed by:	jkoshy
MFC after:	1 week
2011-12-31 12:37:07 +00:00
Marcel Moolenaar
49a5225199 DEBUG is a kernel option. Don't define it here, as it breaks LINT.
Since DEBUG was subsequently undefined, this is just debugging left-
over.
2011-12-30 04:00:31 +00:00
Marcel Moolenaar
b9887274c1 Actually set the baudrate from the FDT. 2011-12-30 03:57:17 +00:00
Dimitry Andric
a3388f6d69 Reapply r228785 now it has been tested by Adrian. Also add comments
with the old AR_SCR_SLE_XXX values, with a short explanation why they
were changed.

Reviewed by:	adrian
MFC after:	1 week
2011-12-30 02:58:37 +00:00
Dimitry Andric
1acc420fe0 In sys/dev/drm/radeon_state.c, use the correct printf length modifiers
for ints.

MFC after:	1 week
2011-12-30 02:07:50 +00:00
Dimitry Andric
8520ce6001 Fix clang warnings in sys/dev/ce/if_ce.c and sys/dev/cp/if_cp.c,
using jkim's last patch (reviewed by bde) from here:

http://docs.freebsd.org/cgi/mid.cgi?201010141558.03154.jkim

MFC after:	1 week
2011-12-29 17:46:24 +00:00
John Baldwin
a74d695299 Further relax the strictness of enforcing allocations to only come from
decoded ranges.  Pass any request for a specific range that fails because
it is not in a decoded range for an ACPI Host-PCI bridge up to the parent
to see if it can still be allocated.  This is based on the assumption that
many BIOSes are inconsistent/broken and that settings programmed into BARs
or resources assigned to other built-in components are more trustworthy than
the list of decoded resource ranges in _CRS.  This effectively limits the
decoded ranges to only being used for "wildcard" ranges when allocating
fresh resources for a BAR, etc.  At some point I would like to only be
this permissive during an early scan of firmware-assigned resources during
boot and to be strict about all later allocations, but that isn't viable
currently.

MFC after:	2 weeks
2011-12-29 16:23:14 +00:00
Konstantin Belousov
84f941284c Add PCI Id for the Intel AMT serial interface as found on my DQ67OW.
MFC after:	1 week
2011-12-29 08:27:37 +00:00
Xin LI
81966bce06 Import the first release of HighPoint RocketRAID 27xx SAS 6Gb/s HBA card
driver.  This driver works for FreeBSD/i386 and FreeBSD/amd64 platforms.

Many thanks to HighPoint for providing this driver.

MFC after:	2 weeks
2011-12-28 23:26:58 +00:00
Alexander Motin
a0b435f856 Set maximum I/O size for mps(4) to MAXPHYS. Looking into the code, I see
no reason why it should be limited to 64K of DFLTPHYS. DMA data tag is any
way set to allow MAXPHYS, S/G lists (chain elements) are sufficient and
overflows are also handled. On my tests even 1MB I/Os are working fine.

Reviewed by:	ken@
2011-12-28 22:49:28 +00:00
Matt Jacob
f6683e5594 Fix target mode compilation issues that arose after a change
in the sense data structures.

MFC after:	1 week
2011-12-27 14:59:24 +00:00
Adrian Chadd
613f73a82d AR5416 has 14 GPIO pins, from 0->13. 2011-12-26 08:21:29 +00:00
Adrian Chadd
404b0e8b91 Since the only thing with a mux is the AR5416 and later, and we're now
doing split software/hardware LED configuration, we can now simply
treat "softled" as an "output" mux type.

This works fine on this DWA-552. Previous generation (pre-11n NICs) don't
have a GPIO mux - only input/output configuration - so they ignore this
field.
2011-12-26 07:48:29 +00:00
Adrian Chadd
3440495a52 Flesh out configurable hardware based LED blinking.
The hardware (MAC) LED blinking involves a few things:

* Selecting which GPIO pins map to the MAC "power" and "network" lines;
* Configuring the MAC LED state (associated, scanning, idle);
* Configuring the MAC LED blinking type and speed.

The AR5416 HAL configures the normal blinking setup - ie, blink rate based
on TX/RX throughput.  The default AR5212 HAL doesn't program in any
specific blinking type, but the default of 0 is the same.

This code introduces a few things:

* The hardware led override is configured via sysctl 'hardled';
* The MAC network and power LED GPIO lines can be set, or left at -1
  if needed.  This is intended to allow only one of the hardware MUX
  entries to be configured (eg for PCIe cards which only have one LED
  exposed.)

TODO:

* For AR2417, the software LED blinking involves software blinking the
  Network LED.  For the AR5416 and later, this can just be configured
  as a GPIO output line.  I'll chase that up with a subsequent commit.

* Add another software LED blink for "Link", separate from "activity",
  which blinks based on the association state.  This would make my
  D-Link DWA-552 have consistent and useful LED behaviour (as they're
  marked "Link" and "Activity."

* Don't expose the hardware LED override unless it's an AR5416 or later,
  as the previous generation hardware doesn't have this multiplexing
  setup.
2011-12-26 07:47:05 +00:00
Adrian Chadd
a497cd8806 Setup the initial LED state on attach and resume.
Some of the NICs I have here power up with the LEDs blinking, which is
incorrect. The blinking should only occur when the NIC is attempting
to associate.

* On powerup, set the state to HAL_LED_INIT, which turns on the "Power" MAC
  LED but leaves the "Network" MAC LED the way it is.

* On resume, also init it to HAL_LED_INIT unless in station mode, where
  it's forced to HAL_LED_RUN. Hopefully the net80211 state machine will
  call newstate() at some point, which will refiddle the LEDs.

I've tested this on a handful of 11n and pre-11n NICs. The blinking
behaviour is slightly more sensible now.
2011-12-26 06:25:12 +00:00
Adrian Chadd
2942e03f5c Update the hardware LED blinking code to do something useful rather than
relying on what the register defaults are.

This forces the blink mode to be proportional to the TX and RX frames
which match the RX filter.

This (along with a few tweaks to if_ath_led.c to configure the correct
GPIO pins) allows my DWA-552 AR5416 NIC to blink the LEDs in a useful
fashion, however those LEDs are marked "Link" and "Act(ivity)", which
don't really map well to the "power" / "network" LED interface which
the MAC provides. Some further tinkering is needed to see what other
useful operating modes are possible.
2011-12-26 06:07:21 +00:00
Adrian Chadd
6558ffd99a Refactor out the software LED config code into a common function, called
ath_led_config().

The eventual aim is to have both software and hardware based LED
configuration done here.
2011-12-26 05:46:22 +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
Adrian Chadd
7e97436b0e Do a quick style(9) pass of some of the code introduced with 802.11n
support.
2011-12-26 05:26:35 +00:00
Luigi Rizzo
6f3bc95594 remove a variable definition which shadows the correct one.
Submitted by:	Eitan Adler
2011-12-25 21:00:56 +00:00
Bjoern A. Zeeb
d9667fc69e Quite the tinderbox for the holidays. Remove the assert[1].
Suggested by:	jhibbits [1]
MFC after:	3 days
2011-12-25 14:29:36 +00:00
Justin Hibbits
7b25dcca76 Implement hwpmc counting PMC support for PowerPC G4+ (MPC745x/MPC744x).
Sampling is in progress.

Approved by:	nwhitehorn (mentor)
MFC after:	9.0-RELEASE
2011-12-24 19:34:52 +00:00
Oleksandr Tymoshenko
d42cc94633 - Enable usbus on octusb 2011-12-24 00:22:21 +00:00
Luigi Rizzo
d0c7b0751a 1. don't use if_pspare directly, but through a macro WMA()
2. move a variable declaration at the beginning of a block
2011-12-23 16:03:57 +00:00
Luigi Rizzo
57bf0568e1 whitespace fixes (one missing newline, one extra tab) 2011-12-23 16:02:14 +00:00
Adrian Chadd
252b52fd58 Disable the code which hard-sets the LEDs on. This prevents the LED
state from correctly updating things.

The reference driver directly enables/disables the LED state as required,
rather than nailing it up like it currently is.  That'll have to come
later by adding some further HAL methods.

Obtained from:	Atheros
2011-12-23 09:09:10 +00:00
Adrian Chadd
b5e55cb397 Port over some more GPIO fixes from the atheros reference HAL.
* Bring the AR5416 GPIO mux mask code in line with the code from the
  HAL.

* Add HAL_DEBUG_GPIO debugging statements, to track what's going on.

* Add Kiwi GPIO specific changes for reading values back.

Obtained from:	Atheros
2011-12-23 08:53:22 +00:00
Adrian Chadd
e81f85f155 Port over some GPIO and LED fixes.
* As a preparation for AR9287 GPIO support, add in the AR9287 GPIO mask.
* Fix the association mask values; these are post-shift values but were
  being shifted in twice. This resulted in some garbage being written
  in the wrong place and the link LED (at least on my d-link AR5416
  NIC) giving totally incorrect blink patterns.
2011-12-23 08:32:53 +00:00
Adrian Chadd
153bf8fbd3 Remove unused #define's.
Pointy hat to: adrian, for not properly reading things when he copied
  ar9285.h to ar9287.h.
2011-12-23 04:05:39 +00:00
Adrian Chadd
ee3219757a Rework this ugly mess that tries to handle reset serialisation.
Some users were reporting concurrent resets _were_ occuring - ie,
either two ath_reset()s ran at the same time (likely one on each CPU)
or ath_reset() versus ath_chan_change().

Instead, this now tries to grab the serialisation semaphore and will
pause() for a while if it fails. It will always eventually succeed though
and will log an error if it hits the recursion situation.

All of this stuff needs to die a horrible death at some point and be
replaced with a properly serialising method of programming this stuff
(eg using the net80211 taskqueue for all of this stuff.) The trouble
is figuring out how to handle the concurrent ioctl() based things without
introducing more LORs (which is another reason why I haven't just wrapped
all of this stuff in large, long-lived locks, a-la what Linux can get
away with.)

MFC after:	Absolutely, positively never.
2011-12-23 03:59:49 +00:00
Adrian Chadd
6e0f116875 Make some more of the 11n specific code conditional.
This doesn't fix compilation w/out AH_SUPPORT_AR5416 as all of the software
aggregation support in if_ath_tx.c and 11n code in if_ath_tx_ht.c touches
the 11n specific fields. I'll work on that later.
2011-12-23 02:40:35 +00:00
Adrian Chadd
197d53c565 Add a temporary debugging statement in order to try and identify what's
going on with the occasional garbage rs_antenna field reported by AR9285
users.

I've discovered that the 11n NICs only fill out the entire RX status
descriptor on the final descriptor in an aggregate. Some of the fields
(notably RSSI) are complete nonsense for A-MPDU subframes. This may
be another example of this.

The driver doesn't currently toss out statistics for non-final aggregate
frames. It's likely that this should be done.

If any users hit this particular debugging message they should report it
immediately to freebsd-wireless@freebsd.org - please ensure you have
ATH_DEBUG enabled so it prints out the full receive descriptor.

PR:		kern/163312
2011-12-23 02:21:22 +00:00
Navdeep Parhar
e050eaa32a Fix return value of function.
Submitted by:	Dan McGregor <dan dot mcgregor at usask dot ca>
2011-12-23 01:39:10 +00:00
Adrian Chadd
ead079638f Use the correct types when calling the decompression mask function.
There's currently no public code which uses this feature and the
current reference driver doesn't enable this feature at all.
It's possible it was used by a previous version of the driver and
that indeed it should return HAL_STATUS; but at this point I'm
happy to require that they complain and submit a patch.

This was found by LLVM compile-time type checking.

Submitted by:	dim
2011-12-22 21:54:53 +00:00