Commit Graph

21163 Commits

Author SHA1 Message Date
Navdeep Parhar
3dd6d7570f Always reset the XGMAC's XAUI PCS on a link up.
MFC after:	3 days
2010-08-15 20:45:16 +00:00
Navdeep Parhar
61cb6c9076 wakeup is required if the adapter lock is released anywhere during
init and not just for the may_sleep case.

Pointed out by:	Isilon
MFC after:	3 days
2010-08-15 20:34:51 +00:00
Adrian Chadd
f70c72aa0c Fix indenting/whitespace issues introduced by me. 2010-08-15 11:40:53 +00:00
Adrian Chadd
5674f4a799 The comment is misleading - that register setting seems to kick off the
initial chip NF cal.
2010-08-15 11:32:05 +00:00
Bernhard Schmidt
ad8e331bf2 Introduce IEEE80211_C_RATECTL, drivers which use the ratectl framework
should set this capability.

MFC after:	2 weeks
2010-08-14 20:12:10 +00:00
Adrian Chadd
627e7864f1 A local addition, not imported from ath9k.
AR_PHY_CALMODE is explicitly reset on interface reset for other chipsets;
this commit also sets it for the AR9160.
2010-08-14 15:48:18 +00:00
Adrian Chadd
6a0c1a60c0 * Merge in AR9160 initval updates from Linux-2.6.34.
* Grab the AR_PHY_CCA and AR_PHY_EXT_CCA initvals from Linux wireless-testing.

Obtained from: Linux-2.6.34
2010-08-14 15:46:18 +00:00
Adrian Chadd
49d2d79b7a Merge in a fix for the power/(gain?) calculation. Apply it to both
the 5416/9160 and 9285 code paths.

Obtained from:	OpenWRT r22123, 522-ath9k_pwrcal_fix.patch
2010-08-14 15:29:21 +00:00
Adrian Chadd
8f279cf6e7 Fix the calibration logic to correctly clamp the calculated coefficient.
Obtained from:	OpenWRT r22123, 521-ath9k_iqcal_fix.patch
2010-08-14 15:28:15 +00:00
Adrian Chadd
e8dabfbea9 Export ath stats via snmp, rather than requiring a debugging interface
and "athstats".
2010-08-14 14:18:02 +00:00
Adrian Chadd
7ec4e6b83b Add a global counter of missed beacons.
The existing missed beacon count is reset once a beacon isn't missed.
2010-08-14 14:01:12 +00:00
Pyun YongHyeon
5bec76e720 Make sure to disable RX MAC in alc_stop_mac(). Previously there
was a logic error which it always enabled RX MAC.
2010-08-13 19:39:33 +00:00
Adrian Chadd
d86cdfe4b0 * Fix indentation
* Restore comment erroneously deleted from the previous commit
2010-08-12 08:39:54 +00:00
Adrian Chadd
52f81b679a Loading the NF CCA values may take longer than expected to occur.
If it does, don't then try reprogramming the NF "cap" values (ie
what values are the "maximum" value the NF can be) - instead,
just leave the current CCA value as the NF cap.

This was inspired by some similar work from ath9k. It isn't
a 100% complete solution (as there may be some reason where a
high NF CCA/cap is written, causing the baseband to stop thinking it
is able to transmit, leading to stuck beacon and interface reset)
which I'll investigate and look at fixing in a later commit.

Obtained from:	Linux
2010-08-12 06:20:54 +00:00
Adrian Chadd
5215ce1038 Use ar5212IsNFCalInProgress() to check for NF calibration progress. 2010-08-12 06:14:26 +00:00
Adrian Chadd
245f553a78 Fix indentation. 2010-08-12 06:12:39 +00:00
Adrian Chadd
ccf98f5d9d Ensure that the correct rxchainmask is used when doing calibration in the
AR5416 and later chipsets.

ath_hal_calibrateN() calls the HAL calibrateN function with rxchainmask=0x1.
This is not necessarily the case for AR5416 and later chipsets.
2010-08-12 06:11:44 +00:00
Adrian Chadd
43ff2d6aec Internal NF calibration should not occur in parallel with any other
calibration. Ensure that the NF calibration completes before continuing
with the rest of the calibration setup process.
2010-08-12 06:08:36 +00:00
Adrian Chadd
85b035b335 Add a couple of functions to check NF calibration progress / completion. 2010-08-12 06:06:14 +00:00
Takanori Watanabe
97f24f666f Add tpm(4) driver for Trusted Platform Module.
You may want to look at http://bsssd.sourceforge.net/ .

Submitted by: Hans-Joerg Hoexer <Hans-Joerg_Hoexer@genua.de>
2010-08-12 00:16:18 +00:00
John Baldwin
9f6eb14c88 Do not use %z to print a time_t. Fixes build on architectures where time_t
and size_t are different types.
2010-08-11 16:56:38 +00:00
Neel Natu
5f7eb1ff54 Start using the 'init_static_kenv()' API provided by r198561 to initialize
CFE environment variables.
2010-08-11 02:13:50 +00:00
Gavin Atkinson
f5113df97d Now that the uplcom(4) driver can autodetect the chipset type, sync the
list of devices supported by uplcom(4) with the following sources:

NetBSD  src/sys/dev/usb/uplcom.c 1.70
OpenBSD src/sys/dev/usb/uplcom.c 1.52
Linux   drivers/usb/serial/pl2303.h from kernel 2.6.35
BeOS    usb_serial/driver.c 1.32

Give several devices better descriptions, and rename
PROLIFIC2 -> NETINDEX while here to match everybody else.

MFC after:	6 weeks (after r211111)
2010-08-10 19:13:11 +00:00
Adrian Chadd
8197f57e6a Don't delay updating the longcal timer - instead, update the longcal
flag immediately so it's only set once per longcal interval.

Without this, the current AR5416 code will continuously spam NF
calibrations during a periodic calibration if the longcal flag
is set. The longcal flag wouldn't be cleared until the calibration
method indicates that calibrations are "complete".

This drops the rate of NF calibration updates down from "once every
shortcal" (ie, every 100ms) during a periodic calibration, to only
once per "longcal" interval. Spamming NF calibrations every 100ms
caused some potentially horrific issues in noisy environments as
NF calibrations can take longer than 100ms and this spamming can
cause invalid NF calibration results to be read back - leading to
missed beacons, and thus leading to a stuck beacon situation.

Stuck beacons cause interface resets, which restart calibrations.
This means that the longcal calibration runs every 100ms (shortcal)
until all initial calibrations are completed. This spamming can then
cause the above issues which leads to stuck beacons, leading to
interface resets, etc, etc. Quite annoying.
2010-08-10 07:56:56 +00:00
Adrian Chadd
8b9cd503d2 Bring over ar5416 inivals from Linux-2.6.34.
Reviewed by:	rpaulo@
Obtained from:	Linux
2010-08-10 07:48:13 +00:00
Adrian Chadd
329e425acd Re-format the ar5416 inivals to be consistent with what
Linux ath9k uses.
2010-08-10 07:47:43 +00:00
Gavin Atkinson
bc65068d4a Attempt to autodetect the cype of chipset, rather than storing this
within the device table.  This code uses the same algorithm as used in the
Linux, NetBSD and DragonflyBSD driver.

While investigating this, it became apparent that the Linux driver always
initialises the device, and not just in the PL2303HX case.  Change
uplcom(4) to do the same.

This change allows us to synchronize our device ID list with Linux and
NetBSD, without requiring knowledge of the chipset in use.

Reviewed by:	hselasky
MFC after:	6 weeks
2010-08-09 17:42:05 +00:00
Pyun YongHyeon
2f70ccea9f Add support for Atheros AR8151/AR8152 PCIe gigabit/fast ethernet
controller. These controllers are known as L1D(AR8151) and
L2CB/B2(AR8152). This change adds supports for the following
controllers.
 o AR8151 v1.0(L1D) gigabit ethernet controller
 o AR8151 v2.0(L1D) gigabit ethernet controller
 o AR8152 v1.1(L2CB) fast ethernet controller
 o AR8152 v2.0(L2CB2) fast ethernet controller
These controllers have the same feature of AR8131/AR8132 and
support improved power saving control. The user visible change at
this moment is reduced jumbo frame size from 9KB to 6KB. Many
thanks to Atheros for continuing to support FreeBSD.

HW donated by:	Atheros Communications, Inc.
2010-08-09 17:28:08 +00:00
Gavin Atkinson
4bb3183d46 Add entries for some devices I have locally. 2010-08-09 17:27:27 +00:00
Pyun YongHyeon
af1f79ce84 Add F1 PHY found on Atheros AR8151 v2.0 PCIe gigabit ethernet
controller.
2010-08-09 17:22:14 +00:00
Dag-Erling Smørgrav
c201d4532c - Add full support for header / data digests.
- Increase target limit from 4 to 64; this limit will be removed entirely
  at a later time.
- Improve recovery from lost network connections.
- Fix some potential deadlocks and a serious memory leak.
- Fix incorrect use of MH_ALIGN (instead of M_ALIGN), which makes no
  practical difference, but triggers a KASSERT with INVARIANTS.
- Fix some warnings in iscontrol(8) and improve the man page somewhat.

