Commit Graph

17555 Commits

Author SHA1 Message Date
Robert Noland
ac165058b7 We need to lock around driver unload now.
The i915 driver installs it's register map at load time now.  We can't
remove the map during unload without holding the lock.

Approved by:	kib
2008-08-30 00:53:30 +00:00
Robert Noland
4d8fefdaf4 Free the device lock around the call to drm_drawable_free_all()
This function manipulates a spin lock and we can't hold a mutex over it.

Approved by:	kib
2008-08-30 00:47:52 +00:00
Marius Strobl
d0d67284f8 For chips with a broken DC_ISR_RX_STATE which f.e. never signals
stopped nor the waiting state and also no other means to check
whether the receiver is idle (see also r163774), we have no choice
than to call mii_tick(9) unconditionally even in the case of the
DC_REDUCED_MII_POLL handling as far as the RX side is concerned.
This isn't necessarily worse than checking whether RX is idle
though because unlike as with TX we're racing with the hardware,
which might receive packets any time while we poll the MII, anyway.

Reported and tested by:	Jacob Owens
Reviewed by:		yongari
MFC after:		3 days
2008-08-29 20:31:41 +00:00
Yoshihiro Takahashi
5798cf97e9 unifdef PC98 2008-08-29 12:25:58 +00:00
Yoshihiro Takahashi
c5fe188c44 Remove unneeded include. 2008-08-29 12:23:51 +00:00
Scott Long
d69c9c7867 Work again to fix the interrupt masking problems. We now recognize
that there are 3 different interrupt enable bits, 2 for different
families of cards, and 1 for when MSI is used.  Also apply a big
hammer backstop for cards that aren't recognized.  This should fix
all of the interrupt issues at boot.
2008-08-29 01:23:16 +00:00
Jack F Vogel
882a54f65f Update to igb driver:
- changes in support of the VLAN filter fix to 126850
	- removal of a bunch of legacy code that was cruft, if not
	  possibly harmful.
	- removal of POLLING from this driver, with multiqueue and
	   MSIX it just makes no sense here.
	- Fix an LRO bug that I've been working on internally, intermittent
	  panics under stress, the problem was releasing the RX ring lock
	  before the LRO flushing.
	- Following the above fix I now enable LRO by default
	- For performance reasons increase the default number of RX queues
	  to 4.
	- Add AIM - "Adaptive Interrupt Moderation", a fancy way of saying
	  that the EITR value is dynamically changed based on the size of
	  packets in the last interrupt interval.

	- Much goodness to try, enjoy!!
2008-08-28 22:28:28 +00:00
Attilio Rao
0359a12ead Decontextualize the couplet VOP_GETATTR / VOP_SETATTR as the passed thread
was always curthread and totally unuseful.

Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
2008-08-28 15:23:18 +00:00
John Baldwin
943bebd2c9 Remove hack attempt at using devfs cloning for per-file descriptor storage.
Use the much simpler cdevpriv for per-fd state and enable it.  This allows
multiple opens of /dev/ipmi0 (e.g. using ipmitool while ipmievd is running
in the background).

MFC after:	1 week
2008-08-28 02:13:53 +00:00
John Baldwin
93269b7123 - Tweak an error message.
- Fix a buglet where && was used instead of & to test if OBF was set in
  a couple of places.

MFC after:	1 week
2008-08-28 02:11:04 +00:00
David Christensen
b6d57579a2 - Updated support for 5716.
- Added some additional code for debug builds.
- Fixed a problem printing physical memory on 64bit system during debugging.
- Modified some of the context memory and mailbox register names to more
  clearly distinguish their use.
- Added memory barriers for Intel CPUs when accessing host memory data
  structures which are written by hardware.

