Commit Graph

25358 Commits

Author SHA1 Message Date
Hans Petter Selasky
5e184962dd - Add support for Etron EJ168 USB 3.0 Host Controllers.
This brand of controllers expects that the number of
contexts specified in the input slot context points
to an active endpoint context, else it refuses to
operate.

- Ring the correct doorbell when streams mode is used.
- Wrap one or two long lines.

Tested by:	Markus Pfeiffer (DragonFlyBSD)
MFC after:	1 week
2012-12-01 22:13:38 +00:00
Andriy Gapon
30bf6110b5 acpi_cpu_notify: disable acpi_cpu_idle while updating C-state data
... to avoid any races or inconsistencies.
This should fix a regression introduced in r243404.

Also, remove a stale comment that has not been true for quite a while
now.

Pointyhat to:	avg
Teested by:	trociny, emaste, dumbbell (earlier version)
MFC after:	 1 week
2012-12-01 18:06:05 +00:00
Andriy Gapon
09424d43c1 acpi_cpu: change cpu_disable_idle to be a per-cpu flag...
and make it safe to manipulate and check the flag

With help from:	jhb
Tested by:	trociny, emaste, dumbbell
MFC after:	1 week
2012-12-01 18:01:01 +00:00
Adrian Chadd
e5d63a99bc Add a new HAL capability - check and enforce whether the NIC supports
enforcing the TXOP and TBTT limits:

* Frames which will overlap with TBTT will not TX;
* Frames which will exceed TXOP will be filtered.

This is not enabled by default; it's intended to be enabled by the
TDMA code on 802.11n capable chipsets.
2012-12-01 03:48:11 +00:00
Jack F Vogel
39aa926bb3 Patch #12 OK, I said there was only 11 patches, but unfortunately
the revamped sysctl code did not work, and needed a change. This
makes the limit get set at the time that all sysctl stats are
created and is actually more elegant imho anyway.
2012-12-01 01:24:40 +00:00
Jack F Vogel
5a5d90a268 Patch #11 - The final patch: this one greatly improves the
TX hot path by getting rid of index calculations and simply
managing pointers. Much of the creative code is due to my
coworker here at Intel, Alex Duyck, thanks Alex!

Also, this whole series of patches was given the critical
eye of Gleb Smirnoff and is all the better for it, thanks
Gleb!
2012-12-01 00:11:24 +00:00
Jack F Vogel
d777904f05 Patch #10 Performance - this changes the protocol offload
interface and code in the TX path,making it tighter and
hopefully more efficient.
2012-12-01 00:03:58 +00:00
Jack F Vogel
df51baf38f Patch #9 Performance - improve the tx dma failure
path, similar to a change done in igb long ago.
2012-11-30 23:54:57 +00:00
Jack F Vogel
47dd71a877 Patch #8 Performance changes - this one improves locality,
moving some counters and data to the ring struct from
the adapter struct, also compressing some data in the
move.
2012-11-30 23:45:55 +00:00
Jack F Vogel
27329b1a91 Patch #7 This is primarily about processing limit control.
- add a limit for both RX and TX, change the default to 256
- change the sysctl usage to be common, and now to be called
during init for each ring.
- the TX limit is not yet used, but the changes in the last
patch in this series uses the value.
- the motivation behind these changes is to improve data
locality in the final code.
- rxeof interface changes since it now gets limit from the
ring struct
2012-11-30 23:28:01 +00:00
Jack F Vogel
01816c875d Patch #6 Whitespace cleanup, and removal of some very old
defines (at Gleb's request). Also, change the defines around
the old transmit code to IXGBE_LEGACY_TX, I do this to make
it possible to define this regardless of the OS level (it is
not defined by default). There are also a couple changed
comments for clarity.
2012-11-30 23:13:56 +00:00
Jack F Vogel
0c2f38e43b Patch #5 Cleanup unused IEEE1588 code fragments, the day may
come when this feature gets implemented, but its not here yet
and I see no reason to leave this laying around.
2012-11-30 23:06:27 +00:00
Jack F Vogel
6d3e416bc4 Patch #4 - this does two things, it removes a number of statistics,
these are FCOE stats (fiber channel over ethernet), something that
FreeBSD does not yet have, they were mistaken for flow control by
the implementor I believe. Secondly, the real flow control stats
are oddly named with a 'link' tag on the front, it was requested
by my validation engineer to make these stats have the same name as
the igb driver for clarity and that seemed reasonable to me.
2012-11-30 22:54:14 +00:00
Jack F Vogel
6a59dfbb86 Patch #3 - Add a new ioctl to access SFP+ module diagnostic
data via the I2C routines in shared code.
2012-11-30 22:41:32 +00:00
Jack F Vogel
35bbbdaa3b Patch #2 - remove OACTIVE and DEPLETED notions from the
multiqueue code, this functionality has proven to be more
trouble than it was worth. Thanks to Gleb for a second
critical look over my code and help in the patches!
2012-11-30 22:33:21 +00:00
Jack F Vogel
7d1157eec8 First of a series of 11 patches leading to new ixgbe version 2.5.0
This removes the header split and supporting code from the driver.
2012-11-30 22:19:18 +00:00
Adrian Chadd
6ef131b446 Include opt_wlan.h so the net80211 RX debug API compiles correctly. 2012-11-30 03:14:11 +00:00
Oleksandr Tymoshenko
1d1ffd9efb Add fdt_get_reserved_regions function. API is simmilar to fdt_get_mem_regions
It returns memory regions restricted from being used by kernel. These
regions are dfined in "memreserve" property of root node in the same
format as "reg" property of /memory node
2012-11-30 03:08:49 +00:00
Oleksandr Tymoshenko
33aad34de6 - Get proper maximum clock frequency for SDHCI v3.0 and higher 2012-11-30 02:35:13 +00:00
Pyun YongHyeon
fe26ad88e3 Add preliminary support for BCM57766 ASIC.
While I'm here add BCM57762 device id which is found on Apple
Thunderbolt ethernet.

Tested by:	Richard Kuhns < rjk <> wintek dot com >
2012-11-30 01:38:00 +00:00
Navdeep Parhar
d588c1f9ba cxgbe/tom: Handle the case where the chip falls out of DDP mode by
itself.  The hole in the receive sequence space corresponds to the
number of bytes placed directly up to that point.

MFC after:	1 week
2012-11-29 19:39:27 +00:00
Navdeep Parhar
000da5202e cxgbe/tom: Add a flag to indicate that the L2 table entry for an
embryonic connection has been setup and never attempt to abort a tid
before this is done.  This fixes a bad race where a listening socket is
closed when the driver is in the middle of step (b) here.  The symptom
of this were "ARP miss" errors from the driver followed by tid leaks.

A hardware-offloaded passive open works this way:

a) A SYN "hits" the TCAM entry for a server tid and the chip delivers it
to the queue associated with the server tid (say, queue A).  It waits
for a response from the driver telling it what to do.

b) The driver decides it is ok to proceed.  It adds the new tid to the
list of embryonic connections associated with the server tid and then
hands off the SYN to the kernel's syncache to make sure that the kernel
okays it too.  If it does then the driver provides an L2 table entry,
queue id (say, queue B), etc. and instructs the chip to send the SYN/ACK
response.

c) The chip delivers a status to queue B depending on how the third step
of the 3-way handshake goes.  The driver removes the tid from its list
of embryonic connections and either expands the syncache entry or
destroys the tid.  In any case all subsequent messages for the new tid
will be delivered to queue B, not queue A.  Anything running in queue B
knows that the L2 entry has long been setup and the new flag is of no
interest from here on.  If the listener is closed it will deal with
so_comp as normal.

MFC after:	1 week
2012-11-29 19:10:04 +00:00
Eitan Adler
1a12569c85 Add support for AT&T Sierra Wireless USB 3G adapter
PR:		kern/173982
Submitted by:	Eric Camachat <eric@camachat.org>
Approved by:	cperciva (implicit)
MFC after:	1 week
2012-11-29 00:32:03 +00:00
Adrian Chadd
8bf4020830 Call if_free() with the correct vnet context if and only if ifp_vnet
isn't NULL.

