Commit Graph

17252 Commits

Author SHA1 Message Date
Warner Losh
c6ac76ad73 Fix the media auto code by breaking it :-). Auto now just means 'use
10BaseT' since it required 10BaseT to have carrier to switch to it.
This chip makes it hard to do proper auto, so we don't do it.  We
can't test carrier on things easily.

Don't insist on carrier when we set the media.  Don't report failures.
Remove a 1s! delay that appears to not be needed.

With these patches, and John Baldwin's patches, I'm able to pass
packets on my IBM EtherJet card again.
2008-06-05 05:51:19 +00:00
John Baldwin
214b852cd9 Style(9) xe(4). The MD5 sums are different, but comparing the dissassemblies
the only changes are from gcc moving some global variables around slightly.
2008-06-04 20:26:57 +00:00
John Baldwin
69d39da3c0 Gah, always reset the timer for the watchdog check. 2008-06-04 19:33:23 +00:00
John Baldwin
d0b2ae8f20 - Split the interrupt handler up into separate subroutines for rx, tx, and
MAC events.
- Use bus_*() rather than bus_space_*() and remove the bus space tag and
  handle from the softc.
- Retire unused macros for examining CIS tuples.
2008-06-04 15:19:58 +00:00
Kevin Lo
974d3a246e Add device IDs for Ricoh R5U870-based OEM cameras 2008-06-04 10:36:24 +00:00
Warner Losh
9018f9625d o Improve the probe code dealing with interrupts.
o When forced to be 10baseT, don't require that the 10baseT interface
  have link to succeed.  Still require it for IFM_AUTO, however, since it
  appears that there's no way to tell if a specific type of interface
  worked.  I'm doing a web search for a datasheet now to see if there's
  anything obvious.
o Minor incidental formatting nits, including collapsing code of the form
	if (foo) {
		bar();
	} else {
		if (baz)
			bing();
	}
  into:
	if (foo) {
		bar();
	} else if (baz) {
		bing();
	}
  to save an indentation level.
o Remove stray reference to 3.x config file syntax.

# I believe John's patches still apply after this...
2008-06-04 06:07:13 +00:00
John Baldwin
b307ca883c - Change the watchdog timer logic to match other drivers that use their own
timer by keeping a once-a-second timer running that decrements a counter
  similar to if_timer and reset the chip if it gets down to zero via the
  decrement.
- Use IFQ_SET_MAXLEN().
2008-06-03 20:40:33 +00:00
Warner Losh
b56700df65 Correct logic error that would prevent cs pccards from working on
systems where the CardBus bridge was connected to a APIC.  The case
where the probe routine is told to not setup the IRQ was mishandled
but the error was masked in the case where the IRQ was a valid one
for the card.

MFC after:	1 week
2008-06-03 05:47:28 +00:00
Alexander Kabaev
e476ebf3d5 Add device ID for AnyDATA ADU-500A EV-DO modem.
Submitted by: Oleksandr Tatmanyants
PR: 118479
2008-06-03 03:31:53 +00:00
Alexander Kabaev
721234d1f6 Add vendor/device IDs for Novatel U740 repackaged by Dell.
Submitted by: David Gilbert
PR: 122803
2008-06-03 03:13:57 +00:00
Coleman Kane
e97f228a10 Update if_ndis to remove the legacy if_watchdog interface and
bring it more up to date. The watchdog timer, and its
associated code, is all collapsed into the ndis_tick function
that was implemented for the NDIS-subsystem watchdog. This
implementation is similar to what numerous other drivers use
to implement the watchdog.

Reviewed by:	thompsa, jhb
MFC after:	2 weeks
2008-06-03 00:55:48 +00:00
John Baldwin
36d05d0ebc Make fe(4) MPSAFE:
- Add a mutex to the softc to protect the softc and device hardware.
- Don't leak bus resources if if_alloc() fails during attach.
- Setup the interrupt handler after calling ether_ifattach().
- Use a private timer to manage the transmit watchdog.

Tested by:	 WATANABE Kazuhiro  CQG00620 of nifty.ne.jp
2008-06-02 19:58:48 +00:00
John Baldwin
9bd9b181ca Add locking and make xe(4) MPSAFE:
- Add a mutex to protect the softc and device hardware.
- Use a callout rather than a callout_handle for the media timer.
- Use a dedicated timer for managing the tx watchdog rather than if_timer.
- Fix some resource leaks if xe_attach() fails.
- Shutdown the device before detaching the driver.
- Setup the interrupt handler after ether_ifattach().

