Commit Graph

21692 Commits

Author SHA1 Message Date
Ed Maste
729e10b9e2 We can pass a format string and args to panic(), so instead of using
printf() to output some information before a panic, just include that
information in the panic.

Submitted by:	bde
Reviewed by:	bde
2011-02-04 15:45:48 +00:00
Adrian Chadd
f6c4b1690f Oops, fix newbie mistake that breaks the normal build. 2011-02-04 00:25:18 +00:00
Adrian Chadd
c1782ce034 Modify the TX path to set and use the 11n rate scenario bits.
This isn't strictly required to TX (at least non-agg and non-HT40,
non-short-GI) frames; but as it needs to be done anyway, just get
it done.

Linux ath9k uses the rate scenario style path for -all- packets,
legacy or otherwise. This code does much the same.

Beacon TX still uses the legacy, non-rate-scenario TX descriptor
setup. Ath9k also does this.

This 11n rate scenario path is only called for chips in the AR5416
HAL; legacy chips use the previous interface for TX'ing.
2011-02-03 20:30:17 +00:00
Adrian Chadd
fe583b84f5 Disable the code I previously added from Rui's 802.11n branch.
A-MPDU RX interferes with packet retransmission/reordering.
In local testing, I was seeing A-MPDU being negotiated and then
not used by the AP sending frames to the STA; the STA would then
treat non A-MPDU frames that are retransmits as out of the window
and get plain confused.

The hardware RX status descriptor has a "I'm part of an aggregate"
bit; so this should eventually be tested and then punted to the
A-MPDU reorder handling only if it has this bit set.
2011-02-03 20:26:26 +00:00
Hans Petter Selasky
a153864056 Fix for detection of MTK 3329 GPS USB devices.
Submitted by:	Mykhaylo Yehorov
PR:		usb/153929
Approved by:	thompsa (mentor)
2011-02-03 18:25:55 +00:00
Ed Maste
7f6563d13c Include driver name in panic string, to make it easier to find these should
the panic ever occur.
2011-02-03 03:07:11 +00:00
Ed Maste
2ad1c92d96 Revert part of r173264. Both aac_ioctl_sendfib and aac_ioctl_send_raw_srb
make use of the aac_ioctl_event callback, if aac_alloc_command fails.  This
can end up in an infinite loop in the while loop in aac_release_command.

Further investigation into the issue mentioned by Scott Long [1] will be
necessary.

[1] http://lists.freebsd.org/pipermail/freebsd-current/2007-October/078740.html
2011-02-03 02:14:53 +00:00
Adrian Chadd
70d2183a7d Call the correct ANI Attach routine. 2011-02-02 03:55:34 +00:00
Nick Hibma
b531de0b14 New ID for the Novatel MC547
PR:		154127
Submitted by:	Mike Tancsa
MFC after:	1 day
2011-02-01 22:26:06 +00:00
Adrian Chadd
be96a6d39b Just to be sure, make sure the MCS rates are allowed for TX.
Approved by:	rpaulo@
2011-02-01 15:26:30 +00:00
Hans Petter Selasky
0c8f4683ec Use correct kernel types for all fields in USB PF code and headers.
Approved by:	thompsa (mentor)
2011-02-01 10:25:48 +00:00
Adrian Chadd
710c377821 Add a new method to the rate control modules which extract out the
three other rates and try counts.

The 11n rate scenario path wants to take a list of rate and tries,
rather than calling setupxtxdesc().
2011-02-01 08:10:18 +00:00
Adrian Chadd
4b44f6f275 Include some preliminary TX HT rate scenario setup code.
The AR5416 and later TX descriptors have new fields for supporting
11n bits (eg 20/40mhz mode, short/long GI) and enabling/disabling
RTS/CTS protection per rate.

These functions will be responsible for initialising the TX descriptors
for the AR5416 and later chips for both HT and legacy frames.

Beacon frames will remain using the non-11n TX descriptor setup for now;
Linux ath9k does much the same.

Note that these functions aren't yet used anywhere; a few more framework
changes are needed before all of the right rate information is available
for TX.
2011-02-01 08:03:01 +00:00
Adrian Chadd
79f02dbfed Refator the common code which calculates the 802.11g protection duration. 2011-02-01 07:50:26 +00:00
Adrian Chadd
81a826882a * Add a rather hacky "does this speak the 11n TX descriptor format"
function; which will be later used by the TX path to determine
  whether to use the extended features or not.

