Commit Graph

19810 Commits

Author SHA1 Message Date
Pyun YongHyeon
cc3c3b4ec4 Add MSI support. 2009-11-19 21:45:06 +00:00
Pyun YongHyeon
5b8f4900f3 Destroy driver mutex in device detach. 2009-11-19 21:39:43 +00:00
Pyun YongHyeon
696e249300 Remove support code for FreeBSD 6.x versions. 2009-11-19 21:08:33 +00:00
John Baldwin
dbd69bc565 Remove commented out reference to if_watchdog and an assignment of zero to
if_timer.

Reviewed by:	scottl
2009-11-19 20:59:40 +00:00
Pyun YongHyeon
23263665d5 Remove complex macros that were used to compute bits values.
Although these macros may have its own strength, its complex
definition make hard to read the code.

Approved by:	delphij
2009-11-19 20:57:35 +00:00
John Baldwin
67e1dfa795 Several fixes to this driver:
- Overhaul the locking to avoid recursion and add missing locking in a few
  places.
- Don't schedule a task to call vge_start() from contexts that are safe to
  call vge_start() directly.  Just invoke the routine directly instead
  (this is what all of the other NIC drivers I am familiar with do).  Note
  that vge(4) does not use an interrupt filter handler which is the primary
  reason some other drivers use tasks.
- Add a new private timer to drive the watchdog timer instead of using
  if_watchdog and if_timer.
- Fixup detach by calling ether_ifdetach() before stopping the interface.
2009-11-19 19:35:15 +00:00
John Baldwin
71098608fc Several fixes to these drivers. Note that these two drivers are actually
just two different attachments (EISA and PCI) to a single driver.
- Add real locking.  Previously these drivers only acquired their lock
  in their interrupt handler or in the ioctl routine (but too broadly in
  the latter).  No locking was used for the stack calling down into the
  driver via if_init() or if_start(), for device shutdown or detach.  Also,
  the interrupt handler held the driver lock while calling if_input().  All
  this stuff should be fixed in the locking changes.
- Really fix these drivers to handle if_alloc().  The front-end attachments
  were using if_initname() before the ifnet was allocated.  Fix this by
  moving some of the duplicated logic from each driver into pdq_ifattach().
  While here, make pdq_ifattach() return an error so that the driver just
  fails to attach if if_alloc() fails rather than panic'ing.  Also, defer
  freeing the ifnet until the driver has stopped using it during detach.
- Add a new private timer to drive the watchdog timer.
- Pass the softc pointer to the interrupt handlers instead of the device_t
  so we can avoid the use of device_get_softc() and to better match what
  other drivers do.
2009-11-19 19:25:47 +00:00
John Baldwin
d4e576c497 - This driver used the if_watchdog timer both as a watchdog on transmit and
auto-negotiation.  To make this simpler and easier to understand I have
  split this out into two separate timers.  One just manages the auto-neg
  side of things and one is a transmit watchdog.  Neither uses if_watchdog.
- Call ether_ifdetach() at the start of detach.
2009-11-19 18:43:43 +00:00
John Baldwin
770c8c790f - Use callout_init_mtx() instead of callout_init(..., CALLOUT_MPSAFE).
- Add a missing callout_drain() to detach.
- Hook into the stats timer and use that to drive the transmit watchdog
  instead of using if_watchdog.
- Run the stats timer every second to match other drivers instead of every
  other second.
- Remove dubious callout handling that stopped the timer only to start it
  again while holding the driver lock without dropping it in between the
  stop and the start.
