Commit Graph

17971 Commits

Author SHA1 Message Date
Kip Macy
5eba27fe0c Add backward compatibility ifdefs for non-multiq kernels 2008-11-23 07:30:07 +00:00
Kip Macy
5d96be4eb8 work around periodic leak on queue overrun by enabling coalescing of packets in to
work requests by default
2008-11-23 00:22:52 +00:00
Kip Macy
098fb9b469 intr_machdep.h breaks build on some arches and is not needed 2008-11-23 00:13:25 +00:00
Marcel Moolenaar
437f63ab5f Cast to uintptr_t before casting to void*. This allows the
QUICC backend to be built on LP64 platforms. This makes it
possible to include the QUICC backend in the kernel module.

PR:		127120
2008-11-22 21:22:53 +00:00
Alexander Motin
f4088192d4 Whitespace cleanup for previous commit. 2008-11-22 15:38:24 +00:00
Alexander Motin
e3ae9f65c2 Handle device_get_children() errors in more correct way.
We shouldn't detach until all children are surely destroyed.

Found with:     Coverity Prevent(tm)
CID:            2137
2008-11-22 15:35:21 +00:00
Alexander Motin
d7b96565f5 Change check order to avoid array overrun.
Found with:	Coverity Prevent(tm)
CID:		2497
2008-11-22 14:48:40 +00:00
Joseph Koshy
c85e8dcf18 Unbreak LINT. 2008-11-22 12:34:49 +00:00
Kip Macy
a02573bc06 - enable multiple transmit queues
- invert sense of hw.cxgb.singleq tunable to hw.cxgb.multiq
- don't wake up transmitting thread by default
- add per tx queue ifaltq to handle ALTQ
- remove several unused functions in cxgb_multiq.c
- add several sysctls: multiq_tx_enable, coalesce_tx_enable,
  and wakeup_tx_thread
- this obsoletes the hw.cxgb.snd_queue_len as ifq is replaced
  by a buf_ring
2008-11-22 08:05:05 +00:00
Kip Macy
db7f0b974f - bump __FreeBSD version to reflect added buf_ring, memory barriers,
and ifnet functions

- add memory barriers to <machine/atomic.h>
- update drivers to only conditionally define their own

- add lockless producer / consumer ring buffer
- remove ring buffer implementation from cxgb and update its callers

- add if_transmit(struct ifnet *ifp, struct mbuf *m) to ifnet to
  allow drivers to efficiently manage multiple hardware queues
  (i.e. not serialize all packets through one ifq)
- expose if_qflush to allow drivers to flush any driver managed queues

This work was supported by Bitgravity Inc. and Chelsio Inc.
2008-11-22 05:55:56 +00:00
George V. Neville-Neil
2a1b9f07fc Several small additions to the Chelsio 10G driver.
1) Fix a bug in dealing with the Alerus 1006 PHY which prevented the
device from ever coming back up once it had been set to down.

2) Add a kernel tunable (hw.cxgb.snd_queue_len) which makes it possible
to give the device more than IFQ_MAXLEN entries in its send queue.  The
default remains 50.

3) Add code to place the card'd identification and serial number into
its description (%desc) so that users can tell which card they have
installed.
2008-11-21 19:22:25 +00:00
Warner Losh
db8deb424e Create a /dev/cardbus%d.cis, to be compatible with older versions of
the software.  This is a trivial amount of code to keep wireless
monitoring software working...  I plan on removing it in 9.0.
2008-11-21 03:03:57 +00:00
Marius Strobl
eddfa7b147 Given that the buffer dcons_crom(4) exposes is used for both input
and output, set BUS_DMA_COHERENT when creating the DMA map used for
loading the buffer. As a side-effect this solves locking issues on
sparc64 when dcons(4) calls bus_dmamap_sync(9) while in an interrupt
filter, which are executed in a critical section, and iommu(4) has
to use a sleep lock when taking advantage of the streaming buffer.

Reported and tested by:	kensmith
Approved by:		simokawa
2008-11-19 22:09:03 +00:00
Ed Schouten
656b038372 Also make dcons(4) use MPSAFE callouts.
The callout locks the TTY layer the way it should, so there is no reason
why its callout shouldn't set this flag.
2008-11-19 21:12:26 +00:00
Ed Schouten
7d82f624de Make nmdm(4) use MPSAFE callouts.
For some reason the nmdm(4) driver doesn't use CALLOUT_MPSAFE, even
though we live in the MPSAFE TTY era. Add the CALLOUT_MPSAFE flags.
System survives.
2008-11-19 21:07:33 +00:00
Jung-uk Kim
ab9df4d74d Make sure legacy replacement route is turned off when enbling HPET.
Reviewed by:	jhb
2008-11-19 20:31:38 +00:00
Marko Zec
44e33a0758 Change the initialization methodology for global variables scheduled
for virtualization.