* Break out the descriptor chaining logic into a separate function;
  again so it can be switched out later on for the 11n version when
  needed.

* Refactor out the encryption-swizzling code that's common in the
  raw and normal TX path.
2011-02-01 06:59:44 +00:00
Adrian Chadd
29e9b81e77 Add TX/RX chainmask info to if_ath - this is needed for the 11n TX rate series. 2011-02-01 04:39:15 +00:00
Adrian Chadd
94d748d2a9 Add a new capability which reports the number of spatial streams a device supports.
The higher levels (net80211, if_ath, ath_rate) need this to make correct
choices about what MCS capabilities to advertise and what MCS rates are
able to be TXed.

In summary:

* AR5416 - 2/3 antennas, 2x2 streams
* AR9160 - 2/3 antennas, 2x2 streams
* AR9220 - 2 antennas, 2x2 sstraems
* AR9280 - 2 antennas, 2x2 streams
* AR9285 - 2 antennas but with antenna diversity, 1x1 stream
2011-02-01 03:51:35 +00:00
Jack F Vogel
bf0477b215 Support for the new Patsburg PCH chipset:
- SMBus Controller
     - SATA Controller
     - HD Audio Controller
     - Watchdog Controller

Thanks to Seth Heasley (seth.heasley@intel.com) for providing us code.

MFC after 3 days
2011-02-01 01:05:11 +00:00
Adrian Chadd
59d7849bbd Remove the now unneeded XXX. 2011-01-31 22:45:14 +00:00
Adrian Chadd
a83df4d35d Enable AMPDU reorder processing and receiving BAR frames when doing 802.11n.
Obtained from:	rpaulo@
2011-01-31 22:44:28 +00:00
Pyun YongHyeon
a280fae7c3 alc_rev was used without initialization such that it failed to
apply AR8152 v1.0 specific initialization code. Fix this bug by
explicitly reading PCI device revision id via PCI accessor.

Reported by:	Gabriel Linder ( linder.gabriel <> gmail dot com )
2011-01-31 20:00:43 +00:00
Jack F Vogel
d5267ede37 Support for the new DH89xxCC PCH chipset including:
- SATA controller
      - Watchdog timer
      - SMBus controller
2011-01-31 18:41:52 +00:00
Adrian Chadd
d39a3a978b Don't incorrectly set the burst duration setting in the TX descriptor.
After inspecting the ath9k source, it seems the AR5416 and later MACs
don't take an explicit RTS/CTS duration. A per-scenario (ie, what multi-
rate retry became) rts/cts control flag and packet duration is provided;
the hardware then apparently fills in whatever details are required.
The per-rate sp/lpack duration calculation just isn't used anywhere
in the ath9k TX packet length calculations.

The burst duration register controls something different; it seems to
be involved with RTS/CTS protection of 11n aggregate frames and is set
via a call to ar5416Set11nBurstDuration().

I've done some light testing with rts/cts protected frames and nothing
seems to break; but this may break said RTS/CTS and CTS-to-self protection.
2011-01-31 15:42:42 +00:00
Adrian Chadd
a565668bc5 Add support for the m25p64; lifted straight from Linux.
This flash chip is found on the Ubiquiti LS-SR71 board.
I've successfully tested reading; I've not tried writing to it yet.
2011-01-30 12:14:06 +00:00
Marcel Moolenaar
3a47c0e263 Don't operate on the parent of the PCI node. It's the PCI node itself
that represents the host controller. This makes the FDT PCI support
working an a bare-bones manner. This needs a lot more work, of which
the beginning are at the end of the file, compiled-out with #if 0.

The intend being that both the Marvell PCIE and Freescale PCI/PCIX/PCIE
duplicate the same platform-independent domain initialization, that
should be moved into an unified implementation in the FDT code. Handling
of resources requires help from the platform. A unified implementation
allows us to properly support PCI devices listed in the device tree and
configured according to the device tree specification.

