Commit Graph

21692 Commits

Author SHA1 Message Date
Adrian Chadd
69efac96c3 Disable flipping antennas for AR9280.
Flipping antennas when doing 11n would cause all kinds of strange issues.
Just don't do it for now and when it comes time to do it, don't do it here.
2011-02-15 13:29:52 +00:00
Marius Strobl
37bb79f173 - Use the correct DMA tag/map pair for synchronize the FC scratch area.
- Allocate coherent DMA memory for the request/response queue area and
  and the FC scratch area.

These changes allow isp(4) to work properly on sparc64 with usage of the
IOMMU streaming buffers enabled.

Approved by:	mjacob
MFC after:	2 weeks
2011-02-14 21:50:51 +00:00
Adrian Chadd
b986265911 bring this in line with what ath9k does. 2011-02-14 21:35:11 +00:00
Adrian Chadd
f9aa1d90b5 Some statistics additions - prepare for error codes > 32 (since the AR5416
error mask is > 5 bits) and add some extra CRC/HT40/ShortGI counters to
help debug 802.11n issues.
2011-02-14 21:24:54 +00:00
Jung-uk Kim
f6c05906ee Rework r218685. Copy just enough data for the resource type.
Reviewed by:	jhb, mdf
2011-02-14 20:05:37 +00:00
Matthew D Fleming
224e25e117 Prevent reading from the ACPI_RESOURCE past its actual end. For
paranoia limit to the size of the ACPI_RESOURCE as well.

Reviewd by:	jhb (in spirit)
MFC after:	1 week
2011-02-14 17:20:20 +00:00
Hans Petter Selasky
f417369bdd * Fix page fault caused by referring freed node.
While updating Tx stats, already freed node could be referred and cause
page fault. To avoid such panic, spool Tx stats in driver's softc. Then,
on every ratectl interval, grab node though ieee80211_iterate_nodes() and
update ratectl stats.

* Simplify some code in run_iter_func().

* Fix typo

* Use memset instead of bzero (hselasky @)

PR:		kern/153938
Submitted by:	PseudoCylon <moonlightakkiy@yahoo.ca>
Approved by:	thompsa (mentor)
2011-02-14 08:14:06 +00:00
Marcel Moolenaar
bba39e1034 Use the preload_fetch_addr() and preload_fetch_size() convenience
functions to obtain the address and size of the PCI vendor data.

Sponsored by: Juniper Networks.
2011-02-13 19:26:51 +00:00
Marcel Moolenaar
01f7b6dad3 Use the preload_fetch_addr() and preload_fetch_size() convenience
functions to obtain the address and size of the bitmap splash image.

Sponsored by: Juniper Networks.
2011-02-13 19:25:48 +00:00
Marcel Moolenaar
efdb11cd58 Use the preload_fetch_addr() and preload_fetch_size() convenience
functions to obtain the address and size of the overriding DSDT.

Sponsored by: Juniper Networks.
2011-02-13 19:24:04 +00:00
Adrian Chadd
1325ba9d01 This should be TX stream, not RX stream. 2011-02-13 15:14:13 +00:00
Alexander Motin
fa84e0f903 Restore DH89xxCC/Patsburg chip IDs accentally dropped at r218596. 2011-02-12 13:28:50 +00:00
Alexander Motin
a7c797f063 Disable NCQ for multiport Marvell 88SX61XX SATA controllers. Simultaneous
active I/O to several disks (copying large file on ZFS) causes timeout after
just a few seconds of run. Single port 88SX6111 seems like not affected.

Skip reading transferred bytes count for these controllers. It works for
88SX6111, but 88SX6145 always returns zero there. Haven't tested others,
but better to be safe.
2011-02-12 07:06:40 +00:00
Adrian Chadd
bf26df3693 The current code used the fields in ath_set11nratescenario() . Use them
correctly:

* pass in whether to allow the hardware to override the duration field
  in the main data frame (durupdate_en) - PS_POLL frames in particular
  don't have the duration bit overriden;
* there's no rts/cts duration here; that's done elsehwere
2011-02-12 02:14:19 +00:00
Jack F Vogel
730d313078 Fix the shared code to be consistent with Intel-internal,
and now build.
2011-02-12 00:07:40 +00:00
Doug Barton
8c1bde8dd0 Restore 2 prototypes that seem to have been mistakenly removed in r218582.
I've manually twiddled the whitespace for e1000_commit_fc_settings_generic
to match the others in the file.

