Commit Graph

18655 Commits

Author SHA1 Message Date
Alexander Motin
53fb2a7ac9 Disable port interrupts before doing PHY reset.
PHY reset causes drive connect/disconnect events, unwanted at this moment.
2009-02-20 20:20:00 +00:00
Alexander Motin
72dc9f05dd Fix pc98 build error due to missing variable.
Submitted by:	avg
2009-02-20 14:10:23 +00:00
Alexander Motin
53963e588a Handle nForce MCP67 and MCP73 SATA controllers as AHCI. They report itself
as ATA RAID, but generic ATAPCI driver unable to detect drives there. AHCI
driver reported to handle them fine. Linux does the same.

Submitted by:	Andrey V. Elsukov on stable@
2009-02-20 08:49:56 +00:00
Scott Long
63b9228b0b Tell CAM that CISS logical devices support tagged queueing. This fixes
the low "max device openings" count that has led to poor performance in
FreeBSD 7.0 and 7.1
2009-02-20 07:43:43 +00:00
Scott Long
9d98ff4d69 Tell CAM that SPI disconnect works, which in turn will let it use tags.
This fixes the low "max device openings" count that has lead to poor
performance in FreeBSD 7.0 and 7.1.

Extra thanks goes to Mike Tancsa at Sentex for providing a debug system for
this.
2009-02-20 07:40:54 +00:00
Scott Long
934dec8c2f Add basic support for DDF, often found on Adaptec HostRAID controllers.
Spares and rebuilds are not supported, so this code should be considered
for entertainment purposes only.
2009-02-20 06:10:12 +00:00
Andriy Gapon
f1e1ddc3d9 acpi_cpu: fixup for PIIX4E PCI config related to C2
This is triggered only if BIOS configures ACPI_BITREG_BUS_MASTER_RLD
aka BRLD_EN_BM to 1.
Rationale:
1. we do not support C3 on PIIX4E
2. bus master activity need not break out of C2 state
3. because of CPU_QUIRK_NO_BM_CTRL quirk we may reset bus master
   status which would result in immediate break out from C2

So if you have seen
cpu0: too many short sleeps, backing off to C1
with this chipset before you may want to try cx_lowest of C2 again.

Reviewed by: rpaulo (mentor), njl
Approved by: rpaulo (mentor)
2009-02-19 14:39:52 +00:00
Alexander Motin
b50bb79c6a Use channel driver's attach/detach routines instead of ata_attach()/
ata_detach() to implement IOCATAATTACH/IOCATADETACH ioctls.
This will permit channel drivers to properly shutdown port hardware on channel
detach and init it on attach.
2009-02-19 12:47:24 +00:00
Sam Leffler
d497b6a449 remove private support for IEEE80211_MODE_HALF and IEEE80211_MODE_QUARTER
now that net80211 has them
2009-02-19 05:22:40 +00:00
Sam Leffler
17e45e1934 Cleanup ath_hal_computetxtime's handling of 1/2 and 1/4-width channels:
o mark phy type to indicate 1/2 or 1/4-rate operation
o use phy type instead of channel attributes to identify 1/2 and 1/4-rate
  operation
o general cleanup of code including move phy constants to ah_internal.h

Eventually this code should go away and we should use the net0211 equivalents.
2009-02-19 04:24:22 +00:00
Sam Leffler
1a15e29ab4 add HAL_DIAG_SETREGS to write registers via the diag api 2009-02-19 04:15:14 +00:00
Sam Leffler
86b3d17f30 whitespace 2009-02-19 04:10:51 +00:00
Alexander Motin
78d154163c Quite mechanical ch_detach implementations for all atapci subdrivers.
Some dmainit call fixes for previous commit.
2009-02-19 00:32:55 +00:00
Robert Watson
8a520db77d if_cx is currently disconnected from the build due to a dependence on
the old TTY implementation; however, take a cut at stripping its
optional Giant-protected code paths enabled using debug.cx.mpsafenet,
which will no longer work once IFF_NEEDSGIANT is removed.
2009-02-19 00:06:01 +00:00
Alexander Motin
04ff88ceac As soon as they called in only same one place (ata_pcichannel_attach()),
join allocate() and dmainit() atapci subdriver's channel initialization
methods into single ch_attach() method.

As opposite to ch_attach() add new ch_detach() method to deallocate/disable
channel.
2009-02-18 22:17:48 +00:00
Alexander Motin
6340835dfd Make ch->dma.free() called symmetrically to ch->dma.alloc(). 2009-02-18 21:12:48 +00:00
Alexander Motin
6a03316a2d Implement proper attach/detach routines for ISA driver. 2009-02-18 20:42:42 +00:00
Sean Bruno
f541131711 Enhance debugging mode by storing the string "BB:TT:LL" once and use
it instead of overloading sbp_show_sdev_info().

replace calls to printf with calls to device_printf and cleanup debug
messages

Remove a bit of dead, commented out code.

Reviewed by:	scottl(mentor)
MFC after:	2 weeks
2009-02-18 18:41:34 +00:00
Alexander Motin
50b6b9cc54 Remove unused variable.
Submitted by:	ganbold
2009-02-18 18:36:13 +00:00
Andrew Thompson
474bb3ce7b Switch over to usbdevs.h generated at compile time. 2009-02-18 06:33:10 +00:00
Ed Maste
8d5b55c37f Use outbound message register 0 instead of mailbox 7 in
aac_{rx,rkt}_get_fwstatus, as done in Adaptec's vendor driver as well as
the Linux drivers.

Submitted by:   jkim, from Adaptec's driver
2009-02-18 01:36:20 +00:00
Sam Leffler
30b00c24b0 fix whitespace 2009-02-17 23:43:17 +00:00
Alexander Motin
7b3a8a2730 Adaptively increase control command timeout when drive is spun down.
This should fix, for example, cache flush timeout error on shutdown, if
some drives are not mounted.

PR:		kern/111023
2009-02-17 23:20:04 +00:00
Andrew Gallatin
4ae3322f1a Fix cut/paste error in previous commit and use the
correct value for SFP+ reserved media type.

MFC after:  1 week
2009-02-17 22:25:19 +00:00
Andrew Gallatin
016385508f Better support for recent Myricom 10GbE NICs
- Update to firmware 1.4.39 for dual-chip NIC (10G-PCIE2-xxx)
  support, and SFP+ i2c support

- Identify newer "B" NICs (10G-PCIEx-8B-x) correctly, rather than
  mis-identifying them as "A" NICs (cosmetic only)

- Identify the IFM_10G_LRM ifmedia type, where applicable.

- Identify ifmedia types for SFP+ based NICs

- Update copyright

Sponsored by: Myricom
MFC after: 1 week
2009-02-17 22:15:58 +00:00
Alexander Motin
b3747cb7d6 Remove useless return, that left from previous commit. 2009-02-17 21:35:17 +00:00
Alexander Motin
46a309e292 ata_interrupt() does not need to return anything. It is not it's business
to report request completion, expecially when it is not reliable.
2009-02-17 21:17:21 +00:00
Sean Bruno
a71c4d427d Introduce 1394a-2000 extended PHY Self ID packets.
Deprecate unused phy_delay Self ID field as it was removed
by 1394a-2000.

Attempt to parse extended Self ID PHY packets if they are detected

Reviewed by:	scottl (mentor)
MFC after:	2 weeks
2009-02-17 19:37:04 +00:00
Alexander Motin
a1fda318a8 Add kernel dumping support. Works fine with sdhci controller driver. 2009-02-17 19:17:25 +00:00
Alexander Motin
bea2dca299 Add support for interruptless kernel dumping. 2009-02-17 19:12:15 +00:00
Sean Bruno
41fd7057bb Simplify some debugging messages and try to consolodate some of the more
interesting conditional printf's into single device_printf's

Change a couple of variable names so that I don't have to trace what they
acutally do anymore.

Enable the display of the Self ID PHY packet if firewire_debug > 0
Reviewed by:	scottl(mentor)
MFC after:	2 weeks
2009-02-17 17:46:43 +00:00
Rafal Jaworowski
fb20e2aeac tsec(4) cosmetics. 2009-02-17 16:02:45 +00:00
Rafal Jaworowski
371bf7cc81 tsec(4): Always try to resume the receiver.
This helps recover from RX stall under heavy loads.

Submitted by:	Piotr Ziecik kosmo ! semihalf dot com
2009-02-17 15:59:27 +00:00
Rafal Jaworowski
0390701af8 tsec(4): do not clear interrupt events register before use.
Prior to this fix, IEVENT register was always cleared before calling
tsec_error_intr_locked(), which prevented error recovery actions from
happening with polling enabled (and could lead to serious problems, including
controller hang).