Sponsored by: Juniper Networks
2011-01-29 21:14:29 +00:00
Marcel Moolenaar
ac3fe75f97 Call newbus_device_create() for PCI devices. Call pci_from_fdt_node()
for the newly created device_t, rather than the parent.
2011-01-29 21:08:03 +00:00
Marcel Moolenaar
2af3fc178e Introduce macro FDT_MAP_IRQ to map from an interrupt controller and
interrupt pin pair to a global IRQ number. When multiple PICs exist
on a board, the interrupt pin alone is not unique.
2011-01-29 20:25:20 +00:00
Adrian Chadd
1e918679c6 Avoid writing CCA threshold values for the EXT radios for non-HT40 channels. 2011-01-29 14:36:31 +00:00
Adrian Chadd
c6c9d8c8ed Bring over some NF calibration changes from ath9k.
Each different radio chipset has a different "good" range of CCA
(clear channel access) parameters where, if you write something
out of range, it's possible the radio will go deaf.

Also, since apparently occasionally reading the NF calibration
returns "wrong" values, so enforce those limits on what is being
written into the CCA register.

Write a default value if there's no history available.

This isn't the case right now but it may be later on when "off-channel"
scanning occurs without init'ing or changing the NF history buffer.
(As each channel may have a different noise floor; so scanning or
other off-channel activity shouldn't affect the NF history of
the current channel.)
2011-01-29 14:27:20 +00:00
Adrian Chadd
7c913dea08 Fix some errors introduced w/ the last commit; fix setting RTS/CTS in the 11n rate scenario.
* I messed up a couple of things in if_athvar.h; so fix that.
* Undo some guesswork done in ar5416Set11nRateScenario() and introduce a
  flags parameter which lets the caller set a few things. To begin with,
  this includes whether to do RTS or CTS protection.
* If both RTS and CTS is set, only do RTS. Both RTS and CTS shouldn't be
  set on a frame.
2011-01-29 12:30:13 +00:00
Adrian Chadd
94b61069cc Link in the 11n specific TX methods into the HAL. 2011-01-29 12:16:26 +00:00
Adrian Chadd
b8e788a53a Migrate the TX path code out of if_ath and into a separate source file.
There's two reasons for this:

* the raw and non-raw TX path shares a lot of duplicate code which should be
  refactored;
* the 11n-ready chip TX path needs a little reworking.
2011-01-29 11:35:23 +00:00
Adrian Chadd
7efd41107b Add a check for the AR9285E; I have no idea what this is.
The only other changes in ath9k for the AR9285E revolve around sleep modes
which are not fully implemented here yet.
2011-01-29 08:52:06 +00:00
Adrian Chadd
5bc8125ad3 Break out the debug macros from if_ath.c into if_ath_debug.[ch] .
This is prep work for breaking out the TX path into a separate
set of source files.
2011-01-29 05:08:21 +00:00
Justin T. Gibbs
8577146eac Fix bug in the netfront driver that caused excessive packet drops during
receive processing.

Remove unnecessary restrictions on the mbuf chain length built during an
LRO receive.  This restriction was copied from the Linux netfront driver
where the LRO implementation cannot handle more than 18 discontinuities.
The FreeBSD implementation has no such restriction.

MFC after: 1 week
2011-01-29 02:36:45 +00:00
Andrew Turner
c8045145b7 Use bus space functions rather than inw/outw
to help a future port of the driver to ARM.

Approved by:	imp (mentor)
2011-01-29 00:53:58 +00:00
Marcel Moolenaar
df0437ca6f Don't use the MAC address in the device tree if it's all zeroes
(i.e. 00-00-00-00-00-00). Use the currently programmed address
instead.

While here, simplify the function.
2011-01-28 23:40:13 +00:00
Pyun YongHyeon
f69ddfbb5f Fix logic error. Due to the bug, it incorrectly checked TXQ status
which in turn can leave TXQ active.

Submitted by:	Brad ( brad <> comstyle dot com )
MFC after:	3 days
2011-01-28 21:03:32 +00:00
Adrian Chadd
a6a308a4df (Mostly) teach ath_rate_sample about MCS rates.
This is just the bare minimum needed to teach ath_rate_sample to try
and handle MCS rates. It doesn't at all attempt to find the best
rate by any means - it doesn't know anything about the MCS rate
relations, TX aggregation or any of the much sexier 11n stuff
that's out there.

It's just enough to transmit 11n frames and handle TX completion.

