Commit Graph

23602 Commits

Author SHA1 Message Date
Adrian Chadd
14d33c7e35 Create a function - ath_tx_kick() - which is called where ath_start() is
called to "kick" along TX.

For now, schedule a taskqueue call.

Later on I may go back to the direct call of ath_rx_tasklet() - but for
now, this will do.

I've tested UDP and TCP TX. UDP TX still achieves 240MBit, but TCP
TX gets stuck at around 100MBit or so, instead of the 150MBit it should
be at.  I'll re-test with no ACPI/power/sleep states enabled at startup
and see what effect it has.

This is in preparation for supporting an if_transmit() path, which will
turn ath_tx_kick() into a NUL operation (as there won't be an ifnet
queue to service.)

Tested:
	* AR9280 STA

TODO:
	* test on AR5416, AR9160, AR928x STA/AP modes

PR:		kern/168649
2012-06-05 03:14:49 +00:00
David E. O'Brien
eb9aea5ac0 Add the 'filemon' device. 'filemon' is a kernel module that provides a device
interface for processes to record system calls of its children.

Submitted by:	Juniper Networks.
2012-06-04 22:54:19 +00:00
Adrian Chadd
470a7f4191 Migrate the TX path to a taskqueue for now, until a better way of
implementing parallel TX and TX/RX completion can be done without
simply abusing long-held locks.

Right now, multiple concurrent ath_start() entries can result in
frames being dequeued out of order.  Well, they're dequeued in order
fine, but if there's any preemption or race between CPUs between:

* removing the frame from the ifnet, and
* calling and runningath_tx_start(), until the frame is placed on a
  software or hardware TXQ

Then although dequeueing the frame is in-order, queueing it to the hardware
may be out of order.

This is solved in a lot of other drivers by just holding a TX lock over
a rather long period of time.  This lets them continue to direct dispatch
without races between dequeue and hardware queue.

Note to observers: if_transmit() doesn't necessarily solve this.
It removes the ifnet from the main path, but the same issue exists if
there's some intermediary queue (eg a bufring, which as an aside also
may pull in ifnet when you're using ALTQ.)

So, until I can sit down and code up a much better way of doing parallel
TX, I'm going to leave the TX path using a deferred taskqueue task.
What I will likely head towards is doing a direct dispatch to hardware
or software via if_transmit(), but it'll require some driver changes to
allow queues to be made without using the really large ath_buf / ath_desc
entries.

TODO:

* Look at how feasible it'll be to just do direct dispatch to
  ath_tx_start() from if_transmit(), avoiding doing _any_ intermediary
  serialisation into a global queue.  This may break ALTQ for example,
  so I have to be delicate.

* It's quite likely that I should break up ath_tx_start() so it
  deposits frames onto the software queues first, and then only fill
  in the 802.11 fields when it's being queued to the hardware.
  That will make the if_transmit() -> software queue path very
  quick and lightweight.

* This has some very bad behaviour when using ACPI and Cx states.
  I'll do some subsequent analysis using KTR and schedgraph and file
  a follow-up PR or two.

PR:		kern/168649
2012-06-04 22:01:12 +00:00
Dimitry Andric
56e4bfe54d Fix build of aicasm when CC=clang. This was due to a side-effect of the
EARLY_BUILD macro: the -Qunused-arguments flag isn't passed anymore when
building this particular program.  However, with clang 3.1 and -Werror,
such unused argument warnings are flagged as errors, causing buildkernel
to fail at this stage, due to the -nostdinc flag passed during linking.
Since the -nostdinc flag isn't actually needed, just remove it.

X-MFC-With:	r236528
2012-06-04 20:36:11 +00:00
Dimitry Andric
cec20e143c Make aicasm compile without warnings if -Wpointer-sign is enabled.
MFC after:	3 days
2012-06-04 17:22:43 +00:00
Marius Strobl
4c87055c0c Disable verification of the flashed content for now; for reasons unknown
it sometimes causes physwr to hang.
2012-06-03 21:03:16 +00:00
Marius Strobl
7f2107d400 - Loop up to 3 seconds when waiting for a device to get ready. [1]
- Make the device description match the driver name.
- Identify the chip variant based on the JEDEC and use that information
  to use the proper values for page count, offset and size instead of
  hardcoding a AT45DB642x with 2^N byte page support disabled.