2009-11-19 18:37:55 +00:00
John Baldwin
73e7361eac This driver has two modes, a netgraph mode and an ifnet mode. In the
netgraph mode it used a private timer to drive the transmit watchdog.  In
the ifnet mode it used if_watchdog.  Now it always uses the private timer.
2009-11-19 18:21:51 +00:00
John Baldwin
e21e2eea58 These drivers only set if_timer but never set if_watchdog. Just remove
the assignments to if_timer.
2009-11-19 18:11:23 +00:00
Rui Paulo
9c9dad53b0 Add WorldB SKU.
Reviewed by:	sam
MFC after:	1 week
2009-11-18 18:48:18 +00:00
Konstantin Belousov
07ff915720 Fix pgsignal() call after signature change in r199355.
Reported and tested by:	bf1783 googlemail com
MFC after:	1 month
2009-11-17 19:24:26 +00:00
John Baldwin
dc8ecaacd4 Use the bus_*() routines rather than bus_space_*() for register operations. 2009-11-17 18:22:14 +00:00
Pyun YongHyeon
77e6010f24 It seems generation of link state change of e1000phy(4) is not
reliable on some Marvell PHYs. If msk(4) know it still does not
have established link check whether msk(4) missed the link state
change by looking into polled link state.

Reported by:	Mel Flynn < mel.flynn+fbsd.current <> mailing.thruhere dot net >,
		Gleb Kurtsou <gleb.kurtsou <> gmail dot com >
Tested by:	Gleb Kurtsou <gleb.kurtsou <> gmail dot com >
2009-11-17 18:19:45 +00:00
John Baldwin
3d32c12abf Always use a private timer instead of if_watchdog and if_timer to drive
the transmit watchdog.  These drivers already used a private timer when
compiled to use Netgraph.  This change just makes them always use the
private timer.  Note that these drivers do not compile and are disconnected
from the build due to TTY changes.
2009-11-17 16:43:02 +00:00
John Baldwin
b1f459a01b Use a private callout timer to drive the transmit watchdog instead of using
if_watchdog and if_timer.  The driver already contained an optional stats
timer that individual attachments could use to provide a 'tick' event.  The
stats timer only ran if the tick function pointer was non-NULL and the
attachment's tick routine had to call callout_reset(), etc.  Now the driver
always schedules a stat timer and manages the callout_reset() internally.
This timer is used to drive the watchdog and will also call the attachment's
'tick' handler if one is provided.

Tested by:	WATANABE Kazuhiro
2009-11-17 14:23:09 +00:00
John Baldwin
12d54232b2 Use a private timer to run the statistics timer instead of (ab)using
if_watchdog and if_timer.

Tested by:	WATANABE Kazuhiro  CQG00620 of nifty.ne.jp
2009-11-17 14:13:30 +00:00
Jung-uk Kim
2272d05019 Merge ACPICA 20091112. 2009-11-16 21:47:12 +00:00
Alexander Motin
5319fb62a8 Do not require payload data to be aligned. It is not mentioned in datasheet
and works fine in practice.
2009-11-16 20:54:47 +00:00
Andrew Thompson
185d20b5f9 Sort ID list by vendor. 2009-11-16 20:36:43 +00:00
Andrew Thompson
2f5c868874 Add the Curitel UM175 3g device. 2009-11-16 20:35:16 +00:00
Alexander Motin
6bd8779bb9 Change the way in which AHCI+PATA combined controllers, such as JMicron
and Marvell handled. Instead of trying to attach two different drivers to
single device, wrapping each call, make one of them (atajmicron, atamarvell)
attach do device solely, but create child device for AHCI driver,
passing it all required resources. It is quite easy, as none of
resources are shared, except IRQ.

As result, it:
- makes drivers operation more independent and straitforward,
- allows to use new ahci(4) driver with such devices, adding support for
new features, such as PMP and NCQ, same time keeping legacy PATA support,
- will allow to just drop old ataahci driver, when it's time come.
2009-11-16 15:38:27 +00:00
Alexander Motin
49b96d25da MFp4:
Check SNCQ HBA capability bit when reporting NCQ support to CAM.
2009-11-14 20:06:04 +00:00
Alexander Motin
00c4be80ae Disable PMP probing for Marvell AHCI controllers.
It is not working for some reason. Linux does the same.
2009-11-14 08:04:38 +00:00
Attilio Rao
884015f6fc Add sysctls in ahd(4) in order to keep track of different classes of
errors. So far 3 different classes are present (correctable,
uncorrectable and fatal) but more can be added easilly.