It shouldn't affect legacy (11abg) behaviour.

Obtained from:	rpaulo@
2011-01-28 08:57:58 +00:00
Adrian Chadd
064e40d0ab Make space for the extended 802.11n MCS rate tables. 2011-01-28 08:45:19 +00:00
Adrian Chadd
d054f3a866 Bring in some 802.11n packet duration calculation functions from a mix of Sam/Rui and linux ath9k .
This will eventually be used by rate control modules and by the TX
code for calculating packet duration when handling rts/cts protection.

Obtained from:	sam@, rpaulo@, linux ath9k
2011-01-28 08:35:55 +00:00
Konstantin Belousov
4a13a769dc Add support for BIO_DELETE on swap-backed md(4). In the case of BIO_DELETE
covering the whole page, free the page. Otherwise, clear the region and
mark it clean. Not marking the page dirty could reinstantiate cleared
data, but it is allowed by BIO_DELETE specification and saves unneeded
write to swap.

Reviewed by:	alc
Tested by:	pho
MFC after:	2 weeks
2011-01-27 16:10:25 +00:00
Adrian Chadd
0fafe07ff3 Initialise the chainmask from the EEPROM rather than the hard-coded defaults.
The defaults enabled three chains on the AR5416 even if the card has two
chains. This restores that and ensures that only the correct TX/RX
chainmasks are used.

When HT modes are enabled, all TX chains will be correctly enabled.

This should now enable analog chain swapping with 2-chain cards.
I'm not sure if this is needed for just the AR5416 or whether
it also applies to AR9160, AR9280 and AR9287 (later on); I'll have
to get clarification.
2011-01-27 09:26:37 +00:00
Adrian Chadd
4ceb85596b Add missing getCapability call for AR5416. 2011-01-27 08:42:50 +00:00
Adrian Chadd
51fcc8350c Make a note to re-check whether that particular check is needed. 2011-01-27 07:33:17 +00:00
Adrian Chadd
6ef699a0a6 Writing to the analog registers on the AR9220 (Merlin PCI) seems to require a delay.
This, along with an initval change which will appear in a subsequent commit,
fixes bus panics that I have been seing with the AR9220 on a Routerstation Pro
(AR7161 MIPS board.)

Obtained from: Linux ath9k
PR: kern/154220
2011-01-27 02:56:03 +00:00
Matthew D Fleming
00f0e671ff Explicitly wire the user buffer rather than doing it implicitly in
sbuf_new_for_sysctl(9).  This allows using an sbuf with a SYSCTL_OUT
drain for extremely large amounts of data where the caller knows that
appropriate references are held, and sleeping is not an issue.

Inspired by:	rwatson
2011-01-27 00:34:12 +00:00
Pyun YongHyeon
54899a96e1 Add support for RTL8105E PCIe Fast Ethernet controller. It seems
the controller has a kind of embedded controller/memory and vendor
applies a large set of magic code via undocumented PHY registers in
device initialization stage. I guess it's a firmware image for the
embedded controller in RTL8105E since the code is too big compared
to other DSP fixups. However I have no idea what that magic code
does and what's purpose of the embedded controller. Fortunately
driver seems to still work without loading the firmware.

While I'm here change device description of RTL810xE controller.

H/W donated by:	Realtek Semiconductor Corp.
2011-01-26 21:14:20 +00:00
Pyun YongHyeon
ed072c9d1a Add Realtek RTL8201E 10/100 PHY found in RTL8105E controller. The
exact model name is not clear yet. All previous RTL8201 10/100 PHYs
used 0x8201 in MII_PHYIDR2 which in turn makes model number 0x20
but this PHY used new model number 0x08.
2011-01-26 21:07:44 +00:00
Pyun YongHyeon
502be0f749 Do not use interrupt taskqueue on controllers with MSI/MSI-X
capability. One of reason using interrupt taskqueue in re(4) was
to reduce number of TX/RX interrupts under load because re(4)
controllers have no good TX/RX interrupt moderation mechanism.
Basic TX interrupt moderation is done by hardware for most
controllers but RX interrupt moderation through undocumented
register showed poor RX performance so it was disabled in r215025.
Using taskqueue to handle RX interrupt greatly reduced number of
interrupts but re(4) consumed all available CPU cycles to run the
taskqueue under high TX/RX network load.  This can happen even with
RTL810x fast ethernet controller and I believe this is not
acceptable for most systems.