Submitted by:	Marcin Ligenza marcinl ! pacomp dot com dot pl
2009-02-17 15:47:13 +00:00
Rafal Jaworowski
ab160495d3 Handle mbuf exhaustion scenario in tsec(4).
Without this fix the system would hang under heavy networking load.

Submitted by:	Leon Theunissen leon ! parsec dot co dot za
2009-02-17 15:39:16 +00:00
Rafal Jaworowski
64f90c9dff tsec(4) style improvements and clean-up. 2009-02-17 14:59:47 +00:00
Rafal Jaworowski
bd37530ee4 Additional features for the tsec(4) Ethernet driver.
- interrupt coalescing
  - polling
  - jumbo frames
  - multicast
  - VLAN tagging

The enhanced version of the chip (eTSEC) can also take advantage of:

  - TCP/IP checksum calculation h/w offloading

Obtained from:	Freescale, Semihalf
2009-02-17 14:57:05 +00:00
Sean Bruno
ebe234793b Synopsis:
If speed of link between two devices is slower than the reported max
speed of both endpoints, the current driver will fail and be unable to
negotiate.

Summary:
Test negotiated speed by reading the CSRROM into a dummy variable.
If that read fails, decrement our speed and retry.  If all else fails,
go to lowest speed possible(0).

Report speed to the user.
Add display of the Bus Info Block when debug.firewire_debug > 1
Support the Bus Info Block(1394a-2000) method of speed detection.

I also should note that I am moving "hold_count" to 0 for future
releases.

This variable determines how many bus resets to "hold" a removed
firewire device before deletion.  I don't feel this is useful and will
probably drop support for this sysctl in the future.

Reviewed by:    scottl(mentor)
MFC after:      2 weeks
2009-02-17 04:08:08 +00:00
Warner Losh
993b1ae273 Hold off root mounting until we've gone through the loop of our thread
almost once.  After we've configured the devices that were present the
first time through, then we know that we're done.  If the device has
other devices that are deferred, then it must do a similar dance.
This catches both PC Cards and CardBus cards.
2009-02-17 02:14:04 +00:00
Alexander Motin
2e46610e21 Make core dumping to ad not to freeze even if interrupts, not disabled
for some reason, stealing our events.
2009-02-16 22:25:39 +00:00
Ed Schouten
55272bd6b4 The streams ptm code is pretty awful and likely incorrect. I don't know
anything about streams, so I'm not going to fix it. Just a small comment
to redirect folks to posix_openpt().
2009-02-16 20:12:28 +00:00
Alexander Motin
9f8919f236 Give atapci knowledge about set of implemented AHCI ports. It is possible
to not allocate them after the recent ata channels enumeration changes.
It allows to save some resources, not bother user with unexisting hardware
and not check unimplemented ports status on every interrupt.
2009-02-16 19:10:07 +00:00
Andrew Thompson
4a93759f47 Make uslcom compile, cut'n'paste errors from uplcom. 2009-02-15 23:38:58 +00:00
Robert Watson
cdb31d3351 Remove debug.ce.mpsafenet: we no longer support running the network
stack with conditional Giant acquisition, and IFF_NEEDSGIANT will
be removed in the near future.
2009-02-15 23:29:13 +00:00
Robert Watson
6b34ab205e Remove debug.ctau.mpsafenet: we no longer support running the network
stack with conditional Giant acquisition, and IFF_NEEDSGIANT will
be removed in the near future.
2009-02-15 23:21:52 +00:00
Robert Watson
c197427cee Remove debug.cp.mpsafenet: we no longer support running the network
stack with conditional Giant acquisition, and IFF_NEEDSGIANT will
be removed in the near future.
2009-02-15 23:18:29 +00:00
Alexander Motin
1c4dd558d1 Remove unneeded AND operation. We have already checked that bit is set. 2009-02-15 21:54:16 +00:00
Alexander Motin
8f740c4b03 Enable MSI support by default. Still can be disabled using device.hints. 2009-02-15 21:17:21 +00:00
Alexander Motin
a3b7c762ba Add initial single-vector MSI support into atapci driver.
Works fine with AHCI and theoretically other MSI capable devices.

At this moment support disabled by default. To enable it, set
"hint.atapci.X.msi=1" device hint.
2009-02-15 20:37:55 +00:00
Alexander Motin
5690c13d14 Add workaround for some ATI chips, failing to soft-reset
when port multiplicator supported, but absent.
2009-02-15 16:05:48 +00:00
Alexander Motin
b8adaa5549 Add SATA and PCI Advanced Features capabilities constants. 2009-02-15 09:49:21 +00:00
Andrew Thompson
06d497c1af MFp4 //depot/projects/usb@157699
Add two new functions to the libusb20 API and required kernel ioctls.

- libusb20_dev_get_iface_desc
- libusb20_dev_get_info

New command to usbconfig, "show_ifdrv", which will print out the kernel driver
attached to the given USB device aswell.

See "man libusb20" for a detailed description.

Some minor style corrections long-line wrapping.

Submitted by:	Hans Petter Selasky
2009-02-14 23:20:00 +00:00
Alexander Motin
ce66729032 Tunes to AHCI reset sequences:
- specification claims that 1 second is just a maximum controller reset time;
implement controller reset properly to save almost 1 second of boot, and
about half second of resume time;
- enable channel interrupts only after channel status reset to fix duplicate
device creation on resume due to unwanted device connection event;
- as described in specification, wait for disk ready status after channel
power-up; it is not so important when disk already touched by BIOS, but
solves device not ready problems on resume and probably some other cases.
- uncomment channel stop/start on soft-reset as it is declared mandatory by
specification; it was commented due to some random drive detection problems
on VIA and JMicron controllers, but I hope it is fixed by previous point.
2009-02-14 23:02:59 +00:00
Andrew Thompson
9480550eca - ieee80211_chan2ieee returns an int
- avoid null deref in detach
- update pause timings

Obtained from:	//depot/projects/usb
2009-02-14 22:29:54 +00:00
Alexander Motin
d7216f5694 DEVICE_PROBE(9) claims that we must not initialize softc on probe stage.
Move channel softc initialization from ata_XXX_probe() to ata_XXX_attach().

Instead of calculating ata channel number as position in child device list,
pass it's real number directly from controller probe routine using ivars.
It is simpler and IMHO more correct.
2009-02-14 21:54:44 +00:00
Ed Schouten
a049439079 Remove unneeded execute-permissions from the USB2 device node.
Giving a charactere device execute permissions doesn't have any use.
Right now there isn't a single device node in /dev that has it, except
the USB2 device node, so remove it.

Approved by:	hps, thompsa
2009-02-14 19:46:28 +00:00
Randall Stewart
eef9e53e55 This commit fixes the issue with alias_sctp.c. No
longer do we require SCTP to be in the kernel for the
lib to be able to handle SCTP. We do this by moving
the CRC32c checksum into libkern/crc32.c and then adjusting
all routines to use the common methods. Note that this
will improve the performance of iSCSI since they were
using the old single 256 bit table lookup versus the
slicing 8 algorithm (which gives a 4x speed up in
CRC32c calculation :-D)

Reviewed by:rwatson, gnn, scottl, paolo
MFC after:	4 week? (assuming we MFC the alias_sctp changes)
2009-02-14 11:34:57 +00:00
Andrew Thompson
fd66bfec7f Since r188030 the error value for attach is returned, this means if kbdmux
fails to attach (possibly due to disable hints) then we get called back for
unload. Correctly handle the case where the keyboard isnt found rather than
calling panic.
2009-02-13 23:36:08 +00:00
Andrew Thompson
c7a8a2fa92 - ieee80211_chan2ieee returns an int
- set ic_update_promisc to the same callback as mcast
- avoid null deref in zyd_detach

Obtained from:	//depot/projects/usb
2009-02-13 21:45:19 +00:00
Andrew Thompson
7fb3a6349b MFp4 //depot/projects/usb; 157501, 157608, 157609
- Make usb2_transfer_pending() part of the USB core header file.
 - Make usb2_transfer_pending() NULL safe.
 - Make sure that USB process functions return if the process has been drained.
 - Remove two unused functions.

Submitted by:   Hans Petter Selasky
2009-02-13 20:57:43 +00:00
Nick Hibma
63573f79e2 Add support for CMOTECH devices (not sure whether this is the correct
name) (not sure whether this works correctly, but should be close).

Fix the stub attach phase for some Novatel cards. They expect the CSW
(repsonse to CBW, SCSI eject command) to be fetched before switching to
modem mode.

MFC after:	2 weeks
2009-02-13 19:49:51 +00:00
Andrew Thompson
5f4638f185 Add the Novatel U760. 2009-02-13 18:45:36 +00:00
Sean Bruno
f25a08888f Update the Self ID structure to conform to 1394a-2000.
Delete the unused defines.