If the attach fails prematurely and there's no if_vnet context, calling
CURVNET_SET(ifp->if_vnet) is going to dereference a NULL pointer.
2012-11-28 07:12:08 +00:00
Adrian Chadd
491e124856 Until I figure out what to do here, remind myself that this needs some
rate control 'adjustment' when NOACK is set.
2012-11-28 06:55:34 +00:00
Adrian Chadd
7c783791c8 Pull out the debugging code from the critical path and make sure it
happens _after_ all of the time delta calculations.
2012-11-28 01:55:22 +00:00
Andre Oppermann
da2299c5c7 Remove unused and unnecessary CSUM_IP_FRAGS checksumming capability.
Checksumming the IP header of fragments is no different from doing
normal IP headers.

Discussed with:	yongari
MFC after:	1 week
2012-11-27 19:31:49 +00:00
Bernhard Schmidt
b29bf00c95 fix a panic resulting from a stray '&'
MFC after:	1 week
2012-11-27 19:09:36 +00:00
Adrian Chadd
821311ea59 * Fix another culprit of my "committed from the wrong directory" nonsense;
now this works for non-debug and debug builds.

* Add a comment reminding me (or someone) to audit all of the relevant
  math to ensure there's no weird wrapping issues still lurking about.

But yes, this does seem to be mostly working.

Pointy-hat-to:	adrian, yet again
2012-11-27 11:30:39 +00:00
Adrian Chadd
4fd97455a3 Correct some debugging output. 2012-11-27 08:40:48 +00:00
Adrian Chadd
584295fca4 Fix build 2012-11-27 05:52:08 +00:00
Adrian Chadd
4bda23f95b Improve the TDMA debugging:
* add some further debugging prints, which are quite nice to have
* add in ALQ hooks (optional!) to allow for the TDMA information to be
  logged in-line with the TX and RX descriptor information.
2012-11-27 02:27:30 +00:00
Adrian Chadd
11f07b7b52 Add in specific TDMA logging types. 2012-11-27 02:24:05 +00:00
Adrian Chadd
e6f1a34af4 Fix the TDMA nexttbtt programming for 802.11n chips.
The existing logic wrapped programming nexttbtt at 65535 TU.
This is not good enough for the 11n chips, whose nexttbtt register
(GENERIC_TIMER_0) has an initial value from 0..2^31-1 TSF.
So converting the TU to TSF had the counter wrap at (65535 << 10) TSF.

Once this wrap occured, the nexttbtt value was very very low, much
lower than the current TSF value.  At this point, the nexttbtt timer
would constantly fire, leading to the TX queue being constantly gated
open.. and when this occured, the sender was not correctly transmitting
in its slot but just able to continuously transmit.  The master would
then delay transmitting its beacon until after the air became free
(which I guess would be after the burst interval, before the next burst
interval would quickly follow) and that big delta in master beacon TX
would start causing big swings in the slot timing adjustment.

With this change, the nexttbtt value is allowed to go all the way up
to the maximum value permissable by the 32 bit representation.
I haven't yet tested it to that point; I really should.  The AR5212
HAL now filters out values above 65535 TU for the beacon configuration
(and the relevant legal values for SWBA, DBA and NEXTATIM) and the
AR5416 HAL just dutifully programs in what it should.

With this, TDMA is now useful on the 802.11n chips.

Tested:

* AR5416, AR9280 TDMA slave
* AR5413 TDMA slave
2012-11-27 02:23:45 +00:00
Adrian Chadd
a52b6c396b Add a note about the magic values here; don't change them. 2012-11-27 02:19:35 +00:00
Adrian Chadd
2cb6e9834f When programming the beacon timer configuration, be very explicit about
what the maximum legal values are.

The current beacon timer configuration from TDMA wraps things at
HAL_BEACON_PERIOD-1 TU.  For the 11a chips this is fine, but for
the 11n chips it's not enough resolution.  Since the 11a chips have a
limit on what's "valid", just enforce this so when I do write larger
values in, they get suitably wrapped before programming.

Tested:

* AR5413, TDMA slave

Todo:

* Run it for a (lot) longer on a clear channel, ensure that no strange
  slippages occur.
* Re-validate this on STA configurations, just to be sure.
2012-11-27 02:18:41 +00:00
Gleb Smirnoff
9c402aeb41 drbr_enqueue() awlays consumes mbuf, no matter did it
fail or not. The mbuf pointer is no longer valid, so
can't be reused after.

  Fix igb_mq_start() where mbuf pointer was used after
drbr_enqueue().

  This eventually leads us to all invocations of
igb_mq_start_locked() called with third argument as NULL.
This allows us to simplify this function.