- Take advantage of bioq_takefirst().
- Given that CONTINUOUS_ARRAY_READ_HF (0x0b) command isn't even mentioned
  in Atmel's DataFlash Application Note, as suggested by the previous
  comment may not work on all all devices and actually doesn't properly
  on at least AT45DB321D (JEDEC 0x1f2701), rewrite at45d_task() to use
  CONTINUOUS_ARRAY_READ (0xe8) for reading instead. This rewrite is laid
  out in a way allowing to easily add support for BIO_DELETE later on.
- Add support for reads and writes not starting on a page boundary.
- Verify the flash content after writing.
- Let at45d_task() gracefully handle errors on SPI transfers and the
  device not becoming ready afterwards again. [1]
- Use DEVMETHOD_END. [1]
- Use NULL instead of 0 for pointers. [1]

Additional testing by:	Ian Lepore

Submitted by:	Ian Lepore [1]
MFC after:	1 week
2012-06-03 01:00:55 +00:00
Marius Strobl
ae5d8757bf Add missing prototypes. While at it, sort them alphabetically.
MFC after:	3 days
2012-06-02 20:47:00 +00:00
Marius Strobl
f3a4392048 Remove nitems() now that it lives in <sys/param.h> since r236486. 2012-06-02 20:00:52 +00:00
Marius Strobl
47f4a4dc9a Take advantage of nitems().
MFC after:	3 days
2012-06-02 19:41:28 +00:00
Hans Petter Selasky
bb57146269 Add appropriate checks for ic_bsschan being set to IEEE80211_CHAN_ANYC in
some of the USB WLAN drivers. This fixes a panic when using monitor mode.

MFC after:	1 week
Submitted by:	PseudoCylon
2012-06-02 09:10:51 +00:00
Matt Jacob
e2873b76a6 Clean up and complete the incomplete deferred enable code.
Make the default role NONE if target mode is selected. This
allows ctl(8) to switch to/from target mode via knob settings.
If we default to role 'none', this causes a reset of the
24XX f/w which then causes initiators to wake up and notice
when we come online.

Reviewed by:    kdm
MFC after:      2 weeks
Sponsored by:   Spectralogic
2012-06-01 23:29:48 +00:00
Jung-uk Kim
9ad569771a Consistently use ACPI_SUCCESS() and ACPI_FAILURE() macros wherever possible. 2012-06-01 21:33:33 +00:00
Jung-uk Kim
4d46ef51dd Execute AcpiLeaveSleepStatePrep() for S1 and reduce code duplication.
MFC after:	3 days
2012-06-01 17:00:33 +00:00
Hans Petter Selasky
d9073c1e6a Improve support for detaching kernel drivers on a per interface basis.
MFC after:	1 week
2012-06-01 16:30:54 +00:00
John Baldwin
03b0ca8b28 Commit a portion of 233708 I missed earlier and don't include the
definition of igb_start() and igb_start_locked() (nor set if_start in
the ifnet) when igb(4) uses if_transmit.
2012-06-01 15:52:41 +00:00
Mitsuru IWASAKI
f0a101b7e2 Call AcpiLeaveSleepStatePrep() in interrupt disabled context
(described in ACPICA source code).

- Move intr_disable() and intr_restore() from acpi_wakeup.c to acpi.c
  and call AcpiLeaveSleepStatePrep() in interrupt disabled context.
- Add acpi_wakeup_machdep() to execute wakeup MD procedures and call
  it twice in interrupt disabled/enabled context (ia64 version is
  just dummy).
- Rename wakeup_cpus variable in acpi_sleep_machdep() to suspcpus in
  order to be shared by acpi_sleep_machdep() and acpi_wakeup_machdep().
- Move identity mapping related code to acpi_install_wakeup_handler()
  (i386 version) for preparation of x86/acpica/acpi_wakeup.c
  (MFC candidate).

Reviewed by:	jkim@
MFC after:	2 days
2012-06-01 15:26:32 +00:00
Adrian Chadd
81c2214dda Add a missing #include, required for IEEE80211_DEBUG. 2012-06-01 06:20:39 +00:00
Eitan Adler
d45ce511db Adding missing dependancies for loading hptiop(4), hptmv(4) and isp(4) as modules.
PR:		kern/166239
Submitted by:	Pavel Timofeev <timp87@gmail.com>
Discussed on:	-stable, -scsi
Reviewed by:	scottl
No objection from: mjacob
Approved by:	cperciva
MFC after:	3 days
2012-06-01 04:34:49 +00:00
Eitan Adler
829ac2c3e0 Fix warning generated by clang;
warning: equality comparison with extraneous parentheses
	[-Wparentheses-equality]