Instead of initializing the affected global variables at instatiation,
assign initial values to them in initializer functions.  As a rule,
initialization at instatiation for such variables should never be
introduced again from now on.  Furthermore, enclose all instantiations
of such global variables in #ifdef VIMAGE_GLOBALS blocks.

Essentialy, this change should have zero functional impact.  In the next
phase of merging network stack virtualization infrastructure from
p4/vimage branch, the new initialization methology will allow us to
switch between using global variables and their counterparts residing in
virtualization containers with minimum code churn, and in the long run
allow us to intialize multiple instances of such container structures.

Discussed at:	devsummit Strassburg
Reviewed by:	bz, julian
Approved by:	julian (mentor)
Obtained from:	//depot/projects/vimage-commit2/...
X-MFC after:	never
Sponsored by:	NLnet Foundation, The FreeBSD Foundation
2008-11-19 09:39:34 +00:00
Alfred Perlstein
6f0e1ffd07 src/sys/dev/usb2/controller/uss820dci_pccard.c
src/sys/dev/usb2/core/usbdevs
src/sys/dev/usb2/include/urio2_ioctl.h
src/sys/dev/usb2/storage/ustorage2_fs.h

These files are not used any more.

src/usr.sbin/Makefile
src/etc/mtree/BSD.include.dist
src/include/Makefile
src/lib/Makefile
src/share/man/man7/hier.7
src/share/mk/bsd.libnames.mk
src/etc/mtree/BSD.include.dist

Make "usbconfig" and "libusb20" a part of the default build.

src/sys/dev/usb/rio500_usb.h
src/sys/dev/usb2/storage/urio2.c

Use common include file.

src/sys/dev/usb2/bluetooth/ng_ubt2.c

Make USB bluetooth depend on "ng_hci" module.

src/sys/dev/usb2/controller/ehci2.c
src/sys/dev/usb2/controller/ehci2.h

Patches for Marvell EHCI.

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

Bugfix for 64-bit platforms. Need to unload the previously loaded DMA
map and some cleanup regarding some corner cases.

src/sys/dev/usb2/core/usb2_core.h
src/sys/dev/usb2/core/usb2_dev.c
src/sys/dev/usb2/core/usb2_dev.h

Bugfix for libusb filesystem interface.

New feature: Add support for filtering device data at the expense of the
userland process.

Add some more comments.

Some minor code styling.

Remove unused function, usb2_fifo_get_data_next().

Fix an issue about "fifo_index" being used instead of "ep_index".

src/sys/dev/usb2/core/usb2_device.c
src/sys/dev/usb2/core/usb2_generic.c

Bugfix for Linux USB compat layer. Do not free non-generic FIFOs when
doing an alternate setting.

Cleanup USB IOCTL and USB reference handling.
Fix a corner case where USB-FS was left initialised after
setting a new configuration or alternate setting.

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

Improvement: Check all USB HUB ports by default at least one time.

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

Bugfix: Make sure destination ASCII string is properly zero terminated
in all cases.

Improvement: Skip invalid characters instead of replacing with a dot.

src/sys/dev/usb2/core/usb2_util.c
src/sys/dev/usb2/image/uscanner2.c

Spelling.

src/sys/dev/usb2/include/Makefile

Share "usbdevs" with the old USB stack.

src/sys/dev/usb2/include/usb2_devid.h
src/sys/dev/usb2/include/usb2_devtable.h

Regenerate files.

Alfred: Please fix the RCS tag at the top.

src/sys/dev/usb2/include/usb2_ioctl.h

Fix compilation of "kdump".

src/sys/dev/usb2/serial/ubsa2.c
src/sys/dev/usb2/serial/ugensa2.c

Remove device ID's which will end up in a new 3G driver.

src/sys/dev/usb2/sound/uaudio2.c

Correct a debug printout.

src/sys/dev/usb2/storage/umass2.c

Sync with old USB stack.

src/lib/libusb20/libusb20.3

Add more documentation.

src/lib/libusb20/libusb20.c

Various bugfixes and improvements.

src/usr.sbin/usbconfig/dump.c
src/usr.sbin/usbconfig/usbconfig.c

New commands for dumping strings and doing custom USB requests from
the command line.

Remove keyword requirements from generated files:
 "head/sys/dev/usb2/include/usb2_devid.h"
 "head/sys/dev/usb2/include/usb2_devtable.h"
2008-11-19 08:56:35 +00:00
Xin LI
202f306c24 Correct a logic error when testing BCE_PHY_SERDES_FLAG.
PR:		kern/128801
Pointed out by:	Adam Morrison
Ok'ed by:	davidch
MFC after:	3 days
2008-11-19 03:24:35 +00:00
John Baldwin
0d484d249f Allow device hints to wire the unit numbers of devices.
- An "at" hint now reserves a device name.
- A new BUS_HINT_DEVICE_UNIT method is added to the bus interface.  When
  determining the unit number of a device, this method is invoked to
  let the bus driver specify the unit of a device given a specific
  devclass.  This is the only way a device can be given a name reserved
  via an "at" hint.