Submitted by:	Daniel Braniss <danny@cs.huji.ac.il>
Sponsored by:	Dansk Scanning A/S, Data Robotics Inc.
2010-08-09 12:36:36 +00:00
Pyun YongHyeon
497ffa52ef It seems some old Sundace(now IC Plus Corp.) controllers do not
like memory mapped register access. Typical problem from the issue
was MII access returned unreliable values. I'm not sure this comes
from lack of register flushing in MII access after accessing
STE_PHYCTL register though.
To address the issue, read hints data that controls which type of
memory mapping should be used in driver. ste(4) still prefers
memory mapping to io mapping but honor hints entered by user except
for controllers that have problems with memory mapping.
The hint to use iomapping could be given by adding the following
line to /boot/device.hints file.

hint.ste.0.prefer_iomap="1"

PR:	kern/149285
MFC after:	5 days
2010-08-09 01:47:09 +00:00
Gavin Atkinson
fe0f636233 The PL2302X can support any baud rate <= 6Mbps, allow any rate to be set.
PR:		usb/128324
Submitted by:	Mike Durian <durian shadetreesoftware.com> (original patch)
MFC after:	2 weeks
2010-08-08 20:53:00 +00:00
Pyun YongHyeon
a4d3574ccf Cache PCIY_PMG and PCIY_EXPRESS capability pointer to softc and use
it instead of calling pci_find_extcap().
2010-08-08 00:43:41 +00:00
Pyun YongHyeon
d62fc5de93 Remove unnecessary assignment. 2010-08-08 00:23:36 +00:00
Pyun YongHyeon
47ae892c85 Always disable ASPM L0s and enable L1 before entering into WOL
suspend state.  Also disable master clock after PHY power down,
this is supposed to save more power. The master clock should be
enabled if WOL is active.
2010-08-08 00:12:31 +00:00
Pyun YongHyeon
a0bca95502 Do not touch CMB TX threshold register when CMB is not used.
Note, alc(4) does not use CMB at all due to silicon bug.
2010-08-07 23:41:46 +00:00
Pyun YongHyeon
1e77baed0d Controller does not seem to support more than 1024 bytes DMA burst.
Limit DMA burst size to be less than or equal to 1024 bytes.
2010-08-07 23:33:06 +00:00
Pyun YongHyeon
e7a28130c4 Marvell model number 0x06 is 88E1101 PHY. 2010-08-07 23:16:21 +00:00
Gavin Atkinson
ce617aca0a Sync the list of devices supported by uslcom(4) with NetBSD, Linux, OpenBSD
and BeOS.  The devices supported by uslcom(4) are now in sync with:

NetBSD  src/sys/dev/usb/uslsa.c 1.11
OpenBSD src/sys/dev/usb/uslcom.c 1.20
Linux   source/drivers/usb/serial/cp210x.c from kernel 2.6.35
BeOS    usb_serial/driver.c 1.32

Two vendor/product IDs from Linux have not been added to uslcom(4):
  SILABS SAEL - This device has special code in u3g to support it
  SILABS GSM2228 - I suspect this should also be covered by u3g(4).

MFC after:	1 week
2010-08-07 16:14:40 +00:00
Gavin Atkinson
01a8caf18e Sort this file a little better: the vendors are supposed to be sorted by
vendor ID in the vendor section, and by symbolic name in the product
section.  Products are sorted by product ID.  While here, get rid of a
duplicate Microsoft Mouse entry, revealed by sorting.

MFC after:	1 week
2010-08-07 16:08:37 +00:00
Joel Dahl
7f22a6d334 Fix typo in comment. 2010-08-07 08:31:32 +00:00
Jung-uk Kim
90f06c5eae Protect shared palette and state buffer with a mutex. Remove defunct
spltty() calls while I am here.
2010-08-07 05:46:04 +00:00
Jung-uk Kim
34622ff1ab When EC burst mode is activated and multiple bytes are accessed, do not
disable and enable repeatedly, just do it once per call.  It also reduces
code duplication.  Check all parameters early and fail immediately.
2010-08-06 23:35:33 +00:00
Jung-uk Kim
709fac0616 Merge ACPICA 20100806. 2010-08-06 23:11:19 +00:00
Jack F Vogel
3b9b3fc3bf Put the early setting of the MAC type back, its
removal resulted in broken code in MSIX setup.
2010-08-06 20:55:49 +00:00
Matt Jacob
c97bb67a70 Figure which is the IO and MEM bars- do not assume that they are in
a fixed order.

PR:		149220
Obtained from:	John Baldwin
MFC after:	1 month
2010-08-06 17:27:00 +00:00
Konstantin Belousov
6aeff67cd8 Disable sync cache for the Transcend Jetflash V90. It is more specific
quirk over the general one for transcend sticks.

Submitted by:	Mykola Dzham <i levsha me>
MFC after:	1 week
2010-08-06 13:45:16 +00:00
Konstantin Belousov
f53444bc4d Mark /dev/zero and /dev/null as eternal.
In collaboration with:	pho
MFC after:	1 month
2010-08-06 09:47:48 +00:00
Pyun YongHyeon
7ee9ed98c6 Reduce Tx interrupt moderation timer from 50ms to 1ms. The default
value resulted in poor performance for UDP packets. With this
change, UDP bulk transfer performance is more than 940Mbps.

While I'm here fix a wrong register definition.
2010-08-06 00:50:16 +00:00
John Baldwin
7d23a9b3d5 - Retire acpi_pcib_resume(). It is has just been an alias for
bus_generic_resume() since the pci_link(4) driver was added.
- Change the ACPI PCI-PCI bridge driver to inherit most of its methods
  from the generic PCI-PCI bridge driver.  In particular, this will now
  restore PCI config registers for ACPI PCI-PCI bridges.

Tested by:	Oleg Sharoyko  osharoiko of gmail
2010-08-05 16:10:12 +00:00
Gavin Atkinson
af9800150c Do not free sc if attach failed, as it was allocated by the bus
infrastructure, not us.  This appears to be a leftover from an older
version of the driver.

Submitted by:	avg
Tested by:	Anton Shterenlikht <mexas bristol.ac.uk>
MFC after:	1 week
X-MFC-Note:	To stable/8 and stable/7 only
2010-08-04 07:49:40 +00:00
Xin LI
28a54cacee Catch known CPUs before using IA32_TEMPERATURE_TARGET.
This way we would have an opportunity to hide the
Tj(target) value doesn't seem right stuff if we know
it's not working there.

Add temperature value for Core2 Duo Extreme Mobile that
I have access to.
2010-08-04 00:25:13 +00:00
Oliver Fromme
d191ee22b1 Add support for ATI Radeon HD 4250.
PR:		kern/149041
Submitted by:	olli
Reviewed by:	rnoland
Approved by:	des (mentor)
MFC after:	1 week
2010-08-03 16:30:56 +00:00
Xin LI
e5fdd9de2c Change copyright holder to author. We prefer using a real legal
entity for copyright holders.

Approved by:	sephe
MFC after:	3 days
2010-07-30 17:51:22 +00:00
Pyun YongHyeon
f39cf57f91 Consistently check header type after reading PCIR_HDRTYPE register.
While I'm here use defined macro instead of using magic numbers for
header type.

Reviewed by:	jhb
2010-07-29 20:42:38 +00:00
Xin LI
a3bc0a4e5c Improve cputemp(4) driver wrt newer Intel processors, especially
Xeon 5500/5600 series:

 - Utilize IA32_TEMPERATURE_TARGET, a.k.a. Tj(target) in place
   of Tj(max) when a sane value is available, as documented
   in Intel whitepaper "CPU Monitoring With DTS/PECI"; (By sane
   value we mean 70C - 100C for now);
 - Print the probe results when booting verbose;
 - Replace cpu_mask with cpu_stepping;
 - Use CPUID_* macros instead of rolling our own.

Approved by:	rpaulo
MFC after:	1 month
2010-07-29 19:08:22 +00:00
George V. Neville-Neil
ee6a02813b Make sure that we clear the correct bits when we turn off
a PMC.  It was possible that we could have turned a bit on but
never cleared it.

Extend the calls to rdmsr() to all necessary functions, not
just those which previously caused a panic.

Pointed out by: jhb@
MFC after:	1 week
2010-07-29 17:52:23 +00:00
John Baldwin
c280c7d482 Fix test for double-nul characters that terminate the string table at
the end of each SMBIOS/DMI structure.

Submitted by:	Dmitrij Tejblum @ yandex.ru
MFC after:	3 days
2010-07-29 13:46:37 +00:00
Neel Natu
762aad8142 Fix 'pciconf -a' by providing an implementation of PCIOCATTACHED.
Reviewed by:	imp
MFC after:	1 week
Pointed out by:	Heymian Wong (heymian at mit.alum.edu)
Sponsored by:	NetApp
2010-07-29 06:27:41 +00:00
Tijl Coosemans
317a3ce2c5 Add quirk for Apacer HT202 USB 2.0 Flash Drive.
PR:		usb/107243
Approved by:	kib (mentor)
MFC after:	1 week
2010-07-28 18:56:01 +00:00
Gavin Atkinson
61bb77d415 Provide descriptions for three vendors and four devices in usbdevs. Use
the official vendor listed for 0x076b, rather than Omnikey, as in the PR.