Submitted by:	Karim Fodil-Lemelin <fodillemlinkarim gmail.com>
Reviewed by:	jfv
2012-11-26 20:03:57 +00:00
Alexander Motin
1ba706292c Fix uninitialized variable reported by gcc, but not clang. 2012-11-26 02:04:11 +00:00
Alexander Motin
8903f19ef0 Remove extra sbuf_trim() copy/pasted into r243530. 2012-11-26 01:54:00 +00:00
Alexander Motin
7ec13509e9 On multiple requests, compact HDA driver verbose output by hiding CODEC's
detailed information under the sound debug.  To make it easier accessible,
export that information through the set of sysctls like dev.hdaa.X.nidY.
Also tune some output to make it both more compact and informative.
2012-11-25 20:06:01 +00:00
Adrian Chadd
6dd853a77a Add a comment which covers what's going on with the 64 bit TSF write.
After chatting with the MAC team, the TSF writes (at least on the 11n
MACs, I don't know about pre-11n MACs) are done as 64 bit writes that
can take some time.  So, doing a 32 bit TSF write is definitely not
supported.  Leave a comment here which explains that.

Whilst here, add a comment which outlines that after a reset or TSF
write, the TSF write may take a while (up to 50uS) to update.
A write or reset shouldn't be done whilst the previous one is in
flight.  Also (and this isn't currently done) a read shouldn't
occur until the SLEEP32_TSF_WRITE_STAT is clear.  Right now we're
not doing that, mostly because we haven't been doing lots of TSF
resets/writes until recently.
2012-11-24 02:41:18 +00:00
Oleksandr Tymoshenko
12ad19bc4c Style fixes
- Remove C++ - style comments
- Use proper device name in panic messages
2012-11-23 19:20:38 +00:00
Alexander Motin
418cc71b52 Remove "clone manager: " message from verbose dmesg. It is pointless to
print values that are statically hardcoded few lines above that.
2012-11-23 15:31:00 +00:00
Alexander Motin
4754395cac Move sndbuf_setmap() output about buffer addresses from the general verbose
output to sound verbose output, where all other sndbuf messages live.
2012-11-23 13:43:51 +00:00
Hans Petter Selasky
8e5e664ccc Remove no longer needed quirk.
Submitted by:	Mark Johnston
2012-11-23 08:22:06 +00:00
Adrian Chadd
84dd5933b5 Use a 64 bit TSF write to update the TSF adjust, rather than a 32 bit
TSF write.

The TSF_L32 update is fine for the AR5413 (and later, I guess) 11abg NICs
however on the 11n NICs this didn't work.  The TSF writes were causing
a much larger time to be skipped, leading to the timing to never
converge.

I've tested this 64 bit TSF read, adjust and write on both the
11n NICs and the AR5413 NIC I've been using for testing.  It works
fine on each.

This patch allows the AR5416/AR9280 to be used as a TDMA member.
I don't yet know why the AR9280 is ~7uS accurate rather than ~3uS;
I'll look into it soon.

Tested:

* AR5413, TDMA slave (~ 3us accuracy)
* AR5416, TDMA slave (~ 3us accuracy)
* AR9280, TDMA slave (~ 7us accuracy)
2012-11-23 05:52:22 +00:00
Adrian Chadd
ddee921170 Fix up the nexttbtt -> TSF delta calculation to not wrap ridiculously
on the 802.11n NICs.

The 802.11n NICs return a TBTT value that continues far past the 16 bit
HAL_BEACON_PERIOD time (in TU.)  The code would constrain nextslot to
HAL_BEACON_PERIOD, but it wasn't constraining nexttbtt - the pre-11n
NICs would only return TU values from 0 -> HAL_BEACON_PERIOD.  Thus,
when nexttbtt exceeded 64 milliseconds, it would not wrap (but nextslot
did) which lead to a huge tsfdelta.

So until the slot calculation is converted to work in TSF rather than
a mix of TSF and TU, "make" the nexttbtt values match the TU assumptions
for pre-11n NICs.

This fixes the crazy deltatsf calculations but it doesn't fix the
non-convergent tsfdelta issue.  That'll be fixed in a subsequent commit.
2012-11-23 05:38:38 +00:00
Adrian Chadd
02a9696b0a Add the HAL wrapper for settsf64. 2012-11-23 05:33:01 +00:00
Adrian Chadd
c83ba0b9bf Implement a HAL method to set a 64 bit TSF value.
TODO: implement it (and test) for the AR5210/AR5211.
2012-11-23 05:32:24 +00:00
Juli Mallett
a8e879f9fc Use MIPS_PHYS_TO_DIRECT_UNCACHED rather than a homegrown version which is not
compatible with 32-bit kernels.
2012-11-23 04:28:13 +00:00
Oleksandr Tymoshenko
82b036b9c6 Look for MAC address in FDT tree nodes that are usb network devices and
have either "mac-address" or "local-mac-addrress" property.
2012-11-23 03:34:12 +00:00
Andriy Gapon
f51d43fe01 acpi_cpu: use fixed resource ids for cx state i/o resources
... instead of the ever increasing ones.
Also, do free old resources when allocating new ones when cx states
change.

Tested by:	Tom Lislegaard <Tom.Lislegaard@proact.no>
Obtained from:	jkim
MFC after:	1 week
2012-11-22 14:40:26 +00:00
Ed Maste
a4732e3583 Use %u for unsigned serial number 2012-11-22 03:54:51 +00:00
Hans Petter Selasky
9efb73396e Fix uplcom clear stall logic for PL2303HX.
Submitted by:	Mark Johnston
MFC after:	1 week
2012-11-21 22:04:40 +00:00
Jaakko Heinonen
341b240dc7 Print correct unit number when attaching preloaded memory disks.
Retire now unused mdunits variable.
2012-11-21 17:05:57 +00:00
Jaakko Heinonen
734e78dfcb Disallow attaching preloaded memory disks via ioctl.
- The feature is dangerous because the kernel code didn't check
  validity of the memory address provided from user space.
- It seems that mdconfig(8) never really supported attaching preloaded
  memory disks.
- Preloaded memory disks are automatically attached during md(4)
  initialization. Thus there shouldn't be much use for the feature.

PR:		kern/169683
Discussed on:	freebsd-hackers
2012-11-21 16:56:47 +00:00
Jaakko Heinonen
02c62349c9 - Don't pass geom and provider names as format strings.
- Add __printflike() attributes.
- Remove an extra argument for the g_new_geomf() call in swapongeom_ev().

Reviewed by:	pjd
2012-11-20 12:32:18 +00:00
Adrian Chadd
cc637103f6 Don't allocate or program a key for the AR5210.
The AR5210 doesn't support HAL_CIPHER_CLR ('clear encryption' keycache
slots), so don't bother - just map them to slot 0 and never program them.
2012-11-19 23:54:05 +00:00
Adrian Chadd
143cfad710 Disable WEP hardware encryption on the AR5210, in order to allow other
encryption types.

The AR5210 only has four WEP key slots, in contrast to what the
later MACs have (ie, the keycache.)  So there's no way to store a "clear"
key.

Even if the driver is taught to not allocate CLR key entries for
the AR5210, the hardware will actually attempt to decode the encrypted
frames with the (likely all 0!) WEP keys.

So for now, disable the hardware encryption entirely and just so it
all in software.  That allows both WEP -and- WPA to actually work.

If someone wishes to try and make hardware WEP _but_ software WPA work,
they'll have to create a HAL capability to enable/disable hardware
encryption based on the current STA/Hostap mode. However, making
multi-vap work with one WEP and one WPA VAP will require hardware
encryption to be disabled anyway.
2012-11-19 23:42:46 +00:00
Adrian Chadd
73f81b5b19 Remove this include, it isn't needed. 2012-11-18 20:41:46 +00:00
Alexander Motin
6d36c821ad Summarize information about connected analog pins and EDID-like data received
from HDMI/DisplayPort devices in form of general connection status and
sound(4)-style channel matrix.  Now that information is only reported in
readable form to verbose logs, but potentially could be used by sound(4)
to correctly choose default devices and configure vchans.

Fix rear and side channels swap on analog 7.1 outputs.  As soon as there is
a huge mess in industry about naming and using of these channels, duplicate
rear channels of 4 and 5.1 streams to both read and side speakers.
2012-11-17 06:33:13 +00:00
Neel Natu
3248464555 IFC @ r243164 2012-11-17 02:55:47 +00:00
Adrian Chadd
875d039e0a Correctly populate the RTS field.
Tested:
	* AR5210, STA mode, RTS enabled
2012-11-17 02:39:37 +00:00
Adrian Chadd
3a4d0022de * Remove ah_desc.h, it's not needed
* Add some shifts that I'm using in userspace (athalq.)

However, this exposes a fun little bug..
2012-11-17 02:39:09 +00:00
Adrian Chadd
93cad1bdbd .. include ah_desc.h here now. 2012-11-17 02:02:36 +00:00
Adrian Chadd
f8af1be8f8 Remove the ah_desc.h reference; it's not needed.
I'm using these descriptor header files in userland and I'm trying to
avoid populating a compatibility ah_desc.h file.
2012-11-17 02:00:33 +00:00
Adrian Chadd
69f33b13d1 I'm not sure why ah_desc.h was required here, but it doesn't _need_
to be. So, just toss it.

There's no options or ah_desc fields in here.

Whilst I'm here, fix up the #ifdef and #define to mach.
2012-11-16 20:04:45 +00:00
Adrian Chadd
e3f0668803 * Remove a duplicate TX ALQ post routine!
* For CABQ traffic, I -can- chain them together using the next pointer
  and just push that particular chain head to the CABQ.  However, this
  doesn't magically make EDMA TX CABQ work - I have to do some further
  hoop jumping.
2012-11-16 19:58:15 +00:00
Adrian Chadd
bb327d284b ALQ logging enhancements:
* upon setup, tell the alq code what the chip information is.
* add TX/RX path logging for legacy chips.
* populate the tx/rx descriptor length fields with a best-estimate.
  It's overly big (96 bytes when AH_SUPPORT_AR5416 is enabled)
  but it'll do for now.

Whilst I'm here, add CURVNET_RESTORE() here during probe/attach as a
partial solution to fixing crashes during attach when the attach fails.
There are other attach failures that I have to deal with; those'll come
later.
2012-11-16 19:57:16 +00:00
Adrian Chadd
956d4fb965 ath(4) ALQ logging improvements.
* Add a new method which allows the driver to push the MAC/phy/hal info
  into the logging stream.
* Add a new ALQ logging entry which logs the mac/phy/hal information.
* Modify the ALQ startup path to log the MAC/phy/hal information
  so the decoder knows which HAL/chip is generating this information.
* Convert the header and mac/phy/hal information to use be32, rather than
  host order.  I'd like to make this stuff endian-agnostic so I can
  decode MIPS generated logs on a PC.

This requires some further driver modifications to correctly log the
right initial chip information.

Also - although noone bar me is currently using this, I've shifted the
debug bitmask around a bit.  Consider yourself warned!
2012-11-16 19:39:29 +00:00
Alexander Motin
1fc2a61440 For some more completeness add matrixes for 3.1 and 7.0 channel setups. 2012-11-16 07:05:57 +00:00
Navdeep Parhar
e1e0aa8d3e cxgbe/tom: Plug mbuf leak.
MFC after:	3 days
2012-11-16 00:21:54 +00:00
Eitan Adler
9e93aa2336 Remove unneeded header from agp: opt_bus.h
Tested with "make universe"

Approved by:	cperciva
MFC after:	1 week
2012-11-15 18:49:17 +00:00
Eitan Adler
5e6997d26c Add deviceid to the disk output on boot to help debugging.
PR:		kern/173290
Submitted by:	Steven Hartland <steven.hartland@multiplay.co.uk>
Approved by:	cperciva
MFC after:	1 week
2012-11-15 15:06:09 +00:00
Adrian Chadd
bbdf3df1c4 Make sure the final descriptor in an aggregate has rate control information.
This was broken by me when merging the 802.11n aggregate descriptor chain
setup with the default descriptor chain setup, in preparation for supporting
AR9380 NICs.

The corner case here is quite specific - if you queue an aggregate frame
with >1 frames in it, and the last subframe has only one descriptor making
it up, then that descriptor won't have the rate control information
copied into it. Look at what happens inside ar5416FillTxDesc() if
both firstSeg and lastSeg are set to 1.

Then when ar5416ProcTxDesc() goes to fill out ts_rate based on the
transmit index, it looks at the rate control fields in that descriptor
and dutifully sets it to be 0.

It doesn't happen for non-aggregate frames - if they have one descriptor,
the first descriptor already has rate control info.

I removed the call to ath_hal_setuplasttxdesc() when I migrated the
code to use the "new" style aggregate chain routines from the HAL.
But I missed this particular corner case.

This is a bit inefficient with MIPS boards as it involves a few redundant
writes into non-cachable memory.  I'll chase that up when it matters.

Tested:

 * AR9280 STA mode, TCP iperf traffic
 * Rui Paulo <rpaulo@> first reported this and has verified it on
   his AR9160 based AP.

PR:		kern/173636
2012-11-15 03:00:49 +00:00
Dimitry Andric
cde1b992cf Fix a bug in aicasm_gram.y, noted by a newer clang 3.2 snapshot: it
compared an enum scope_type against a yacc-generated define, so the
condition would always be false.

MFC after:	3 days
2012-11-14 18:54:08 +00:00
Eitan Adler
9445dd3b87 Add support for CIR1000 - Cirrus Logic V34 to the uart driver
Approved by:	cperciva (implicit)
MFC after:	1 week
2012-11-13 21:04:35 +00:00
Eitan Adler
8f19da81d1 Add support for CIR1000 - Cirrus Logic V34 to the sio driver
PR:		kern/44267
Submitted by:	Michail Vidiassov <master@iaas.msu.ru>
Arrival-Date:	Sat Oct 19 07:30:00 PDT 2002
Approved by:	cperciva (implicit)
MFC after:	1 week
2012-11-13 20:38:55 +00:00
Adrian Chadd
5f9fe65d64 Place 'dev.ath.X.debug' back under ATH_DEBUG, rather than ATH_DEBUG_ALQ. 2012-11-13 19:45:13 +00:00
Neel Natu
7d3d462b09 IFC @ r242940 2012-11-13 07:39:05 +00:00
Adrian Chadd
7d9dd2ac96 Add some debugging to try and catch an invalid TX rate (0x0) that is
being reported.
2012-11-13 06:28:57 +00:00
Kevin Lo
07ab70a447 Use uiomove return value instead of returning 0. 2012-11-13 06:03:43 +00:00
Kevin Lo
72794e9e2c Check the return value of uiomove(9). 2012-11-13 05:58:52 +00:00
Neel Natu
9f812a5beb Revert r229954 which in turn had reverted r228556 in projects/bhyve.
This was done to work around build issues when building projects/bhyve on an
8.x system at the time.

The workaround is no longer needed so re-instantiate r228556 in projects/bhyve.

Discussed with:	grehan@
Obtained from:	NetApp
2012-11-13 03:56:50 +00:00
Dimitry Andric
9c715a0979 Redo r242889, now using the method from projects/amd64_xen_pv r240747.
Reminded by:	kib
MFC after:	3 days
2012-11-12 22:28:32 +00:00
Sean Bruno
045d21a728 Update MAX_TASKS to scale a bit based on MAXCPU
This alleviates issues on newer Sandy/Ivy Bridge gear that seems to require
boatloads more ACPI resources than before.

Reviewed by:	avg@
Obtained from:	Yahoo! Inc.
MFC after:	2 weeks
2012-11-12 18:09:25 +00:00
Hans Petter Selasky
b70f0569e8 Add new USB IDs.
MFC after:	1 week
PR:		usb/173503
2012-11-12 07:25:51 +00:00
Adrian Chadd
603280386b Correctly fix the 'scan during STA mode' crash. 2012-11-11 21:58:18 +00:00
Adrian Chadd
58c82ec453 Remove this; i incorrectly committed the wrong (debug) changes in my
previous commit.
2012-11-11 21:57:18 +00:00
Roman Divacky
985518b80a Fix a typo. 2012-11-11 10:45:21 +00:00
Roman Divacky
f9a866956b Change the XNB_ASSERT from a statement expression to do-while(0) as its
result is never used.
2012-11-11 10:42:34 +00:00
Neel Natu
a10c6f5544 IFC @ r242684 2012-11-11 03:26:14 +00:00
Adrian Chadd
04cdca73d9 Don't call av_set_tim() if it's NULL.
This happens during a scan in STA mode; any queued data frames will
be power save queued but as there's no TIM in STA mode, it panics.

This was introduced by me when I disabled my driver-aware power save
handling support.
2012-11-11 00:34:10 +00:00
Adrian Chadd
3345c65be0 Correct some rather weird and broken behaviour observed when doing
actual traffic with an AR9380/AR9382/AR9485.

The sample rate control stats would show impossibly large numbers for
"successful packets transmitted."  The number was a tad under 2^^64-1.
So after a bit of digging, I found that the sample rate control code
was making 'tries' turn into a negative number.. and this was because
ts_longretry was too small.

The hardware returns "ts_longretry" at the current rate selection,
not overall for that TX descriptor.  So if you setup four TX rate
scenarios and the second one works, ts_longretry is only set for
the number of attempts at that second rate scenario.  The FreeBSD HAL
code does the correction in ath_hal_proctxdesc() - however, this isn't
possible with EDMA.

EDMA TX completion is done separate from the original TX descriptor.
So the real solution is to split out "find ts_rate and ts_longretry"
from "complete TX descriptor".  Until that's done, put a hack in
the EDMA TX path that uses the rate scenario information in the ath_buf.

Tested: AR9380, AR9382, AR9485 STA mode
2012-11-10 22:37:06 +00:00
Dimitry Andric
cddb1ffae1 Fix all the inconsistent nve_os* function declarations and definitions
in nve(4).  The OS_API structure defined in os.h expects NV_API_CALL
attributes, effectively regparm(0), on its function pointers, but all
the functions were declared and defined without this attribute.

MFC after:	1 week
2012-11-10 16:02:12 +00:00
Kevin Lo
f78d5b7e8a s/ATH_DEBUG/ATH_DEBUG_ALQ 2012-11-10 15:21:39 +00:00
Yoshihiro Takahashi
7a1cea226c Use ANSI prototype to fix build with clang.
MFC after:	1 week
2012-11-10 14:58:06 +00:00
Kevin Lo
9fc1923565 Fix the build. 2012-11-10 08:34:40 +00:00
Hans Petter Selasky
e71628651b Fix LOW and FULL speed USB INTERRUPT endpoint support for the
DWC OTG driver. Fix a hang issue when using LOW and FULL speed
BULK traffic. Make sure we don't ask for data in the last
microframe. This allows using devices like USB mice and USB
keyboards connected to the RPI-B.

Suggested by:	gonzo @
2012-11-09 16:28:58 +00:00
Roman Divacky
28f48eee07 Give tw_osl_dbg_printf format string to pacify clang warning. 2012-11-09 15:29:52 +00:00
Roman Divacky
46c7655029 Give device_printf format string to pacify clang warning. 2012-11-09 14:58:26 +00:00
Roman Divacky
b093ae5964 Cast VIA_READ to (void) where the result is unused. 2012-11-09 14:46:23 +00:00
Roman Divacky
73a19e6564 Remove unused static mn_timeout. 2012-11-09 14:14:51 +00:00
Roman Divacky
36e335c161 Give panic format string to pacify clang warning. 2012-11-09 13:58:52 +00:00
Eitan Adler
5bcc8e2fbd Add support for Advantech PCI-1602 RS-485/RS-422 serial card
PR:		kern/169726
Submitted by:	Jan Mikkelsen <janm@transactionware.com>
Approved by:	cperciva (implicit)
MFC after:	5 days
2012-11-09 01:51:06 +00:00
Adrian Chadd
a64438faed Fix a very incorrect description. 2012-11-09 01:28:11 +00:00
Adrian Chadd
bbee93a84e Fix the build - fix up the ath_alq code to not compile by default. 2012-11-08 23:11:59 +00:00
Adrian Chadd
b69b0dcc24 Add some hooks into the driver to attach, detach and record EDMA descriptor
events.

This is primarily for the TX EDMA and TX EDMA completion. I haven't yet
tied it into the EDMA RX path or the legacy TX/RX path.

Things that I don't quite like:

* Make the pointer type 'void' in ath_softc and have if_ath_alq*()
  return a malloc'ed buffer.  That would remove the need to include
  if_ath_alq.h in if_athvar.h.
* The sysctl setup needs to be cleaned up.
2012-11-08 18:11:31 +00:00
Adrian Chadd
2a2441c9fa Add my initial cut at driver-layer ALQ support.
I'm using this to debug EDMA TX and RX descriptors and it's really helpful
to have a non-printf() way to decode frames.

I won't link this into the build until I've tidied it up a little more.

This will eventually be behind ATH_DEBUG_ALQ.
2012-11-08 18:07:29 +00:00
Adrian Chadd
174484b17a Oops, fix bogus spacing. 2012-11-08 17:46:27 +00:00
Adrian Chadd
ae3815fd18 Implement the ATH_RESET_NOLOSS path for TX stop and start; this is needed
for 802.11n TX device restarting.

Remove the debug printf()s; they're no longer needed here.
2012-11-08 17:43:58 +00:00
Adrian Chadd
d4c0d5d0d9 Convert this to a debug printf; it's working fine now. 2012-11-08 17:32:55 +00:00
Hans Petter Selasky
78abbdd54f Make the USB ethernet methods constant again in if_udav.c,
so that both adapter variants can be attached at the same
time.

MFC after:	0 days
2012-11-08 16:31:13 +00:00
Kevin Lo
b72d9fd455 Add new USB device ID. 2012-11-08 09:29:05 +00:00
Konstantin Belousov
e9f581ba31 Zero the newly allocated md(4) swap-backed page to prevent random
kernel memory leakage to userspace. For the typical use, when a
filesystem put on the md disk, the change only results in CPU and
memory bandwidth spent to zero the page, since filsystems make sure
that user never see unwritten content.  But if md disk is used as raw
device by userspace, the garbage is exposed.

Reported by:	Paul Schenkeveld <freebsd@psconsult.nl>
MFC after:	2 weeks
2012-11-08 03:17:41 +00:00
Doug Ambrisko
59ddd3e9b6 Add support for SCSI pass through devices to be attached and
detached.

PR:		172864
Submitted by:	rstone@
2012-11-08 00:32:36 +00:00
Alexander Motin
aaff3a7331 Announce diagnostic page 7 (Element Descriptor) support. 2012-11-07 22:53:46 +00:00
Aleksandr Rybalko
dc9c386cd0 Disable automatic attachment of arswitch. It can't be auto-detected (like PHYs
do) and cause a problems trying to attach another instance to child mdio.