- Implement BUS_HINT_DEVICE_UNIT() for the acpi(4) and isa(4) bus drivers.
  Both of these busses implement this by comparing the resources for a
  given hint device with the resources enumerated by ACPI/PnPBIOS and
  wire a unit if the hint resources are a subset of the "real" resources.
- Use bus_hinted_children() for adding hinted devices on isa(4) busses
  now instead of doing it by hand.
- Remove the unit kludging from sio(4) as it is no longer necessary.

Prodding from:	peter, imp
OK'd by:	marcel
MFC after:	1 month
2008-11-18 21:01:54 +00:00
John Baldwin
d0e14c5099 Fix the maximum transfer size for mfi(4) disk devices to not exceed the
maximum number of scatter/gather elements supported in the bus dma tag.

Reviewed by:	scottl
MFC after:	1 week
2008-11-17 23:30:19 +00:00
Maksim Yevmenkin
8fc061164d Undo revision 185013 until better solution is found.
Pointed out by:	bde
2008-11-17 20:33:13 +00:00
Philip Paeps
6cfbfdb6f9 Fix two possible (but unlikely) NULL-pointer dereferences in glxsb(4).
Spotted by:	Coverity
MFC after:	1 week
2008-11-17 07:09:40 +00:00
Warner Losh
a7de0b74a7 Overhaul of CIS parsing, next step: keep a cached copy of the CIS,
read before we configure the card, so we can implement
/dev/cardbus*.cis.  Also, do this on a per-child basis, so we now have
a different name than before.  I think i'll have to fix that for some
legacy tools to keep working.

I can now do a dumpcis on my running atheros card and have it still work!
2008-11-17 01:32:29 +00:00
Pyun YongHyeon
30dda99b96 Fix typo. It restuled in activating unwanted Rx filtering as well
as resetting Rx threshold configuration.