Tested by:	Ian FREISLICH  ianf of clue.co.za
2008-06-02 19:43:24 +00:00
John Baldwin
00f1da89ab Make ie(4) MPSAFE:
- Add a mutex to the softc and use it to protect the softc and device.
- Setup the interrupt handler in the common code instead of in each front
  end and do it after ether_ifattach().
- Use ie_stop() and ieinit_locked() in iereset() rather than frobbing IFF_UP
  and invoking ieioctl().
- Use DELAY() to implement a spin loop on a register with a timeout rather
  than scheduling a timeout and then doing a tight spin on the register.
  In the non-MPSAFE case this would never have worked because the spinning
  code held Giant and the timeout routine would have been blocked on Giant
  forever.  The same approach would not worke in the MPSAFE case either for
  the same reason, hence use a loop around DELAY().
- Clear IFF_DRV_(RUNNING|OACTIVE) in ie_stop() rather than in callers.
- Call ieinit_locked() directly rather than ieioctl(!) from ie_mc_reset().
- Don't leak the rx frame buffer on detach.

Tested by:	Thierry Herbelot  thierry of herbelot.com
2008-06-02 19:17:40 +00:00
Warner Losh
f791dd06c2 Slight simplification of the power parsing code, as well as using
autoincrement in some places where it makes sense.  This makes this .o
about 180 bytes smaller on x86 and amd64 with no apparent functional
changes.
2008-06-01 20:55:34 +00:00
Philip Paeps
be38401738 Try to detect a Synaptics touchpad before IntelliMouse. Some touchpads will
pretend to be IntelliMouse (which have a few more features than generic mice)
causing the IntelliMouse probe to work and the Synaptics code never to be
called.

This should not break "real" IntelliMouse because the Synaptics detection code
is fairly specific.

PR:		kern/120833
Submitted by:	Eygene Ryabinkin <rea-fbsd -at- codelabs.ru>
MFC after:	1 week
2008-06-01 13:44:51 +00:00
Sam Leffler
faaedb30ca 5416 and similar chips grew another region in the pci clock domain
where register accesses do not pass through the byte-lane hardware;
extend the register op macros to deal with this

MFC after:	1 week
2008-05-31 22:44:06 +00:00
Remko Lodder
1388635ca5 Import rewritten nve device id's, which brings this more
inline with if_nfe.

PR:		110883
Submitted by:	Claudel <regis at claudel dot ch>
Approved by:	imp (mentor, implicit)
MFC after:	1 week
2008-05-31 14:17:36 +00:00
John Baldwin
8b461b2ba1 Remove various and sundry NetBSDism's in preparation for adding locking. 2008-05-30 21:48:05 +00:00
John Baldwin
f720694bc3 Trim an extra semi-colon. 2008-05-30 18:26:37 +00:00
John Baldwin
f115052111 Fix build with DEBUG defined.
Reported by:	tinderbox
2008-05-30 16:22:30 +00:00
Weongyo Jeong
e54b92f37b Fix a panic that it's occurred when NDIS init handler returned a error
by unknown reasons.   In this case, sc->ifp is still NULL so it will
cause a page fault during calling ndis_detach()
2008-05-30 07:17:51 +00:00
Benno Rice
0aefb0a63c The XScale PXA255 has three generally ns16x50 compatible UARTs. One of the
variations from normal 16x50 behaviour however is the the use of a normally
unused bit of IER to control RX timeout interrupts independently of the
generally used RXRDY bit.  If this bit is not enabled, we only ever get
interrupts when the FIFO is full, never before.  This is not very useful when
the UART is being used as a console.

In order to support this without causing potential problems on more "normal"
16x50 variants, this change introduces two hints for the uart device, ier_mask
and ier_rxbits.  These can be used to override which bits get set and cleared
when we're enabling and disabling RX interrupts.

Reviewed by:	marcel
2008-05-30 01:57:13 +00:00
John Baldwin
3022250a49 Use if_printf() and if_xname and retire 'unit' from the softc. 2008-05-29 17:32:55 +00:00
Ed Schouten
06d425f92e Remove the distinction between device minor and unit numbers.
Even though we got rid of device major numbers some time ago, device
drivers still need to provide unique device minor numbers to make_dev().
These numbers are only used inside the kernel. They are not related to
device major and minor numbers which are visible in devfs. These are
actually based on the inode number of the device.

It would eventually be nice to remove minor numbers entirely, but we
don't want to be too agressive here.