Submitted by:	dim
Tested by:	me
2011-02-11 23:08:34 +00:00
Jack F Vogel
15cb0f401a Somehow the RX ring depletion fix got partially removed,
replace the missing pieces.
2011-02-11 19:49:07 +00:00
Jack F Vogel
4b52dc6ad6 Revert changes made here, they will cause a conflict
later on with our shared code.
2011-02-11 19:03:00 +00:00
Jack F Vogel
fe954359d6 Inconsistencies in the updated igb shared code and the older
em/lem, breaking the build, correcting that.
2011-02-11 17:18:42 +00:00
Adrian Chadd
f449ab1c29 .. how'd this compile before I commit it and then not now?
Fixed.
2011-02-11 14:07:27 +00:00
Adrian Chadd
6c9b00e11f The last parameter to ath_computedur_ht() is short-GI, not short-preamble. 2011-02-11 13:05:15 +00:00
Bjoern A. Zeeb
b60688be0f After r218530 export several functions which are no longer private to
e1000_mac.c but part of the e1000_api.

X-MFC with: 218530 by jfv
2011-02-11 09:58:38 +00:00
Jack F Vogel
f0ecc46d04 Add support for the new I350 family of 1G interfaces.
- this also includes virtualization support on these devices

Correct some vlan issues we were seeing in test, jumbo frames on vlans
did not work correctly, this was all due to confused logic around HW
filters, the new code should now work for all uses.

Important fix: when mbuf resources are depeleted, it was possible to
completely empty the RX ring, and then the RX engine would stall
forever. This is fixed by a flag being set whenever the refresh code
fails due to an mbuf shortage, also the local timer now makes sure
that all queues get an interrupt when it runs, the interrupt code
will then always call rxeof, and in that routine the first thing done
is now to check the refresh flag and call refresh_mbufs. This has been
verified to fix this type 'hang'. Similar code will follow in the other
drivers.

Finally, sync up shared code for the I350 support.

Thanks to everyone that has been reporting issues, and helping in the
debug/test process!!
2011-02-11 01:00:26 +00:00
David Christensen
9510c63d8b - Updated firmware which improves small packet performance.
MFC after:	2 weeks
2011-02-11 00:41:49 +00:00
David Christensen
08266a07e3 - Added error checking to nvram read functions.
- Minor style updates.

Submitted by:	gcooper@freebsd.org
MFC after:	2 weeks
2011-02-10 22:36:23 +00:00
Marcel Moolenaar
8d5ac6c3cf Use the preload_fetch_addr() and preload_fetch_size() convenience
functions and only create the MD device when we have a non-zero
pointer and size.

Sponsored by: Juniper Networks
2011-02-09 19:31:10 +00:00
Bernhard Schmidt
e7d14e9bcc Rework beacon handling re-enable run_updateslot().
Drivers which rely on net80211 to create the beacon need to call
ieee80211_beacon_update() on iv_update_beacon() calls. This is required
that certain bits, e.g. TIM, get updated. A call to ieee80211_beacon_alloc()
is not enough because it does not care about flags which can only change
during runtime. By design a beacon is supposed to be allocated only once
while moving into RUN state.

To handle all possible calls to iv_update_beacon() the run_updateslot()
function has been revived and run_updateprot() has been added.
run_updateslot() handles slot time changes and run_updateprot() changes
to protection, both can change while nodes associate/leave.

Submitted by:	Alexander Zagrebin <alex at zagrebin.ru>,
		PseudoCylon <moonlightakkiy atyahoo.ca>
MFC after:	3 weeks
2011-02-09 18:09:27 +00:00
Adrian Chadd
191470d361 Expose the 4k transaction workaround hooks to the driver, but don't (yet)
fix the descriptor allocation.
2011-02-09 16:37:29 +00:00
Adrian Chadd
67397d396f Add in the (very!) optional glue to flip the 11n bits for if_ath.
There's still a lot of random issues to sort out with the radio side of
things and AMPDU RX handling (and completely missing AMPDU TX handling!)
but if people wish to give this a go and assist in debugging the
issues, they can define ATH_DO_11N to enable it.

I'm just re-iterating - this is here to allow people to assist in
further 11n development; it is not any indication that the 11n support
is complete and functional.