Submitted by:	Joost Mulders < Joost.Mulders <> Sun DOT COM >
2008-11-17 00:50:59 +00:00
Maksim Yevmenkin
ae670dad61 More locking for syscons(4). This should prevent races with sckbdevent().
PR:		kern/127446
Submitted by:	Eygene Ryabinkin rea-fbsd at codelabs dot ru
2008-11-16 22:39:04 +00:00
John Baldwin
284c87f60e Various whitespace and style fixes. 2008-11-16 17:42:02 +00:00
Joseph Koshy
7dada26401 Print PMC widths in the initialization announcement. 2008-11-16 04:21:59 +00:00
Joseph Koshy
bc4f0ade98 Correct an oversight: call the MD finalize hook at module unload
time.
2008-11-15 11:11:32 +00:00
Joseph Koshy
edfea6b4ad Fix assertions.
Reported by:	keramida
2008-11-15 11:07:54 +00:00
Joseph Koshy
8cd64ec8ad Correct an indexing error (a change missed out in #184802). 2008-11-15 10:56:36 +00:00
Alexander Motin
316f941e96 Correct association 0 handling.
as=0 means unused pin, so disable it explicitly, this is mostly cosmetics.
2008-11-15 09:39:00 +00:00
Warner Losh
e371fa4547 First step in cleaning up CIS parsing and /dev/cardbus*.cis: remove
redundant malloc/free.  Add comments about how this should really be
done.  Fix an overly verbose comment about under 1MB mapping: go ahead
and set the bits, but we ignore them.
2008-11-15 05:22:06 +00:00
Jung-uk Kim
c884498f0b - Revive fdc(4) per-device flag 0x10, which was removed in r1.284[1].
- If the flag is set and auto-select fails, assume disk is not present.
- Set disk empty flag only when the floppy controller reset is needed.
It fixes regression introduced in r1.311, which prevented it from ignoring
errors.  Now fdformat(1) and dd(1) with conv=noerror option can continue
when read/write errors occur as they should.
- Do not retry disk probing as it is extremely slow and pointless.
- Move the disk probing code into a separate function.
- Do not reset disk empty flag if write-protect check fails somehow.

PR:		kern/116538[1]
2008-11-15 01:43:34 +00:00
Doug Ambrisko
4254ef5903 Fix compile. I was in the wrong tree when I tested it :-(
Pointed out by:	Andrzej
2008-11-14 23:32:31 +00:00
Doug Ambrisko
b89b182c58 When running a 32bit app. on amd64, ensure the bits above 32bit
are zero for the copyout.  Confirmed by LSI.
2008-11-14 21:05:45 +00:00
David E. O'Brien
c12dbd1d96 Fix typo where the code was missing the "IPMICTL_RECEIVE_MSG_32" condition
test.
2008-11-14 01:53:10 +00:00
Nick Hibma
edaad74b67 Hide the attach message. This needs to be done in the probe as well, as
the softc is reset a few times during probing.

Print 'changing to modem mode' messages if booting verbose to show the
reason for the time delay. Note: Some devices (Huawei for one) take 20
seconds to appear on the USB bus).
2008-11-13 21:49:07 +00:00
Nick Hibma
eaa5bb21ca Silence detach messages if the device has marked itself quiet (u3g).
MFC after:	3 weeks
2008-11-13 21:46:19 +00:00
Nick Hibma
ab72d59941 Add a reset device command to ugen.c.
This is needed to make some devices work that require a firmware upload
and a USB reset afterwards.
2008-11-13 21:34:34 +00:00
Alexander Motin
2e013ce0e3 Add ADMA, SATA and SAS mass storage subclasses reporting. 2008-11-13 19:57:33 +00:00
Doug Ambrisko
0a15841568 One more piece to add to make sense data work for a user app. from LSI.
Submitted by:	LSI
MFC after:	3 days
2008-11-13 17:13:16 +00:00
Pyun YongHyeon
20f9ef43cb Fix Rx/Tx checksum offload ioctl handling. Now checksum offload
can be controlled by ifconfig(8). Note, VLAN hardware tagging
controls still lacks required handler but it requires more driver
cleanups so I didn't touch that part.

PR:	kern/128766
2008-11-13 04:11:01 +00:00
Doug Ambrisko
fa1e6ef4ef - Fix from jhb for failing I/O request when bus_dmamap_load fails.
- Fix to ioctl path in which the length could be 0 which means
  no data in/out from LSI.
- Fix to ioctl path in which the data in the sense data space
  of the ioctl packet is a really a pointer to some location in
  user-space.  From LSI re-worked a bit by me.
- Add HW support for next gen cards from LSI.

Thanks to LSI for their support!

Submitted by:	jhb, LSI
MFC after:	3 days
2008-11-12 22:44:50 +00:00
John Baldwin
c26864e001 Various style and whitespace fixes. Previously parts of this file used
8 space indent, parts used 4 space indent, and other parts used a weird
mixture (8 spaces for first indent, 4 spaces for the rest).
2008-11-12 22:14:05 +00:00
Nathan Whitehorn
669518d7d5 Probe ADB miscellaneous devices (ID 7) instead of stopping at ID 6. This
allows us to probe the brightness and volume control buttons on PPC Apple
laptops, though there is not yet a driver to do anything useful with them.
2008-11-12 17:33:36 +00:00
Giorgos Keramidas
7d4723c325 Add a quirk for Belkin USB Bluetooth adapters (F8T012xx1 series)
The same (vendor, product) tuple is used for aue(4) adapters,
but I am not sure if the quirk is correct.  I'm using the USB
device 'release' info to skip aue(4) detection right now, but
if there's a better way to differentiate between USB-LAN and
USB Bluetooth we should update the quirk.

Reviewed by:	imp, rink
MFC after:	2 weeks
2008-11-12 13:58:59 +00:00
Colin Percival
94d754a5c7 Add support for the Microsoft Comfort Optical Mouse 3000 (model 1043).
PR:		usb/128760
Submitted by:	Arjan de Vet
2008-11-12 13:32:19 +00:00
Pyun YongHyeon
3c6e15bcee Add ale(4), a driver for Atheros AR8121/AR8113/AR8114 PCIe ethernet
controller. The controller is also known as L1E(AR8121) and
L2E(AR8113/AR8114). Unlike its predecessor Attansic L1,
AR8121/AR8113/AR8114 uses completely different Rx logic such that
it requires separate driver. Datasheet for AR81xx is not available
to open source driver writers but it shares large part of Tx and
PHY logic of L1. I still don't understand some part of register
meaning and some MAC statistics counters but the driver seems to
have no critical issues for performance and stability.

The AR81xx requires copy operation to pass received frames to upper
stack such that ale(4) consumes a lot of CPU cycles than that of
other controller. A couple of silicon bugs also adds more CPU
cycles to address the known hardware bug. However, if you have fast
CPU you can still saturate the link.
Currently ale(4) supports the following hardware features.
  - MSI.
  - TCP Segmentation offload.
  - Hardware VLAN tag insertion/stripping with checksum offload.
  - Tx TCP/UDP checksum offload and Rx IP/TCP/UDP checksum offload.
  - Tx/Rx interrupt moderation.
  - Hardware statistics counters.
  - Jumbo frame.
  - WOL.

AR81xx PCIe ethernet controllers are mainly found on ASUS EeePC or
P5Q series of ASUS motherboards. Special thanks to Jeremy Chadwick
who sent the hardware to me. Without his donation writing a driver
for AR81xx would never have been possible. Big thanks to all people
who reported feedback or tested patches.

HW donated by:	koitsu
Tested by:	bsam, Joao Barros <joao.barros <> gmail DOT com >
		Jan Henrik Sylvester <me <> janh DOT de >
		Ivan Brawley < ivan <> brawley DOT id DOT au >,
		CURRENT ML
2008-11-12 09:52:06 +00:00
Kip Macy
d1340303b9 Update firmware version check
make ddp a tunable

Obtained from:	Chelsio Inc.
MFC after:	3 days
2008-11-12 04:45:09 +00:00
Andrew Thompson
a1f8daf412 Fake the assoc id so that ndis can work on the latest net80211.
PR:		kern/128750
Submitted by:	Paul B. Mahol
2008-11-11 03:36:15 +00:00
Jung-uk Kim
e8976a6d64 Make ispfw(4) play nice with individual firmware modules.
- Do not let individual KLD module unregister firmware image loaded by ispfw
or vice versa.
- Make 'kldunload ispfw' actually unregister all firmware images loaded by
ispfw, not just 'isp_1040'.
- Print which KLD module actually loaded the firmware image.
- Remove unused return value from do_load_fw() and do_unload_fw() and remove
duplicate sys/param.h while I am here.
2008-11-11 00:14:10 +00:00
Andrew Thompson
40f3a90f89 Add missing USB_BUS_LOCK* change from r184824. 2008-11-10 23:18:10 +00:00
Andrew Thompson
7b874a7b2b Convert the two main locking areas into macros to make it clear on what we are
grabbing and why. These are now:

 USB_BUS_LOCK/USB_BUS_UNLOCK
 USB_XFER_LOCK/USB_XFER_UNLOCK

Reviewed by:	alfred
2008-11-10 20:54:31 +00:00
Joseph Koshy
e829eb6d61 - Separate PMC class dependent code from other kinds of machine
dependencies.  A 'struct pmc_classdep' structure describes operations
  on PMCs; 'struct pmc_mdep' contains one or more 'struct pmc_classdep'
  structures depending on the CPU in question.

  Inside PMC class dependent code, row indices are relative to the
  PMCs supported by the PMC class; MI code in "hwpmc_mod.c" translates
  global row indices before invoking class dependent operations.

- Augment the OP_GETCPUINFO request with the number of PMCs present
  in a PMC class.

- Move code common to Intel CPUs to file "hwpmc_intel.c".

- Move TSC handling to file "hwpmc_tsc.c".
2008-11-09 17:37:54 +00:00
Joseph Koshy
2ad65bf421 Style tweak. 2008-11-09 17:07:52 +00:00
Ed Schouten
5bbae50149 Reduce the default baud rate of PTY's to 9600.
On RELENG_6 (and probably RELENG_7) we see our syscons windows and
pseudo-terminals have the following buffer sizes:

| LINE RAW CAN OUT IHIWT ILOWT OHWT LWT     COL STATE  SESS      PGID DISC
| ttyv0  0   0   0  7680  6720 2052 256       7 OCcl       1146  1146 term
| ttyp0  0   0   0  7680  6720 1296 256       0 OCc       82033 82033 term

These buffer sizes make no sense, because we often have much more output
than input, but I guess having higher input buffer sizes improves
guarantees of the system.

On MPSAFE TTY I just sent both the input and output buffer sizes to 7
KB, which is pretty big on a standard FreeBSD install with 8 syscons
windows and some PTY's. Reduce the baud rate to 9600 baud, which means
we now have the following buffer sizes:

|  LINE   INQ  CAN  LIN  LOW  OUTQ  USE  LOW   COL  SESS  PGID STATE
| ttyv0  1920    0    0  192  1984    0  199     7  2401  2401 Oil
| pts/0  1920    0    0  192  1984    0  199  5631  1305  2526 Oi

This is a lot smaller, but for pseudo-devices this should be good
enough. You need to do a lot of punching to fill up a 7.5 KB input
buffer. If it turns out things don't work out this way, we'll just
switch to 19200 baud.
2008-11-08 20:40:39 +00:00
Pyun YongHyeon
dca3a3a011 Remove informational messages left. These messages were intended to
show up in verbose boot mode.

Reported by:	pluknet ( pluknet<> gmail DOT com )
2008-11-07 07:02:28 +00:00
Warner Losh
0762c37122 Bring in http://perforce.freebsd.org/chv.cgi?CH=152584 from hps.
Submitted by:	hps
2008-11-06 17:26:12 +00:00
Bjoern A. Zeeb
c30067e8bf Hide AF_INET specific ioctl handling under #ifdef INET.
MFC after:	2 months
2008-11-06 11:11:25 +00:00
Bjoern A. Zeeb
edb04458d5 Hide AF_INET specific ioctl handling under #ifdef INET.
MFC after:	2 months
2008-11-06 11:00:57 +00:00
Bjoern A. Zeeb
ca6bc428e7 For now our LRO code (tcp_lro.c) only supports IPv4 properly thus
only enable if INET is on.

Reviewed by:	kmacy
MFC after:	2 months
2008-11-06 10:35:46 +00:00
Bjoern A. Zeeb
34627f9384 Hide AF_INET specific ioctl handling under #ifdef INET.
Reviewed by:	kmacy
MFC after:	2 months
2008-11-06 10:17:57 +00:00
Bjoern A. Zeeb
f0176c5c6f Hide an unused variable in case we compile with neither INET nor INET6.
NATM needs 'struct in_addr' to compile, which is a problem on its own
but include in.h for now if we have NATM but neither INET or INET6.

MFC after:	2 months
2008-11-06 09:41:31 +00:00
Bjoern A. Zeeb
994d867cf7 In case INET is not defined, then ANCACHE is not defined and
the sc does not have 'an_have_rssimap' variable.
Add an ANCACHE check to poperly hide the case and make an(4)
compile without INET.

MFC after:	2 months
2008-11-06 08:55:46 +00:00
Ed Schouten
932ef5b5cd Reintroduce the snp(4) driver.
Because the TTY hooks interface was not finished when I imported the
MPSAFE TTY layer, I had to disconnect the snp(4) driver. This snp(4)
implementation has been sitting in my P4 branch for some time now.
Unfortunately it still doesn't use the same error handling as snp(4)
(returning codes through FIONREAD), but it should already be usable.

I'm committing this to SVN, hoping someone else could polish off its
rough edges. It's always better than having a broken driver sitting in
the tree.
2008-11-05 15:04:03 +00:00
Rink Springer
203b82c842 Even though the previous commit was functionally equivalent with the code it replaced, it was wrong: le16toh should have been used.
Note that these changes will not make the driver work on powerpc, but it should fix at least the i386/amd64 cases.

Obtained from:	//depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#20
Noticed by:	jeli, ed
2008-11-04 20:57:39 +00:00
Rink Springer
9fbaa8e74d Fix the build (on at least powerpc) by moving the htole16() from the case(x) expression directly to the switch(x) itself.
Reviewed by:	imp@
2008-11-04 19:28:19 +00:00
John Baldwin
2ff47c5f18 Remove unnecessary locking around vn_fullpath(). The vnode lock for the
vnode in question does not need to be held.  All the data structures used
during the name lookup are protected by the global name cache lock.
Instead, the caller merely needs to ensure a reference is held on the
vnode (such as vhold()) to keep it from being freed.

In the case of procfs' <pid>/file entry, grab the process lock while we
gain a new reference (via vhold()) on p_textvp to fully close races with
execve(2).

For the kern.proc.vmmap sysctl handler, use a shared vnode lock around
the call to VOP_GETATTR() rather than an exclusive lock.

MFC after:	1 month
2008-11-04 19:04:01 +00:00
Rui Paulo
31fb990621 Add support for Asus A8Sr notebooks.
PR:		128553
Submitted by:	Eygene Ryabinkin <rea-fbsd at codelabs.ru>
Reviewed by:	philip
MFC after:	2 months
2008-11-04 11:52:50 +00:00
Alfred Perlstein
eabe30fc9c Bring in USB4BSD, Hans Petter Selasky rework of the USB stack
that includes significant features and SMP safety.

This commit includes a more or less complete rewrite of the *BSD USB
stack, including Host Controller and Device Controller drivers and
updating all existing USB drivers to use the new USB API:

1) A brief feature list:

  - A new and mutex enabled USB API.

  - Many USB drivers are now running Giant free.

  - Linux USB kernel compatibility layer.

  - New UGEN backend and libusb library, finally solves the "driver
    unloading" problem. The new BSD licensed libusb20 library is fully
    compatible with libusb-0.1.12 from sourceforge.

  - New "usbconfig" utility, for easy configuration of USB.

  - Full support for Split transactions, which means you can use your
    full speed USB audio device on a high speed USB HUB.

  - Full support for HS ISOC transactions, which makes writing drivers
    for various HS webcams possible, for example.

  - Full support for USB on embedded platforms, mostly cache flushing
    and buffer invalidating stuff.

  - Safer parsing of USB descriptors.

  - Autodetect of annoying USB install disks.

  - Support for USB device side mode, also called USB gadget mode,
    using the same API like the USB host side. In other words the new
    USB stack is symmetric with regard to host and device side.

  - Support for USB transfers like I/O vectors, means more throughput
    and less interrupts.

  - ... see the FreeBSD quarterly status reports under "USB project"