Reviewed by:	scottl
2009-02-13 17:45:09 +00:00
Sean Bruno
01f312783e Remove redundant while () from loop.
Submitted by:	 Ganbold <ganbold@micom.mng.net>
Reviewed by:	 scottl
2009-02-13 17:44:07 +00:00
Sam Leffler
015ebba0c0 remove references to ic_stats
Spotted by:	Lucius Windschuh <lwindschuh@googlemail.com>
2009-02-13 16:17:05 +00:00
Sam Leffler
3fc21fed93 add SIOCZATHSTATS ioctl to zero driver statistics 2009-02-13 05:38:03 +00:00
Sam Leffler
36c6be9ab4 add driver stat to count tx drops due to insufficient frag buffers 2009-02-13 05:30:22 +00:00
Andrew Thompson
4c3179db83 Restore some of the link handling code that was inadvertently removed in
r188412, this broke the GU-1000T adapters.

Submitted by:	yongari
Pointy hat:	me
2009-02-13 03:38:08 +00:00
Andrew Thompson
8385da51b7 Add module dependency on miibus.
Submitted by:	yongari
2009-02-13 02:48:32 +00:00
Pyun YongHyeon
53414a48f8 Receving VLAN oversized frames raise SIS_ISR_RX_ERR interrupt, so
make sis_rxeof() handle that too. Previously it used to receive the
frame and reset controller.

PR:	kern/131414
2009-02-13 02:08:20 +00:00
Sam Leffler
a4f7ec0929 Recognize AR5212_AR2317_REV2 in ar5312Probe()
Submitted by:	Pavel Roskin <proski@gnu.org>
2009-02-13 01:50:04 +00:00
Robert Watson
6d0147064d Remove unused ifaddr and ifreq local variables.
MFC after:	3 days
2009-02-12 23:55:35 +00:00
Roman Divacky
0d15110307 Remove obsolete C preprocessor assertions.
Approved by:    kib (mentor)
2009-02-12 18:33:56 +00:00
Kevin Lo
13ae6dce6d Add support for the Sunix SUN1889-based dual parallel port card.
PR: kern/128219
Submitted by: Thinker K.F. Li <thinker at branda dot to>
2009-02-12 10:39:19 +00:00
Alexander Motin
c7a5ac775b s/succeded/succeeded/ in comments. 2009-02-12 09:37:45 +00:00
Sean Bruno
373d922731 Enhance debug messages and attempt to unify them into one format where possible.
Reviewed by:	scottl
2009-02-12 03:26:05 +00:00
Sean Bruno
d717909f5a Update comments around various structs.
Add speeds S800, S1600 and S3200
2009-02-12 03:05:42 +00:00
Sam Leffler
4a7019252b fix both instances of name
Pointy hat:	sam
2009-02-11 22:34:22 +00:00
Sam Leffler
d34b671cda fix typo in AH_CHIP definition
Submitted by:	Pavel Roskin <proski@gnu.org>
2009-02-11 22:18:03 +00:00
Sam Leffler
71a3564e5f gcc 4.3.2 examines getLowerUpperIndex() and concludes that it's not
guaranteed to initialize its two last arguments.  Therefore, there is a
warning in the subsequent caller ar5416FillVpdTable(), which doesn't
initialize those arguments.

Change getLowerUpperIndex() to assign values to indexL and indexR even
in the case of assertion failure.

Submitted by:	Pavel Roskin <proski@gnu.org>
2009-02-11 22:15:37 +00:00
John Baldwin
84f9a0e5c5 Fix lptopen() and lptclose() to not trash the state of the HAVEBUS flag
in 'sc_state'.  This allows the lpt_release_ppbus() calls in those two
routines to actually release the ppbus and thus fixes the hangs noticed
with the lpt(4) driver since the recent ppbus changes.  The old lpt(4)
driver didn't actually check the HAVEBUS flag in lpt_release_ppbus() which
is why these bugs weren't noticed before.
2009-02-11 14:25:09 +00:00
Alexander Leidinger
3141a8dcd1 All open fixes and improvements from Konstantin for which users had to
use patches so far:
 + Envy24:
   - fix: broken init data for M Audio Delta DiO 2496
   - add: support for M Audio Delta 44
   - add: support for M Audio Delta 1010LT
     Tested by:	Dominique Goncalves, dominique.goncalves at gmail.com
   - add: support for Terratec EWX 2496
     Tested by:	Stefan Sperling, stsp at stsp.name
   - add: support for M Audio Delta 66
     Tested by:	Richard Bown, richard.bown at blueyonder.co.uk
   - add: support for M Audio Delta 1010
     Tested by:	Andrew Reilly, areilly at bigpond.net.au
 + Envy24HT:
   - add: support for Terrasoniq TS22PCI
   - fix: M-Audio Revolution 5.1 sound volume is very low
     Reported by:	Oliver Hartmann, ohartman at zedat.fu-berlin.de
                 	Andrey Slusar, anrays at gmail.com
     Tested by:		Andrey Slusar, anrays at gmail.com
               		Rusu Silviu, arol.the at gmail.com
   - fix: M-Audio Revolution 7.1 sound is distorted and very quiet
     Reported by:	Olev Hannula, hannula at gmail.com
     Tested by:		Olev Hannula, hannula at gmail.com
               		Stanislav Belansky, stanislav at icmail.ru
   - fix: Terratec PHASE 22 codec is power-off due to wrong init data
     Reported by:	Philipp Ost, pj at smo.de
     Tested by:		Philipp Ost, pj at smo.de
 + SpicDS:
   - fix: AK4381 produce hiss sound on 192kHz sample rate
   - fix: stupid bug with volume control for AK4396

Submitted by:	 	Konstantin Dimitrov <kosio.dimitrov@gmail.com>
2009-02-11 10:29:45 +00:00
Pyun YongHyeon
f1bb696a81 Allocating 2 MSI messages do not seem to work on certain controllers
so use just 1 MSI message. This fixes regression introduced in
r188381.

Tested by:	many
2009-02-11 00:23:56 +00:00
Kai Wang
64fc5491db Added entries for Lava SP-PCI (1 serial + 1 parallel) PCI card. The
card is a multifunction PCI and report itself as two logical devices.
2009-02-11 00:08:03 +00:00
Sam Leffler
59fbb2570a don't do phantom beacon miss checking for s/w beacon miss handling,
this can mistakenly drop events that cause the s/w bmiss timer to
never get re-armed
2009-02-10 23:48:29 +00:00
Warner Losh
e436c38238 Fix shutdown prototypes. 2009-02-10 23:17:20 +00:00
Warner Losh
507a69a927 Fix read_ivar prototype. 2009-02-10 23:13:48 +00:00
Warner Losh
b23193a559 Fix iicbus_intr, iicbus_write and device_read_ivar prototypes... 2009-02-10 22:50:23 +00:00
Warner Losh
f2aa0e9f88 fix arcmsr_attach, probe, detach, and shutdown prototypes to match newbus. 2009-02-10 22:46:36 +00:00
Marius Strobl
4012d104cd Don't reset the PHY probe retry counter within the loop so
it will eventually terminate as intended.

Submitted by:	Helen Zhang
2009-02-10 21:54:23 +00:00
Sam Leffler
330528331c mark the CLR key installed for open auth stations such that it is reclaimed
when net80211 tears down station state; without this we leak keycache slots
2009-02-10 19:27:50 +00:00
Sam Leffler
a32ac9d3a9 add hw.ath.bstuck to control the stuck beacon threshold 2009-02-10 19:26:42 +00:00
Sam Leffler
054d7b6979 on resume ah_curchan may be NULL if no channel change has been done;
workaround this by passing net80211's channel as we know it'll never
be null

Submitted by:	trasz
2009-02-10 19:25:11 +00:00
Sam Leffler
41576ce6db consolidate conditional code 2009-02-10 19:23:25 +00:00
Olivier Houchard
cd5c163926 Hmm... "base? base : 0" and "base" should be equivalent.
Pointy hat to:	cognet

MFC after:	3 days
2009-02-09 22:59:22 +00:00
Andrew Thompson
78ba73614f Remove usb2_config_td.[ch], they are no longer used. 2009-02-09 22:23:01 +00:00
Andrew Thompson
41f3098786 MFp4 //depot/projects/usb; 157429, 157433, 157443
Various changes wrt. usb procs and tasks.

Submitted by:	Hans Petter Selasky
2009-02-09 22:18:11 +00:00
Andrew Thompson
1b216d3626 Correct sources for r188417
MFp4 //depot/projects/usb; 157412

Sync from svn.freebsd.org/base/user/thompsa/usb which is a minimal changeset
from oldUSB (no config_td).