To mitigate the issue, use one-shot timer register to moderate RX
interrupts. The timer register provides programmable one-shot timer
and can be used to suppress interrupt generation. The timer runs at
125MHZ on PCIe controllers so the minimum time allowed for the
timer is 8ns. Data sheet says the register is 32 bits but
experimentation shows only lower 13 bits are valid so maximum time
that can be programmed is 65.528us. This yields theoretical maximum
number of RX interrupts that could be generated per second is about
15260. Combined with TX completion interrupts re(4) shall generate
less than 20k interrupts. This number is still slightly high
compared to other intelligent ethernet controllers but system is
very responsive even under high network load.

Introduce sysctl variable dev.re.%d.int_rx_mod that controls amount
of time to delay RX interrupt processing in units of us. Value 0
completely disables RX interrupt moderation. To provide old
behavior for controllers that have MSI/MSI-X capability, introduce
a new tunable hw.re.intr_filter. If the tunable is set to non-zero
value, driver will use interrupt taskqueue. The default value of
the tunable is 0. This tunable has no effect on controllers that
has no MSI/MSI-X capability or if MSI/MSI-X is explicitly disabled
by administrator.

While I'm here cleanup interrupt setup/teardown since re(4) uses
single MSI/MSI-X message at this moment.
2011-01-26 20:25:40 +00:00
Alexander Motin
7f63cad89e Add missing part of r217877. 2011-01-26 13:10:07 +00:00
Adrian Chadd
f68a9f06e1 Add ar5416RestoreChainMask() which will undo any AR5416 specific chainmask
overriding after calibration.

This will get set for other two chain radios, such as AR9280 and later on,
AR9287. It should however be a nul operation.
2011-01-26 10:48:29 +00:00
Adrian Chadd
b868c6d0b1 Add an AR5416 workaround - force a different bias based on 2.4ghz channel frequency.
Obtained from:	Linux ath9k
2011-01-26 10:36:43 +00:00
Adrian Chadd
60a507a514 Break out the chainmask init code into a new function - ar5416InitChainMasks() .
ath9k does a few different things here during config - if it's an early
AR5416 with two chains, it enables all three chains for calibration and
then restores the chainmask to the original values after initial
calibration has completed.

The reason behind this commit is to begin breaking out the chainmask
configuration for this specific reason; follow-up commits will add
the chainmask restore in the ar5416Reset() routine.
2011-01-26 10:08:37 +00:00
Adrian Chadd
5a2def3a5e * fix HAL_DEBUG_INTERRUPT to be a separate bit, it was overlapping with
something else
* add HAL_DEBUG_GPIO, for some GPIO related debugging I'm tinkering with
  at the moment.
2011-01-26 09:37:43 +00:00
Alexander Motin
a59641a90d Hardware supported by siis(4) allows software control over activity LEDs.
Expose that functionality to led(4) OR-ing it with regular LED activity.
2011-01-26 08:54:10 +00:00
Pyun YongHyeon
d180a66f19 Remove TX taskqueue and directly invoke re_start in interrupt task. 2011-01-25 23:27:28 +00:00
Pyun YongHyeon
4a58fd452a Prefer MSI-X to MSI on controllers that support MSI-X. All
recent PCIe controllers(RTL8102E or later and RTL8168/8111C or
later) supports either 2 or 4 MSI-X messages. Unfortunately vendor
did not publicly release RSS related information yet. However
switching to MSI-X is one-step forward to support RSS.
2011-01-25 22:18:00 +00:00
Pyun YongHyeon
f9ad4da76d Disable TSO for all Realtek controllers. Experimentation showed
RTL8111C generated corrupted frames where TCP option header was
broken. All other sample controllers I have did not show such
problem so it could be RTL8111C specific issue. Because there are
too many variants it's hard to tell how many controllers have such
issue. Just disable TSO by default but have user override it.
2011-01-25 19:05:46 +00:00
Konstantin Belousov
96410b9575 Bio shall not be accessed after g_io_deliver(9).
Reported and tested by:	pho
Reviewed by:	ae, phk
MFC after:	1 week
2011-01-25 14:00:30 +00:00
Adrian Chadd
3545027dc3 * Re-format the v4k header to be consistent
* Re-do the structure size/component math to make sure the struct matches
  the expected size