PR:		usb/123351
Submitted by:	Marcin Cieslak <saper SYSTEM.PL>
MFC after:	1 week
2010-07-28 17:38:43 +00:00
Gavin Atkinson
082dbb0d11 Add support for the Corega CG-USBRS232R to uplcom(4)
PR:		usb/129173
Submitted by:	SHIMAOKA Shunsuke <shimaoka.shunsuke gmail.com>
MFC after:	1 week
2010-07-28 16:29:10 +00:00
Matthew D Fleming
370808da5f Fix clang warning on empty statement.
Reviewed by:    rdivacky, zml
Approved by:    zml (mentor)
2010-07-28 16:24:11 +00:00
Matthew D Fleming
a767c78e4a Fix clang warning on empty statement.
Reviewed by:    rdivacky, zml
Approved by:    zml (mentor)
2010-07-28 16:24:06 +00:00
Gavin Atkinson
4c01dc3e12 Support the Pyramid KBS USB LCD under uftdi(4)
PR:		usb/129758
Submitted by:	joao lima <jlima visionware.pt>
MFC after:	1 week
2010-07-28 08:48:35 +00:00
Andrew Thompson
a6977f4ae4 Fix the entry for the Option ICON452 where an underscore was used instead of
whitespace.

Submitted by:	Lucius Windschuh
2010-07-27 22:55:24 +00:00
Gavin Atkinson
7dddb455e5 Prevent uhid(4) from attaching to the Liebert PowerSure Personal XT UPS.
PR:		usb/129251
Submitted by:	Andrew D Wiles <adw+gnats avatastic.co.uk>
MFC after:	1 week
2010-07-27 17:07:16 +00:00
Gavin Atkinson
627ab90b2a Add support for the Longcheer WM66 USB HSDPA Modem to u3g(4)
This patch is different to that provided in the PR, due to the changes in
this driver since 7.x.

PR:		usb/129945
Submitted by:	Antonio Hilario <avahilario gmail.com>
MFC after:	1 week
2010-07-27 12:29:45 +00:00
Gavin Atkinson
46cbe200b5 - Support two devices made by West Mountain Radio in uslcom(4) [1]
- Bring in several other devices from OpenBSD while here.  Use the
  official manufacturer name over the OpenBSD name in the case of
  GEMALTO.  Reorder list slightly to aid future syncing.

- Remove duplicate SILABS CP2102 define from usbdevs

PR:		usb/131912 [1]
Submitted by:	Jack Twilley <mathuin gmail.com> [1]
MFC after:	1 week
2010-07-27 07:57:35 +00:00
Jung-uk Kim
954022384f Fix an apparent typo.
Found by:	clang
Reviewed by:	davidch, yongari
2010-07-26 23:24:42 +00:00
Gavin Atkinson
c3b40fb7bf Prevent uhid(4) from attaching to the Gembird Silver Shield remote power
plug.  Note that the Vendor ID 0x04b4 is officially assigned to Cypress,
so use that instead of adding a second vendor with an identical ID, in the
same way other similar cases are treated in usb/usbdevs.

PR:		usb/132785
Submitted by:	Dirk-Willem van Gulik <dirkx webweaving.org>
MFC after:	1 week
2010-07-26 21:22:57 +00:00
Gavin Atkinson
7ab53cc48b Prevent ukbd(4) and uhid(4) from attaching when a WiSPY DBx Spectrum
Analyzer is attached.

PR:		usb/134631
Submitted by:	Jesse Kempf <jkempf davisvision.com>
MFC after:	1 week
2010-07-26 20:44:29 +00:00
John Baldwin
b739a509f2 - Change the warning about PCI-e links narrower than x8 to only apply to
10G cards.  1G cards are x4 only.
- Use constants from pcireg.h for reading the current link width.
- Use pci_set_max_read_req() rather than implementing it by hand.

Reviewed by:	np
MFC after:	1 week
2010-07-26 17:31:15 +00:00
Jaakko Heinonen
b42f40b8eb - Remove some extra white space.
- Wrap g_md_dumpconf() prototype to 80 columns.
2010-07-26 10:37:14 +00:00
Rui Paulo
daef39e7ae Remove the acpi_aiboost driver. It has been replaced by aibs(4). 2010-07-25 17:55:57 +00:00
Alexander Motin
8edcf69406 Export PCI IDs of ATA/SATA controllers through CAM and ata(4) layers to
GEOM. This information needed for proper soft-RAID's on-disk metadata
reading and writing.
2010-07-25 15:43:52 +00:00
Gavin Atkinson
6d07817641 Give a name to the HTC Wizard Smartphone
PR:		usb/135575
Submitted by:	lioux
2010-07-25 15:14:42 +00:00
Andriy Gapon
7f5b7f2323 ichwd: correct range check for timeout value
This is similar to a fix in r189305 but for earlier ICH versions (<= 5).

Reported by:	someone via attilio
Discussed with:	des, attilio
MFC after:	1 week
2010-07-24 19:40:16 +00:00
George V. Neville-Neil
6de27dc09f style(9) fix
MFC after:	1 week
2010-07-24 18:53:46 +00:00
George V. Neville-Neil
dc1ccafedd Fix a bug in the statistics code for tracking the head and
tail pointers of the tx and rx queues.   We needed a SYSCTL_PROC
to correctly get the values at run time.

Submitted by:	Andrew Boyer aboyer at averesystems.com
MFC after:	1 week
2010-07-23 17:53:39 +00:00
Weongyo Jeong
0f3801fa37 Fixes a mistake to calculate CALC_COEFF2() value that tmp[3] is
used even if it's unreachable.

PR:		kern/144505
Submitted by:	Henning Petersen <henning.petersen at t-online dot de>
MFC after:	1 week
2010-07-22 20:08:02 +00:00
Jaakko Heinonen
f4e7c5a894 Convert md(4) to use alloc_unr(9) and alloc_unr_specific(9) for unit
number allocation. The old approach had some problems such as it allowed
an overflow to occur in the unit number calculation.

PR:		kern/122288
2010-07-22 10:24:28 +00:00
Xin LI
d74001ad8d Apply vendor version 1.20.00.17.
This version adds support for ARC1880; additionally this version fixed
an issue where all devices on a SAS port gets offlined when any device
failed on the port [1].

Many thanks to Areca for continuing to support FreeBSD.

PR:		kern/148502 [1]
Submitted by:	Ching-Lung Huang <ching2048 areca com tw>
Obtained from:	Areca
Tested by:	Rich Ercolani <rercola acm jhu edu> [1]
MFC after:	2 weeks
2010-07-21 18:50:24 +00:00
Attilio Rao
651aa2d896 KTR_CTx are long time aliased by existing classes so they can't serve
their purpose anymore. Axe them out.

Sponsored by:	Sandvine Incorporated
Discussed with:	jhb, emaste
Possible MFC:	TBD
2010-07-21 10:05:07 +00:00
Alexander Motin
599cf0f197 Fix several un-/signedness bugs of r210290 and r210293. Add one more check. 2010-07-20 15:48:29 +00:00
Alexander Motin
51636352b6 Extend timer driver API to report also minimal and maximal supported period
lengths. Make MI wrapper code to validate periods in request. Make kernel
clock management code to honor these hardware limitations while choosing hz,
stathz and profhz values.
2010-07-20 10:58:56 +00:00
Andrew Thompson
21a9d6e706 - Support for Globetrotter iCON 452.
- Fixed the interface probe routine to only attach to USB interfaces the driver
  actually supports.  This allows other drivers to attach to things like
  MicroSD slots etc.
- Fixed network interface enumeration to be globally sequential instead of
  relying on the USB interface numbers.  This make sure the first network
  interface always is at uhso0 and the second at usho1 and so on.
- Added a radio kill switch; exposed through sysctl.
- Updated the manual page to be verbose about the number of serial ports and
  include iCON 452 in the set of tested hardware.

Submitted by:	Fredrik Lindberg
2010-07-20 03:10:22 +00:00
Pyun YongHyeon
ad09ad06bc Specify BCE_RX_BUF_ALIGN alignment for RX buffers. All bce(4)
controllers require RX buffers aligned on BCE_RX_BUF_ALIGN bytes.

Reviewed by:	davidch
2010-07-19 23:48:03 +00:00
Pyun YongHyeon
3016d3fe4e Specify BUS_DMA_ZERO flag to bus_dmamem_alloc(9) and remove bzero()
calls. Also add BUS_DMA_COHERENT flag to bus_dmamem_alloc(9) to
take advantage of efficient synchronization for architectures that
support that feature.

Reviewed by:	davidch
2010-07-19 23:41:45 +00:00
Pyun YongHyeon
6351e52fcf Use bus_get_dma_tag() to get parent tag. Also use
BUS_SPACE_MAXSIZE_32BIT to specify sum of all segment lengths.
Previously it used MAXBSIZE which was wrong.