2) To enable the driver in the default kernel build:

2.a) Remove all existing USB device options from your kernel config
file.

2.b) Add the following USB device options to your kernel configuration
file:

# USB core support
device          usb2_core

# USB controller support
device		usb2_controller
device		usb2_controller_ehci
device		usb2_controller_ohci
device		usb2_controller_uhci

# USB mass storage support
device		usb2_storage
device		usb2_storage_mass

# USB ethernet support, requires miibus
device		usb2_ethernet
device		usb2_ethernet_aue
device		usb2_ethernet_axe
device		usb2_ethernet_cdce
device		usb2_ethernet_cue
device		usb2_ethernet_kue
device		usb2_ethernet_rue
device		usb2_ethernet_dav

# USB wireless LAN support
device		usb2_wlan
device		usb2_wlan_rum
device		usb2_wlan_ral
device		usb2_wlan_zyd

# USB serial device support
device		usb2_serial
device		usb2_serial_ark
device		usb2_serial_bsa
device		usb2_serial_bser
device		usb2_serial_chcom
device		usb2_serial_cycom
device		usb2_serial_foma
device		usb2_serial_ftdi
device		usb2_serial_gensa
device		usb2_serial_ipaq
device		usb2_serial_lpt
device		usb2_serial_mct
device		usb2_serial_modem
device		usb2_serial_moscom
device		usb2_serial_plcom
device		usb2_serial_visor
device		usb2_serial_vscom