* Just to be clear that we care about bitmask ordering, revert my previous
  change and instead define that macro if we're on big-endian.
2011-01-25 07:37:12 +00:00
Adrian Chadd
6468b2baa5 Bring over a fix from ath9k - zero some of the TX descriptors for Kite/AR9285.
Kite doesn't have per-chain control (it has one chain) or antenna control; so
don't try to set those descriptor entries.
2011-01-25 05:47:50 +00:00
Adrian Chadd
2b020858f9 Rename this linux-ism __BIG_ENDIAN_BITFIELD macro to something suitable for FreeBSD.
Warner has pointed out that FreeBSD's bit orders follow byte orders.
2011-01-25 05:41:36 +00:00
Adrian Chadd
d55a8a09e8 Commit updated AR9285 (Kite) v2 initvals from ath9k. 2011-01-25 05:36:29 +00:00
Adrian Chadd
fb14f71662 Fix the Atheros V4K EEPROM definitions to match those in ath9k.
It turns out that the V4K eeprom definitions (used by the AR9285 and
its derivatives) is wrong. These values are at least causing issues
on my AR2427.

With this fix (and initvals in a subsequent commit), the AR2427 behaves
a lot better.

Note - there's still significant drift between the ath9k v4k eeprom
init code (again, used by AR9285 and derivatives) and what's in this
tree. That needs to be investigated and resolved.
2011-01-25 05:35:09 +00:00
Marcel Moolenaar
f1fb96475a In uart_tty_outwakeup(), check CTS/RTS flow control settings and
prevent sending data when CTS is de-asserted.
In uart_tty_intr(), call uart_tty_outwakeup() when the CTS signal
changed, knowing that uart_tty_outwakeup() will do the right
thing for flow control. This avoids redundant conditionals.

PR:		kern/148644
Submitted by:	John Wehle <john@feith.com>
MFC after:	3 days
2011-01-24 18:34:16 +00:00
Pyun YongHyeon
4de89d86cd Reinitialize driver when MTU is changed and driver is running.
Reported by:	Huang, Yusheng ( yusheng.huang <> bluecoat com )
2011-01-24 17:53:58 +00:00
Hans Petter Selasky
99f017d21b Add more sanity checks for USB_HOST_ALIGN input values. Re-factor existing
checks for readability.

Approved by:	thompsa (mentor)
2011-01-24 17:38:37 +00:00
Adrian Chadd
514539dcbd Remove an invalid register setup; this is likely a holdover from
the AR5212 code. It doesn't exist in ath9k and I've been told it
doesn't exist in the Atheros internal driver.
2011-01-24 17:03:22 +00:00
Alexander Motin
f1bfc8aba8 ICH7 SATA controller in legacy mode can provide access to SATA registers
via AHCI-like memory resource at BAR(5). Use it if BIOS was so kind to
allocate memory for that BAR. This allows hot-plug support and connection
speed reporting.