This excludes the taskqueue changes (for the moment) as requested.
2009-02-09 22:14:38 +00:00
Andrew Thompson
caba0185f0 MFp4 //depot/projects/usb; 157412
Sync from svn.freebsd.org/base/user/thompsa/usb which is a minimal changeset
from oldUSB (no config_td).

This excludes the taskqueue changes (for the moment) as requested.
2009-02-09 22:12:47 +00:00
Andrew Thompson
3630903af2 MFp4 //depot/projects/usb; 157069, 157255
- Change "usb2_pause_mtx" so that it takes the timeout value in ticks
 - Make sure that attach waits for the generic probe to leave room for firware
   loader drivers and device specific USB Audio drivers like USB phone adapters

Submitted by:	Hans Petter Selasky
2009-02-09 22:11:02 +00:00
Andrew Thompson
d102bcfd1b MFp4 //depot/projects/usb; 157203
- Remove CAM layer quirks

Submitted by:	Hans Petter Selasky
2009-02-09 22:09:21 +00:00
Andrew Thompson
fc7ca11552 MFp4 //depot/projects/usb; 157069
- Change "usb2_pause_mtx" so that it takes the timeout value in ticks

Submitted by:	Hans Petter Selasky
2009-02-09 22:06:52 +00:00
Andrew Thompson
1c39f075ce MFp4 //depot/projects/usb; 157069, 157136, 157143, 157145, 157429
- USB serial drivers cleanup, factor out code
 - Simplify line state programming
 - Integrate uslcom from old USB stack

Submitted by:	Hans Petter Selasky
2009-02-09 22:05:25 +00:00
Andrew Thompson
9b90005109 MFp4 //depot/projects/usb; 157100
1. Move most of the ifnet logic into the usb2_ethernet module, this includes,
 - make all usb ethernet interfaces named ue%d
 - handle all threading in usb2_ethernet
 - provide default ioctl handler
 - handle mbuf rx
 - provide locked callbacks for init,start,stop,etc

2. Cleanup CDC-Ethernet driver.

Submitted by:	Hans Petter Selasky
Obtained from:	svn.freebsd.org/base/user/thompsa/usb [1]
2009-02-09 22:02:38 +00:00
Andrew Thompson
559f11917d MFp4 //depot/projects/usb; 157069, 157429, 157430
- Change "usb2_pause_mtx" so that it takes the timeout value in ticks
 - Factor out USB ethernet and USB serial driver specific control request.
 - USB process naming cleanup.

Submitted by:	Hans Petter Selasky
2009-02-09 21:56:33 +00:00
Andrew Thompson
8259ac9313 MFp4 //depot/projects/usb
- Bring in ehci2_ixp4xx.c and ehci2_mbus.c from dev/usb.

Submitted by:	Hans Petter Selasky
2009-02-09 21:50:04 +00:00
Andrew Thompson
81fe4e1110 MFp4 //depot/projects/usb; 157069,157296,157375,157384,157430
- Change "usb2_pause_mtx" so that it takes the timeout value in ticks
 - USB controller: EHCI High Speed Interrupt endpoint fix.
 - Fix OHCI and EHCI counting bug when multiple TD's are involved in
   a short USB transfer and a short packet happens on the non-last TD in the
   USB transfer frame.
 - USB process naming cleanup.

Submitted by:	Hans Petter Selasky
2009-02-09 21:47:39 +00:00
Max Khon
7c9d6ad424 tulip_busdma_cleanup: pass correct vaddr (2nd arg) to bus_dmamem_free()
Found with:	Coverity Prevent(tm)
CID:		1998
2009-02-09 17:07:29 +00:00
Max Khon
0a5eaa9d0e Do not self-initialize a variable.
Found with:	Coverity Prevent(tm)
CID:		3864, 3865
2009-02-09 16:58:18 +00:00
Max Khon
166366b5cd Remove unused variable.
Found with:	Coverity Prevent(tm)
CID:		3693
2009-02-09 16:57:07 +00:00
Ed Schouten
3b31c19691 Properly implement GIO_ATTR and CONS_GETINFO.
It seems I didn't implement these two ioctl()'s properly, which meant
vidcontrol couldn't properly obtain certain terminal parameters.
2009-02-09 15:55:21 +00:00
Pyun YongHyeon
c2d2e19cb7 Reclaim transmitted frames in re_tick(). This is for PCIe
controllers that lose Tx completion interrupts under certain
conditions. With this change it's safe to use MSI on PCIe
controllers so enable MSI on these controllers.
2009-02-09 04:59:13 +00:00
Warner Losh
047e5fdabc When bouncing pages, allow a new option to preserve the intra-page
offset.  This is needed for the ehci hardware buffer rings that assume
this behavior.

This is an interim solution, and a more general one is being worked
on.  This solution doesn't break anything that doesn't ask for it
directly.  The mbuf and uio variants with this flag likely don't work
and haven't been tested.

Universe builds with these changes.  I don't have a huge-memory
machine to test these changes with, but will be happy to work with
folks that do and hps if this changes turns out not to be sufficient.

Submitted by:	alfred@ from Hans Peter Selasky's original
2009-02-08 22:54:58 +00:00
Andrew Thompson
0ac54a56b8 The NRL value in the queue head must be zero for interrupt transfers. This was
diagnosed using a USB analyser obtained through a FreeBSD Foundation grant.

Thanks to:	FreeBSD Foundation
2009-02-08 21:08:00 +00:00
Sam Leffler
26b3568c2f fix typo
Submitted by:	Christoph Mallon <christoph.mallon@gmx.de>
2009-02-08 20:29:37 +00:00
Andrew Thompson
3e1c5e2b56 Fix build, sigh. 2009-02-07 15:51:32 +00:00
Andrew Thompson
875d039fd8 Dont hold the lock over the controller init, we are still attaching. 2009-02-07 06:27:16 +00:00
Sam Leffler
c2e344594e count stuck beacon events 2009-02-07 05:34:41 +00:00
Sam Leffler
9313bae41d fix building w/o CFI_ARMEDANDDANGEROUS 2009-02-07 05:32:19 +00:00
Sam Leffler
bd8c9fc04d expand CFI_ARMEDANDDANGEROUS to include writing the user segment
of the PR; this register is actually write-once so deserves the
safety-belt as much as the PLR
2009-02-07 05:03:25 +00:00
Wojciech A. Koszek
e54815ad40 si_cmdname() is defined only when SI_DEBUG is enabled, thus
using this function in simple printf() causes compile-time
problems. Use conditionally enabled DPRINT() macro instead.
2009-02-07 02:14:27 +00:00
Sam Leffler
b2e73ce955 fix 11n channel construction 2009-02-07 01:54:57 +00:00
Sam Leffler
58ae70168f add macro for future regulatory mods 2009-02-07 01:53:44 +00:00
Nathan Whitehorn
9772bc0bec Rearrange this code slightly to pass softcs around instead of device_t,
solving a possible panic when snd_ai2s is loaded at boot time. Also change
the device setup to indicate to the pcm layer that the device is MPSAFE.

Submitted by:	Marco Trillo
Suggestions by: Ariff Abdullah
2009-02-07 01:15:13 +00:00
Wojciech A. Koszek
c353491ad3 Fix AGP debugging code:
- correct format strings
- fill opt_agp.h if AGP_DEBUG is defined
- bring AGP_DEBUG to LINT by mentioning it in NOTES

This should hopefully fix a warning that was...

Found by:	Coverity Prevent(tm)
CID:		3676
Tested on:	amd64, i386
2009-02-06 20:57:10 +00:00
Kevin Lo
14fdb5561d In urtw_init() call urtw_stop(ifp, 0) rather than urtw_stop(ifp, 1)
to stop the device.
2009-02-06 15:27:40 +00:00
Kevin Lo
5b5b27b3f3 Regen 2009-02-06 15:04:06 +00:00
Kevin Lo
83d78e07da Add the Buffalo WLI-U2-SG54HG 2009-02-06 15:03:17 +00:00
Warner Losh
fc4c469701 fix spelling error
Submitted by:	trasz
2009-02-06 09:34:17 +00:00
Warner Losh
1b37372ada Store the entire funce for disk type functions (eg CF cards and the
like).
2009-02-06 07:49:03 +00:00
Wojciech A. Koszek
172ab3e96e Remove unused variable.
Found with:	Coverity Prevent(tm)
CID:		4138
2009-02-06 00:55:19 +00:00
Sam Leffler
506c6a3a3d add PSB channels to the calibration list 2009-02-06 00:48:56 +00:00
Wojciech A. Koszek
1e9e2b22b8 Bring consistent debugging output for all values that are supposed
to be printed in a hexadecimal format. Otherwise, '270' doesn't say
much.