# USB bluetooth support
device		usb2_bluetooth
device		usb2_bluetooth_ng

# USB input device support
device		usb2_input
device		usb2_input_hid
device		usb2_input_kbd
device		usb2_input_ms

# USB sound and MIDI device support
device		usb2_sound

2) To enable the driver at runtime:

2.a) Unload all existing USB modules. If USB is compiled into the
kernel then you might have to build a new kernel.

2.b) Load the "usb2_xxx.ko" modules under /boot/kernel having the same
base name like the kernel device option.

Submitted by: Hans Petter Selasky hselasky at c2i dot net
Reviewed by: imp, alfred
2008-11-04 02:31:03 +00:00
Nick Hibma
92ad2cd779 Bugfix: Cut&paste error from the NetBSD code.
Also: Change the initialisation of the command string to a static
initialiser. Verify it against the output of umass.c when being sent a
command using 'camcontrol eject da0' to a Bulk-Only device.

This should make those devices work that need a SCSI eject command to
switch to modem mode (Novatel 950D and others).
2008-11-03 22:09:27 +00:00
Nick Hibma
bcde061b22 uaa->ifaces contains pointers so set its entry to NULL not 0. 2008-11-03 22:05:44 +00:00
Alexander Motin
9325b9b23b Remove " + 1".
Thread ID can't be zero anyway while increment may give owerflow.
2008-11-03 18:28:12 +00:00
Warner Losh
8481e37b53 Nit: Add a few leading zeros to make this match other mask constants
in this file.  Also to make sure that I got other ASI constants right.
2008-11-03 15:38:45 +00:00
Warner Losh
714cb2219c Turns out this isn't even used at all... The bogon that I was tracing was
in code from my p4 tree, not -current.  Delete it here.
2008-11-03 06:37:59 +00:00
Warner Losh
89558ee870 Use child (the card) in preference to cbdev (the bridge) when
allocating resources to read the CIS.  I'm not sure when this changed,
but it is totally wrong.  Also, add a minor improvement to the
debugging.