Reviewed by:	davidch
2010-07-19 23:35:43 +00:00
Pyun YongHyeon
b18d9d4b15 Add KASSERT to check number of returned DMA segments.
Reviewed by:	davidch
2010-07-19 23:25:19 +00:00
Adrian Chadd
62c3a412df Fix naming to be consistent. 2010-07-19 21:50:43 +00:00
Adrian Chadd
53436ace02 Extend the mx25l erase function to support different erase commands. 2010-07-19 21:46:40 +00:00
Pyun YongHyeon
c87831d8f4 Do not report current link state if interface is not UP.
Reviewed by:	davidch
2010-07-19 21:41:54 +00:00
Adrian Chadd
d2cf1fd5e4 Extend the mx25l flash device support to include a set of per-device
flags.

Some of these parts will support 4K/32K block erases rather than
a sector erase. This includes (at least) the MX25L128.
2010-07-19 21:38:15 +00:00
Pyun YongHyeon
f8bfabe733 Correctly check the result of media selection. Previously it always
returned success.

Reviewed by:	davidch
2010-07-19 21:38:07 +00:00
Pyun YongHyeon
a3e063e20d Don't change current media in bce_stop(). There is no need to do
this here.

Reviewed by:	davidch
2010-07-19 21:32:47 +00:00
Pyun YongHyeon
68de78a5fa Have bce_init_ctx() return error code and make caller check the
return code. If context was not setup correctly give up
initialization. While I'm here move variable declarations to the
beginning of the function.

Reviewed by:	davidch
2010-07-19 21:25:05 +00:00
Pyun YongHyeon
5c4ac8ba07 When we didn't find a matching flash device, do not touch flash
config data. While I'm here, use return code of bce_init_nvram()
to set error instead of directly setting ENODEV.

Reviewed by:	davidch
2010-07-19 21:13:07 +00:00
Jung-uk Kim
25a14f561c Improve style slightly. 2010-07-19 20:31:04 +00:00
Jung-uk Kim
490770af47 Fix two long-standing line wrapping bugs in VGA renderer for pixel mode.
Font size may be smaller than 16 and logical scan line may be larger than
the displayed scan line.

MFC after:	3 days
2010-07-19 18:56:18 +00:00
Rafal Jaworowski
4f124b977c Eliminate FDT_IMMR_VA define.
This removes platform dependencies from <machine>/fdt.h for the benfit of
portability.
2010-07-19 18:47:18 +00:00
Rafal Jaworowski
5710b7a9da Move MRVL FDT fixups and PIC decode routine to a platform specific area.
This allows for better encapsulation (and eliminates generic fdt_arm.c, at
least for now).
2010-07-19 18:41:50 +00:00
Adrian Chadd
dddd00f6a4 Include 4k/32k erase commands.
These were sourced from the MX25L128 datasheet and match up
with what is used in Linux mtd/devices/m25p80.c .

Add a FreeBSD keyword whilst I'm here.
2010-07-19 15:05:35 +00:00
Alexander Motin
e064bdc08a Make legacy ATA emulation detection more strict. This should fix false
positive legacy detection and attach failure/panic for Marvell 88SX6141
controller and potentially some others.

PR:		kern/145064
2010-07-16 17:27:43 +00:00
Alexander Motin
6332c92180 Improve interrupt setup errors handling. 2010-07-16 10:05:00 +00:00
Jung-uk Kim
69496408a5 Simplify AcpiOsReadPort() and AcpiOsWritePort() with iodev_read_*() and
iodev_write_*().  This removes unnecessary uses of temporary macros as well.
There is no functional change after this (verified with md5(1) on amd64).
2010-07-16 04:27:38 +00:00
Adrian Chadd
e87f728e23 Fix KASSERT() messages to reflect reality. 2010-07-16 04:26:37 +00:00
Jung-uk Kim
aa353b1b6b Use pmap_mapdev()/pmap_unmapdev() to map device memory instead of using
AcpiOsMapMemory()/AcpiOsUnmapMemory() (-> pmap_mapbios()/pmap_unmapbios())
for AcpiOsReadMemory() and AcpiOsWriteMemory().  Although they do not sound
too obvious, these functions are exclusively used to access memory mapped
IO in ACPICA.
2010-07-16 03:59:50 +00:00
Pyun YongHyeon
caf088fc1f Use Miscellaneous Configuration Register bit definition instead of
magic number.
2010-07-15 23:34:58 +00:00
Jung-uk Kim
337744d9a6 If there is any pending sleep request, disallow entering S5 state.
Otherwise, bad things may happen. ;-)
2010-07-15 23:24:06 +00:00
Jung-uk Kim
6e7661023a - AcpiOsReadPciConfiguration() needs similar fixes as r209965 and r210129.
According to ACPICA User Guide and Programmer Reference, the read data must
be zero extended to fill the 64-bit return value even if the bit width of
the location is less than 64.
- Return error when 64-bit access is requested as we do not support 64-bit
PCI register access (yet).  XXX We may have to split it up into two 32-bit
accesses if it is really required.
2010-07-15 19:52:54 +00:00
Jung-uk Kim
89339b38d8 - AcpiOsReadMemory() needs similar fixes as r209965. [1]
According to ACPICA User Guide and Programmer Reference, the read data must
be zero extended to fill the 32-bit return value even if the bit width of
the port is less than 32.
- Remove 64-bit read/write from AcpiOsReadMemory() and AcpiOsWriteMemory().
These functions do not support 64-bit access (yet).  Clean up style nits
and unnecessary bit masking while I am here.

Reported by:	Liu, Jinsong (jinsong dot liu at intel dot com) via
		Lin Ming (ming dot m dot lin at intel dot com) [1]
2010-07-15 17:11:49 +00:00
Bernhard Schmidt
ef403f3689 Handle RUN->ASSOC->RUN transition correctly, as in not trigger a
firmware error. Convert if statements to a switch statement while
I'm here.

Tested by:	Benjamin Kaduk <kaduk at mit.edu>
MFC after:	2 weeks
2010-07-15 11:52:20 +00:00
Bernhard Schmidt
7832b1f674 Add support for firmware images in "type-length-value" format.
Obtained from:	OpenBSD
MFC after:	2 weeks
2010-07-15 10:37:49 +00:00
Bernhard Schmidt
76e46e73c3 Detect active chains differently to work around a firmware bug which
would mark non-existing chains as active.

Obtained from:	OpenBSD
MFC after:	1 week
2010-07-15 09:34:00 +00:00
Bernhard Schmidt
b1429c8528 - Add new IDs for 6000 series devices.
- The 6000 series WiMAX devices need a separate firmware.
- The b-gen devices are not hooked because the hardware revision type
  is not know.

Obtained from:	OpenBSD
MFC after:	1 week
2010-07-15 09:30:54 +00:00
Bernhard Schmidt
f901a391d4 Fix some small whitespace nits.
MFC after:	3 days
2010-07-15 08:05:20 +00:00
Bernhard Schmidt
07baa68089 Remove duplicate vendor:device entry.
MFC after:	3 days
2010-07-15 07:45:37 +00:00
Pyun YongHyeon
a5ad2f1541 Remove enabling Data FIFO protection with indirect memory access.
r165114 added that code and that change ignored the same logic
committed in r135772. In addition, data FIFO protection should be
selectively enabled instead of applying to all PCIe devices.
While I'm here add BCM5785 to devices that do not require this
fix.
2010-07-14 21:47:49 +00:00
John Baldwin
020e9fc33b Rework the SMBIOS table walker to make it operate like other table walkers
and remove a buffer overflow:
- Remove the array of per-type dispatch functions.  Instead, pass each
  structure to a single callback.  The callback should check the type of
  each table entry to take appropriate action.  This matches the behavior
  of other table walkers such as for the MP Table and MADT.
- Don't attempt to save an array of string pointers for each structure
  entry.  Instead, just skip the strings.  If this code is reused to
  provide a generic SMBIOS table walker in the future we could provide
  a method that looks up a specific string N for a given structure record
  instead of pre-populating an array of pointers.  This fixes a buffer
  overflow for structure entries with more than 20 strings.

PR:		kern/148546
Reported by:	Spencer Minear @ McAfee
MFC after:	3 days
2010-07-14 18:06:21 +00:00
Justin T. Gibbs
b744190698 Correct logic bug in aicasm's undefined register bit access detection code.
The code in question verifies that all register write operations only change
bits that are defined (in the register definition file) for that effected
register.  The bug effectively disabled this checking.

o Fix the check by testing the opcode against all supported read ("and" based)
  operands.

o Add missing bit definitions to the aic7xxx and aic79xx register definition
  files so that the warning (treated as a fatal error) does not spuriously
  fire.

Reported by:	Pawel Worach <pawel.worach@gmail.com>
MFC after:	1 week
2010-07-14 14:31:18 +00:00
Remko Lodder
d5c7b904ba Add a 4 and 7 port USB hub from NEC.
PR:		148189
MFC after:	1 week
2010-07-13 20:09:14 +00:00
Jung-uk Kim
708358cdb6 Initialize a variable before its use. 2010-07-13 19:58:06 +00:00
Jung-uk Kim
917b850dce Preallocate buffers for palette and state. Do not save DAC registers as
we reset DAC mode and restore palette data while we are resuming always.
2010-07-13 19:48:20 +00:00
Pyun YongHyeon
736b931958 Prefer PCIR_BAR macro over BGE_PCI_BAR0. 2010-07-13 19:45:40 +00:00
Pyun YongHyeon
b65256d7bd Fix error message for jumbo buffer allocation failure. 2010-07-13 19:42:55 +00:00
Pyun YongHyeon
333704a37f style. 2010-07-13 19:39:51 +00:00
George V. Neville-Neil
f4a9c30419 Fix a panic brought about by writing an MSR without a proper mask.
All of the necessary wrmsr calls are now preceded by a rdmsr
and we leave the reserved bits alone.
Document the bits in the relevant registers for future reference.