Reported by:	arundel
Reviewed by:	gnn
Approved by:	cperciva
MFC after:	3 days
2012-06-01 04:23:20 +00:00
Pyun YongHyeon
198b3ad636 Remove unnecessary device_printfs.
Pointed out by:	marius
2012-05-31 23:56:10 +00:00
Marius Strobl
749a52693c Try to finally get the point in time at which bge_add_sysctls() is called
right; it needs to be called before bge_can_use_msi() but in turn requires
bge_flags to be properly set.

Submitted by:	yongari
MFC after:	3 days
2012-05-30 20:04:07 +00:00
Sean Bruno
87e7271687 Cosmetic nit. If a configured volume has no label, don't emit an empty
string for the name during probe.  Simply indicate that it has no label.

Submitted by:	bhaga@
MFC after:	3 days
2012-05-30 17:07:50 +00:00
Eitan Adler
d9b73ea9cf Add support for Sun 1040 PCI Quad Serial
PR:		kern/163450
Submitted by:	Anonymous Hardware Hacker <silicium@harmony-p.ath.cx>
Approved by:	cperciva
MFC after:	1 week
2012-05-30 03:47:51 +00:00
Robert Noland
cf864f03b6 Add device ids for the Winbond 83627DHG-P chip and set the registers to
trigger the keyboard reset line on timeout.

Reviewed by:	bz
MFC after:	1 week
2012-05-29 16:39:42 +00:00
Robert Noland
63fb0bb621 Fix a typo in wbwd so that CRF5 is actually written to the data register
rather than the index register.

Reviewed by:	bz
MFC after:	3 days
2012-05-29 16:25:01 +00:00
Hans Petter Selasky
58a9da85fe Add quirk for Marvell based AHCI controller.
MFC after:	3 days
Suggested by:	mav @
2012-05-29 15:56:30 +00:00
Mitsuru IWASAKI
e3b56b6604 Reorder resume procedures.
DEVICE_RESUME() should be done before AcpiLeaveSleepState() because
PCI config space evaluation can be occurred during control method
executions.

This should fix one of the hang up problems on resuming.

MFC after:	3 days
2012-05-29 05:28:34 +00:00
Mitsuru IWASAKI
ffe3f1f8cc Fix the problem acpi_sleep_force() hang.
Suspending from callout cause the freeze in DEVICE_SUSPEND().
Suspend from acpi_task thread in stead.

MFC after:	3 days
2012-05-29 05:09:40 +00:00
Andrew Gallatin
bebda077b1 Update mxge(4) firmware to the latest version available from
Myricom (1.4.55).

MFC after:	3 days
Sponored by: Myricom, Inc.
2012-05-29 00:53:51 +00:00
Alan Cox
2444cf8fd0 A small simplification to i915_gem_pager_fault().
Reviewed by:	kib
2012-05-28 21:15:54 +00:00
Alexander Motin
4cfe4ccf16 Make legacy ATA to not call device_add_child() with unit number but
without driver name. This fixed legacy ATA breakage by r235978.

MFC after:	1 week
2012-05-28 14:33:15 +00:00
Konstantin Belousov
46932515ac Disable end of buffer fixup by default. New DDX does not need this, and
since batch_len is unused by Linux driver, it seems that it is sometimes
gets passed wrong. This causes command buffer corruption and GPU hung.

Old GEMified DDX drivers that needs this workaround are not supported.

MFC after:	1 month
2012-05-28 13:58:08 +00:00
Konstantin Belousov
886add7764 Fix calculation of the execution buffer end in the mapped pages
when it is spilled into the next page.

MFC after:	1 month
2012-05-28 13:55:49 +00:00
Marius Strobl
0554fd516f - Fix some typos in mmc_acquire_bus() and mmc_send_csd().
- Fix some math errors in mmc_decode_csd_sd().
- Fix incorrect arguments to mmc_send_app_op_cond() in mmc_go_discovery().
- Add reporting of CSD for debug purposes.
- Add detection (and skipping) of password-locked cards.
- Add setting of block length on card if necessary.

Submitted by:	Patrick Kelsey
MFC after:	3 days
2012-05-27 16:08:58 +00:00
Rafal Jaworowski
c49504be41 Import EHCI attachment driver for Freescale integrated controller.
Obtained from:	Freescale, Semihalf.
Written by:	Michal Dubiel
2012-05-26 21:05:11 +00:00
Marius Strobl
243d601f05 Make the VIA workaround application somewhat more consistent with the
ATI one.
2012-05-26 08:43:51 +00:00
Marius Strobl
af3839c4ab Consistently use USB_PAGE_SIZE. Currently, this is cosmetic.
MFC after:	3 days
2012-05-26 08:33:53 +00:00
Marius Strobl
7e543a0ed3 Make the VIA workaround actually do its intended job.
MFC after:	3 days
2012-05-26 08:31:12 +00:00
Marius Strobl
9e2174bc8e Remove extraneous empty lines.
MFC after:	3 day
2012-05-26 08:17:30 +00:00
Marius Strobl
21b5913f1f - When creating the DMA tag for user data, don't ask for more segments
than required for handling MAXPHYS and report the resulting maximum
  I/O size to CAM instead of implicitly limiting it to DFLTPHYS.