Submitted by:	Luiz Otavio O Souza
Approved by:	adrian (menthor)
2012-11-07 22:43:09 +00:00
Hans Petter Selasky
9a630052d4 Add lock asserts instead of "auto-locking".
MFC after:	1 weeks
Suggested by:	ed @
2012-11-07 18:59:42 +00:00
Hans Petter Selasky
3b8e984374 The tty_inwakeup callback appears to be called both locked and unlocked.
Handle the required locking automatically for now.

MFC after:	1 weeks
2012-11-07 18:44:05 +00:00
Adrian Chadd
89d2e576a4 Don't compile in my (not yet committed) ath_alq code unless ATH_DEBUG_ALQ
is defined.

This will unbreak ATH_DEBUG builds.
2012-11-07 16:34:09 +00:00
Hans Petter Selasky
3e2d883535 Patch to improve USB serial console.
MFC after:	1 weeks
Submitted by:	Bruce Evans
2012-11-07 08:13:56 +00:00
Kevin Lo
0f5e7edc14 Fix typo; s/ouput/output 2012-11-07 07:00:59 +00:00
Adrian Chadd
bdbb6e5b8c Disable my software queue TIM and PS handling for now.
ps-poll is totally broken in its current form.

This should unbreak things enough to let people use PS-POLL devices,
but leave it in place for me to finish PS-POLL handling.
2012-11-07 06:29:45 +00:00
Adrian Chadd
7877ac644e Add new HAL configuration features for the updated AR9300 HAL. 2012-11-07 06:23:23 +00:00
Doug Ambrisko
58ef3154a5 - Extend the prior commit to use the generic SCSI command building
function use that for JBOD and Thunderbolt disk write command.  Now
  we only have one implementation in mfi.