MFC after:	2 weeks
2011-01-24 09:24:20 +00:00
Pyun YongHyeon
7be4de2de7 Apply TX interrupt moderation to all RTL810xE PCIe Fast Ethernet
controllers. Experimentation with RTL8102E, RTL8103E and RTL8105E
showed dramatic decrement of TX completion interrupts under high TX
load(e.g.  from 147k interrupts/second to 10k interrupts/second)
With this change, TX interrupt moderation is applied to all
controllers except RTL8139C+.
2011-01-24 00:01:06 +00:00
Adrian Chadd
d8d0c29db8 Enable the 11n PHY by default whether or not 11n is configured.
The linux ath9k driver and (from what I've been told) the atheros reference
driver does this; it then leaves discarding 11n frames to the 802.11 layer.

Whilst I'm here, merge in a fix from ath9k which maintains a turbo register
setting when enabling the 11n register; and remove an un-needed (duplicate)
flag setting.
2011-01-23 14:49:50 +00:00
Adrian Chadd
69d1f737f8 Update the AR9280v2 inivals to match what is in Linux ath9k.
This repairs the behaviour of my AR9280 - both radio chains now seem
to correctly be receiving.
2011-01-23 14:30:35 +00:00
Andrew Thompson
d929b72e23 Revert the ndis part of r212122, windrv_stub.c already adds a MODULE_VERSION
and this breaks loading miniport drivers from loader.conf

Reported by:	Yuri <yuri^rawbw^com>
Submitted by:	Paul B Mahol
MFC after:	3 days
2011-01-22 21:33:18 +00:00
Hans Petter Selasky
d8d1becfdd Allow USB_HOST_ALIGN to be configured at compile time. This patch is
necessary for MIPS based RouterStation Pro board and maybe other MIPS
based boards as well.

Submitted by:	Milan Obuch
Approved by:	thompsa (mentor)
2011-01-22 13:52:23 +00:00
Jack F Vogel
7d5f64a903 Don't bother to run the flowcontrol code if there
is no change. Thanks to Andrew for the tweak.
2011-01-22 00:19:15 +00:00
Jack F Vogel
1d4e0b19e4 Missing case for 82598DA type adapter, thanks Andrew. 2011-01-22 00:08:06 +00:00
Jack F Vogel
c6f98cde15 Leftover bogus TX UNLOCK removed. Thanks to
Andrew Boyer.
2011-01-21 23:55:28 +00:00
Adrian Chadd
409daaf37b Fix some typos. 2011-01-21 07:28:48 +00:00
Adrian Chadd
25580e3f63 Add missing getCapability call for AR5416. 2011-01-21 07:26:53 +00:00
Adrian Chadd
a5314ffdf0 Modify the v14/v4k eeprom diag interface to return the whole eeprom.
The v1 and v3 interfaces returned the whole EEPROM but the v14/v4k
interfaces just returned the base header. There's extra information
outside of that which would also be nice to get access to.
2011-01-21 06:42:25 +00:00
Adrian Chadd
a108ab6394 ANI changes #1 - split out the ANI polling from the RxMonitor hook.
The rxmonitor hook is called on each received packet. This can get very,
very busy as the tx/rx/chanbusy registers are thus read each time a packet
is received.

Instead, shuffle out the true per-packet processing which is needed and move
the rest of the ANI processing into a periodic event which runs every 100ms
by default.
2011-01-21 05:21:00 +00:00
Pyun YongHyeon
c27d7a76fc Correct wrong definition of PM timer mask and adjust L1/PM timer
value. While I'm here enable all clocks before initializing
controller. This change should fix lockup issue seen on AR8152
v1.1 PCIe Fast Ethernet controller.

PR:	kern/154076
MFC after:	3 days
2011-01-20 18:26:33 +00:00
Adrian Chadd
1e659efff7 ar9280SetAntennaSwitch() was using the AR5416 chainmasks (3 chains)
rather than the AR9280 chainmasks (2 chains)
2011-01-20 15:09:11 +00:00
Nick Hibma
0223e98a7e Add another ID for the ZTE MF190 Surf Stick
Submitted by:	nagilum
MFC after:	1 day
2011-01-20 13:02:54 +00:00
Adrian Chadd
c44797fc39 Only enable 11n modes if the chipset suports 11n.
Since the AR2427 doesn't allow 802.11n, it shouldn't have them
configured.
2011-01-20 09:46:18 +00:00
Adrian Chadd
1d6334ce30 Include the device ids for the AR2427.
This is apparently an AR9285 with the 802.11n specific bits disabled.

This code is completely untested; I'm doing this in response to users
who wish to test the functionality out. It's likely as buggy as the
AR9285 support is in FreeBSD at the moment.
2011-01-20 09:37:53 +00:00
Adrian Chadd
204582f2f3 Push the non-AR5416 related stuff into chipset specific directories.
sys/dev/ath/ath_hal/ar5416/ is getting very crowded and further
commits will make it even more crowded. Now is a good time to
shuffle these files out before any more extensive work is done
on them.

Create an ar9003 directory whilst I'm here; ar9003 specific
chipset code will eventually live there.
2011-01-20 09:03:40 +00:00
Adrian Chadd
564e7aea54 Add a comment from my local HAL about what is actually going on here
with these ADC DC Gain/Offset calibrations.

The whole idea is to calibrate a pair of ADCs to compensate for any
differences between them.

The AR5416 returns lots of garbage, so there's no need to do the
calibration there.

The AR9160 returns 0 for secondary ADCs when calibrating 2.4ghz 20mhz
modes. It returns valid data for the secondary ADCs when calibrating
2.4ghz HT/40 and any 5ghz mode.
2011-01-20 08:40:22 +00:00
Adrian Chadd
bd97c52a22 Migrate the sample rate module to the new ath_hal_gettxcompletionrates() API.
This removes the chipset-dependent TX DMA completion descriptor groveling.
It should now be (more) portable to other, later atheros chipsets when the
time comes.
2011-01-20 08:19:23 +00:00
Adrian Chadd
82d2927d95 Add in the public method to access the tx completion rates. 2011-01-20 08:15:46 +00:00
Adrian Chadd
88117a532d Include the initial support for external EEPROMs.
The AR9100 at least doesn't have an external serial EEPROM
attached to the MAC; it instead stores the calibration data
in the normal system flash.

I believe earlier parts can do something similar but I haven't
experienced it first-hand.

This commit introduces an eepromdata pointer into the API but
doesn't at all commit to using it. A future commit will
include the glue needed to allow the AR9100 support code
to use this data pointer as the EEPROM.
2011-01-20 07:56:09 +00:00
Adrian Chadd
c485136b7f Port over another EEPROM option from ath9k - AR_EEP_DAC_HPWR_5G
This will be used by the temperature compensation calibration code
which will shortly make an appearance.
2011-01-20 07:42:39 +00:00
Adrian Chadd
7fbdd9a0e9 Add another HAL function which waits for a register for a configurable amount.
This will be used by some future code.
2011-01-20 07:03:20 +00:00
Adrian Chadd
9ea467445d Add a new HAL method to retrieve the completion schedule. It sets
the completion schedule from the hardware and returns AH_TRUE if
the hardware supports multi-rate retries (AR5212 and above); and
returns AH_FALSE if the hardware doesn't support multi-rate retries.

The sample rate module directly reads the TX completion descriptor
and extracts the TX schedule information from that. It will be
updated in a future commit to instead use this method to determine
the completion schedule.
2011-01-20 05:49:15 +00:00
Adrian Chadd
25c96056ef Use the now-exposed diag code, rather than a hard-coded magic number. 2011-01-20 04:59:11 +00:00
Adrian Chadd
0dbe9289ce Break out the diagnostic codes from ah_internal.h and place them in ah_diagcodes.h.
Since we now have the source code, there's no reason to hide the diag codes
from other areas.

They live in the HAL as they form part of the HAL API and should still be treate
as "potentially flexible; don't publish as a public API." But since they're
already used as a public API (see follow-up commit), we may as well use
them in place of magic constants.
2011-01-20 04:57:26 +00:00
Matthew D Fleming
cbc134ad03 Introduce signed and unsigned version of CTLTYPE_QUAD, renaming
existing uses.  Rename sysctl_handle_quad() to sysctl_handle_64().
2011-01-19 23:00:25 +00:00
Jack F Vogel
182b3808b5 Update driver to version 2.3.8:
CRITICAL FIX - with stats changes the older 82598 will panic
	and trash the stack on driver load, FCOE registers ONLY exist
	in 82599 and must not be read otherwise.

	kern/153951 - to correct incorrect media type on adapters
	with pluggable modules I have eliminated the old static
	table in favor of a new dynamic shared code routine. This
	also has the benefit of detecting changes when a different
	module is inserted.

	Performance/enhancement to the Flow Director code from my
	linux coworker (the developer of the code).

	Fixes from Michael Tuexen - a data corruption problem on the
	82599 (CRITICAL), fix so the buf size correctly adjusts as
	the cluster changes, and max descriptors are set properly.
	Also added 16K clusters for those REALLY big jumbos :)

	In the RX path, the RX LOCK was not being released, and this
	causes LOR problems. Add the code that igb already has.

	Sync with in house shared code, this was necessary for the
	Flow Director fix.

MFC in 2 days
2011-01-19 19:36:27 +00:00
Jack F Vogel
fbfbce8ae9 Fix for kern/152853, pullup at the wrong point
is breaking UDP. Thanks to Petr Lampa for the
patch.
2011-01-19 18:20:11 +00:00