- Move the variables of sym_action2() out of nested scope as required
  by style(9) and remove extraneous curly braces.
- Replace a magic value for PCIR_COMMAND with the appropriate macro.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

Tested with a HBA donated by wilko.

MFC after:	3 days
2012-05-26 08:03:42 +00:00
Adrian Chadd
1a67d0266c Add the AR9280 workarounds for PCIe suspend/resume.
These aren't strictly needed at the moment as we're not doing APSM
and forcing the NIC in and out of network sleep.  But, they don't hurt.

Tested:

* AR9280 (mini-PCIe)

Obtained from:	Qualcomm Atheros, Linux ath9k
2012-05-26 01:36:25 +00:00
Adrian Chadd
b815538dec Avoid using hard-coded numbers here. 2012-05-26 01:35:11 +00:00
Adrian Chadd
a35baf81c9 Remove an unneeded field from ath_buf. 2012-05-26 01:34:36 +00:00
Adrian Chadd
cf2a77f961 Add some AR5416/AR5418 WAR's for power-on and suspend/resume:
* Now that ah_configPCIE is called for both power on and suspend/resume,
  make sure the right bit(s) are cleared and set when suspending and
  resuming.  Specifically:

  + force disable/enable the PCIe PHY upon suspend/resume;
  + reprogram the PCIe WAR register when resuming and upon power-on.

* Add a recipe which powers down any PCIe PHY hardware inside the AR5416
  (which is the PCI variant) to save on power.  I have (currently) no way
  to test exactly how much power is saved, if any.

Tested on:

* AR5416 cardbus - although unfortunately pccard/cbb/cardbus currently
  detaches the NIC upon suspend, I don't think it's a proper test case.

* AR5418 PCIe attached to expresscard - since we're not doing PCIe APSM,
  it's also not likely a full/good test case.

In both instances I went through a handful of suspend/resume cycles and
ensured that the STA vap reassociated correctly.

TODO:

* Setup a laptop to simply sit in a suspend/resume loop, making sure that
  the NIC always correctly comes back;

* Start doing suspend/resume tests with actual traffic going on in the
  background, as I bet this process is all quite racy at the present;

* Test adhoc/hostap mode, just to be completely sure it's working correctly;

* See if I can jury rig an external power source to an AR5416 to test out
  whether ah_disablePCIE() works.

Obtained from:	Qualcomm Atheros
2012-05-25 17:53:57 +00:00
Adrian Chadd
5a8ffc7d5c * According to the reference code, AR_WA_D3_L1_DISBABLE is bit 14.
* Add some other WAR bits (very usefully described too) in preparation for
  porting over some suspend/resume fixes from ath9k/Atheros.

Obtained from:	Qualcomm Atheros
2012-05-25 16:45:56 +00:00
Rafal Jaworowski
9994219b7d More Cicada/Vitesse PHY ids.
Obtained from:	Semihalf
2012-05-25 15:05:17 +00:00
Adrian Chadd
ae2a0aa428 oops - ath_hal_disablepcie is actually destined for another purpose,
not to disable the PCIe PHY in prepration for reset.

Extend the enablepci method to have a "poweroff" flag, which if equal
to true means the hardware is about to go to sleep.
2012-05-25 05:01:27 +00:00
Bjoern A. Zeeb
e2c0161e2e MFp4 bz_ipv6_fast:
Add TSO6 and LRO/IPv6 support.
  Fix the module Makefile to at least properly inlcude opt_inet6.h
  and allow builds without INET or INET6.

  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems

Reviewed by:	gnn (as part of the whole)
MFC After:	3 days
2012-05-25 03:02:56 +00:00
Bjoern A. Zeeb
47cfa99a50 MFp4 bz_ipv6_fast:
Allow LRO to work on IPv6 as well.
  Fix the module Makefile to at least properly inlcude opt_inet6.h
  and allow builds without INET or INET6.

  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems

Reviewed by:	gnn (as part of the whole)
MFC After:	3 days
2012-05-25 03:00:34 +00:00