Reviewed by:	imp
2009-02-05 23:51:11 +00:00
Kip Macy
532700bd00 fix non-witness compile 2009-02-05 21:18:39 +00:00
Sam Leffler
e25b0c1528 eliminate gainFCorrection; just have ar5212GetGainFCorrection return
the calculated value as it's only used in one place
2009-02-05 21:13:31 +00:00
Sam Leffler
3267a60cbd Minor packet drop improvements:
o change tdma packet drop msg when ack required to ATH_DEBUG_TDMA
  (ATH_DEBUG_XMIT is too noisy)
o add a debug msg for raw packet drop due to interface down/invalid
o add stats for these two cases
o explain how another drop case is handled
2009-02-05 21:02:40 +00:00
Sam Leffler
5b1e30afaa improve IQ cal debug msgs; in particular don't scare people by screaming
"MISGATED IQ CAL!" when it's not
2009-02-05 20:56:33 +00:00
Sam Leffler
4d5c4f2a67 fill in ar5212ResetCalValid; reset the IQ valid flag on the channel
so IQ calibration will be started on the next periodic cal
2009-02-05 20:51:53 +00:00
Sam Leffler
3b00bfe121 style 2009-02-05 20:49:13 +00:00
Sam Leffler
5c5b75f94f replace r/w idiom with OS_REG_SET_BIT (to match other code) 2009-02-05 20:48:30 +00:00
Warner Losh
2f4f3e9365 Don't check for mapping above 4GB on 32-bit platforms. 2009-02-05 20:44:06 +00:00
Warner Losh
102720b585 do_product_lookup should return a const struct pccard_product *. 2009-02-05 19:39:07 +00:00
Warner Losh
73e04c0b84 Fix parameter types for set_res_flags and read_ivars 2009-02-05 19:38:31 +00:00
Warner Losh
a6340ec88d shutdown returns an int 2009-02-05 19:37:49 +00:00
Warner Losh
8c1d2b702b shutdown returns an int 2009-02-05 19:36:14 +00:00
Warner Losh
16ec4b00e6 writereg returns an int. 2009-02-05 19:33:35 +00:00
Warner Losh
85a7cf04e7 writereg returns an int. 2009-02-05 19:33:20 +00:00
Warner Losh
005f7c3308 Make iclear return int, since that matches all function definitions of it. 2009-02-05 19:32:34 +00:00
Warner Losh
3fd8527379 reset_epp and ecp_sync both return int. 2009-02-05 19:31:55 +00:00
Warner Losh
174ed15e5c Shutdown returns an int. 2009-02-05 19:30:55 +00:00
Warner Losh
cdaf8487a3 Add some additional debugging for the memory code. 2009-02-05 18:51:14 +00:00
Warner Losh
b6c974e8da device_shutdown returns an int. 2009-02-05 18:43:13 +00:00
Warner Losh
1496d4a967 pcib_read_config and pcib_write_config take u_int params. 2009-02-05 18:40:42 +00:00
Warner Losh
e3545bcc26 device_shutdown returns int. 2009-02-05 18:39:33 +00:00
Warner Losh
66a149db32 bus_add_child takes a const char *. 2009-02-05 18:38:39 +00:00
Sam Leffler
63425a7f25 Add support for frobbing Intel StrataFlash Protection Registers:
o add CFI_SUPPORT_STRATAFLASH compile option to enable support
o add new ioctls to get/set the factory and user/oem segments of the PR
  and to get/set Protection Lock Register that fuses the user segment
o add #defines for bits in the status register
o update cfi_wait_ready to take an offset so it can be used to wait for
  PR write completion and replace constants w/ symbolic names

Note: writing the user segment isn't correct; committing now to get review.

Sponsored by:	Carlson Wireless
Reviewed by:	imp, Chris Anderson
2009-02-05 18:12:07 +00:00
Nathan Whitehorn
6b122703cc Fix bm_shutdown() KOBJ method to correspond to return int, as it should.
Found by:	Andriy Gapon
2009-02-04 22:16:27 +00:00
Warner Losh
a620f9a577 Correct signatures to match kobj function definitions. 2009-02-04 21:11:31 +00:00
Warner Losh
56e63ed738 Shutdown routine returns int. 2009-02-04 20:39:45 +00:00
Warner Losh
850f048e58 detach doesn't return an unsinged int, but returns an int. 2009-02-04 20:35:22 +00:00
Warner Losh
02fa902fbe Fix shutdown routine to return 0 and change signature from void return
to int.
2009-02-04 20:26:27 +00:00
Warner Losh
85d27a4f81 Correct signature for the identify routine. The bad parameter wasn't
used at all, so this is just a tidiness excersize.
2009-02-04 20:23:42 +00:00
Ed Schouten
41ba7e9b13 Slightly improve the design of the TTY buffer.
The TTY buffers used the standard <sys/queue.h> lists. Unfortunately
they have a big shortcoming. If you want to have a double linked list,
but no tail pointer, it's still not possible to obtain the previous
element in the list. Inside the buffers we don't need them. This is why
I switched to custom linked list macros. The macros will also keep track
of the amount of items in the list. Because it doesn't use a sentinel,
we can just initialize the queues with zero.

In its simplest form (the output queue), we will only keep two
references to blocks in the queue, namely the head of the list and the
last block in use. All free blocks are stored behind the last block in
use.

I noticed there was a very subtle bug in the previous code: in a very
uncommon corner case, it would uma_zfree() a block in the queue before
calling memcpy() to extract the data from the block.
2009-02-03 19:58:28 +00:00
John Baldwin
e2f76cae05 Trim what we expose to userland in <dev/ppbus/ppbconf.h> to just the
constants used for the ppi(4) ioctls for bits in the control and status
registers.

Reviewed by:	db
2009-02-03 19:49:21 +00:00
Sam Leffler
8313510315 add Roel's copyright as he did the initial version 2009-02-03 19:21:15 +00:00
Sam Leffler
e73090b5d3 honor any interface width (e.g. setup by the bus shim) and don't probe;
this is needed for the moment to workaround bus shim issues
2009-02-03 19:09:16 +00:00
Sam Leffler
3a114d1f92 reorg ioctl code to simplify adding new requests 2009-02-03 19:07:41 +00:00
Sam Leffler
50d5ad0e42 fix compilation w/ AH_DEBUG 2009-02-03 19:00:56 +00:00
Sean Bruno
23ee18767e Delete fwohci_filt() as it is now unused
Obtained from:	Marius Strobl <marius@alchemy.franken.de>
MFC after:	2 weeks
2009-02-03 17:13:37 +00:00
John Baldwin
3619ea6a08 Don't right-adjust the SMBus slave address for SSIF IPMI BMCs enumerated
via ACPI either.  This is somewhat academic since we don't currently
support such devices though.
2009-02-03 16:39:51 +00:00
John Baldwin
bb6bb7fe1b - Change ichsmb(4) to follow the format of all the other smbus controllers
for slave addressing by using left-adjusted slave addresses (i.e.
  xxxxxxx0b).
- Require the low bit of the slave address to always be zero in smb(4) to
  help catch broken applications.
- Adjust some code in the IPMI driver to not convert the slave address for
  SSIF to a right-adjusted address.  I (or possibly ambrisko@) added this in
  the past to (unknowingly) work around the bug in ichsmb(4).

Submitted by:	 Andriy Gapon <avg of icyb.net.ua> (1,2)
MFC after:	1 month
2009-02-03 16:14:37 +00:00
Andrew Thompson
c96a3b833f - Keep the same sorting on usb_errstr_table as the enum.
- Use c99 array initializers for usb_quirk_str so the indexing isnt critical.
2009-02-03 16:00:20 +00:00
Andrew Thompson
911ee9f112 Add missing string table for the usb quirk enum.
Pointy hat:	me
Submitted by:	rrs
2009-02-03 15:24:00 +00:00
Randall Stewart
2f4afd2125 Adds support for SCTP checksum offload. This means
we, like TCP and UDP, move the checksum calculation
into the IP routines when there is no hardware support
we call into the normal SCTP checksum routine.

The next round of SCTP updates will use
this functionality. Of course the IGB driver needs
a few updates to support the new intel controller set
that actually does SCTP csum offload too.

Reviewed by:	gnn, rwatson, kmacy
2009-02-03 11:00:43 +00:00
Andrew Thompson
5261ba87bc Move away from autogenerated enums, these values never change and its helpful
to be able to look them up.
2009-02-03 05:50:36 +00:00
Warner Losh
711873d44f o Define some symbols for a few items that are bare constants in the
code.
o Use NULL in preference to 0 for a few pointers.
o default to bus timing normal, like we default to bus_width_1.
2009-02-03 04:28:45 +00:00
Kip Macy
a392a2719c break out of loop if we run out of mbufs 2009-02-02 23:04:20 +00:00
John Baldwin
ba8d936dd2 Goof, catch up to constant rename (I renamed it to match the overall PCI
style of having register offsets start with PCIR_* rather than PCI_*).