Obtained from:	Sandvine Incorporated
Reviewed by:	emase, gibbs
Sponsored by:	Sandvine Incorporated
MFC:		2 weeks
2009-11-13 22:57:20 +00:00
Alexander Motin
3f809d7a40 Add support for SATA ports on SATA+PATA Marvell controllers.
These controllers provide combination of AHCI for SATA and legacy
PCI ATA for PATA. Use same solution as used for JMicron controllers.
Add IDs of Marvell 88SX6102, 88SX6111. 88SX6141 alike controllers
2009-11-13 22:53:49 +00:00
Alexander Motin
a1c0421a4a Add more codec IDs. 2009-11-13 21:06:33 +00:00
Ed Schouten
4b2361f811 Convert syscons on i386 to TERM=xterm.
TEKEN_XTERM is now gone. Because we always use xterm mode now, we only
need a TEKEN_CONS25 switch to go back to cons25.
2009-11-13 11:28:54 +00:00
Ed Schouten
e42fc36867 Switch the default terminal emulation style to xterm for most platforms.
Right now syscons(4) uses a cons25-style terminal emulator. The
disadvantages of that are:

- Little compatibility with embedded devices with serial interfaces.
- Bad bandwidth efficiency, mainly because of the lack of scrolling
  regions.
- A very hard transition path to support for modern character sets like
  UTF-8.

Our terminal emulation library, libteken, has been supporting
xterm-style terminal emulation for months, so flip the switch and make
everyone use an xterm-style console driver.

I still have to enable this on i386. Right now pc98 and i386 share the
same /etc/ttys file. I'm not going to switch pc98, because it uses its
own Kanji-capable cons25 emulator.

IMPORTANT: What to do if things go wrong (i.e. graphical artifacts):

- Run the application inside script(1), try to reduce the problem and
  send me the log file.