Tested by:	mdf
MFC after:	1 week
2010-07-13 19:37:45 +00:00
Pyun YongHyeon
797ab05ef6 Make bge_stop_fw() static.
While I'm here use ANSI function definitions.
2010-07-13 19:33:46 +00:00
Nathan Whitehorn
45b570f5ef Fix build on architectures where PAGE_SIZE is a long (sparc64, powerpc). 2010-07-13 19:27:20 +00:00
Jung-uk Kim
36a483bbcd Make SMP code path conditional at run-time. 2010-07-13 16:35:41 +00:00
Alexander Motin
8a6870808d Rise knowledge about curthread->td_intr_frame by one step. Make timer
callback argument really opaque. Not repeat interrupt handler's problem
in case somebody will ever need to have both argument and frame.
2010-07-13 12:46:06 +00:00
Alexander Motin
b6ef82a03b Disable multi-sector PIO transfers if ATA_SET_MULTI command failed.
Submitted by:	Mikolaj Golub on fs@
2010-07-13 06:42:47 +00:00
Takanori Watanabe
1b0f43beb1 Fix comment.
Pointed out by: hrs
2010-07-13 03:56:29 +00:00
Takanori Watanabe
55fdde371a One more Prolific serial device ID.
Submitted by:	Kouichi Hirabayashi on FreeBSD-users-jp
MFC after: 1 week.
2010-07-13 03:49:30 +00:00
Jung-uk Kim
31bc79db46 Fix white spaces. 2010-07-13 02:48:42 +00:00
Jung-uk Kim
502e578cde According to ACPICA User Guide and Programmer Reference, the read data must
be zero extended to fill the 32-bit return value even if the bit width of
the port is less than 32.
2010-07-13 02:45:44 +00:00
Marius Strobl
fd435d5c06 Correct inverted parent DMA tag parameters.
Reviewed by:	ken
MFC after:	3 days
2010-07-12 23:01:21 +00:00
Marius Strobl
cac33e16cf - Make the maxsize parameter of the data buffer DMA tag match maxio, which
was missed in r209599.
  Reported and tested by: Michael Moll
- Declare mpt_dma_buf_alloc() static just like mpt_dma_buf_free(), both are
  used in mpt.c only.

Reviewed by:	ken
MFC after:	r209599
2010-07-12 22:57:57 +00:00
Jack F Vogel
9886a800fc Fix for a panic when TX checksum offload is done and
a packet has only a header in the first mbuf, the
checksum code will dereference a pointer into the
non-existing IP header. Do a check for the size and
pullup if needed. Thanks to Michael Tuexen for this
fix.

MFC: asap - should be in 8.1 IMHO
2010-07-12 21:47:30 +00:00
Alexander Motin
cd646aba81 Revert and remake r209883:
Do not grab lock while setting up interrupt, as it causes LOR with
allocation code. Instead make interrupt handler check that CAM bus
initialization completed before touching it.

While there, slightly improve attach errors handling.

Reported by:	kib
2010-07-12 12:16:11 +00:00
Andrew Thompson
6bce5ae1c5 Use more compact deviceid table.
Submitted by:	Akinori Furukoshi
2010-07-11 23:54:44 +00:00
Andrew Thompson
75c7615952 Update for style(9).
Submitted by:	Akinori Furukoshi (author)
2010-07-11 23:52:12 +00:00
Rafal Jaworowski
d1d3233ebd Convert Freescale PowerPC platforms to FDT convention.
The following systems are affected:

  - MPC8555CDS
  - MPC8572DS

This overhaul covers the following major changes:

  - All integrated peripherals drivers for Freescale MPC85XX SoC, which are
    currently in the FreeBSD source tree are reworked and adjusted so they
    derive config data out of the device tree blob (instead of hard coded /
    tabelarized values).

  - This includes: LBC, PCI / PCI-Express, I2C, DS1553, OpenPIC, TSEC, SEC,
    QUICC, UART, CFI.

  - Thanks to the common FDT infrastrucutre (fdtbus, simplebus) we retire
    ocpbus(4) driver, which was based on hard-coded config data.

Note that world for these platforms has to be built WITH_FDT.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2010-07-11 21:08:29 +00:00
Rafal Jaworowski
c5a514a756 Provide more defines for PCI-Express device ctrl. 2010-07-11 20:55:39 +00:00
Rafal Jaworowski
da6bc8989d Introduce PowerPC-specific helper routines for FDT.
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2010-07-11 20:49:36 +00:00
Rafal Jaworowski
caaa3c62d4 Save fdtbus trigger / polarity data at their correct index. 2010-07-11 20:33:39 +00:00
Rafal Jaworowski
a22cd1e668 Let simplebus(4) diagnostics be a bit more descriptive. 2010-07-11 20:30:59 +00:00
Weongyo Jeong
e7c6c10e16 Fixes a page fault in bwi_pci_probe() because the array isn't terminated
with NULL.

PR:		kern/148473
Submitted by:	Grzegorz Dabrowski <grzegorz.dabrowski at gmail dot com>
MFC after:	1 week
2010-07-10 22:37:23 +00:00
Weongyo Jeong
6dcc706bc5 Fixes a bug for LP PHY that some frames have 2 padding bytes at the
start so we should adjust the mbuf if the driver is running in PIO mode.
Now it should work well with WPA authentication and association for LP
PHY devices.

Tested by:	Warren Block <wblock at wonkity.com>
MFC after:	1 month
2010-07-10 21:39:03 +00:00
Alexander Motin
aecfe194a9 If ata_sata_phy_reset() failed and ata_generic_reset() is not called, mark
channel as having no devices connected. This improves hot-unplug operation
on legacy-emulating SATA controllers.
2010-07-10 15:36:27 +00:00
Alexander Motin
663c22a27d On attach, grab channel lock before setting up interrupt. This fixes crash
in ATA_CAM mode if phy connect event arrive before CAM bus initialization
completed.
2010-07-10 15:27:27 +00:00
Alexander Motin
9a9bce34f1 Make hw.ata.ata_dma_check_80pin tunable affect not only device side, but
also controller side cable checks. Make respective sysctl writable.

PR:		kern/143462
2010-07-10 13:46:14 +00:00
Pyun YongHyeon
2610dbf59b Some revision of Yukon controller generates corrupted frame when TX
checksum offloading is enabled.  The frame has a valid checksum
value so payload might be modified during TX checksum calculation.
Disable TX checksum offloading but give users chance to enable it
when they know their controller works without problems with TX
checksum offloading.

Reported by:	Andrzej Tobola <ato <> iem dot pw dot edu dot pl>
2010-07-09 21:21:08 +00:00
Xin LI
c8ed14e2d8 Don't use pack() for structures that is used purely for software state.
Otherwise the resulting, unaligned mutex structure would trigger panic.

Submitted by:		Tom Cough <tom.couch lsi.com>
Reported/Tested by:	jhb
MFC after:		3 days
2010-07-09 17:38:15 +00:00
Jack F Vogel
d6ff3d4d13 Fix of a VLAN problem by jhb, the checksum capability
got lost along the way.

MFC: asap
2010-07-09 17:11:29 +00:00
Navdeep Parhar
bd1a9fbad6 Improve cxgb(4)'s behaviour when faced with temporarily "bouncy" links:
- Run the adapter's tick at 1Hz and remove link state checks from it.
  Instead, have each port check its link state.  Delay the check so that
  it takes place slightly after the driver is notified of a change in
  link state.  This is a cheap way to debounce these notifications if
  many are received in rapid succession.  POLL_LINK_1ST_TIME flag can
  also be eliminated as a side effect of these changes.
- Do not reset the PHY when link goes down.
- Clear port's link_fault flag if the PHY indicates link is down.
- get_link_status_r should leave speed and duplex alone when link is down.

MFC after:	1 month
2010-07-09 00:38:00 +00:00
Navdeep Parhar
2c32b50248 Eliminate ext_intr_task. The "slow" interrupt handler is already
running on the adapter's task queue.  Just do what the task does
instead of enqueueing it.

MFC after:	3 days
2010-07-09 00:36:35 +00:00
Navdeep Parhar
29c54b85f9 Fix bufsize calculation so that cxgbtool can display information for the
last I/O queue too.

MFC after:	3 days
2010-07-09 00:35:09 +00:00
Pyun YongHyeon
78b1140644 Remove enabling RX checksum offloading in RX filter setup. RX
checksum is enabled in sge_init_locked().
While I'm here do not set RX checksum bits in RX descriptor
initialization. It is controller's job to set these bits.

Tested by:	xclin <xclin <> cs dot nctu dot edu dot tw >
2010-07-08 18:22:49 +00:00
Nathan Whitehorn
a26209a43a Missed a file in r209803: this header contains a definition of
OFW_STD_32BIT.