This should help everybody trying to run dumpcis on atheros wireless
card as well.

MFC after:	2 days
2008-11-03 06:06:22 +00:00
Warner Losh
6e39a203de We can't mask out the higher order bits and have the size come out
right...  Good thing the size was ignored...

Where this macro is used, there's no reason to do it anyway.  There
seems to have been some old-time confusion between the CIS pointer
definition, and the BAR definitions at the base of this bug.
2008-11-03 05:52:43 +00:00
Scott Long
64c71632bf Move the CAM passthrough code into a true module so that it doesn't have to be
compiled into the main AMR driver.  It's code that is nice to have but not
required for normal operation, and it is reported to cause problems for some
people.
2008-11-03 00:53:54 +00:00
Ed Schouten
3c5f535bbf Make the touch pad on my PowerBook G4 12" a little more usable.
For an unknown reason the touch pad of my PowerBook generates button 5
events when you operate it. This causes the adb_mouse code to convert
them to button 2 events, which is not what we want.

Add a new flag, AMS_TOUCHPAD, which is used to distinguish the touch
pad. When set, don't convert button events of unknown buttons to the
last button.

There are still three problems left with respect to user input:

- The mouse button events are not properly processed when the touch pad
  isn't touched.

- The arrow keys on the keyboard don't work inside X11.

- The power button isn't handled by the kernel, similar to the ACPI
  power button on i386/amd64.

Approved by:	nwhitehorn
2008-11-02 19:08:10 +00:00
Warner Losh
96cf0b6d56 Make the no driver stuff an ifdef. 2008-11-02 17:35:15 +00:00
Warner Losh
972f68aeab Move mn over. One of the last stragglers in sys/pci. There's no
module built for this hardware, so no changes needed.
2008-11-02 17:04:54 +00:00
Alexander Motin
57675eb3fa As soon as we have several threads per process now, it is not correct to
use process ID as ACPI thread ID. Concurrent requests with equal thread
IDs broke ACPI mutexes operation causing unpredictable errors including
AE_AML_MUTEX_NOT_ACQUIRED that I have seen.