Important notes:

* This doesn't support 1-stream cards yet - (eg AR9285) - the various bits
  that negotiate TX/RX MCS don't know not to try >1 stream TX or negotiate
  1-stream RX; so don't enable 11n unless you've first taught the rate
  control module and the net80211 stack to negotiate 1-stream stuff;

* The only rate control module minimally 11n aware is ath_rate_sample;

* ath_rate_sample doesn't know about HT/40; so airtime will be incorrectly
  calculated;

* The AR9160 and AR9280 radio code is unreliable at the higher MCS rates for
  some reason; this will definitely impact 11n performance;

* AMPDU-TX isn't yet implemented;

* AMPDU-RX may be a bit buggy still and will definitely suffer from the
  radio unreliability mentioned above (ie, don't expect 150/300mbit
  RX just yet.)
2011-02-09 15:43:38 +00:00
Adrian Chadd
be97670785 Fix the keycache behaviour for multicast keycache search.
The correct bit to set is 0x1 in the high MAC address byte, not 0x80.
The hardware isn't programmed with that bit (which is the multicast
adress bit.)

The linux ath9k keycache code uses that bit in the MAC as a "this is
a multicast key!" and doesn't set the AR_KEYTABLE_VALID bit.
This tells the hardware the MAC isn't to be used for unicast destination
matching but it can be used for multicast bssid traffic.

This fixes some encryption problems in station mode.

PR: kern/154598
2011-02-09 15:23:16 +00:00
Marius Strobl
1115e138a9 Correct signedness and off-by-one issues in parameters used for DMA tag
creation.

PR:		154259
Submitted by:	Vladislav Movchan (partially)
MFC after:	3 days
2011-02-09 11:28:57 +00:00
Hans Petter Selasky
8833442863 Minor cleanup:
- use device_printf() instead of printf() to give more accurate warnings.
 - use memcpy() instead of bcopy().
 - add missing #if's for non-FreeBSD compilation.

Approved by:	thompsa (mentor)
2011-02-09 08:01:45 +00:00
Marcel Moolenaar
6a9f4949fb Improve the error interrupt handler. In particular, read the
error address on a decoding error to unlatch it and to allow
us to print a better diagnostics message. This also has the
side effect of clearing the condition, which prevents an
interrupt storm.
2011-02-08 22:16:29 +00:00
Adrian Chadd
00fc87059c net80211 really doesn't want A_MPDU to appear on non-11n station node mbufs.
Revert back to the previous method of doing it for where a node can be
identified and it's an 11n node.