Submitted by:	rss
2009-02-02 22:06:20 +00:00
Maksim Yevmenkin
8de7d5083c Properly retun error core from kbdmux_modevent()
Reported by:	Christoph Mallon < christoph -dot- mallon -at- gmx -dot- de >
MFC after:	1 week
2009-02-02 21:34:04 +00:00
John Baldwin
da1e0915c5 - Add a new ioctl to /dev/pci to fetch details on an individual BAR of a
device.  The details include the current value of the BAR (including all
  the flag bits and the current base address), its length, and whether or not
  it is enabled.  Since this operation is not invasive, non-root users are
  allowed to use it (unlike manual config register access which requires
  root).  The intention is that userland apps (such as Xorg) will use this
  interface rather than dangerously frobbing the BARs from userland to
  obtain this information.
- Add a new sub-mode to the 'list' mode of pciconf.  The -b flag when used
  with -l will now list all the active BARs for each device.

MFC after:	1 month
2009-02-02 19:54:16 +00:00
Sam Leffler
8216b39e2b o make SAVE_CCK slightly less error prone by always writing the _flag
value used later by RESTORE_CCK
o swap arg order in RESTORE_CCK to slightly reduce cost
2009-02-02 16:56:58 +00:00
Sam Leffler
55a2313ad2 restore variable initialization removed in r187831; this broke
the horrible SAVE/RESTORE_CCK macros used by swan/nala cards to
implement 11b using 11g
2009-02-02 16:55:57 +00:00
Alfred Perlstein
7e474656a6 src/usr.bin/usbhidaction/usbhidaction.c
src/usr.bin/usbhidctl/usbhid.c
src/sys/dev/usb2/include/usb2_hid.h
src/sys/dev/usb2/input/uhid2.c
src/lib/libusbhid/Makefile
src/lib/libusbhid/descr.c
src/lib/libusbhid/descr_compat.c
src/lib/libusbhid/usbhid.3
src/lib/libusbhid/usbhid.h
src/lib/libusbhid/usbvar.h

Patches to make libusbhid and HID userland utilities compatible with
the new USB stack. All HID ioctls should go through the libusbhid
library to ensure compatibility. I have found at least one piece of
software in /usr/ports which needs to get updated before USB HID
devices will work. This is the X joystick input driver.

Reported and tested by:

Daichi GOTO and Masanori OZAWA.

src/sys/dev/usb2/core/usb2_process.c

Correct USB process names.

Reported by:

Andre Guibert de Bruet

src/sys/dev/usb2/serial/uftdi2.c

Integrate changes from old USB stack.

Submitted by:	hps
2009-02-02 00:49:39 +00:00
Sean Bruno
3042cc43f0 Some updates and bug squashing in the firewire stack.
Move the interupt handler to a driver_intr_t type function as it was trying
to do way to much for a lightweight filter interrupt function.

Introduce much more locking around fc->mtx.  Tested this for lock reversals
and other such lockups.  Locking seems to be working better, but there
is much more to do with regard to locking.  The most significant lock is
in the BUS RESET handler.  It was possible, before this checkin, to set
a bus reset via "fwcontrol -r" and have the BUS RESET handler fire before
the code responsible for asserting BUS RESET was complete.  This locking
fixes that issue.

Move some of the memory allocations in the fc struct to the attach function
in firewire.c

Rework the businfo.generation indicator to be merely a on/off bit now.
It's purpose according to spec is to notify the bus that the config ROM
has changed.  That's it.

Catch and squash a possible panic in SBP where in the SBP_LOCK was held
during a possible error case.  The error handling code would definitely
panic as it would try to acquire the SBP_LOCK on entrance.

Catch and squash a camcontrol/device lockup when firewire drives go away.
When a firewire device was powered off or disconnected from the firewire
bus, a "camcontrol rescan all" would hang trying to poll removed devices
as they were not properly detached.  Don't do that.

Approved by:	scottl
MFC after:	2 weeks
2009-02-01 23:28:52 +00:00
Andrew Thompson
84bcda5d68 Revert part of r187970, the NULL check was removed from
udbp_bulk_read_complete() as well as udbp_attach.
2009-02-01 01:07:15 +00:00
Andrew Thompson
50bf982db6 Remove check for null softc in attach, it can never happen. 2009-02-01 00:51:25 +00:00
Alexander Motin
a05a433984 Fix bug in hint.hdac.X.config parsing. 2009-01-31 08:24:09 +00:00
John Baldwin
be57da218c Use si_drv1 to hold the softc for the adb_mouse character device instead of
using devclass_get_softc().

Tested by:	nwhitehorn
2009-01-29 16:18:49 +00:00
Ed Schouten
218653a7fc Make adb_mouse use dev2unit() instead of minor().
A real fix would be to migrate it to si_drv0 to store the softc
directly, but this is the quickest way to fix it right now.
2009-01-29 05:59:42 +00:00
Alexander Motin
64e4196db9 Add one more debug level. 2009-01-28 23:18:21 +00:00
Alexander Motin
5b69a497e5 Add hw.sdhci.debug sysctl to control debug level. 2009-01-28 22:53:41 +00:00
Alexander Motin
ed01be88f7 Improve mmc driver verbose logging.
Make requests logging controllable by hw.mmc.debug sysctl.
2009-01-28 22:09:00 +00:00
Maksim Yevmenkin
3045a45f42 Update ubtbcmfw2 (aka usb2_bluetooth_fw) driver
Reviewed by:	HPS
2009-01-28 20:06:02 +00:00
Maksim Yevmenkin
0e360a7ebe Make ng_ubt2 (aka usb2_bluetooth_ng) driver only attach as "generic" driver
Reviewed by:	HPS
2009-01-28 20:04:39 +00:00
Sam Leffler
59efa8b517 Overhaul regulatory support:
o remove HAL_CHANNEL; convert the hal to use net80211 channels; this
  mostly involves mechanical changes to variable names and channel
  attribute macros
o gut HAL_CHANNEL_PRIVATE as most of the contents are now redundant
  with the net80211 channel available
o change api for ath_hal_init_channels: no more reglass id's, no more outdoor
  indication (was a noop), anM contents
o add ath_hal_getchannels to have the hal construct a channel list without
  altering runtime state; this is used to retrieve the calibration list for
  the device in ath_getradiocaps
o add ath_hal_set_channels to take a channel list and regulatory data from
  above and construct internal state to match (maps frequencies for 900MHz
  cards, setup for CTL lookups, etc)