Use kernel thread ID instead of process ID for ACPI thread.
2008-11-02 12:50:16 +00:00
Warner Losh
205e85c3e2 Merge some minor deltas from p4 newcard tree:
(1) Belkin F5D7050_V4000 was also sold as 'Ativa 802.11g wireless card'
(document)
(2) Add HP Office Jet 4215
2008-11-02 03:00:36 +00:00
Ed Schouten
b75d197096 Allow a read() on /dev/ams[0-9] to be interrupted.
Right now ams_read() uses cv_wait() to wait for new data to arrive on
the mouse device. This means that when you run `cat /dev/ams0', it
cannot be interrupted directly. After you press ^C, you first need to
move the mouse before cat will quit. Make this function use
cv_wait_sig(), which allows it to be interrupted directly.

Reviewed by:	nwhitehorn
2008-11-01 08:07:02 +00:00
Alexander Motin
9fccea878a Add quirk to set GPIO2 to enable internal speaker on Dell Vostro 1400.
Tested by:	Sergio Veloso
2008-10-30 17:54:20 +00:00
Sam Leffler
d6f57961a8 Fix checks for fast frames negotiation. ni_ath_flags holds the
capabilities reported by the ap.  These need to be cross-checked
against the local configuration in the vap.  Previously we were
only checking the ap capabilities which meant that if an ap reported
it was ff-capable but we were not setup to use them we'd try to do
ff aggregation and drop the frame.

There are a number of problems to be fixed here but applying this
fix immediately as the problem causes all traffic to stop (and has
not workaround).

Reported by:	Ashish Shukla
2008-10-30 16:22:04 +00:00
Nathan Whitehorn
014186973a Fix some possible infinite loops in the ADB code, and remove some hacks
that were inserted in desperation during bring-up. In addition, move ADB bus
enumeration and child attachment to when interrupts are available.
2008-10-30 15:27:13 +00:00
Nick Hibma
2726c918a7 We need to print out the device info ourselves on FBSD 6.
Submitted by:	Thomas Nystrom
2008-10-30 08:32:18 +00:00
Nick Hibma
72963ee0de Bugfix: Check the error code for in progress as well, after starting the
transfer.

Some changes to improve the debugging experience.
2008-10-30 08:17:27 +00:00
Nick Hibma
7a82770108 Return USBD_NORMAL_COMPLETION instead of a hard coded 0. 2008-10-30 08:13:49 +00:00
Alexander Motin
3a4a255741 Allow card reader bridge driver to report maximum supported transfer size.
sdhci supports up to 65535 blocks transfers, at91_mci - one block.

Enable multiblock operations disabled before to follow at91_mci driver
limitations.

Reviewed by:	imp@
2008-10-29 20:01:26 +00:00
Bjoern A. Zeeb
96ceb14462 Comment out #define turning on debugging which went in with r184436 and
which is also in conf/NOTES and thus defined twice when building LINT.
2008-10-29 11:03:15 +00:00
Nick Hibma
f0a54b4813 Add the device ID for the mass storage device that appears before the
modem appears to facilitate faster switching to modem mode.
2008-10-29 08:08:55 +00:00
Bjoern A. Zeeb
31b5bf894f Unbreak LINT from r184381 using the correct variable in debugging
DPRINTF for the device and remove dead code.
2008-10-28 09:45:07 +00:00
Nick Hibma
b6d213aee8 Grab Sierra and Novatel init functions from NetBSD version of the u3g
driver (rev 1.3), by Joerg Sonnenberger.

Note: This change is untested as I do not own the hardware. Let me know
if things work or do not work for you by sending me the output dmesg (and
usbctl -f /dev/usbX if possible). Thanks.
2008-10-27 22:44:22 +00:00
Marius Strobl
a8376f70e7 Do as the Linux tg3 driver does and enable MSI support also
for the BCM5714 revision A0 when in a multi-port configuration
and unconditionally for the remainder of the class of BCM575X
and beyond chips.
This was prodded by mav and is based on a suggestion and a
patch submitted by jhb.

Reviewed by:	jhb
MFC after:	2 months
2008-10-27 22:10:01 +00:00
Robert Noland
f3dcc5387b Fix error in busmaster enable logic
rs400/rs480 should clear the RADEON_BUS_MASTER_DIS bit.  This should get
the rs485 IGP chips going again.

Approved by:	jhb (mentor)
Obtained from:	drm git master
2008-10-27 21:24:34 +00:00
Robert Noland
38cbf617d3 Fix some fallout from the busmaster disable cleanup
rs400 is just like rs480

Approved by:	jhb (mentor)
Obtained from:	drm git
2008-10-27 21:21:36 +00:00
Robert Noland
c85e91464a Don't report GEM capability until we actually have GEM support.
This was causing the newer Intel video drivers to fail and abort X.

Approved by:	jhb (mentor)
2008-10-27 21:16:07 +00:00