- Fix dumping on Thunderbolt cards.  Polled IO commands do not seem to
  be normally acknowledged by changing cmd_status to MFI_STAT_OK.
  In order to get acknowledgement of the IO is complete, the Thunderbolt
  command queue needs to be run through.  I added a flag MFI_CMD_SCSI
  to indicate this command is being polled and to complete the
  Thunderbolt wrapper and indicate the result.  This flag needs to be
  set in the JBOD case in case if that us using Thunderbolt card.
  When in the polling loop check for completed commands.
- Remove mfi_tbolt_is_ldio and just do the check when needed.
- Fix an issue when attaching of disk device happens when a device is
  already scheduled to be attached but hasn't attached.
- add a tunable to allow raw disk attachment to CAM via:
        hw.mfi.allow_cam_disk_passthrough=1
- fixup aborting of commands (AEN and LD state change).  Use a generic
  abort function and only wait the command being aborted not both.
  Thunderbolt cards don't seem to abort commands so the abort times
  out.
2012-11-06 23:25:06 +00:00
Navdeep Parhar
274b95d3ac Make sure the inp hasn't been dropped before trying to access its socket
and tcpcb.

MFC after:	3 days
2012-11-06 20:22:39 +00:00
Navdeep Parhar
c5dddc6694 Remove the tid from the software table (and bump down the in-use
counter) when the syncache doesn't want the driver to reply to an
incoming SYN.  This fixes a harmless bug where tids_in_use would
go out of sync with the hardware counter.

MFC after:	3 days
2012-11-06 18:58:57 +00:00
Adrian Chadd
6e84772f4d Convert the aggregate descriptor path over to use the same API as
the non-aggregate path.

I "cheated" by using some TX setup code in our HAL that isn't present
in the atheros HAL (or Linux ath9k.)

The old path for forming aggregates was:

* setup the rate control in the first descriptor;
* call chaintxdesc() on all the frames;
* call setupfirsttxdesc() on the first descrpitor in the first
  frame;
* call setuplasttxdesc() on the last descriptor in the last frame.

The new path for forming aggregates looks like the non-aggregate path:

* call setuptxdesc() on the first descriptor in the first frame;
* setup the rate control in the first descriptor;
* call filltxdesc() on each descriptor in the frame;
* if it's an aggregate - call set11n_aggr_{first, middle, last} as
  appropriate (see the code for a description of what is "appropriate".)

Now, this is done primarily for the AR9300 HAL - it doesn't implement
the first set of aggregate functions.  It just has the older methods
and the "first/middle/last" aggregate methods.  So, let's convert the
code to use these.