Because the 8-15 bits of the device number field (si_drv0) are still
reserved for the major number, there is no 1:1 mapping of the device
minor and unit numbers. Because this is now unused, remove the
restrictions on these numbers.

The MAXMAJOR definition was actually used for two purposes. It was used
to convert both the userspace and kernelspace device numbers to their
major/minor pair, which is why it is now named UMINORMASK.

minor2unit() and unit2minor() have now become useless. Both minor() and
dev2unit() now serve the same purpose. We should eventually remove some
of them, at least turning them into macro's. If devfs would become
completely minor number unaware, we could consider using si_drv0 directly,
just like si_drv1 and si_drv2.

Approved by:	philip (mentor)
2008-05-29 12:50:46 +00:00
Kirk McKusick
1454b5785e The SIIG 4 port serial card based on the Oxford OX16PCI954 is
clocked at 10x normal speed. That is, when you set it for 9600
baud, it actually does 96000 baud. In order to make it plug and
play with other serial ports, it has to have its clock rate
reduced by a factor of 10.

Discussed with: Marcel Moolenaar
MFC after:	2 weeks
2008-05-29 07:15:52 +00:00
Sam Leffler
e387d629b8 correct rx radiotap channel flags construction for 11n frames 2008-05-29 00:14:35 +00:00
Sam Leffler
d3ac945bb4 Cleanup power handling and fix suspend/resume:
o do not put the chip into full sleep in ath_stop as it gains
  nothing and causes many parts to hang in ath_detach because we
  may touch the chip during vap teardown; this may also fix issues
  with unloading the module
o add a note in ath_detach to explain ath_hal_detach puts the
  chip in low power mode; this is useful to know as it means
  unloading the module will place a pci device in the lowest
  possible power state
o leave an #ifdef notyet marker for powering down the chip when
  a device is marked down; we can't do that until we handle all
  the ways the driver may be entered and touch the chip
o fix resume by reloading the h/w key cache as it's been clobbered
  (for pci) by the socket being powered off; for station mode we
  directly stop+init the chip and then simulate a beacon miss to
  get the upper layers sync'd up; for other configs we must brute
  force stop+start the vaps so they go through the state machine
2008-05-29 00:10:48 +00:00
Sam Leffler
71b8507770 close a race on detach by reordering bpfdetach and taskqueue_free 2008-05-28 23:55:11 +00:00
Sam Leffler
4df6277969 send EAPOL frames at the same rate used for mgt frames 2008-05-28 23:41:40 +00:00
Doug Ambrisko
46fb79ea72 Add support to talk to the LSI ioctl path on with FreeBSD 32 bit app's
on amd64.  Note the only difference is the iovec32 part so I use the
native structure for everything else.

Also I plan to MFC all the changes in -current to 7-stable and 6-stable
shortly since I've been running them.  This does not include the cam
changes.

MFC after:	3 days
2008-05-28 23:19:27 +00:00
John Baldwin
4cef699e97 Grr, restore some useful comments that were only in the NetBSD code. 2008-05-28 19:47:08 +00:00
John Baldwin
70194343be Remove NetBSD and FreeBSD 4.x code from this driver in preparation for
adding locking, etc.
2008-05-28 19:44:46 +00:00
Ariff Abdullah
2bc599822b Release pcm mutex before calling snd_clone_unref(), which in turns might
calling destroy_dev() with sleepable malloc(9). The entire opetation
is being serialized through pcm cv from top down, so dropping mutex is
rather safe.

Reported by:	delphij
2008-05-27 02:16:05 +00:00
Pyun YongHyeon
a5ebadc632 Add driver support for PCIe adapters based on JMicron JMC250
gigabit ethernet and JMC260 fast ethernet controllers. ATM jme(4)
supports all hardware features except RSS and multiple Tx/Rx queue.

In these days most ethernet controller vendors take a ply of
concealing hardware detailes from open source developers. As
contrasted with these vendors JMicron provided all necessary
information needed to write a stable driver during driver writing
and answered many questions I had. They even helped fixing driver
bugs with protocol analyzer. Many thanks to JMicron for their
support of FreeBSD.

H/W donated by:	JMicron
2008-05-27 01:42:01 +00:00
Pyun YongHyeon
6021a944af Add JMicron JMP202/JMP211 PHY driver. 2008-05-27 01:16:40 +00:00
Søren Schmidt
454f3b9249 Dont call ata_start() when ata_reinit fails in the ioctl path. 2008-05-26 08:58:48 +00:00
Xin LI
9f2c7365ab We can not call iwn_start directly in the interrupt
context, where the iwn mutex is being held, and
iwn_start assumes that we do not have that mutex held.