Pointy hat to:	me
2010-07-08 18:15:06 +00:00
Nathan Whitehorn
054e5dcbe4 Change the argument type to OF_call_method to take an array of cell_t
instead of unsigned longs to prepare for platforms where they are not
the same.
2010-07-08 14:29:23 +00:00
Nathan Whitehorn
517524ec87 Fix iicbus_get_addr() on 64-bit big-endian systems. The bus accessor
passes a uintptr_t, not a uint32_t.
2010-07-08 14:19:52 +00:00
Adrian Chadd
d273f00076 Extend the ath debugging a little to log the interface name.
Some devices have >1 atheros card and the current debug prints
make it impossible to tell which interface is being unhappy.
2010-07-08 14:08:03 +00:00
Konstantin Belousov
83d5d2963e Do not mention VM_ALLOC_RETRY in comment, and normalize the terminology
(blocking -> sleeping).

Reviewed by:	alc
MFC after:	3 days
2010-07-08 08:39:02 +00:00
Jung-uk Kim
3664686221 Fix mis-merges in the previous commit. 2010-07-06 21:41:08 +00:00
Jung-uk Kim
a88e22b7ad Merge ACPICA 20100702. 2010-07-06 20:57:28 +00:00
Konstantin Belousov
d12fc952b7 Calculate nshift only once.
Also noted by:	avg
MFC after:	1 week
2010-07-06 18:22:57 +00:00
Pyun YongHyeon
864104fe59 Zero entire status block and add missing bus_dmamap_sync(9). 2010-07-06 18:17:31 +00:00
Jung-uk Kim
061b7e5463 Plug a possible memory leak.
Submitted by:	Yamagi Burmeister (lists at yamagi dot org)
2010-07-06 18:08:55 +00:00
Jung-uk Kim
c3cbd4125e Fix a possible null pointer dereference. A patch for -STABLE was
Submitted by:	Yamagi Burmeister (lists at yamagi dot org)
2010-07-06 18:05:05 +00:00
Pyun YongHyeon
55a24a0597 It seems read DMA mode register requires both IPv4 TSO and IPv6 TSO
configuration to get IPv4 TSO work on BCM57780. While I'm here
apply the same fix to BCM5785 which shares similar hardware feature
of BCM57780. This change makes TSO work on BCM57780.

Tested by:	Tong Liu <nemoliu <> gmail dot com>
2010-07-06 02:07:59 +00:00
Warner Losh
2a08b0b7a1 Add a safety-belt. If the identified disk has 0 blocks, don't attach
it.  This can happen in some cases when plugging in SD/SmartCard PC
Cards with empty slots.  It is better to detect this bogosity, and
refuse to attach rather than panic with a division by zero (in one of
many places) down stream.
2010-07-04 07:42:52 +00:00
Warner Losh
907659f0dc Minor formatting nits. 2010-07-04 05:58:17 +00:00
Alexander Motin
7ce1f3e580 Add ata(4) ability to limit initial ATA mode for devices via device hints.
After boot this mode can be changed with atacontrol/camcontrol as usual.
It works for both legacy and ATA_CAM wrapper mode.

PR:		kern/123980
2010-07-03 14:14:42 +00:00
Kevin Lo
a02f351b57 Fix build 2010-07-01 05:03:24 +00:00
Jack F Vogel
b827058579 OK, I was a bit sleep this morning and checked in
the core changes but left out the shared code, lol.
Well, and a couple fixes to the core... hopefully
this will all be complete now.

Happy happy joy joy :)
2010-06-30 21:05:51 +00:00
Jack F Vogel
911fddbcb5 SR-IOV support added to igb
What this provides is support for the 'virtual function'
interface that a FreeBSD VM may be assigned from a host
like KVM on Linux, or newer versions of Xen with such
support.

When the guest is set up with the capability, a special
limited function 82576 PCI device is present in its virtual
PCI space, so with this driver installed in the guest that
device will be detected and function nearly like the bare
metal, as it were.

The interface is only allowed a single queue in this configuration
however initial performance tests have looked very good.

Enjoy!!
2010-06-30 17:26:47 +00:00
Jack F Vogel
17d2646b7c Left out header change in last delta - new member
in adapter so that advertise changes can be done
to one port without the other changing.
2010-06-30 16:28:28 +00:00
Gleb Smirnoff
3da2cea421 Fix build. 2010-06-30 11:17:55 +00:00
Jack F Vogel
1fa9ef23cc BAH, I apologize, the wrong version of the code got
fat fingered in place, this is the correct version
that actually works... <sheepish grin>

MFC: in a week
2010-06-30 01:10:08 +00:00
Jack F Vogel
5f46ec799a Add a new sysctl option, this will allow one to
limit the advertised speed of an SFP+ to 1G, effectively
"forcing" link at that lower speed. It is off by default
and is enabled by sysctl dev.ix.0.force_gig=1, 0 will
set it back to the norm.
2010-06-30 01:01:06 +00:00
Kenneth D. Merry
4201341ff7 Change the mpt driver to allow larger I/O sizes.
The mpt driver previously didn't report a 'maxio' size to CAM, and so the
da(4) driver limited I/O sizes to DFLTPHYS (64K) by default.  The number
of scatter gather segments allowed, as reported to busdma, was
(128K / PAGE_SIZE) + 1, or 33 on architectures with 4K pages.

Change things around so that we wait until we've determined how many
segments the adapter can support before creating the busdma tag used for
buffers, so we can potentially support more S/G segments and therefore
larger I/O sizes.

Also, fix some things that were broken about the module unload path.  It
still gets hung up inside CAM, though.

mpt.c:		Move some busdma initialization calls in here, and call
		them just after we've gotten the IOCFacts, and know how
		many S/G segments this adapter can support.

mpt.h:		Get rid of MPT_MAXPHYS, it is no longer used.

		Add max_cam_seg_cnt, which is used to report our maximum
		I/O size up to CAM.

mpt_cam.c:	Use max_cam_seg_cnt to report our maximum I/O size to CAM.

		Fix the locking in mpt_cam_detach().

mpt_pci.c:	Pull some busdma initialization and teardown out and put
		it in mpt.c.  We now delay it until we know many scatter
		gather segments the adapter can support, and therefore
		how to setup our busdma tags.

mpt_raid.c:	Make sure we wake up the right wait channel to get the
		raid thread to wake up when we're trying to shut it down.

Reviewed by:	gibbs, mjacob
MFC after:	2 weeks
2010-06-29 22:07:53 +00:00
Weongyo Jeong
03286b3576 Initializes the ratectl for a node when the state is changed to RUN.
This prevents a kernel fault by dividing with zero because the initial
rate was 0 and didn't be initialized.

Tested by:	Warren Block <wblock at wonkity.com>
MFC after:	3 days
2010-06-29 21:56:42 +00:00
Weongyo Jeong
68cd814a8a Fixes NULL pointer reference that it's occurred when the state is
changed to RUN because ic->ic_newassoc isn't set anywhere now.  In the
previous bwi_newassoc() is used to initialize AMRR rate routines.

Tested by:	Warren Block <wblock at wonkity.com>
MFC after:	3 days
2010-06-29 21:52:40 +00:00
Rui Paulo
cb3fbd1b92 Fix typo introduced in previous revision. 2010-06-27 10:17:11 +00:00
Rui Paulo
fcfe3ad480 Fix the AR_SREV_MERLIN_20_OR_LATER() check.
Submitted by:	Alex Kozlov <spam at rm-rf.kiev.ua>
MFC after:	2 weeks
2010-06-26 20:59:10 +00:00
Rui Paulo
bbe4a97d41 Import the acpi_aibs(4) driver written by Constantine A. Murenin.
It has more features than acpi_aiboost(4) and it will eventually replace
acpi_aiboost(4).

Submitted by:	Constantine A. Murenin <cnst at FreeBSD.org>
Reviewed by:	freebsd-acpi, imp
MFC after:	1 month
2010-06-25 15:32:46 +00:00
George V. Neville-Neil
5ea4d522bb Make sure that all the exposed counters and variables are actually
being updated.

Pointed out by:	jfv
2010-06-24 21:17:58 +00:00
Jung-uk Kim
28ef508f86 Use M_WAITOK for VESA BIOS initialization consistently. 2010-06-23 23:34:56 +00:00
Jung-uk Kim
362487c0ba Let x86bios_alloc() pass contigmalloc(9) flags. Use it to set M_WAITOK
from VESA BIOS initialization.  All other malloc(9) uses in the function is
blocking any way.
2010-06-23 17:20:51 +00:00
Konstantin Belousov
95882b9865 Remove unused i586 optimized bcopy/bzero/etc implementations that utilize
FPU registers for copying. Remove the switch table and jumps from
bcopy/bzero/... to the actual implementation.
As a side-effect, i486-optimized bzero is removed.

Reviewed by:	bde
Tested by:	pho (previous version)
2010-06-23 10:40:28 +00:00
Andrew Thompson
e3e05e50d9 - fix for USB audio devices which use the 7-byte endpoint descriptor instead of
the 9-byte one.
- remove sync-endpoint code, which is currently unused.

Reported by:	Antun Matanovi
Submitted by:	Hans Petter Selasky
2010-06-22 21:16:18 +00:00
Andrew Thompson
3851442c61 Reduce MIDI input buffer size to one USB packet, hence some USB devices don't
properly short terminate their transfers. This fixes a problem where input
appears several seconds late.