o compact the private channel table: we keep one private channel
  per frequency instead of one per HAL_CHANNEL; this gives a big
  space savings and potentially improves ani and calibration by
  sharing state (to be seen; didn't see anything in testing); a new config
  option AH_MAXCHAN controls the table size (default to 96 which
  was chosen to be ~3x the largest expected size)
o shrink ani state and change to mirror private channel table (one entry per
  frequency indexed by ic_devdata)
o move ani state flags to private channel state
o remove country codes; use net80211 definitions instead
o remove GSM regulatory support; it's no longer needed now that we
  pass in channel lists from above
o consolidate ADHOC_NO_11A attribute with DISALLOW_ADHOC_11A
o simplify initial channel list construction based on the EEPROM contents;
  we preserve country code support for now but may want to just fallback
  to a WWR sku and dispatch the discovered country code up to user space
  so the channel list can be constructed using the master regdomain tables
o defer to net80211 for max antenna gain
o eliminate sorting of internal channel table; now that we use ic_devdata
  as an index, table lookups are O(1)
o remove internal copy of the country code; the public one is sufficient
o remove AH_SUPPORT_11D conditional compilation; we always support 11d
o remove ath_hal_ispublicsafetysku; not needed any more
o remove ath_hal_isgsmsku; no more GSM stuff
o move Conformance Test Limit (CTL) state from private channel to a lookup
  using per-band pointers cached in the private state block
o remove regulatory class id support; was unused and belongs in net80211
o fix channel list construction to set IEEE80211_CHAN_NOADHOC,
  IEEE80211_CHAN_NOHOSTAP, and IEEE80211_CHAN_4MSXMIT
o remove private channel flags CHANNEL_DFS and CHANNEL_4MS_LIMIT; these are
  now set in the constructed net80211 channel
o store CHANNEL_NFCREQUIRED (Noise Floor Required) channel attribute in one
  of the driver-private flag bits of the net80211 channel
o move 900MHz frequency mapping into the hal; the mapped frequency is stored
  in the private channel and used throughout the hal (no more mapping in the
  driver and/or net80211)
o remove ath_hal_mhz2ieee; it's no longer needed as net80211 does the
  calculation and available in the net80211 channel
o change noise floor calibration logic to work with compacted private channel
  table setup; this may require revisiting as we no longer can distinguish
  channel attributes (e.g. 11b vs 11g vs turbo) but since the data is used
  only to calculate status data we can live with it for now
o change ah_getChipPowerLimits internal method to operate on a single channel
  instead of all channels in the private channel table
o add ath_hal_gethwchannel to map a net80211 channel to a h/w frequency
  (always the same except for 900MHz channels)
o add HAL_EEBADREG and HAL_EEBADCC status codes to better identify regulatory
  problems
o remove CTRY_DEBUG and CTRY_DEFAULT enum's; these come from net80211 now
o change ath_hal_getwirelessmodes to really return wireless modes supported
  by the hardware (was previously applying regulatory constraints)
o return channel interference status with IEEE80211_CHANSTATE_CWINT (should
  change to a callback so hal api's can take const pointers)
o remove some #define's no longer needed with the inclusion of
  <net80211/_ieee80211.h>

Sponsored by:   Carlson Wireless
2009-01-28 18:00:22 +00:00
Ed Schouten
a4611ab612 Last step of splitting up minor and unit numbers: remove minor().
Inside the kernel, the minor() function was responsible for obtaining
the device minor number of a character device. Because we made device
numbers dynamically allocated and independent of the unit number passed
to make_dev() a long time ago, it was actually a misnomer. If you really
want to obtain the device number, you should use dev2udev().

We already converted all the drivers to use dev2unit() to obtain the
device unit number, which is still used by a lot of drivers. I've
noticed not a single driver passes NULL to dev2unit(). Even if they
would, its behaviour would make little sense. This is why I've removed
the NULL check.

Ths commit removes minor(), minor2unit() and unit2minor() from the
kernel. Because there was a naming collision with uminor(), we can
rename umajor() and uminor() back to major() and minor(). This means
that the makedev(3) manual page also applies to kernel space code now.

I suspect umajor() and uminor() isn't used that often in external code,
but to make it easier for other parties to port their code, I've
increased __FreeBSD_version to 800062.
2009-01-28 17:57:16 +00:00
Sam Leffler
5fe9f04492 change ic_getradiocaps driver callback to include the max # channels
so callers know the size of the array passed down
2009-01-27 23:19:36 +00:00
Nick Hibma
c57c9cb6be Fix the input buffer at 1024. The previous calculated buffer size
exceeded the maximum size of 1 page for OHCI controllers. Other serial
drivers use the same size, so I assume this should be enough (1MB/s
throughput?).
2009-01-27 19:37:30 +00:00
Stanislav Sedov
0db1aa0bcb - Add support for Moxa Technologies CP-168EL/PCIe card.
Submitted by:	dmarck
MFC after:	1 week
2009-01-27 09:38:44 +00:00
Jeff Roberson
597979c4b7 - Add support for nehalem/corei7 cpus. This supports all of the core
counters defined in the reference manual.  It does not support the
   'uncore' events.

Reviewed by:	jkoshy
Sponsored by:	Nokia
2009-01-27 07:29:37 +00:00
Maksim Yevmenkin
50e71c31aa Clean up ng_ubt2. Get rid of excessive use of NG_NODE_REF/UNREF().
Make detach() completely synchronous. Properly handle stalled USB
transfers (use internal mechanism instead of submitting own control
transfers). Rename/remove a couple of variables and update comments.
This work was done in close collaboration with HPS.

Reviewed by:	HPS
2009-01-26 20:59:41 +00:00
John Baldwin
192204fece Don't unlock the parent ppc lock until after releasing the ppbus.
Submitted by:	csjp
2009-01-26 20:58:05 +00:00
Andrew Thompson
023ac6ce67 MFp4 //depot/projects/usb/ @156706
Adjust an UHCI portreset delay.

Submitted by:	Hans Petter Selasky
2009-01-26 17:55:07 +00:00
Andrew Thompson
6bd202b0ce Regen. 2009-01-26 17:50:20 +00:00
Andrew Thompson
2b9a58fd23 MFp4 //depot/projects/usb/ @156522,156530
UHCI SOF Quirk. Makes some broken USB devices work again.  Reported by several
 people. Patch made by me.

Submitted by:	Hans Petter Selasky
2009-01-26 17:49:58 +00:00
Andrew Thompson
4d64302ef7 MFp4 //depot/projects/usb/ @156521
U3G regression issue. Patch to support multiple modem instances per logical
 USB interface.

Submitted by:	Hans Petter Selasky
2009-01-26 17:47:32 +00:00
Andrew Thompson
fb89268fbf Fix up USB_GET_REPORT_DESC ioctl.
Submitted by:	daichi
2009-01-26 17:45:50 +00:00
Andrew Thompson
5a869e681d Add umass quirk.
Submitted by:	Hans Petter Selasky
2009-01-26 17:43:58 +00:00
Andrew Thompson
6eba88e901 Add a usb hid quirk.
Submitted by:	Andre Guibert de Bruet
2009-01-26 17:42:02 +00:00
Alexander Motin
18141fb27d Specify analog beep pin widget for several AD codecs.
It gives working speaker control for that systems.
2009-01-26 15:55:15 +00:00
Nathan Whitehorn
a808d0177a Change the way our softc is stored to use the devinfo facility provided by pcm
instead of the regular device softc interface. This brings the AOA driver in
line with the other pcm drivers.

Requested by:	ariff
2009-01-26 14:43:18 +00:00
John Baldwin
34bb786889 Add missing locking around setting the ppc interrupt handler IVAR.
Reported by:	    many
2009-01-26 14:12:12 +00:00
Rafal Jaworowski
1aef11be0e Teach iic(4) the 'repeated start' I2C condition. This will be used by the
upcoming i2c(8) diag utility.

Reviewed by:	bms, stas
Obtained from:	Semihalf
2009-01-26 13:53:39 +00:00
Nathan Whitehorn
8486eb86a7 Add support for the I2S and davbus audio controllers found in Apple PowerPC
hardware.

Submitted by:	Marco Trillo
2009-01-25 18:20:15 +00:00
Ed Schouten
8d456252aa Remove unneeded checks of device unit number from speaker(4).
Calls on the cdev can only be made on existing devices. This means we
don't have to check the value of dev2unit().
2009-01-25 09:20:59 +00:00
Jung-uk Kim
129dec4245 - Add few VIA bridges to agp_via.c and connect it to amd64 build
as they support Intel Core/Core 2 and VIA Nano processors.
- Align "optional agp" in conf/files.* for consistency while I am here.
2009-01-23 17:48:18 +00:00
Sam Leffler
8698ea65aa fix return status handling by ar5XXXReset; this is the reason the
driver sometimes reports reset failed w/ status 0
2009-01-23 05:33:48 +00:00
Weongyo Jeong
d195485267 Add a new USB wireless driver, urtw(4) for supporting Realtek's 8187L
chipset.
2009-01-23 05:04:49 +00:00
Sam Leffler
8d91de92ee don't run the calibration code if scanning, we won't be on the home channel 2009-01-23 03:15:28 +00:00
John Baldwin
66a86c3bc1 Fix a compile bogon. 'ppbus' is used by two different sets of debug code
in lptout().

Reported by:	several
2009-01-22 15:35:54 +00:00
Takanori Watanabe
824a5dd970 Rename sc_is_pseudo to sc_nobulk member in ufoma_softc.
That was pseudo ucom because it used home brew tty interface.
Now, it is integrated to usb serial framework, so it is not pseudo
ucom any more.
2009-01-22 05:05:56 +00:00
John Baldwin
2067d312d4 Add locking to ppc and ppbus and mark the whole lot MPSAFE:
- To avoid having a bunch of locks that end up always getting acquired as
  a group, give each ppc(4) device a mutex which it shares with all the
  child devices including ppbus(4), lpt(4), plip(4), etc.  This mutex
  is then used for all the locking.
- Rework the interrupt handling stuff yet again.  Now ppbus drivers setup
  their interrupt handler during attach and tear it down during detach
  like most other drivers.  ppbus(4) only invokes the interrupt handler
  of the device that currently owns the bus (if any) when an interrupt
  occurs, however.  Also, interrupt handlers in general now accept their
  softc pointers as their argument rather than the device_t.  Another
  feature of the ppbus interrupt handlers is that they are called with
  the parent ppc device's lock already held.  This minimizes the number
  of lock operations during an interrupt.
- Mark plip(4), lpt(4), pcfclock(4), ppi(4), vpo(4) MPSAFE.
- lpbb(4) uses the ppc lock instead of Giant.
- Other plip(4) changes:
  - Add a mutex to protect the global tables in plip(4) and free them on
    module unload.
  - Add a detach routine.
  - Split out the init/stop code from the ioctl routine into separate
    functions.
- Other lpt(4) changes:
  - Use device_printf().
  - Use a dedicated callout for the lptout timer.
  - Allocate the I/O buffers at attach and detach rather than during
    open and close as this simplifies the locking at the cost of
    1024+32 bytes when the driver is attached.
- Other ppi(4) changes:
  - Use an sx lock to serialize open and close.
  - Remove unused HADBUS flag.
  - Add a detach routine.
  - Use a malloc'd buffer for each read and write to avoid races with
    concurrent read/write.
- Other pps(4) changes:
  - Use a callout rather than a callout handle with timeout().
  - Conform to the new ppbus requirements (regular mutex, non-filter
    interrupt handler).  pps(4) is probably going to have to become a
    standalone driver that doesn't use ppbus(4) to satisfy it's
    requirements for low latency as a result.
  - Use an sx lock to serialize open and close.
- Other vpo(4) changes:
  - Use the parent ppc device's lock to create the CAM sim instead of
    Giant.
- Other ppc(4) changes:
  - Fix ppc_isa's detach method to detach instead of calling attach.

Tested by:	  no one :-(
2009-01-21 23:10:06 +00:00
Joerg Wunsch
cdea919138 Add the dresden elektronik SensorTerminalBoard which uses an FT245. 2009-01-21 20:57:28 +00:00
Ed Schouten
2dfc3551a6 Add Unicode rendering to the teken demo application.
Some time ago I tried adding Unicode rendering to the teken demo
application, but I didn't get it working. It seems I forgot to call
setlocale(). Polish this code and make sure it doesn't get lost.

Also a small fix for my previous commit: all Unicode characters in
teken_boxdrawing are below 0x10000, so store them as 16-bit values.
2009-01-21 19:43:10 +00:00
Warner Losh
b63865c6bf Default to normal bus timing mode on SD cards. In practice, most
cards people have today support high speed mode, so the timing field
would be initialized to bus_timing_hs, but there are some slow
cards...
2009-01-21 17:49:23 +00:00
Warner Losh
38d1bc2312 Fix minor style nit for file consistency. 2009-01-21 17:34:14 +00:00
Warner Losh
3cb54b06bc Make the command reporting be under boot verbose.
Also, report a few other things under boot verbose.
Small style nit to make new code look like old code in this file.
2009-01-21 17:28:24 +00:00
Alexander Motin
1e9d4974c1 Fix copy/paste mistake in variable name. This could lead to using incorrect
bus frequency.
2009-01-21 14:22:06 +00:00
Sam Leffler
b2edeea7fb correct typo that left programmed sifs time in the slot time
(to be applied on subsequent resets)

Submitted by:	Jiri Fojtasek <jiri.fojtasek@hlohovec.net>
2009-01-21 02:53:00 +00:00
Maksim Yevmenkin
c4830de394 Fix typo in comment
Pointed out by:	Daan Vreeken / Daan at vehosting dot nl
2009-01-20 23:25:27 +00:00
Maksim Yevmenkin
127a7d3f89 Update (well, actually rewrite mostly) ng_ubt2 driver for USB2.
Reviewed by:	HPS, alfred
Blessed by:	HPS
2009-01-20 22:17:05 +00:00
Jung-uk Kim
566ca8ca5d - Add support for 8110SCe part. Some magic registers were taken from
Linux driver.
- Swap hardware revisions for 8110S and 8169S as Linux driver claims.

Reviewed by:	yongari (early version)
2009-01-20 20:22:28 +00:00
Jung-uk Kim
aaab4fbea7 Retire RL_FLAG_INVMAR bit to match its comment and reality. 2009-01-20 20:04:09 +00:00
Jung-uk Kim
ff19136537 - Do not read and write RX configuration register multiple times.
- Always program RX configuration register from scratch instead of
doing read/modify/write.
- Rename re_setmulti() to re_set_rxmode() to be reflect reality.
- Simplify hash filter logic a little while I am here.

Reviewed by:	yongari (early version)
2009-01-20 19:58:01 +00:00
Nathan Whitehorn
ed366ae5c8 Set the wrong softc size when defining the ofw_iicbus class. Change it to
the correct value.
2009-01-20 14:06:30 +00:00
Ed Schouten
4873b07e2a Properly implement the VT100 SCS sequences in xterm-mode.
Even though VT100-like devices can display non-ASCII characters, they do
not use an 8-bit character set. Special escape sequences allow the VT100
to switch character maps. The special graphics character set stores the
box drawing characters, starting at 0x60, ending at 0x7e. This means
we now pass the character map tests in vttest, even the save/restore
cursor test, combined with character maps. dialog(1) also works a lot
better now.

This commit also includes some other minor fixes:

- Default to 24 lines in teken_demo when using xterm emulation.
- Make white foreground and background work in teken_demo.
2009-01-20 11:34:28 +00:00
Nathan Whitehorn
f5a78b2f7e Change the probe priority for PCI and I2C generic bus modules from
numerical constants to BUS_PROBE_GENERIC.

Suggested by:	jhb
2009-01-20 00:05:43 +00:00
Andrew Thompson
70e1b678ee Set the pipe pointer before calling usbd_transfer() as its possible for the
xfer callback to be invoked on error.

MFC after:	2 weeks
2009-01-19 21:22:10 +00:00
Alexander Motin
8e097e5b32 Add two more nVidia HDMI codec IDs. 2009-01-19 19:16:50 +00:00
Pyun YongHyeon
96b774f489 Sometimes RTL8168B seems to take long time to access GMII registers
in device attach phase. Double GMII register access timeout value
to fix the issue.

Reported by:	wkoszek
Tested by:	wkoszek
2009-01-19 02:31:27 +00:00
Ed Schouten
fcf1ff110a Don't forget to mark the color translation array as const.
Spotted by:	Christoph Mallon <christoph mallon gmx de>
2009-01-18 09:44:33 +00:00
Andrew Thompson
f2476867dc Just put the ifnet pointer first in the softc like it needs to be rather than
adding another deliciously evil pointer.
2009-01-18 05:35:58 +00:00
Giorgos Keramidas
7efe59806b Add support for CMedia CMI120.
PR:		kern/123640
Approved by:	ariff
MFC after:	2 weeks
2009-01-18 04:29:42 +00:00
Ed Schouten
6cecf41bf7 Fix for my previous commit: color mapping is not 1:1.
Cons25 doesn't seem to use a straight 1:1 mapping to the ANSI colors,
but uses the same color numbers as at least used by syscons on i386. I
suspect if you change the definitions on a different architecture,
things may break? Not sure.

Add a small array to convert syscons-style color codes to ANSI
equivalents, which are used by libteken internally. I didn't notice this
bug, because I only tested my code with black, white and green, all of
them shared the same numbers.
2009-01-17 23:01:40 +00:00
Ed Schouten
ec9037a258 Make vidcontrol's color setting work again.
It turns out I forgot to implement two escape sequences that allows the
user to change the default foreground and background colors. I thought
they were implemented by syscons itself, but vidcontrol just generates
some escape sequences, which get interpreted by the terminal emulator.

Reported by:	mgp (forums)
2009-01-17 22:53:53 +00:00
Alexander Motin
0f9e2596e2 Convert battery capacity/rate from mA to mW only when summary is requested.
Unconditional conversion causes incorrect rate units reported by acpiconf.

MFC after:	2 weeks
2009-01-17 17:40:44 +00:00
Ed Schouten
83409a55ec Allow experimental libteken features to be tested without changing code.
The teken library already supports UTF-8 handling and xterm emulation,
but we have reasons to disable this right now. Because we should make it
easy and interesting for people to experiment with these features, allow
them to be set in kernel configuration files.

Before this commit we had a flag called `TEKEN_CONS25' to enable
cons25-style emulation. I'm calling it the opposite now, `TEKEN_XTERM',
because we want to enable it in kernel configuration files explicitly.

Requested by:	kib
2009-01-17 16:37:13 +00:00
John Baldwin
589d604bf9 Disable decoding of BARs by devices before we trash the value in the BAR
by writing all 1's to it to determine its length.  This fixes issues with
MCFG on at least some machines where a trashed BAR claimed subsequent
attempts at PCI config transactions because the addresses in the MCFG
window fell in the decoding range of the BAR.

In general it is a bad idea to leave the BARs enabled while we are
frobbing with them in this manner.

Sleuthing by:  tegge
MFC after:     1 week
2009-01-16 22:22:30 +00:00
Sam Leffler
5e36f05822 export PSB frequencies 2009-01-16 20:44:45 +00:00
Ed Schouten
ef1a9cf642 Remove unused files from the digi(4) driver.
The digi(4) driver directory contains some files that cannot be checked
out on Windows filesystems. This isn't a big deal, but the files aren't
used anyway.

There are still some other places where checkouts on Windows don't work,
such as VFS_MOUNT.9/vfs_mount.9. This should already be a small
improvement.

MFC after:	1 month
2009-01-16 14:45:48 +00:00