Resolve this issue with what we do for other NICs by
splitting the iwn_start procedure into two parts,
iwn_start() do the locking, and iwn_start_locked()
assumes that the mutex is being held.  This resolves
panic when WITNESS is enabled.
2008-05-26 07:40:14 +00:00
Robert Watson
e4372ceba0 Remove netatm from HEAD as it is not MPSAFE and relies on the now removed
NET_NEEDS_GIANT.  netatm has been disconnected from the build for ten
months in HEAD/RELENG_7.  Specifics:

- netatm include files
- netatm command line management tools
- libatm
- ATM parts in rescue and sysinstall
- sample configuration files and documents
- kernel support as a module or in NOTES
- netgraph wrapper nodes for netatm
- ctags data for netatm.
- netatm-specific device drivers.

MFC after:	3 weeks
Reviewed by:	bz
Discussed with:	bms, bz, harti
2008-05-25 22:11:40 +00:00
Ed Schouten
166eef7229 Change my email address to the one from the FreeBSD project.
Approved by:	philip (mentor)
2008-05-24 18:35:55 +00:00
Kevin Lo
c730aefff3 Add codec id for Sigmatel STAC9872AK
Reviewed by:	ariff
2008-05-22 09:14:12 +00:00
Andrew Thompson
244117df45 Giant is no longer required and can not be held over kproc_exit(). 2008-05-21 23:04:10 +00:00
Jack F Vogel
458575f87d Thanks to report from Neil Hoggarth I found a missing UNLOCK in
the watchdog code. This delta also incorporates some missing PCI
IDs that got added.

PR 122928 - might be fixed by this, no verification at this point.
2008-05-21 21:06:17 +00:00
Pawel Jakub Dawidek
7840976da5 Drop Giant before calling kproc_exit(), so we don't trigger assertion in
kproc_exit().

Discussed with:	imp
2008-05-20 12:34:30 +00:00
Pawel Jakub Dawidek
661812c066 Add ID for T61p, which is not IBM really, but well. 2008-05-20 12:26:45 +00:00
Kevin Lo
774ba0453e Add support for controlling the audio power
Tested on:	VGN-SZ79TN
2008-05-20 06:32:07 +00:00
Jack F Vogel
77d4244f22 This small change will allow this driver in HEAD to build
on 6.3 as well as 7 :)
2008-05-19 23:01:11 +00:00
Pyun YongHyeon
16199571c5 Add age(4), a driver for Attansic/Atheros L1 gigabit ethernet
controller. L1 has several threshold/timer registers and they
seem to require careful tuned parameters to get best
performance. Datasheet for L1 is not available to open source
driver writers so age(4) focus on stability and correctness of
basic Tx/Rx operation. ATM the performance of age(4) is far from
optimal which in turn means there are mis-programmed registers or
incorrectly configured registers.
Currently age(4) supports all known hardware assistance including
  - MSI support.
  - TCP Segmentation Offload.
  - Hardware VLAN tag insertion/stripping.
  - TCP/UDP checksum offload.
  - Interrupt moderation.
  - Hardware statistics counter support.
  - Jumbo frame support.
  - WOL support.

L1 gigabit ethernet controller is mainly found on ASUS
motherboards. Note, it seems that there are other variants of
hardware as known as L2(Fast ethernet) and newer gigabit ethernet
(AR81xx) from Atheros. These are not supported by age(4) and
requires a seperate driver. Big thanks to all people who reported
feedback or tested patches.

Tested by:	kevlo, bsam, Francois Ranchin < fyr AT fyrou DOT net >
		Thomas Nystroem < thn AT saeab DOT se >
		Roman Pogosyan < asternetadmin AT gmail DOT com >
		Derek Tattersal < dlt AT mebtel DOT net >
		Oliver Seitz < karlkiste AT yahoo DOT com >
2008-05-19 01:39:59 +00:00
Pyun YongHyeon
d1307e812e Add Attansic/Atheros F1 PHY driver. 2008-05-19 01:12:10 +00:00
Remko Lodder
5d6ab21196 Add support for the Epson 4800 scanner.
PR:		118391
Submitted by:	"Pedro F. Giffuni" <giffunip at tutopia dot com>
Approved by:	imp (mentor, implicit)
MFC after:	3 days
Committed at:	BSDCan 2008
2008-05-18 03:07:40 +00:00