Reported by:	Alexander Yerenkow
Submitted by:	Hans Petter Selasky
2010-06-22 21:13:36 +00:00
Andrew Thompson
33ba3721c9 Add new device id.
PR:		usb/147190
2010-06-22 21:08:45 +00:00
Andrew Thompson
0f66567792 Add a mass storage quirk.
PR:		usb/147196
2010-06-22 21:03:13 +00:00
Andrew Thompson
8f55d259c2 Add new device id.
PR:		usb/146907
2010-06-22 21:01:40 +00:00
Andrew Thompson
a4cadedb58 Add support for LOW speed BULK transfers. This mode is not recommended by the
USB 2.0 standard, though some USB devices use it anyway.

Submitted by:	Hans Petter Selasky
2010-06-22 20:57:48 +00:00
Alexander Motin
49ed68bbf3 Add "legacy route" support to HPET driver. When enabled, this mode makes
HPET to steal IRQ0 from i8254 and IRQ8 from RTC timers. It can be suitable
for HPETs without FSB interrupts support, as it gives them two unshared
IRQs. It allows them to provide one per-CPU event timer on dual-CPU system,
that should be suitable for further tickless kernels.

To enable it, such lines may be added to /boot/loader.conf:
hint.atrtc.0.clock=0
hint.attimer.0.clock=0
hint.hpet.0.legacy_route=1
2010-06-22 19:42:27 +00:00
Alexander Motin
e723056a58 Do not set level-triggered interrupt mode if we are not going to use it.
This fixes QEMU crash due to unsupported level-triggered HPET interrupts.

Reported by:	kib@
2010-06-22 16:10:48 +00:00
Alexander Motin
7ea5021353 Fix ia64 build broken by r209371.
ia64, same as amd64 has ACPI and always has APIC.

Submitted by:	jhb@
2010-06-21 20:27:32 +00:00
Alexander Motin
875b8844be Implement new event timers infrastructure. It provides unified APIs for
writing event timer drivers, for choosing best possible drivers by machine
independent code and for operating them to supply kernel with hardclock(),
statclock() and profclock() events in unified fashion on various hardware.

Infrastructure provides support for both per-CPU (independent for every CPU
core) and global timers in periodic and one-shot modes. MI management code
at this moment uses only periodic mode, but one-shot mode use planned for
later, as part of tickless kernel project.

For this moment infrastructure used on i386 and amd64 architectures. Other
archs are welcome to follow, while their current operation should not be
affected.

This patch updates existing drivers (i8254, RTC and LAPIC) for the new
order, and adds event timers support into the HPET driver. These drivers
have different capabilities:
 LAPIC - per-CPU timer, supports periodic and one-shot operation, may
freeze in C3 state, calibrated on first use, so may be not exactly precise.
 HPET - depending on hardware can work as per-CPU or global, supports
periodic and one-shot operation, usually provides several event timers.
 i8254 - global, limited to periodic mode, because same hardware used also
as time counter.
 RTC - global, supports only periodic mode, set of frequencies in Hz
limited by powers of 2.

Depending on hardware capabilities, drivers preferred in following orders,
either LAPIC, HPETs, i8254, RTC or HPETs, LAPIC, i8254, RTC.
User may explicitly specify wanted timers via loader tunables or sysctls:
kern.eventtimer.timer1 and kern.eventtimer.timer2.
If requested driver is unavailable or unoperational, system will try to
replace it. If no more timers available or "NONE" specified for second,
system will operate using only one timer, multiplying it's frequency by few
times and uing respective dividers to honor hz, stathz and profhz values,
set during initial setup.
2010-06-20 21:33:29 +00:00
Alexander Motin
9085ea5054 Report transport type in XPT_PATH_INQ.
MFC after:	3 days
2010-06-19 13:42:14 +00:00
Alexander Motin
33827b8428 Report transport type in XPT_PATH_INQ.
PR:		i386/147929
MFC after:	3 days
2010-06-19 13:41:17 +00:00
Alexander Motin
3a18e1b6d7 Oops! Add " / hz" missed in r209328. Assume interrupt rate hz/2, not 1/2. 2010-06-19 08:46:17 +00:00
Brian Somers
5d6d222816 Add a missing linefeed
PR:		147337
Submitted by:	cyberleo at cyberleo dot net
MFC after:	1 week
2010-06-19 08:42:29 +00:00
Alexander Motin
7150e67191 While we indeed can't precisely measure time spent in C1, we can consider
measured interval as upper bound. It should be more precise then just
assuming hz/2. For idle CPU it should be quite precise, for busy - not
worse then before.
2010-06-19 08:36:12 +00:00
Alan Cox
69a990a144 Catch up with the page and page queues locking changes. 2010-06-18 23:14:16 +00:00
Nathan Whitehorn
9f220e4d78 Revert changes accidentally committed as part of r209298. 2010-06-18 14:20:54 +00:00
Nathan Whitehorn
7248ea35ca Following r209299, level interrupts are low by default on PPC, so remove
the hack here to reprogram the interrupt for K2 SATA devices.
2010-06-18 14:17:45 +00:00
Nathan Whitehorn
eaef5f0af8 Provide for multiple, cascaded PICs on PowerPC systems, and extend the
OFW interrupt map interface to also return the device's interrupt parent.

MFC after:	8.1-RELEASE
2010-06-18 14:06:27 +00:00
Xin LI
b7a4702bd1 Remove an unused comment. 2010-06-17 19:48:03 +00:00
Jack F Vogel
b7741e7a13 Two stats were duplicated, thanks to Andrew Boyer
for pointing this out.
2010-06-17 17:38:39 +00:00
George V. Neville-Neil
fdbf7e3c5e Move statistics into the sysctl tree making it easier to find
and use them.
Add previously hidden statistics, some of which include interrupt
and host/card communication counters.
2010-06-16 20:57:41 +00:00
George V. Neville-Neil
9dc69a1589 Move statistics into the sysctl tree making it easier to find
and use them.
Add previously hidden statistics, some of which include interrupt
and host/card communication counters.
2010-06-16 17:36:53 +00:00
Jack F Vogel
dfc14ce06e Changes from John Baldwin adding to last commit,
change rxeof api for poll friendliness, and
eliminate unnecessary link tasklet use. Thanks John!
2010-06-16 16:37:36 +00:00
Jack F Vogel
0dee704f01 Change to have legacy interrupts use the same
handler had a flaw, thanks to John Baldwin for
finding it. Change which queue legacy tasks are
enqueued on.

MFC: soonest
2010-06-15 21:11:51 +00:00
John Baldwin
42040ff081 When updating individual CPU's lowest Cx state to use, never set it to a
state lower than the lowest one supported by the current CPU.  This closes
some races with changes to the hw.acpi.cpu_cx_lowest sysctl while Cx
states for individual CPUs were changing (e.g. unplugging the AC adapter
of a laptop) that could result in panics.

Submitted by:	Giovanni Trematerra
Tested by:	David Demelier  demelier dot david of gmail
MFC after:	3 days
2010-06-15 19:14:39 +00:00
Alan Cox
ecd5dd957d Eliminate unnecessary page queues locking. 2010-06-15 18:37:31 +00:00
Andriy Gapon
a9bdb5d3ad sound/pcm: use non-const string as a value with SYSCTL_STRING
Although the sysctls are marked with CTLFLAG_RD and the values will stay
immutable, current sysctl implementation stores value pointer in
void* type, which means that const qualifier is discarded anyway
and some newer compilers complaint about that.
We can't use de-const trick in sysctl implementation, because in that
case we could miss an opposite situation where a const value is used
with CTLFLAG_RW sysctl.

Complaint from:	gcc 4.4, clang
MFC after:	2 weeks
2010-06-15 07:06:54 +00:00
Jung-uk Kim
0f817de766 Fix typos that broke duration calculations on protection frames. A similar
fix was done for ral(4) long ago and it must be copy-and-paste bugs.

Found by:	clang
2010-06-14 23:01:50 +00:00
Bernhard Schmidt
98f4f952f3 Fix TX retry rate handling. tx->linkq is an index to a rate table
beginning with the highest available rate. Currently we always use
54m for the first retry no matter what AMRR has choosen. Fix this
by setting the index to the next lower rate.

Approved by:	rpaulo (mentor)
Tested by:	Brandon Gooch <jamesbrandongooch at gmail.com>
MFC after:	2 weeks
2010-06-14 18:26:10 +00:00
Bernhard Schmidt
7041d50cfd sc_lastrs is also used in case the sending station is not known, for
example in a split IBSS scenario. Therefore always assign sc_lastrs.
This removes a hack I committed in r206457.

Approved by:	rpaulo (mentor)
2010-06-14 08:24:00 +00:00
Alexander Motin
93fc07b434 Virtualize pci_remap_msi_irq() call from general MSI code. It allows MSI
(FSB interrupts) to be used by non-PCI devices, such as HPET.
2010-06-14 07:10:37 +00:00
Andrew Thompson
beaa05370d - Because hostapd calls iv_key_set() before if_init(), make sure key_set
callback function will be executed, and that the key won't be deleted during
  the init process.