Note: the AR5416 HAL in FreeBSD had that code (from me, a while ago)
and a previous commit brought it up to behave the same as the AR9300
HAL routines.

There's some further tidyups to be done - specifically, avoid doing
multiple calls to the 11n descriptor functions. I shouldn't call
clr11n_aggr(), then set11n_aggr_middle(), then also set11n_aggr_first().
On (at least MIPS) the TX descriptors are in non-cachable memory and
this will cause multiple slow writes.

I'll debug/tidy that up in a future commit.

Tested:

* AR9280, STA
* AR9280/AR9160, AP
* AR9380, STA (using a local, closed source HAL, sorry!)
2012-11-06 06:19:11 +00:00
Marcel Moolenaar
ef3afadd29 Add the UQ_MSC_NO_PREVENT_ALLOW quirk to handle devices that do not support
the 'PREVENT/ALLOW MEDIUM REMOVAL' SCSI command. An example of such a
device is the STmicro ST72682. We send the SCSI command for every open and
close, which can result in a significant amount of spam on the console
during boot.

Reviewed by:	hps@
2012-11-05 21:03:38 +00:00
Dimitry Andric
29658c96ce Remove duplicate const specifiers in many drivers (I hope I got all of
them, please let me know if not).  Most of these are of the form:

static const struct bzzt_type {
	[...list of members...]
} const bzzt_devs[] = {
	[...list of initializers...]
};

The second const is unnecessary, as arrays cannot be modified anyway,
and if the elements are const, the whole thing is const automatically
(e.g. it is placed in .rodata).

I have verified this does not change the binary output of a full kernel
build (except for build timestamps embedded in the object files).

Reviewed by:	yongari, marius
MFC after:	1 week
2012-11-05 19:16:27 +00:00
Hans Petter Selasky
d30d96ea57 Add a jitter buffer in the common USB serial driver code which
temporarily stores characters if the TTY buffer is full when
used a as a console. This can happen when a console is suspended.
Also properly do the flow stop signalling when this happens and
flow start when the condition changes back to normal again.

Bump __FreeBSD_version to force external kernel modules
to be recompiled. No kernel API changes.

MFC after:	1 week
Suggested by:	ed @
2012-11-05 17:50:40 +00:00
Adrian Chadd
c19a2a1a9f Clear IFF_DRV_OACTIVE if any slots were completed.
This unblocks TX EDMA under high load.
2012-11-05 09:27:47 +00:00
Adrian Chadd
bc919a54b2 TX EDMA debugging fixes:
* Do the calculation for each ath_buf, rather than just the first
* Correct the calculation in the first place.
2012-11-05 07:08:45 +00:00
Eitan Adler
a016af99a9 Add support for a few more devices:
PNP0510 and FUJ02E5 for a  "Wacom Tablet at FuS Lifebook T"
PNP0502 and PNP0511 for some other generic devices.

PR:		kern/173357
Submitted by:	Andrey Zakharchenko <avz@jscc.ru>
Approved by:	cperciva (implicit)
MFC after:	1 week
2012-11-04 20:50:23 +00:00
Andriy Gapon
e21e29d716 cpuctl_do_cpuid: explicitly use ecx=0 for cpuid call
... instead of whatever random value may happen to be in the register.
ecx is important to some cpuid leaves.

To do: extend cpuctl interface to provide for ecx value parameter.

MFC after:	5 days
2012-11-04 13:46:28 +00:00
Adrian Chadd
4c5038c7b5 Oops - conditionalise that. 2012-11-04 00:46:01 +00:00
Adrian Chadd
d40c846abf EDMA TX tweaks:
* don't poke ath_hal_txstart() if nothing was pushed into the FIFO during
  the refill process;

* shuffle around the TX debugging output a little so it's logged at
  TX hardware enqueue;

* Add logging of the TX status processing.
2012-11-03 22:54:42 +00:00
Ed Schouten
305921c48e Add tty_set_winsize().
This removes some of the signalling magic from the Syscons driver and
puts it in the TTY layer, where it belongs.
2012-11-03 22:21:37 +00:00
Adrian Chadd
64dbfc6d92 For AR9380 NICs - the non-enterprise versions don't support RTS protection
of small (< 256 byte) aggregate frames.

This needs to be done or 11n aggregation TX just simply doesn't work
on these NICs.

Whilst here, extend some debug printing; I was using this whilst
debugging the TX power setup in the TX descriptor(s) on the AR9380.
2012-11-03 22:13:42 +00:00
Adrian Chadd
5540369b93 Add a new HAL call to extract out the HAL enterprise bits from the
AR9300 HAL.
2012-11-03 22:12:35 +00:00
Marcel Moolenaar
22ff74b2f4 Add a MD_ROOT_FSTYPE kernel option. The option specifies the
file system part for the MD_ROOT mount string. Hardcoding the
the file system type as "ufs" is too restrictive.
2012-11-03 21:20:55 +00:00
Marcel Moolenaar
db43ed3750 Allow using the embedded EHCI host controller in Freescale SoCs
by adding the missing bits. See ehci_fsl.c for their use.
2012-11-03 21:05:32 +00:00
Adrian Chadd
b90559c429 HAL API updates, from the previous couple of HAL commits. 2012-11-03 04:56:08 +00:00
Adrian Chadd
f74b406ddd HAL API changes!
* introduce a new HAL API method to pull out the TX status descriptor
  contents.

* Add num_delims to the 11n first aggr method.  This isn't used by the
  driver at the moment so it won't affect anything.
2012-11-03 04:55:43 +00:00
Adrian Chadd
70ee90299b Add a debug method to dump the EDMA TX status descriptor contents out.
This requires some HAL API changes to be useful, as there's no way
right now to pull out the TX status descriptor contents.
2012-11-03 04:53:44 +00:00
Xin LI
808df72635 Copy code from scsi_read_write() as mfi_build_syspd_cdb() to build SCSI
command properly.  Without this change, mfi(4) always sends 10 byte READ
and WRITE commands, which will cause data corruption when device is
larger than 2^32 sectors.

PR:		kern/173291
Submitted by:	Steven Hartland <steven.hartland multiplay.co.uk>
Reviewed by:	mav
MFC after:	2 weeks
2012-11-02 22:07:45 +00:00
Matt Jacob
5ac438d68c Don't allow for more than one segment for the control space since
we're not set up to deal with that.

X-MFC:	242479
MFC after:	1 week
2012-11-02 14:38:57 +00:00
Matt Jacob
8e1b6e7aec Don't allow for more than one segment for the control space since
we're not set up to deal with that.

MFC after:	1 week
2012-11-02 14:37:21 +00:00
Gleb Smirnoff
c109de1e07 - If DRM_DEBUG_DEFAULT_ON is defined, then initialize drm_debug_flagi to
all supported debugging bits.
- If DRM_DEBUG_DEFAULT_ON isn't defined, then initialize drm_debug_flag
  to zero.

DRM_DEBUG_DEFAULT_ON is defined when module is build with -DDEBUG_DRM
or if kernel config has 'options DEBUG_DRM'.

Reviewed by:	kib
2012-11-02 05:26:33 +00:00
Hans Petter Selasky
d3e08ca9f0 Correct buffer size printout.
MFC after:	1 week
2012-11-01 20:58:55 +00:00
Hans Petter Selasky
58e8ac5c34 Increase default volume for FastTracker playback channels.
MFC after:	1 week
2012-11-01 20:43:23 +00:00
Hans Petter Selasky
ff4d595304 Fix sysctl free bug in last commit, which eventually leads to a panic.
Add software mixer table for FastTrack Ultra.
Only set volume controls which are valid at startup for standard
USB audio devices, so that settings like treble and bass use
the reset defaults.

MFC after:	1 week
2012-11-01 20:09:48 +00:00
Alfred Perlstein
bad7e7f3dd Provide a device name in the sysctl tree for programs to query the
state of crashdump target devices.

This will be used to add a "-l" (ell) flag to dumpon(8) to list the
currently configured dumpdev.