I'll have to do some further research into exactly what is being messed up
with the sequence number matching and I'll then revisit this.
2011-02-08 20:16:43 +00:00
Adrian Chadd
5e9608093f Commit some missing bits to the sample rate module to (more) correctly calculate 802.11n packet duration.
This doesn't yet take into account HT40 packet durations as the node info
(needed to know if it's a HT20 or HT40 node) isn't available everywhere
it needs to be.
2011-02-08 18:31:28 +00:00
Adrian Chadd
bd7ea37bac I missed this commit - enable 4k transaction support for the ar5416+ar9160. 2011-02-08 14:15:46 +00:00
Adrian Chadd
e0e5b8b471 There's apparently a bug with Merlin (AR9280) and later chipsets where
putting descriptors (not buffers) across a 4k page boundary can cause issues.
I've not seen it in production myself but it apparently can cause problems.

So, in preparation for addressing this workaround, (re)-expose the particular
HAL capability bit which marks whether the chipset has support for cross-4k-
boundary transactions or not.

A subsequent commit will modify the descriptor allocation to avoid allocating
descriptor entries that straddle a 4k page boundary.
2011-02-08 12:49:01 +00:00
Matthew D Fleming
e7ceb1e99b Based on discussions on the svn-src mailing list, rework r218195:
- entirely eliminate some calls to uio_yeild() as being unnecessary,
   such as in a sysctl handler.

 - move should_yield() and maybe_yield() to kern_synch.c and move the
   prototypes from sys/uio.h to sys/proc.h

 - add a slightly more generic kern_yield() that can replace the
   functionality of uio_yield().

 - replace source uses of uio_yield() with the functional equivalent,
   or in some cases do not change the thread priority when switching.

 - fix a logic inversion bug in vlrureclaim(), pointed out by bde@.

 - instead of using the per-cpu last switched ticks, use a per thread
   variable for should_yield().  With PREEMPTION, the only reasonable
   use of this is to determine if a lock has been held a long time and
   relinquish it.  Without PREEMPTION, this is essentially the same as
   the per-cpu variable.
2011-02-08 00:16:36 +00:00
David Christensen
2306fc3f4c - Added systcls for header splitting, RX/TX buffer count, interrupt
coalescing, strict RX MTU, verbose output, and shared memory debug.
- Added additional debug counters (VLAN tags and split header frames).
- Updated debug counters to 64 bit definitions.
- Updated l2fhdr bit definitions.
- Combined RX buffer sizing into a single function.
- Added buffer size and interrupt coalescing settings to adapter info
  printout.

Submitted by:	davidch
MFC after:	2 weeks
2011-02-07 23:00:24 +00:00
Nick Hibma
3b8227640a Curitel UM150 needs a quirk to stop it from detaching straight after
attach (resetting actually).

Submitted by:	Oleg Nauman
MFC after:	1 week
2011-02-07 22:37:27 +00:00
Adrian Chadd
8f6997190b Add in some AR9280 specific board configuration options.
* The existing radio config code was for the AR5416/AR9160 and missed out
  on some of the AR9280 specific stuff. Include said stuff from ath9k.

* Refactor out the gain control settings into a new function, again pilfered
  from ath9k.

* Use the analog register RMW macro when touching analog registers.

Obtained from:	Linux ath9k
2011-02-07 22:00:31 +00:00
Adrian Chadd
1a506b1a27 Bring over some AR9280-specific v14 additions that exist in ath9k.
Obtained from:	Linux ath9k
2011-02-07 21:48:26 +00:00
Adrian Chadd
806099d3d5 Use analog delay macro for modifying an analog register. 2011-02-07 21:30:56 +00:00
Adrian Chadd
d9a80efdc2 Add a new RMW macro for analog register writes which implements the needed
wait period between operations.
2011-02-07 21:30:13 +00:00
Adrian Chadd
3118fac370 Fix typo in SIFS setup 2011-02-07 17:04:31 +00:00
Adrian Chadd
ec165c61b1 Add in a per phy error sysctl. 2011-02-07 15:09:13 +00:00
Adrian Chadd
a07e9ddb3b Just tag all RX packets as needing reorder processing for now.
This fixes two problems -

* All packets need to be processed here, not just aggregate ones - as any
  received frames (AMPDU or otherwise) in the given TID (traffic class id)
  will update the sequence number and, implied with that, update the window;
* It seems there's situations where packets aren't matching a current node but
  somehow need to be tracked. Thus just tag them all for now; I'll figure out
  the why later.

Whilst I'm here, bump the stats counters whilst I'm at it.

This fixes AMPDU RX in my tests; the main problems now stem from what look
like PHY level error/retransmits which are impeding general throughput, incl.
AMPDU.
2011-02-06 20:11:24 +00:00
Adrian Chadd
f673a81060 Only tag packets with the A-MPDU bit if they were part of an A-MPDU RX.
Whilst I'm here, add a counter to count said packets.
2011-02-06 17:40:27 +00:00
Adrian Chadd
c7ff3cee42 Add a temporary workaround so the 11n rate scenario setup code sets a useful
TX chainmask.

since the upper layers don't (yet) know about the active TX/RX chainmasks,
it can't tell the rate scenario functions what to use. I'll eventually sort
this out; this restores functionality in the meantime.
2011-02-05 22:54:37 +00:00
Pyun YongHyeon
bc2a100257 Disable TX IP checksum offloading for RTL8168C controllers. The
controller in question generates frames with bad IP checksum value
if packets contain IP options.  For instance, packets generated by
ping(8) with record route option have wrong IP checksum value. The
controller correctly computes checksum for normal TCP/UDP packets
though.
There are two known RTL8168/8111C variants in market and the issue
I observed happened on RL_HWREV_8168C_SPIN2. I'm not sure
RL_HWREV_8168C also has the same issue but it would be better to
assume it has the same issue since they shall share same core.
RTL8102E which is supposed to be released at the time of
RTL8168/8111C announcement does not have the issue.

Tested by:	Konstantin V. Krotov ( kkv <> insysnet dot ru )
2011-02-04 17:49:55 +00:00