MFC after:	Two weeks.
2008-08-27 18:47:24 +00:00
Warner Losh
ff54eabd8a Remove opt_wi.h from module and fix typo in pccarddevs. 2008-08-27 05:43:46 +00:00
Warner Losh
db4ba9a33e Remove opt_wi.h 2008-08-27 05:39:44 +00:00
Warner Losh
dcf77c235d The APDL-325 is a Wireless LAN pcmcia adapter that sits inside some
Billion Access Points.  Fix wi(4) to recognise the adapter.

PR:		77913
Submitted by:	Daan Vreeken [PA4DAN]
MFC after:	3 days
2008-08-27 04:52:27 +00:00
Warner Losh
cfd23b465a Some PC Cards don't have the proper IRQ mask in them. The standard
says that in such cases we can pick any interrupt.  One of these cards
is the LG11 Wireless LAN card.  I don't have one of these, but I do
know that this doesn't hurt any cards I've tried it with.

PR:		92070
Submitted by:	Helge Oldach
MFC after:	3 days
2008-08-27 04:36:27 +00:00
Warner Losh
505c6d6ae9 Add preliminary support for the OLICOM OC2231 and OC2232. This is the
first driver that does the configuration dance with CFE's.  There's
likely some additional configuration that's needed to get things
working completely...
2008-08-27 04:11:03 +00:00
Rafal Jaworowski
321e12c82e tsec: Refactor driver's structure.
Split the driver into the core functionality part (sys/dev/tsec/if_tsec.c) and
the bus attachment (sys/dev/tsec/if_tsec_ocp.c).

This lets better integrate and maintain the driver in other environments with
different attachment abstractions (there is at least one other FreeBSD port --
MPC83xx -- which uses this TSEC driver, but with different local bus model
i.e. some OF derivative). While there, clean up and fix minor cosmetics.

Obtained from:	Semihalf
2008-08-26 10:41:49 +00:00
Rafal Jaworowski
5432bd9f6a tsec: Improve and clean up callouts.
- eliminate the unused tsec_tick_ch callout
- adjust and fix the main tsec callout handling
- minor naming improvements

Obtained from:	Semihalf
2008-08-26 09:38:28 +00:00
John Baldwin
94bf3b9f69 Add more PCI IDs including those for ICH10.
PR:		kern/126736
Submitted by:	Olivier Smedts  olivier of gid0 org
MFC after:	1 week
2008-08-25 15:23:54 +00:00
Yoshihiro Takahashi
81df65c311 Add the 2nd CCU and PnP devices support on pc98.
Reviewed by:	imp
Obtained from:	//depot/projects/uart with some fixes
2008-08-25 14:45:24 +00:00
Warner Losh
93b7e554c5 MFp4: Network Adapter is redundant. 2008-08-25 05:20:17 +00:00
Warner Losh
2e8082cc0c MFp4: necessary quirks to get 3c1 not working (still no interrupts) 2008-08-25 04:59:43 +00:00
Warner Losh
b8feb2e53e Send the magic unlock packet the linux driver claims to have sniffed
to enable line control.

PR:		121184
Submitted by:	Andriy Gapon
2008-08-25 02:42:13 +00:00
Warner Losh
cea93ce340 Greatly expand the devices listed as being supported. This list was
taken from PR/121184 which was mechanically generated from similar
lists in the Linux ipaq driver.  I then took the numbers we had in
usbdevs and filled in the right symbols and eliminated duplicates.

PR:		121184
2008-08-25 02:36:27 +00:00
Warner Losh
677461a8dd Sort the list of supported products alphabetically. 2008-08-25 02:06:26 +00:00
Benjamin Close
34f004ce88 Correct detection of particular wpi cards which only support b/g
and fix the output to indicate b/g not a/g

Submitted by:	ischram at telenet.be
Reviewed by:	thompsa
Approved by:	sam (co-mentor)
MFC after:	1 month
2008-08-24 22:42:39 +00:00
Ed Schouten
537de51435 Make syscons(4) use ttyv0 instead of consolectl as its primary window.
When I was hacking on uart(4) to make it work with the MPSAFE TTY layer,
I noticed there was a difference between the way syscons and uart work
with respect to consoles:

- The uart(4) driver sets cn_name to the corresponding ttyu%r node,
  which means init(8) (which opens /dev/console) will have its output
  redirected to /dev/ttyu%r. After /etc/rc is done, it can spawn a getty
  on that device node as well.

- Syscons used a little different approach. Apart from the /dev/ttyv%r
  nodes, it creates a /dev/consolectl node. This device node is used by
  moused and others to deliver their data, but for some reason it also
  acts as a TTY, which shares its stat structure with ttyv0. This device
  node is used as a console (run conscontrol).

There are a couple advantages of this approach:

- Because we use two different TTY's to represent the 0th syscons
  window, we allocate two sets of TTY buffers. Even if you don't use
  /dev/consolectl after the system has booted (systems that don't run
  moused), it seems the buffers are still allocated.

- We have to apply an evil hack to redirect input to /dev/consolectl.
  Because each window (stat) is associated not associated with one TTY,
  syscons solves this by redirecting all input to closed TTY's to
  consolectl.

  This means that opening /dev/ttyv0 while in single user mode will
  probably cause strange things to happen with respect to keyboard input
  redirection.

The first patch that I discussed with philip@ turned consolectl into a
symlink to ttyv0, but this was not a good idea, because in theory we
would want consolectl to be a simple device node, which contains all the
`privileged' ioctl()'s. Apart from that, it didn't work, because each
time /dev/ttyv0 got revoked, moused also lost its descriptor to deliver
input, which meant you had to plug out/in your mouse to make it work
again. This version just leaves the consolectl device the way it is. It
can still be used to write output to ttyv0, but it can no longer receive
any input.

In my opinion this patch is not a complete solution, but it's already a
step in the good direction. It would allow us to turn consolectl into a
special (non-TTY) device node in the far future. It shaves off 15 KB of
wasted TTY buffer space.

Discussed with:	philip
2008-08-24 19:50:57 +00:00
Bjoern A. Zeeb
e1e6bc8b42 Make lmc(4) compile without INET6 defined[1]. While here make it
compile if there is no INET defined.

Obtained from:	zec (via p4 vimage branch)[1]
MFC after:	3 months
2008-08-24 18:27:19 +00:00
Ed Schouten
dd63e2a189 Make sysmouse(4) use its own locks, instead of using Giant.
When I changed syscons(4) to work with the MPSAFE TTY code, I just
locked all device nodes down using the compatibility feature that allows
you to override the TTY's lock (Giant in this case). Upon closer
inspection, it seems sysmouse(4) only has two internal variables that
need locking: mouse_level and mouse_status.

I haven't done any performance benchmarks on this, though I think it
won't have any dramatic improvements on the system. It is good to get
rid of Giant here, because the third argument of tty_alloc() has only
been added to ease migration to MPSAFE TTY. It should not be used when
not needed.

While there, remove SC_MOUSE, which is a leftover from the MPSAFE TTY
import.
2008-08-24 15:20:44 +00:00
Kip Macy
2be5c100cf Evidently the block device starts at 767.
MFC after:	1 month
2008-08-24 04:42:41 +00:00
Warner Losh
4b8e067a75 Some PC Card variants of the 82365 don't seem to like setting the IRQ
number in the irq register.  While there are other issues with these
variants, avoiding writing to it helps interrupt generation on at
least one card, and doesn't hurt on the others.  Flag ISA attachment
as needing INT_NO_REG written, and don't update the PC Card attachment
(which will have the effect of not touching it for PC Cards).

Document this in a comment, and tweak one or two formatting nits while
I'm here.
2008-08-24 00:22:42 +00:00
Warner Losh
e04ca6236a Fix style nit: s/^ }/}/ in two places. 2008-08-23 23:30:54 +00:00
Warner Losh
be63007e99 Style nit: s/^ }/}/ 2008-08-23 23:28:33 +00:00
Kip Macy
5ce36d5254 make block devices start at 0 2008-08-23 21:30:08 +00:00
Robert Noland
a2a2d95441 Update drm kernel drivers.
This is a sync to mesa/drm pre-gem, with a few fixes on top of that.
It also contains one local patch supplied by kib@ that I can't apply to
git.master shared code.

Approved by:	flz
Obtained from:	mesa/drm git.master
MFC after:	2 weeks
2008-08-23 20:59:12 +00:00
Marius Strobl
993a741ac6 - Use m_collapse(9) instead of m_defrag(9) if possible. This results
in a noticeable reduction in system time spent.
- If bus_dmamap_load_mbuf_sg(9) fails with EFBIG and we already have
  defragmented the mbuf chain, don't bother to defragment and load it
  a second time just yet as it's likely to fail again anyway.

MFC after:	3 days
2008-08-23 20:57:48 +00:00
Warner Losh
a4e1d2d2cf Make sure that we handle errors in device_get_children correctly. 2008-08-23 18:27:10 +00:00
Warner Losh
25ee8cca07 Handle the error case properly for device_get_children. 2008-08-23 18:22:49 +00:00
Warner Losh
099ea4b570 Handle errors from device_get_children. 2008-08-23 16:38:20 +00:00
Warner Losh
d444cd5f28 When device_get_children returns an error, ignore that bus' children. 2008-08-23 15:57:43 +00:00
Warner Losh
60e984e137 Move the code that looks for the companion phy to a subroutine to make
sure we get the error handling right in both places.  This also
simplifies the code somewhat.
2008-08-23 15:50:18 +00:00
Warner Losh
3106346290 There actually were bugs in the original handling that I missed last
night.

Free the children after each pci bus that is searched.  Otherwise we
leak them.  With free in the new place, we also have to free children
before going to done when we find the device we're looking for.

Also, if we can't get the children of a device, just ignore that bus.
2008-08-23 15:34:31 +00:00
Warner Losh
373444e7a1 It turns out that my analysis of the error handling here was wrong.
When there's an error, we don't want to free the children, since it
will be stack garbage.  While we did fail to dereference it by setting
devs to 0, we didn't fail to call free.  We never failed to fail, it
was the easiest thing to do.
2008-08-23 15:29:28 +00:00
Marius Strobl
78d22f42a8 - Restore the behavior of enabling the MII buffer for an internal
PHY only and not also in the case of an external PHY currently
  doing full duplex, which accidentally got broken in r172334.
  It's still not clear to me why we need to enable the buffer for
  an internal PHY though.
- Count excess and late collisions as output errors. [1]
- Count receive errors as input errors. [1]

Obtained from:	NetBSD [1]
MFC after:	3 days
2008-08-23 15:03:26 +00:00
Warner Losh
195c96b714 Revert bogusly committed file. 2008-08-23 07:46:58 +00:00
Warner Losh
e1bd4ee68b Set devs to 0 in case device_get_children return an error. The right thing
to do here is nothing in that case...
2008-08-23 07:46:20 +00:00
Warner Losh
83bda63e3e Actually revert last... Upon closer inspection the code works in the
face of errors already...  A bit unorthodox, but none-the-less valid.
2008-08-23 07:43:03 +00:00
Warner Losh
b52943f026 Handle errors in device_get_children gracefully. 2008-08-23 07:41:21 +00:00
Warner Losh
da02572e7f Handle errors from device_get_chidlren.
Free child list when there's more children than we expected.
2008-08-23 07:38:00 +00:00
Warner Losh
696771ee0a Cope with errors from device_get_children(). These errors can happen
only in low memory situations, so the error fork of these fixes is
lightly tested, but they should do the least-wrong thing...

Submitted by:	Hans Petter Selasky
2008-08-23 07:23:52 +00:00