Reviewed by:	phk
2012-11-01 17:01:05 +00:00
Hans Petter Selasky
902514f628 Export all mixer nodes into dev.pcm.X.mixer.Y sysctl nodes, hence the
PCM API doesn't support showing all the knobs. Make sure all the USB audio
mixer nodes are freed at detach. Before this patch USB audio would leak
some memory at detach. Print out buffer sizes in number of samples at attach.
Fix setting of volume controls when the number of channels is greater than two.

MFC after:	1 week
2012-11-01 16:54:26 +00:00
Hans Petter Selasky
3f5171b17f Add missing inclusion guard. 2012-11-01 16:39:01 +00:00
Pyun YongHyeon
84c168f49a TCP/UDP checksum offloading feature for IP fragmented datagram was
removed in r99417.  bge(4) controllers can do TCP checksum offload
for IP fragmented datagrams but unlike ti(4), it lacks UDP checksum
offloading for IP fragmented datagrams. The problem was bge(4)
blindly requested TCP/UDP checksum for IP fragmented datagrams such
that it resulted in corrupted UDP datagrams before r99417.
Remove remaining code for TCP checksum offloading for IP fragmented
datagrams which should have been removed in r99417.
2012-11-01 06:02:27 +00:00
Pyun YongHyeon
a8eeb50c81 Remove TCP/UDP checksum offloading feature for IP fragmented
datagrams.  Traditionally upper stack fragmented packets without
computing TCP/UDP checksum and these datagrams were passed to
driver.  But there are chances that other packets slip into the
interface queue in SMP world. If this happens firmware running on
MIPS 4000 processor in the controller would see mixed packets and
it shall send out corrupted packets.
While I'm here simplify checksum offloading setup.