- In the mean time, you can run `vidcontrol -T cons25' and `export
  TERM=cons25' so you can run applications the same way you did before.
  You can also build your kernel with `options TEKEN_CONS25' to make all
  virtual terminals use the cons25 emulator by default.

Discussed on:	current@
2009-11-13 05:54:55 +00:00
Navdeep Parhar
a9c23ef044 Don't disable the XGMAC's tx on ifconfig down. It is unnecessary
and can cause false backpressure in the chip.  Fix a us/ms mixup
while here.
2009-11-13 00:37:29 +00:00
Navdeep Parhar
3cb33003ce The 10GBASE-T card should use an IPG of 1. Also enable the check
for low power startup on this card.
2009-11-13 00:34:28 +00:00
Navdeep Parhar
1fa10c920e Make sure *some* edc is setup even for an unknown transceiver (assume
it is optical).
2009-11-13 00:31:51 +00:00
Navdeep Parhar
7ead19d4a8 sc->rev and is_offload(sc) will always be 0 during probe. Wait till
attach to get correct values.
2009-11-13 00:28:16 +00:00
Jung-uk Kim
2f28bf307c - Remove a redundant check for dpms(4).
- Test a cheaper function first.
2009-11-12 18:16:35 +00:00
Jung-uk Kim
bf71c25f87 - Partially revert hackish r198964 and r199002.
- Add a proxy driver vgapm to help vgapci to save/load VGA state.
- Move device_set_desc() to the right place while we are here.

Reviewed by:	jhb
2009-11-12 17:56:56 +00:00
John Baldwin
f140aad88c More consistent whitespace. 2009-11-11 20:29:40 +00:00
John Baldwin
58fbe5ab67 Use a dedicated callout to drive the transmit watchdog timer instead of
using if_watchdog and if_timer.

Tested by:	gavin
2009-11-11 20:27:53 +00:00
Jack F Vogel
466727ddbe With an i386 kernel the igb driver can cause a
page fault panic on initialization due to a large
number of bounce pages being allocated. This is due
to the dma tag requiring page alignment on mbuf mapping.
This was removed some time back from the ixgbe driver
and is not needed here either.
2009-11-11 19:13:40 +00:00
Alexander Motin
30a4094f86 MFp4:
- Move tagged queueing control from ADA to ATA XPT. It allows to control
  device command queue length correctly. First step to support < 32 tags.
- Limit queue for non-tagged devices by 2 slots for ahci(4) and siis(4).
- Implement quirk matching for ATA devices.
- Move xpt_schedule_dev_sendq() from header to source file.
- Move delayed queue shrinking to the more expected place - element freeing.
- Remove some SCSIsms in ATA.
2009-11-11 11:10:36 +00:00
Alexander Motin
8e57bf8357 MFp4:
Add set of chip IDs, known to support AHCI.
2009-11-11 10:44:09 +00:00
Ed Schouten
3a8a07eadd Allow Syscons terminal emulators to provide function key strings.
xterm and cons25 have some incompatibilities when it comes to escape
sequences for special keys, such as F1 to F12, home, end, etc. Add a new
te_fkeystr() that can be used to override the strings.

scterm-sck won't do anything with this, but scterm-teken will use
teken_get_sequences() to obtain the proper sequence.
2009-11-11 08:20:19 +00:00
Nathan Whitehorn
b201cde68d Reduce probe priority of USB input devices to BUS_PROBE_GENERIC from
BUS_PROBE_SPECIFIC. This allows device-specific drivers like atp to
attach reliably.

Reviewed by:	hps
2009-11-11 03:17:51 +00:00
John Baldwin
3be4af9213 - Locking fixes to not do silly things like drop the lock only to call a
function that immediately reacquires the lock.  Also removes recursive
  locking.
- Use the statistics timer to drive the transmit watchdog instead of using
  if_watchdog and if_timer.

Tested by:	gavin
2009-11-10 22:04:19 +00:00
Pyun YongHyeon
5c1da2fac0 Controller does not update Tx descriptors(send BDs) after sending
frames so remove unnecessary BUS_DMASYNC_PREREAD and
BUS_DMASYNC_POSTREAD of bus_dmamap_sync(9).
2009-11-10 20:29:20 +00:00
Nathan Whitehorn
d7f3684090 Add support for the touchpads found in later models of iBook and
Powerbook.

Reviewed by:	Rohit Grover <rgrover1 at gmail.com>
2009-11-10 19:14:06 +00:00
Alexander Motin
03a6387ec3 MFp4:
Organize device IDs and add some more of them.
2009-11-10 09:46:52 +00:00
Pyun YongHyeon
e6bf277eff Zero out Tx/Rx descriptors before using them. Also add missing
bus_dmamap_sync(9) after Tx descriptor initialization.
2009-11-09 23:09:18 +00:00
Pyun YongHyeon
aa94f33338 Add missing bus_dmamap_sync(9) before issuing kick command. 2009-11-09 22:58:30 +00:00
Roman Divacky
68c4dfdf0c Make isa_dma functions MPSAFE by introducing its own private lock. These
functions are selfcontained (ie. they touch only isa_dma.c static variables
and hardware) so a private lock is sufficient to prevent races. This changes
only i386/amd64 while there are also isa_dma functions for ia64/sparc64.
Sparc64 are ones empty stubs and ia64 ones are unused as ia64 does not
have isa (says marcel).

This patch removes explicit locking of Giant from a few drivers (there
are some that requires this but lack ones - this patch fixes this) and
also removes the need for implicit locking of Giant from attach routines
where it's provided by newbus.

Approved by:	ed (mentor, implicit)
Reviewed by:	jhb, attilio (glanced by)
Tested by:	Giovanni Trematerra <giovanni.trematerra gmail com>
IA64 clue:	marcel
2009-11-09 20:29:10 +00:00