- txmic and rxmic are written into the chip the same place regardless of
  opmode.
- Make the hardware generate 802.11 sequence numbers.

Submitted by:	Akinori Furukoshi
Obtained from:	git://gitorious.org/run/run.git
2010-06-14 00:40:23 +00:00
Rafal Jaworowski
db5ef4fc77 Convert Marvell ARM platforms to FDT convention.
The following systems are involved:

  - DB-88F5182
  - DB-88F5281
  - DB-88F6281
  - DB-78100
  - SheevaPlug

This overhaul covers the following major changes:

  - All integrated peripherals drivers for Marvell ARM SoC, which are
    currently in the FreeBSD source tree are reworked and adjusted so they
    derive config data out of the device tree blob (instead of hard coded /
    tabelarized values).

  - Since the common FDT infrastrucutre (fdtbus, simplebus) is used we say
    good by to obio / mbus drivers and numerous hard-coded config data.

Note that world needs to be built WITH_FDT for the affected platforms.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation.
2010-06-13 13:28:53 +00:00
Rafal Jaworowski
dc65d002dd Initial FDT infrastructure elements for ARM.
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2010-06-13 13:12:52 +00:00
Rafal Jaworowski
10e8667600 Provide identify method for the fdtbus(4).
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2010-06-13 12:58:31 +00:00
Navdeep Parhar
27d1c65e8e cxgb(4): add knob to get packet timestamps from the hardware.
The T3 ASIC can provide an incoming packet's timestamp instead of its RSS hash.
The timestamp is just a counter running off the card's clock.  With a 175MHz
clock an increment represents ~5.7ns and the 32 bit value wraps around in ~25s.

# sysctl -d dev.cxgbc.0.pkt_timestamp
dev.cxgbc.0.pkt_timestamp: provide packet timestamp instead of connection hash

# sysctl -d dev.cxgbc.0.core_clock
dev.cxgbc.0.core_clock: core clock frequency (in KHz)
# sysctl dev.cxgbc.0.core_clock
dev.cxgbc.0.core_clock: 175000
2010-06-12 22:33:04 +00:00
Navdeep Parhar
06eace6376 make format string a string literal.
Reported by:	clang
2010-06-12 22:24:39 +00:00
Jack F Vogel
e6ec2d1fa6 Put back the lost bus_describe_intr() calls. 2010-06-11 21:35:19 +00:00
Jack F Vogel
91c0189dc0 Change the mbuf memory calls back to NOWAIT as a
problem has been seen in one case with doing the
M_WAITOK
2010-06-11 20:59:29 +00:00
Jack F Vogel
2e6bd30b46 Add a couple fixes from Michael Tuexen.
Remove unneeded rxtx handler, make que handler generic.
Do not allocate header mbufs in rx ring if not doing hdr split.
Release the lock in rxeof call to stack.

MFC for 8.1 asap
2010-06-11 20:54:27 +00:00
Jung-uk Kim
7b2d603ef0 Fix one more case where a string is passed via format argument instead.
Found by:	clang
2010-06-11 20:08:20 +00:00
Jung-uk Kim
2e1bf57ca8 Simplify a function for getting brightness levels. 2010-06-11 19:58:41 +00:00
Jung-uk Kim
30363a9a9e Remove unused assignment.
Found by:	clang static analyzer
Found by:	Coverity Prevent[tm] (CID 4537, 4538, 4539)
2010-06-11 19:53:42 +00:00
Andriy Gapon
1bdfff2252 fix a few cases where a string is passed via format argument instead of
via %s

Most of the cases looked harmless, but this is done for the sake of
correctness.  In one case it even allowed to drop an intermediate buffer.

Found by:	clang
MFC after:	2 week
2010-06-11 19:27:21 +00:00
Jack F Vogel
0301599d3d Remove a disable_queue from the beginning of the
interrupt handler, automask handles it.
Also, add in msix vector descriptions.

MFC for 8.1 asap
2010-06-11 19:03:59 +00:00
John Baldwin
3aa6d94e0c Update several places that iterate over CPUs to use CPU_FOREACH(). 2010-06-11 18:46:34 +00:00
Jung-uk Kim
80fba82198 Fix a possible dereference of null pointer.
Found by:	clang static analyzer
Found by:	Coverity Prevent[tm] (CID 3423)
2010-06-11 18:19:23 +00:00
Matt Jacob
8340692f44 Don't pass a buffer directly as a printflike format string.
Found by: clang
MFC after:	1 month
2010-06-10 19:38:07 +00:00
Xin LI
ddaa454e6a Apply driver update from LSI. Many thanks to LSI for continuing to
support FreeBSD.

  1) Timeout ioctl command timeouts.
       Do not reset the controller if ioctl command completed
       successfully.
  2) Remove G66_WORKAROUND code (this bug never shipped).
  3) Remove unnecessary interrupt lock (intr_lock).
  4) Timeout firmware handshake for PChip reset (don't wait forever).
  5) Handle interrupts inline.
  6) Unmask command interrupt ONLY when adding a command to the pending
     queue.
  7) Mask command interrupt ONLY after removing the last command from
     the pending queue.
  8) Remove TW_OSLI_DEFERRED_INTR_USED code.
  9) Replace controller "state" with separate data fields to avoid races:

       TW_CLI_CTLR_STATE_ACTIVE                     ctlr->active
       TW_CLI_CTLR_STATE_INTR_ENABLED               ctlr->interrupts_enabled
       TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY          ctlr->internal_req_busy
       TW_CLI_CTLR_STATE_GET_MORE_AENS              ctlr->get_more_aens
       TW_CLI_CTLR_STATE_RESET_IN_PROGRESS          ctlr->reset_in_progress
       TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS   ctlr->reset_phase1_in_progress

 10) Fix "req" leak in twa_action() when simq is frozen and req is NOT
     null.
 11) Replace softc "state" with separate data fields to avoid races:
       TW_OSLI_CTLR_STATE_OPEN                      sc->open
       TW_OSLI_CTLR_STATE_SIMQ_FROZEN               sc->simq_frozen
 12) Fix reference to TW_OSLI_REQ_FLAGS_IN_PROGRESS in
     tw_osl_complete_passthru()
 13) Use correct CAM status values.
       Change CAM_REQ_CMP_ERR to CAM_REQ_INVALID.
       Remove use of CAM_RELEASE_SIMQ for physical data addresses.
 14) Do not freeze/ release the simq with non I/O commands.
       When it is appropriate to temporarily freeze the simq with an I/O
       command use:
         xpt_freeze_simq(sim, 1);
         ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
       otherwise use:
         xpt_freeze_simq(sim, 1);
         xpt_release_simq(sim, 1);

Submitted by:	Tom Couch <tom.couch lsi.com>
PR:		kern/147695
MFC after:	3 days
2010-06-09 21:40:38 +00:00
Alexander Motin
c4219fc1b0 Add set of codec IDs.
PR:		kern/147466
2010-06-09 05:49:02 +00:00
John Baldwin
374d9c4d18 The lock associated with the /dev/apm knote is already held, so use
KNOTE_LOCKED() instead of KNOTE_UNLOCKED().

Reported by:	mav
MFC after:	3 days
2010-06-08 21:27:05 +00:00
Pyun YongHyeon
77982948d1 Remove unused macros.
Reviewed by:	bde
2010-06-08 17:28:28 +00:00
Alexander Motin
a47eae85b4 Disable NCQ and PMP support for VIA VT8251 AHCI. It was reported to be
unreliable under load. Linux does the same.
2010-06-08 10:03:08 +00:00
Kenneth D. Merry
931eeffaa2 A number of netfront fixes and stability improvements:
- Re-enable TSO.  This was broken previously due to CSUM_TSO clearing the
   CSUM_TCP flag, so our checksum flags were incorrectly set going to the
   netback driver.  That was fixed in r206844 in tcp_output.c, so we can
   turn TSO back on here.

 - Fix the way transmit slots are calculated, so that we can't overfill
   the ring.

 - Avoid sending packets with more fragments/segments than netback can
   handle.  The Linux netback code can only handle packets of
   MAX_SKB_FRAGS, which turns out to be 18 on machines with 4K pages.  We
   can easily generate packets with 32 or so fragments with TSO turned on.
   Right now the solution is just to drop the packets (since netback
   doesn't seem to handle it gracefully), but we should come up with a way
   to allow a driver to tell the TCP stack the maximum number of fragments
   it can handle in a single packet.

 - Fix the way the consumer is tracked in the receive path.  It could get
   out of sync fairly easily.

 - Use standard Xen ring macros to make it clearer how netfront is using
   the rings.

 - Get rid of Linux-ish negative errno return values.

 - Added more documentation to the driver.

 - Refactored code to make it easier to read.

 - Some other minor fixes.

Reviewed by:	gibbs

Reviewed by:	gibbs
Sponsored by:	Spectra Logic
MFC after:	7 days
2010-06-08 03:13:26 +00:00
Matt Jacob
95f7dfb2fa Fix XPT_GET_TRAN_SETTING for FC which has been broken for while so that
it will figure out the correct target to handle index and be able to find
things like WWPN, etc.

MFC after:	2 weeks
2010-06-07 17:39:36 +00:00