MFC After:	1 week
2012-11-01 05:39:21 +00:00
Alexander Motin
76eb28f350 Only four specific ATA PIO commands transfer several sectors per DRQ block
(interrupt).  All other ATA PIO commands transfer one sector or 512 bytes
at one time.  Hardcode these exceptions in ata(4) with ATA_CAM option.
This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`.
2012-11-01 00:09:01 +00:00
Jack F Vogel
8fce93a144 A few important fixes:
- Testing TSO6 has led me to discover that HW RSC is
    a problematic feature, it is ONLY designed to work
    with IPv4 in the first place, and if IP forwarding
    is done it can't be disabled as LRO in the stack,
    also initial testing we've done at Intel shows an
    equal performance using TSO[46] on the TX and LRO
    on RX, if you ran older code on 82599 or later hardware
    you actually could have detrimental performance for
    this reason. So I am disabling the feature by default
    and all our adapters will now use LRO instead.

  - If you have flow control off and multiple queues it
    was possible when the buffer of one queue becomes
    full that all RX movement is stalled, to eliminate
    this problem a feature bit is now set that will allow
    packets to be dropped when full rather than stall.
    Note, the default is to have flow control on, and this
    keeps this from happening.

  - Because of the recent fixes in the stack, LRO is now
    auto-disabled when problematic, so I have decided to
    enable it by default in the capabilities in the driver.

  - There are some 1G modules used by some customers, a couple
    small tweaks to properly support those in the media code.

  - A note: we have now done some testing of TSO6 and using
    LRO with IPv6 and it all works great!! Seeing line rate
    in both directions in best cases. Thanks bz for your
    excellent work!!
2012-10-31 23:50:36 +00:00
Jim Harris
633c572996 Use callout_reset_curcpu to allow the callout to be handled by the
current CPU and not always CPU 0.

This has the added benefit of reducing a huge amount of spinlock
contention on the callout_cpu spinlock for CPU 0.

Sponsored by:	Intel
2012-10-31 23:44:19 +00:00
Alexander Motin
3049555773 ASUS EeePC 1001px has strange variant of ALC269 CODEC, that mutes speaker
if unused in that configuration mixer at NID 15 is muted.  Probably CODEC
incorrectly reports its internal connections.  Hide that muter from the
driver to avoid muting and make built-in speaker work.

There are several different CODECs sharing this ID and I have not enough
information about them and the bug to implement more universal solution.

Tested by:	Big Yuuta <init.py@gmail.com>
MFC after:	2 weeks
2012-10-31 22:11:51 +00:00
Adrian Chadd
aff98f17c6 Since the PLL changes aren't in here yet for the AR9130 half/quarter
rate support, disable it.
2012-10-31 21:14:25 +00:00
Adrian Chadd
b0245b90ba Oops - this was incorrectly removed in a previous commit. 2012-10-31 21:06:55 +00:00
Adrian Chadd
9bb63aa8ff Oops - missing from the last commit - add ANI immunity levels for AR9160.
Obtained from:	Qualcomm Atheros
2012-10-31 21:04:23 +00:00
Adrian Chadd
adadb6074d HAL updates!
* Add some more ANI spur immunity levels.
* For AR5111 radios attached to an AR5212, limit the 5GHz channels
  that are available. A later revision of the AR5111 supports the 4.9GHz
  PSB channels but right now there's no check in place for the radio
  revision.

  If someone wants PSB support on AR5212+AR5111 radios then please let
  me know and I'll add the relevant version check.

Obtained from:	Qualcomm Atheros
2012-10-31 21:03:55 +00:00
Adrian Chadd
3631c3f200 Add in the last random assortment of missing bits for the AR9380 HAL.
Obtained from:	Qualcomm Atheros
2012-10-31 21:00:01 +00:00
Adrian Chadd
321e63ddee Add the emulation PCI device id - these days, 0xabcd shows up all over
the internet as "AR9380 and later which didn't get its PCI ID written
in at power-on", so it's hardly an unknown constant.

Obtained from:	Qualcomm Atheros
2012-10-31 20:58:24 +00:00
Jack F Vogel
89da5b3198 Correct code that was lost somewhere in the past,
this was designed to keep duplicate null vlan tags from
being added. When doing vlans purely via the switch
this problem will occur. Reported by external customer.
2012-10-31 18:16:42 +00:00
Adrian Chadd
bf57b7b2ce I've had some feedback that CCK rates are more reliable than MCS 0
in some very degenerate conditions.

However, until ath_rate_form_aggr() is taught to not form aggregates
if ANY selected rate is non-MCS, this can't yet be enabled.

So, just add a comment.
2012-10-31 06:35:50 +00:00
Adrian Chadd
1b5c5f5ad0 I give up - introduce a TX lock to serialise TX operations.
I've tried serialising TX using queues and such but unfortunately
due to how this interacts with the locking going on elsewhere in the
networking stack, the TX task gets delayed, resulting in quite a
noticable throughput loss:

* baseline TCP for 2x2 11n HT40 is ~ 170mbit/sec;
* TCP for TX task in the ath taskq, with the RX also going on - 80mbit/sec;
* TCP for TX task in a separate, second taskq - 100mbit/sec.

So for now I'm going with the Linux wireless stack approach - lock tx
early.  The linux code does in the wireless stack, before the 802.11
state stuff happens and before it's punted to the driver.
But TX locking needs to also occur at the driver layer as the TX
completion code _also_ begins to drain the ifnet TX queue.

Whilst I'm here, add some KTR traces for the TX path.

Note:

* This really should be done at the net80211 layer (as well, at least.)
  But that'll have to wait for a little more thought to happen.
2012-10-31 06:27:58 +00:00
Hans Petter Selasky
7a75e881d7 If a USB mass storage device doesn't respond properly
to the initial SCSI INQUIRY command, enable all quirks.
This fixes detection of some Transcend TS2GUFM devices.

MFC after:	1 week
Reported by:	Michael Dexter
2012-10-30 16:56:16 +00:00
Attilio Rao
5584e91718 Fixup r240246: hwpmc needs to retain the pinning until ASTs are not
executed. This means past the point where userret() is generally
executed.

Skip the td_pinned check if a callchain tracing is currently happening
and add a more robust check to pmc_capture_user_callchain() in order to
catch td_pinned leak past ast() in hwpmc case.

Reported and tested by:	fabient
MFC after:	1 week
X-MFC:	r240246
2012-10-30 15:10:50 +00:00
Andrey Zonov
df0adc13c7 - Remove BCE_JUMBO_HDRSPLIT kernel option which was forgotten in r218423.
Approved by:	davidch
Approved by:	kib (mentor)
2012-10-30 13:22:39 +00:00
Alexander Motin
401f7c11ff Set all pins initial connection status to unknown (2) and then update it
with the real value in regular way if sensing is supported.  This fixes
minor inconsistency when playback redirection appeared in undefined state
on boot if headphones were not connected.
2012-10-30 12:44:30 +00:00
Alexander Motin
ed228e403f Print card and subsystem IDs in verbose logs to help to identify system.
Hide some less iseful messages under debug.
2012-10-30 10:59:42 +00:00
Pyun YongHyeon
9bdff6fffa TSO engine of L1 requires a separate DMA descriptor for TCP
payload.  This means driver has to split a TX buffer into two
pieces of TX buffers when the TX buffer contains both
ethernet/IP/TCP header and partial TCP payload.  The controller
does not require all header should be in a TX buffer but driver
forced it to compute IP/TCP header size/offset which is required
parameter to configure DMA descriptor for TSO.
While here, slightly reorder DMA descriptor setup to enhance
readability and remove unnecessary code for TSO(upper stack never
requests TSO when the frame length is less than or equal to MTU).

Reported by:	Yamagi Burmeister <lists <> yamagi dot org>
Tested by:	Yamagi Burmeister <lists <> yamagi dot org>
MFC After:	1 week
2012-10-30 07:55:03 +00:00
Neel Natu
9b80cdf59a Teach FreeBSD to detect that it is a guest running inside BHyVe.
Reviewed by:	grehan
Obtained from:	NetApp
2012-10-30 03:03:37 +00:00
Oleksandr Tymoshenko
a0eae699c9 Separate interrupts enable/disable logic from setting port parameters.
Otherwise setting baud rate in TTY mode effectively disables TX/RX
interrupts and renders port unusable.
2012-10-30 01:52:49 +00:00
Oleksandr Tymoshenko
a9387eb1df Add BCM2835 SDHCI driver and enable it in Raspberry Pi config 2012-10-29 17:23:45 +00:00
Oleksandr Tymoshenko
8f3b7d5616 Add new quirks:
- Data timeout is broken
  - Data timeout uses SD clock
  - Capabilities register is unavailable

Add calculations for clock divisor for SDHCI 3.0
2012-10-29 17:21:58 +00:00
Baptiste Daroussin
2ef2a08637 add support for newer Lenovo ThinkPads to acpi_ibm
PR:		kern/164538
Submitted by:	Pierre Imai <pierre@imai.at>
MFC after:	2 weeks
2012-10-29 10:22:00 +00:00
Juli Mallett
e38cb26842 Recognize the Marvell 88E1145 Quad Gigabit PHY. 2012-10-29 00:17:12 +00:00
Adrian Chadd
548a605d0d Begin fleshing out some software queue awareness for TIM handling with
the power save queue.

* introduce some new ATH_NODE lock protected fields, tracking the
  net80211 psq and TIM state;
* when doing buffer transitions - ie, when sending and completing
  buffers - check the state of the SWQ and update the TIM appropriately.
* when clearing the TIM bit, if the SWQ is not empty then delay clearing
  it.

This is racy, but it's no less racy than the current net80211 power
save queue management code.  Specifically, with multiple TX threads,
it's quite plausible that parallel state updates will race and the
TIM will be left in an inconsistent state.  I'll address that in
a follow-up commit.
2012-10-28 21:13:12 +00:00
Adrian Chadd
a93c5097c9 Add a temporary (for values of "temporary") work around for hotplug
support with ath(4) and VIMAGE.

Right now the VIMAGE code doesn't supply a default vnet context during:

* hotplug attach;
* any device detach.

It special cases kldload/boot time probing (by setting the context to
vnet0) but that doesn't occur when probing devices during a bus rescan -
eg, adding a cardbus card.

These will eventually go away when the VIMAGE support extends to providing
default contexts to hotplug attach/detach.
2012-10-28 18:46:06 +00:00
Hans Petter Selasky
b4380da796 Implement support for the so-called USB feedback endpoint for USB
audio devices. This endpoint gives clues to the USB host about the
actual data rate on asynchronous endpoints and makes the more
expensive USB audio devices usable under FreeBSD.
The Linux USB audio driver was used as reference for the
automagic shift of the received value.

MFC after:	1 week
2012-10-28 14:37:17 +00:00
Neel Natu
1ea1e18490 Probe for existence of the bvm debug port instead of just assuming that it is
always present.

Suggested by:	grehan
Obtained from:	NetApp
2012-10-27 22:54:23 +00:00
David E. O'Brien
4e359efd5b A little bit easier to read. 2012-10-26 20:24:13 +00:00
Alexander Motin
23d9e39c1a Implement CAM_ATAIO_NEEDRESULT (fetching full set of result registers) for
ata(4) driver in ATA_CAM mode.  That slighty improves error reporting and
also should fix `smartctl -l scterc /dev/adaX` operation.

MFC after:	3 weeks
2012-10-26 20:03:08 +00:00
Adrian Chadd
9572684af7 Since it's not immediately obvious whether the current TX path handles
fragment rate lookups correctly, add a comment describing exactly that.

The assumption in the fragment duration code is the duration of the next
fragment will match the rate used by the current fragment.  But I think
a rate lookup is being done for _each_ fragment.  For older pre-sample
rate control this would almost always be the case, but for sample
it may be incorrect more often then correct.
2012-10-26 16:31:12 +00:00
David E. O'Brien
93665dfffb Iterate rather than use recursion. We can blow out the kernel stack if there
is a long chain of fork(2)s.
2012-10-26 15:44:29 +00:00
Nathan Whitehorn
20d85134d8 Make sure to define __BIG_ENDIAN and __LITTLE_ENDIAN with the appropriate
number of underscores for Linux compatibility in drm(4).

Submitted by:	sendtomatt at gmail dot com
MFC after:	2 weeks
2012-10-26 14:29:57 +00:00
Hans Petter Selasky
76eaf53752 Make sure the vendor class quirk only matches the vendor specific
class, else multiple pcm devices can appear on certain USB audio
devices.

MFC after:	1 week
2012-10-26 12:41:01 +00:00
Hans Petter Selasky
3557aa50ce Add support for Fast Track Ultra 8R from M-audio.
MFC after:	1 week
2012-10-26 11:41:57 +00:00
Hans Petter Selasky
83cadd7dcc Add missing CTLFLAG_TUN flag to tunable sysctls in USB stack.
Rearrange the tunables and belonging sysctl declarations, so
that they are next to eachother.

Submitted by:	n_hibma @
MFC after:	1 week
2012-10-26 06:04:47 +00:00
Peter Wemm
4354cca446 Increase the driver-side limit on the number of logical volumes that
the driver will recognize.  I've tested this as far as 25 volumes.
2012-10-25 18:46:02 +00:00
David E. O'Brien
ab4ee4bb75 Desupport pre-FreeBSD 7.1. 2012-10-25 18:39:09 +00:00
Navdeep Parhar
fef542fe1c Initialize the response queue mutex a bit earlier to avoid a panic that
occurs if t3_sge_alloc_qset fails and then t3_free_qset attempts to
destroy an uninitialized mutex.

Submitted by:	Vijay Singh <vijju dot singh at gmail>
MFC after:	3 days
2012-10-25 18:11:04 +00:00
Xin LI
022a7377d0 Update hptiop(4) to version 1.8, which added support for HighPoint
RocketRAID 4500 series.

Many thanks to HighPoint Technologies for their continued support
of FreeBSD!

Submitted by:	HighPoint Technologies
MFC after:	3 days
2012-10-25 17:29:11 +00:00
Hans Petter Selasky
1234097efb Fix USB audio specification compliance by filtering which descriptors can
appear on which interface. This fixes detection of some USB audio adapters.
Also increase the channel limit for FULL speed devices to 4 channels.

Tested by:	gavin
MFC after:	1 week
2012-10-24 08:00:01 +00:00