Commit graph

11632 commits

Author SHA1 Message Date
Doug Rabson 04fa3b29f5 Add configuration rom entries for IP over firewire. 2004-06-13 13:58:00 +00:00
MIHIRA Sanpei Yoshiro ee0f521c12 To support the promiscuous mode udav(4) driver
PR:		kern/67862
Submitted by:	WATANABE Shingo <nabe@nabechan.org>
2004-06-13 11:22:58 +00:00
Doug Rabson b8b3323469 Add a new driver to support IP over firewire. This driver is intended to
conform to the rfc2734 and rfc3146 standard for IP over firewire and
should eventually supercede the fwe driver. Right now the broadcast
channel number is hardwired and we don't support MCAP for multicast
channel allocation - more infrastructure is required in the firewire
code itself to fix these problems.
2004-06-13 10:54:36 +00:00
Scott Long 1da2ceea66 Get rid of UMA zones and instead allocate all ecb's up front and track them
in a TAILQ.  Re-arrange some of the ecb elements so that they can stay
stable through alloc/free cycles while the rest get bzero'd.

- Use the tag_id from the ecb rather than fro the ccb.  The latter is only
for target mode.

- Honor the ccb flags for tag_action when deciding whether to do a tagged
or untagged transaction.

- Re-arrange autosense completion so that it works correctly in failure
cases.

- Turn on the PI_TAG_ABLE flag so that CAM will send us tagged transactions.

This enables tagged queueing in the driver.
2004-06-13 09:08:44 +00:00
John-Mark Gurney 0ddcf11c52 make code less broken, only try to create unit 0 since there can only
be one, this will help prevent multipling devices if this driver is
ever loaded/unloaded multiple times...

Prodded by:	julian
2004-06-13 05:00:19 +00:00
Scott Long fec4efc10b When autosense is retrieved, tell CAM about it instead of juust pretending
that the command succeeded.  Sheesh!  This makes CDROMs no longer cause an
instant panic at boot.  Thanks to Jake Burkholder for providing a remote
test setup.
Also make device resets work, thanks to another typo.
2004-06-12 05:19:17 +00:00
Scott Long 76ff08d072 Correct typo from previous commit. 2004-06-12 03:23:37 +00:00
Marius Strobl 093caf3332 Back out 1.23 until I figure out why it causes Netra t1 100 to no longer
pass any traffic. Unfortunately this means no full-duplex link with auto-
negotiation on hme(4) using DP83840A PHYs again.
I really thought I had tested this also on a Netra t1 100...
2004-06-12 02:23:06 +00:00
Jens Schweikhardt d809991124 Style cleanup. 2004-06-11 18:47:44 +00:00
Vinod Kashyap 75e4d88db4 Fix for a problem seen only on 6xxx series controllers, where-in the
driver tries to submit the same request repeatedly, on finding the
controller cmd queue to be full.

Submitted by:ps, vkashyap
Reviewed by:re
Approved by:re
2004-06-11 18:42:44 +00:00
Jens Schweikhardt 37522eed80 * Fix typo in comment.
* remove extraneous semicolon between function definitions.
* vm_offset_t is not a pointer, so return 0, not NULL. This
  fixes two warnings.
2004-06-11 17:51:37 +00:00
Scott Long 13bbbdd9c2 Make the XPT_CALC_GEOMETRY op dependent on the sc_extended_geometry flag
that is set in the bus front-end.
2004-06-11 15:33:20 +00:00
Poul-Henning Kamp 1930e303cf Deorbit COMPAT_SUNOS.
We inherited this from the sparc32 port of BSD4.4-Lite1.  We have neither
a sparc32 port nor a SunOS4.x compatibility desire these days.
2004-06-11 11:16:26 +00:00
Søren Schmidt 68599b781f Back out the last change as that broke some SATA devices.
Now we are cleaing up remove a few lines of unused code.
2004-06-11 07:39:15 +00:00
Eric Anholt 3ba181deb2 Merge from DRI CVS as of 2004-05-26. Most of the meat is new PCI IDs and a new
packet for Radeon.
2004-06-11 03:26:59 +00:00
Marius Strobl 543912b386 Remove second <sys/cdefs.h> and __FBSDID. 2004-06-10 22:15:51 +00:00
Marius Strobl 397f6b1e7f Add a first version of a pcf(4) front-end for the Sun i2c devices ("i2c"
is the actual name here) on EBus and which are PCF8584 (on systems having
a boot-bus controller the i2c are said to not be a PCF8584). Similar to the
SUNW,envctrl devices, onboard slaves for monitoring fans, temperatures and
such hang off of these i2c devices. But there's also stuff like EEPROMs
housing the hostid of the system and the boards usally have a connector to
add custom slave devices (on CP1500 there's actually a second PCF8584 with
its own I2C bus for these).
This driver already works fine but I'm not yet sure if access to the slave
devices on CP1400/CP1500 marked as "reserved for factory use" in the docs
should be blocked (most likely these are the voltage controllers wich aren't
meant to be controller by software and even not by the firmware). Once the
issues with polled mode are fixed in the common pcf(4) part in pcf.c, this
front-end should probably honour the poll-mode property of the i2c devices.
Tested on Ultra AXe and CP1500 (Netra t1 100).

OK'ed by:	joerg, nsouch
2004-06-10 21:56:52 +00:00
Marius Strobl a9f012c75d - Add missing <sys/module.h>.
- Use "envctrl" as the name when registering this module rather than "pcf";
  we can't have "pcf" as the name for all pcf(4) front-ends or we would get
  conflicts.

OK'ed by:	joerg
2004-06-10 21:53:04 +00:00
Marius Strobl cdd89aebf5 - Add missing <sys/module.h>.
- s,pcf_,pcf_isa, to better reflect the purpose of this front-end and to
  avoid conflicts.
- Don't use this front-end for attaching to EBus, declaring it as an EBus
  driver was a cut&paste accident according to joerg.

OK'ed by:	joerg, nsouch
2004-06-10 21:51:39 +00:00
Marius Strobl f2ce1eaef9 - #define\tFOO\tBAR
- Remove two tabs from an otherwise empty line.

OK'ed by:	nsouch
2004-06-10 21:48:51 +00:00
John Baldwin 092a5c4530 Remove atdevbase and replace it's remaining uses with direct references to
KERNBASE instead.
2004-06-10 20:31:00 +00:00
Roman Kurakin 2a8436eae5 Free tty at detach().
Tested by:	`pstat -t`
Requested by:	phk
2004-06-10 13:50:28 +00:00
Scott Long c31d0cf77b Port the NetBSD esp(4) driver. This only includes the sbus front-end, so
its primary use is for the FEPS/FAS366 SCSI found in Sun Ultra 1e and 2
machines.  Once the pci front-end is ported, this driver can replace the
amd(4) driver.

The code as-is is fairly stable.  I've disabled tagged-queueing until I can
figure out a corruption bug related to it.  I'm importing it now so that
people with these machines can (finally) stop netbooting and report bugs
before 5.3.
2004-06-10 05:11:39 +00:00
Ian Dowse f2b2cfdac0 Initialise `restartcnt' in the newly malloc'd usbd_port structure,
as otherwise the junk it contains may cause uhub_explore to give
up without ever trying to restart the port. This fixes the following
errors I was seeing with a VIA UHCI controller:

	uhub0: port error, restarting port 1
	uhub0: port error, giving up port 1
2004-06-10 01:13:26 +00:00
Marius Strobl 9d3be787c2 - Add a LLADDR() forgotten in the conversion to ether_crc32_le().
- Remove a variable no longer used after the conversion.
- While here, save on another one no longer really necessary after the
  conversion.
2004-06-10 00:06:04 +00:00
Marius Strobl c240bd8cf8 - Remove a variable no longer used after the conversion to ether_crc32_le().
- While here, save on another one no longer really necessary after the
  conversion.
2004-06-10 00:04:16 +00:00
Roman Kurakin daac3fffc8 Check if we control device. Else we will go to panic cause we don't have
properly initialized dev_t structure at open.
2004-06-09 17:58:51 +00:00
Warner Losh 09f3862add When adding files to the repo, it is very important to not forget
the cvs add function.
2004-06-09 16:56:22 +00:00
Warner Losh 6732641e0a Step 1 in moving EISA devices to kobj/newbus. Use kobj methods for
all of the interface between the driver and the bus.  This will enable
us to stop special casing eisa bus attachments in modules and treat them
like we treat all other busses.

In the longer run, we need to eliminate much (all?) of these interfaces
and switch to using the standard bus_alloc_resource(), but that's not
done right now.

# I've not updated the modules to include eisa, etc, just yet

Tested on: Compaq Proliant 3000/333 purchased for eisa work
2004-06-09 16:08:20 +00:00
Bill Paul da3003f09a Add some special case code to fix a problem with the BCM5704 in TBI (fiber)
mode. The 5704 apparently has some s00p3r s33kr1t registers for setting
the advertisement of pause frame ability (i.e flow control) when in
autoneg mode. If we don't set these registers correctly, we may not
be able to negotiate a proper link with some switches. (Symptom is that
the NIC reports the link as up (PCS synched) but no traffic can be
exchanged.)

PR:		kern/67598
2004-06-09 16:01:59 +00:00
Christian Weisgerber 0e939c0cea Replace handrolled CRC calculation with ether_crc32_[lb]e(). 2004-06-09 14:34:04 +00:00
Warner Losh 8c81529f45 Only match cards that claim to be network cards. I've had two
different cards that matched vendor/id, but weren't wi cards.  This is
because the vendor foolishly didn't have unique product ids.  Symbol
has a serial card that would otherwise match the wi driver, for
example...

Taken from a patch for xe posted by: Carlos Velasco
2004-06-09 06:31:40 +00:00
Christian Weisgerber ea48e26883 Replace convoluted and broken CRC calcuation with ether_crc32_le().
This should fix multicast reception.
2004-06-09 00:30:11 +00:00
Christian Weisgerber 1d5056708c * Fix multicast reception.
* Replace handrolled crc calculation with ether_crc32_le().

Based on:

PR:		67544
Submitted by:	HASHI Hiroaki <hashiz@tomba.cskk-sv.co.jp>
2004-06-09 00:25:44 +00:00
Joerg Wunsch a91a792fed Implement the BREAK_TO_DEBUGGER option for sab(4). 2004-06-08 11:58:34 +00:00
Roman Kurakin a5d60d8852 1. struct tty => struct tty *tty.
Requested by:	phk
2004-06-08 10:38:20 +00:00
Nate Lawson 1f36889f63 Remove accidental change. 2004-06-07 21:44:01 +00:00
Nate Lawson 45e556cc69 Avoid printing extraneous warning messages when trying to switch a device
which doesn't support ACPI power states.  Return AE_NOT_FOUND for these
cases and don't print the warning message.  Also, print the name of the
handle instead of device when unable to switch states.  The device is often
not attached at this point and so its name is NULL, which doesn't help
debugging.
2004-06-07 21:39:15 +00:00
Poul-Henning Kamp 5df76176f7 Make linesw[] an array of pointers to linedesc instead of an array of
linedisc.
2004-06-07 20:45:45 +00:00
John Baldwin 4dc4ea2604 - Use PCI_INVALID_IRQ macro rather than a magic number.
- Remove obsolete comment about APIC_IO routing.
2004-06-07 17:36:22 +00:00
Bill Paul cdd83ba354 Add an entry to the PCI ID list to support the serial interface on the
Broadcom 802.11g/GPRS CardBus card.

Submitted by:	Yann Berthier yb at sainte-barbe dot org
2004-06-07 16:33:47 +00:00
Don Lewis 144a53875b Nuke a cryptic and useless diagnostic printf(). 2004-06-07 12:25:14 +00:00
MIHIRA Sanpei Yoshiro 55184d950a Sync to 1.181 of usbdevs 2004-06-05 21:36:06 +00:00
MIHIRA Sanpei Yoshiro 7c48241358 Add support Sony/Ericsson SEMC DSS-20 SyncStation,
which can be used to communicate with the P900 mobile phone.

PR:		misc/67606
Submitted by:	Christian Gusenbauer <c47g@gmx.at>
MFC after:	1 week
2004-06-05 21:33:59 +00:00
Paul Saab a54e98d365 Document the 64bit version of blocks_to_recover for logical drive status.
Pad the struct to 1024 bytes as defined in the firmware spec.
2004-06-05 18:31:04 +00:00
Paul Saab b612d5e1ea Add pci id's for the SmartArray 6422 and V100 controllers. Also
add a whole bunch of pci id's for future controllers.

Submitted by:	John Cagle <first.last@hp.com>
2004-06-05 18:12:56 +00:00
MIHIRA Sanpei Yoshiro 157077e99b Sync to 1.180 of usbdevs 2004-06-05 13:37:54 +00:00
MIHIRA Sanpei Yoshiro a9ec4ac997 Add device ID for atuwi USB wlan driver, AWL400 Wireless adapter.
(Atmel at76c503a http://vitsch.net/bsd/atuwi)

PR:		kern/67254
Submitted by:	Arjan van Leeuwen <avleeuwen@piwebs.com>
2004-06-05 13:36:10 +00:00
Nate Lawson 0e4148688c Don't forget to pass shutdown events down to children first now that we
handle them at the bus level too.
2004-06-05 09:56:04 +00:00
Nate Lawson 169b539a33 Disable wake GPEs in the reboot path as well as poweroff path. This fixes
"stray irq 9" messages on my Thinkpad.  It may also help with general
reboot consistency although the recent hang on reboot was solved by
acpi_cpu.c rev 1.39.
2004-06-05 07:25:58 +00:00
Nate Lawson a2afe45a8a Rework acpi_cpu_idle() to select the next idle state before sleeping, not
after.  Unify the paths for all Cx states.  Remove cpu_idle_busy and
instead do the little profiling we need before re-enabling interrupts.
Use 1 quantum as estimate for C1 sleep duration since the timer interrupt
is the main reason we wake.

While here, change the cx_history sysctl to cx_usage and report statistics
for which idle states were used in terms of percent.  This seems more
intuitive than counters.  Remove the cx_stats structure since it's no
longer used.  Update the man page.

Change various types which do not need explicit size.
2004-06-05 07:02:18 +00:00
MIHIRA Sanpei Yoshiro 4845af6ce0 Sync to 1.179 of usbdevs 2004-06-05 05:25:16 +00:00
MIHIRA Sanpei Yoshiro b9ebb45a96 Add support Neodio-3260 8-in-1 multi format USB memory card / flash controller
PR:		kern/67115
Submitted by:	Jukka A. Ukkonen <jau@iki.fi>
MFC after:	1 week
2004-06-05 05:23:46 +00:00
Dag-Erling Smørgrav 63eaecc921 Take advantage of the dev sysctl tree.
Approved by:	wpaul
2004-06-04 22:24:46 +00:00
Poul-Henning Kamp 13e84a71e0 Centralize the line discipline optimization determination in a function
called ttyldoptim().

Use this function from all the relevant drivers.

I belive no drivers finger linesw[] directly anymore, paving the way for
locking and refcounting.
2004-06-04 21:55:55 +00:00
Poul-Henning Kamp fe3ec6224a Manual edits to change linesw[]-frobbing to ttyld_*() calls. 2004-06-04 20:04:52 +00:00
Paul Saab bbfb452827 Update logical drive structure 2004-06-04 17:22:13 +00:00
Peter Wemm f2b6954343 Work around the preemption problem in acpi_cpu.c for shutting down.
Submitted by:  nate / jhb
2004-06-04 17:03:18 +00:00
Yaroslav Tykhiy 3e4482412b Implement support for controlling VLAN_HWTAGGING through ioctl(SIOCSIFCAP).
This includes not only toggling the flag in if_capenable, but also really
reconfiguring the hardware.

Approved by:	tackerman (as the em(4) maintainer)
2004-06-04 16:57:18 +00:00
Maxime Henrion 0547806326 Make the emu10k1 pcm driver INTR_MPSAFE. The locking is modeled
exactly as done in the cmi driver.  I am quite confident this is
safe since I'm runing this for more than two weeks now, on an SMP
box.  A few people tested this patch for me successfully as well.
2004-06-04 16:42:33 +00:00
Poul-Henning Kamp 2140d01b27 Machine generated patch which changes linedisc calls from accessing
linesw[] directly to using the ttyld...() functions

The ttyld...() functions ar inline so there is no performance hit.
2004-06-04 16:02:56 +00:00
Poul-Henning Kamp e451f9b758 Make the remaining serial drivers call ttyioctl() rather than calling
the linedisc directly.
2004-06-04 08:02:37 +00:00
Bill Paul 55cfa737d7 Unbreak the Intel 2100 Centrino wireless driver (and probably others):
- In subr_ndis.c, my_strcasecmp() actually behaved like my_strncasecmp():
  we really need it to behave like the former, not the latter. (It was
  falsely matching "RadioEnable", which defaults to 1 with "RadioEnableHW"
  which the driver creates itself and to 0, because we were using
  strlen("RadioEnable") as the length to test. This caused the radio to
  always be turned off. :( )

- In if_ndis.c, only set IEEE80211_CHAN_A for channels if we actually
  set any IEEE80211_MODE_11A rates. (ieee80211_attach() will "helpfully"
  add IEEE80211_MODE_11A to ic_modecaps for you if you initialize any
  802.11a channels. This caused "ndis0: 11a rates:" to erroneously be
  displayed during driver load.)

- Also in if_ndis.c, when using TESTSETRATE() to add in any missing 802.11b
  rates, remember to OR the rates with IEEE80211_RATE_BASIC, otherwise
  comparing against existing basic rates won't match. (1, 2, 5.5 and
  11Mbps are basic rates, according to the 802.11b spec.) This erroneously
  cause 11Mbps to be added to the 11b rate list twice.
2004-06-04 04:43:36 +00:00
Poul-Henning Kamp 186f2b9e04 Add missing <sys/module.h> includes currently relying on nested include
in <sys/kernel.h>
2004-06-03 06:10:02 +00:00
Maxime Henrion 67fc050f0c Abstract the locking in fxp(4) a bit more by using macros for
mtx_assert() and mtx_owned(), as it is done in other places,
for instance proc locking.
2004-06-02 22:59:57 +00:00
Maxime Henrion 0f1db1d60f Use the device sysctl tree instead of rolling our own. Some of the
sysctls were global (hw.fxp_rnr and hw.fxp_noflow), all of them are
now per-device.  Sample output of "sysctl dev.fxp0" with this patch,
with the standard %foo nodes removed :

dev.fxp0.int_delay: 1000
dev.fxp0.bundle_max: 6
dev.fxp0.rnr: 0
dev.fxp0.noflow: 0
2004-06-02 22:52:18 +00:00
Scott Long 03b5fe51bf Collapse sync fib locking into normal i/o locking. The former didn't
protect the registers so it was trivially possible for a sync command and
i/o command to fight each other and confuse the controller.  Make the
sync fib alloc/release functions inline and remove the somewhat worthless
AAC_SYNC_LOCK_FORCE flag.  Thanks to Adil Katchi for helping me to track
this down in RELENG_4.
2004-06-02 18:15:48 +00:00
Max Khon 9455fe9a67 Remove extra semicolon. 2004-06-02 18:03:07 +00:00
Bill Paul a1b1f3821d Explicitly #include <sys/module.h> in these files too (they use
MODULE_DEPEND()).
2004-06-01 23:27:36 +00:00
Poul-Henning Kamp 9c01a318d2 A major overhaul of the nmdm(4) driver:
It was based on the pty(4) driver which as a tty side an a non-tty side.

Nmdm(4) seems to have inherited two symmetric sides from pty but
unfortunately they are not quite ttys.  Running a getty one one
side and tip on the other failed to produce NL->CRNL mapping for
instance.

Rip out the basically bogus cdevsw->{read,write} functions and rely
on ttyread() and ttywrite() which does the same thing.

Use taskqueue_swi_giant to run a task for either side to do what
needs to be done.  (Direct calling is not an option as it leads to
recursion.)  Trigger the task from the t_oproc and t_stop methods.

Default the ports to not ECHO.  Since we neither rate limiting nor
emulation, two ports echoing each other is a really bad idea, which
can only be properly mitigated by rate limiting, rate emulation or
intelligent detection.  Rate emulation would be a neat feature.

Ditch the modem-line emulation, if needed for some app, it needs
to be thought much more about how it interacts with the open/close
logic.
2004-06-01 22:53:00 +00:00
Poul-Henning Kamp 4b5f407579 Remove unused variable. 2004-06-01 19:02:51 +00:00
Scott Long 614c22b2a2 Commit the correct version of the patch from last night. This fixes an
immediate panic when doing any i/o, and it closes a completion race.
2004-06-01 15:50:11 +00:00
Poul-Henning Kamp 138fbf675a Gainfully employ the new ttyioctl in the trivial cases. 2004-06-01 13:49:28 +00:00
Søren Schmidt 86e711a393 When waiting for drive to become ready, reinit the request params as they
might get trashed by autosensing.
2004-06-01 12:28:45 +00:00
Søren Schmidt c83c43b66e Use the right cmd+errorcode if we are in autosense/not. 2004-06-01 12:26:08 +00:00
Poul-Henning Kamp be9bd88238 There is no need to explicitly call the stop function. In all likelyhood
->l_close() did it and ttyclose certainly will.
2004-06-01 11:57:15 +00:00
Poul-Henning Kamp a1cda79464 There is no need to explicitly call ttwakeup() and ttwwakeup() after
ttyclose() has been called.  It's already been done once by ttyclose,
and probably once by the line-discipline too.
2004-06-01 11:38:06 +00:00
Søren Schmidt 92b3fb2908 Only set and report error if not set already. 2004-06-01 11:37:24 +00:00
Søren Schmidt 541cd509d3 Dont retry on devices that left the system.
Ignore "fake" devices that has 0x7f status.
2004-06-01 11:34:46 +00:00
Poul-Henning Kamp bda4474a59 ttyclose() increments t_gen. Remove redundant increments in drivers. 2004-06-01 10:15:56 +00:00
Seigo Tanimura a5dc42def9 Axe the old midi drivers and framework. matk has developed a new
module-friendly midi subsystem to be merged soon.
2004-06-01 06:22:59 +00:00
Scott Long 397fa34f51 Collapse aac_map_command() into aac_startio(). Check the AAC_QUEUE_FRZN in
every iteration of aac_startio().  This ensures that a command that is
deferred for lack of resources doesn't immediately get retried in the
aac_startio() loop.  This avoids an almost certain livelock.
2004-06-01 05:32:26 +00:00
Nicolas Souchu 4f16b8b190 Necessary modifications do get pcf working again for ISA. Tested with
my Elektor card. Note that the hints are necessary to specify the
IO base of the pcf chip. This enables to check the IO base when the
probe routine is called during ISA enumeration.

The interrupt driven code is mixed with polled mode, which is wrong
and produces supposed spurious interrupts at each access. I still have
to work on it.
2004-05-31 14:24:21 +00:00
Takanori Watanabe 92fae6e79e Devclass have to be shared with same 'pcm' devclass, or
unit management will corrupt.
2004-05-31 11:38:46 +00:00
Scott Long 2c81db6cb5 Turn down the queue size by 8 until I can figure out why the 512th command
keeps on getting lost.
2004-05-30 22:40:28 +00:00
Poul-Henning Kamp 77409fe148 Add missing #include <sys/module.h> 2004-05-30 20:34:58 +00:00
Poul-Henning Kamp 5dba30f15a add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
Poul-Henning Kamp fe12f24bb0 Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
Poul-Henning Kamp f11d01c3bc Add missing <sys/module.h> includes 2004-05-30 20:00:41 +00:00
Poul-Henning Kamp 41ee9f1c69 Add some missing <sys/module.h> includes which are masked by the
one on death-row in <sys/kernel.h>
2004-05-30 17:57:46 +00:00
Scott Long dd83a01e81 Use a unique malloc type rather than M_DEVBUF. 2004-05-30 04:01:29 +00:00
MIHIRA Sanpei Yoshiro f7ec9a7547 check interface number
Kyocera AH-K3001V has 2 data interface.  But we could use only one
interface(id = 0)

PR:		kern/66779
Submitted by:	Togawa Satoshi <toga@puyo.org>
2004-05-30 01:48:04 +00:00
Marius Strobl 23465eaec2 In hme_init() call mii_mediachg() to make sure the current media is set.
This is part 2/2 of fixing autonegotiation on hme(4) using DP83840A PHYs.
It appears to also fix the occasional problems to establish a link on
hme(4) using LU6612 PHYs and shouldn't hurt on those using QS6612 PHYs.

Obtained from:	NetBSD
2004-05-29 18:29:53 +00:00
Marius Strobl f0e531572d DP83840A on hme(4) don't advertise their media capabilities themselves
properly. This causes the autonegotiation to e.g. never establish a
100baseTX full-duplex link. The solution to this problem is to manually
write the capabilities from the BMSR to the ANAR every time a media
change occurs, even when already in autonegotiation mode.
The NetBSD way of doing this is to set their MIIF_FORCEANEG flag in the
NIC driver. This causes mii_phy_setmedia() to call mii_phy_auto() (which
will set the ANAR according to the BMSR) even when the PHY alread is in
autonegotiation mode. However, while doing the same on FreeBSD (which
involves porting the MIIF_FORCEANEG flag and converting nsphy.c to use
mii_phy_setmedia()) fixes autonegotiation, using mii_phy_setmedia()
causes this driver to no longer work properly in the other modes.
Another drawback of that approach is that this will also force writing
the ANAR on other PHYs whose drivers use mii_phy_setmedia() and which
are used with a NIC whose driver sets MIIF_FORCEANEG (e.g. hme(4) is
known to be used together with 3 different PHYs while only the DP83840A
require this workaround).
So instead of moving to MIIF_FORCEANEG, just call mii_phy_auto() in
nsphy_service() unconditionally when hanging off of a hme(4) and serving
a media change

This is part 1/2 of fixing autonegotiation on hme(4) using DP83840A PHYs.
2004-05-29 18:23:26 +00:00
Marius Strobl b78791d37e Spelling fix in a comment. 2004-05-29 18:13:44 +00:00
Marius Strobl 50aa106108 Remove double __FBSDID and move the remaining one into a common place after
the license(s) and before the driver comment (the latter only in drivers not
having __FBSDID at that location).
2004-05-29 18:09:10 +00:00
Marius Strobl c4386506c7 Move __FBSDID out from under a comment. 2004-05-29 17:45:45 +00:00
Marius Strobl 5aa5480919 Spelling fix in a comment. 2004-05-29 16:54:59 +00:00
Ian Dowse 94122d1695 In axe_stop(), close the pipes before calling axe_reset(). axe_reset()
changes the device configuration index, which should not be done
while there are pipes open.

Debugged with help from:	Luke Dean <LukeD@pobox.com>
2004-05-29 15:21:33 +00:00
Ian Dowse 93804be0d7 Refuse to change the configuration index if the device has open
pipes, since open pipes are linked off a usbd_interface structure
that is free()'d when the configuration index is changed. Attempting
to close or use such pipes later would access freed memory and
usually crash the system.

The only driver that is known to trigger this problem is if_axe,
which is itself at fault, but it is worth detecting the situation
to avoid the obscure crashes that result from this type of easily
made driver mistakes.
2004-05-29 14:51:23 +00:00
Roman Kurakin 24f6353dc4 Switch to using C99 sparse initialisers for the type methods array.
Requested by:	harti

MFC after:	1 week
2004-05-29 13:17:28 +00:00
Bill Paul d1a5f43855 In subr_ndis.c, when searching for keys in our make-pretend registry,
make the key name matching case-insensitive. There are some drivers
and .inf files that have mismatched cases, e.g. the driver will look
for "AdhocBand" whereas the .inf file specifies a registry key to be
created called "AdHocBand." The mismatch is probably a typo that went
undetected (so much for QA), but since Windows seems to be case-insensitive,
we should be too.

In if_ndis.c, initialize rates and channels correctly so that specify
frequences correctly when trying to set channels in the 5Ghz band, and
so that 802.11b rates show up for some a/b/g cards (which otherwise
appear to have no 802.11b modes).

Also, when setting OID_802_11_CONFIGURATION in ndis_80211_setstate(),
provide default values for the beacon interval, ATIM window and dwelltime.
The Atheros "Aries" driver will crash if you try to select ad-hoc mode
and leave the beacon interval set to 0: it blindly uses this value and
does a division by 0 in the interrupt handler, causing an integer
divide trap.
2004-05-29 06:41:17 +00:00
Nate Lawson 2b9609ab9b Decrease sleep_delay default to 1 second now that the machines that
required the 5 second delay have been fixed.
2004-05-29 05:34:04 +00:00
Nate Lawson 5acd02180c Style cleanups, don't set the device description before the probe routine
has completed successfully.
2004-05-29 04:32:50 +00:00
Julian Elischer f8aae7776f Switch to using C99 sparse initialisers for the type methods array.
Should make no binary difference.

Submitted by:	Gleb Smirnoff <glebius@cell.sick.ru>
Reviewed by:	Harti Brandt <harti@freebsd.org>
MFC after:	1 week
2004-05-29 00:51:19 +00:00
John Baldwin 91c14f698c Don't assume that the current setting (_CRS) of a PCI link device is
correct.  Instead, check it against the possible settings (_PRS) when
the link is probed.  This is important when using APIC mode but link
devices still have PIC mode settings.  This is also what Linux does.

Additional prodding by:	Len Brown len dot brown at intel dot com
2004-05-28 17:31:32 +00:00
Nate Lawson e3aa81b84d Style fixes. 2004-05-28 16:38:37 +00:00
Nate Lawson 043498df33 Now that we properly disable GPEs before entering a sleep state, including
S5 (soft off), we don't need to disable ACPI when powering off.  This may
fix some systems that don't power off correctly.
2004-05-28 07:16:52 +00:00
Nate Lawson 54af2f27c7 Style cleanups. "extern" is unneeded for function prototypes. 2004-05-28 07:15:55 +00:00
Nate Lawson cc85c78ce3 Update the new suspend/resume GPE methods to properly limit the GPE
based on the destination sleep state.  Add a method to restore the old
state on resume.  This is needed for the case of suspending to a very low
state disabling a GPE (i.e. S4), resuming, and then suspending to a higher
state (i.e. S3).  This case should now keep the proper GPEs enabled.
2004-05-28 07:04:09 +00:00
Nate Lawson 44b8ae7193 Pass a pointer to the sleep state instead of casting gymnastics to pass
the value itself in the pointer.
2004-05-28 06:32:16 +00:00
Nate Lawson 5c9ea25e69 Fix paste-o. 2004-05-28 06:29:30 +00:00
Nate Lawson 88a79fc05b Attach per-device sysctls to allow users to set whether or not a given
device can wake the system.  For example:

    dev.root0.nexus0.acpi0.acpi_lid0.wake: 1
    dev.root0.nexus0.acpi0.acpi_button0.wake: 1
    dev.root0.nexus0.acpi0.pcib0.wake: 0
    dev.root0.nexus0.acpi0.sio0.wake: 0
2004-05-28 06:28:55 +00:00
Scott Long 44eaf12c79 Remove a redundant include directive 2004-05-28 04:42:10 +00:00
Marcel Moolenaar 80c74f3d56 Fix LP64 environments: cast a pointer type to intptr_t before casting
to int and vice versa.
2004-05-28 02:50:43 +00:00
Warner Losh 3b8c0bec8a Don't nest includes here. There's no need and the subset included is lame.
Submitted by: bde
2004-05-28 02:24:07 +00:00
Warner Losh 33de92af3f Include required machine/bus.h 2004-05-28 02:23:10 +00:00
Paul Saab 10672bdf56 Define another HOTPLUG event. 2004-05-28 00:49:57 +00:00
Tony Ackerman e03f8cdc4f First release of ixgb driver for the Intel(R) PRO/10GbE Family of Adapters. This driver has
been developed for use with FreeBSD, version 4.8 and later.

Submitted by:	Hema Joyce
Reviewed by: 	Prafulla Deuskar
Approved by: 	Prafulla Deuskar
MFC after:	1 week
2004-05-28 00:23:00 +00:00
Warner Losh bc8d2181b3 Use rman_get_start in preference to reaching into the rman structure. 2004-05-27 22:43:10 +00:00
Nate Lawson e8b4d56eb5 Restructure the wake GPE API. Now there are three functions:
acpi_wake_init:
    Evaluate _PRW and set the GPE type
acpi_wake_set_enable:
    Enable or disable a device's GPE.
acpi_wake_sleep_prep:
    Perform any last-minute changes to the device to prepare it for
    entering the given sleep state.

Also, walk the entire namespace when transitioning to a sleep state,
disabling any GPEs which aren't appropriate for the given state.  Transition
acpi_lid and acpi_button to the new API.

This clears the way for non-ACPI-aware devices to wake the system (i.e.
modems) and fixes a problem where systems power up after shutdown when a
GPE is triggered.
2004-05-27 18:38:45 +00:00
Warner Losh 9a7be62a1c Fixing disorder is the hardest thing in the world: Learn to sort :-)
Submitted by: bde
2004-05-27 15:21:51 +00:00
Yaroslav Tykhiy 44e0bc11b9 POLA dictates that VLAN_MTU be enabled by default.
In particular, disabling it was likely to break configurations
involving ng_vlan(4) since the latter couldn't control
the parent's VLAN_MTU in the way vlan(4) did.

Pointed out by:	ru
2004-05-27 14:36:58 +00:00
Joerg Wunsch 7351b0acf8 Make "envctrl" a known master driver for iicbus. 2004-05-27 13:29:09 +00:00
Warner Losh 2e31e339d1 Fix disordering of pccarddevs.h noticed by bde. Also remove a few
redundant includes and fix some of the include disordering.

Submitted by: bde
2004-05-27 03:49:45 +00:00
Warner Losh 54c9d8aabc These are now not needed, after repo copy and conversion. 2004-05-27 01:31:11 +00:00
Warner Losh eb9482f4eb Sort includes, remove unnecssary ones.
Submitted by: bde
2004-05-27 01:27:04 +00:00
Pawel Jakub Dawidek 50a33b6aaa Those sysctls shouldn't be writtable from inside a jail. 2004-05-26 23:03:27 +00:00
Mathew Kanner 3858fd7a0c Add PCI ID for via 8237.
Submitted by:	Josh Elsasser <jre@vineyard.net>
Approved by:	tanimura (mentor)
PR:		kern/61730
2004-05-26 22:05:50 +00:00
Thomas Moestl 89eef2de47 It seems that clearing the MCR_IE bit in the modem control register
does not reliably prevent the triggering of interrupts for all supported
configurations. Thus, the FIFO size probe could cause an interrupt,
which could lead to an interrupt storm in the shared interrupt case.

To prevent this, change ns8250_bus_probe() to use the overflow bit in
the line status register instead of the RX ready bit in the interrupt
identification register to detect whether the FIFO has filled up.
This allows us to clear all bits in the interrupt enable register during
the probe, which should prevent interrupts reliably.
Additionally, the detected FIFO size may be a bit more accurate, because
the overflow bit is only set when the FIFO did actually fill up, while
interrupts would trigger a bit early.

Reviewed and tested on a lot of hardware by:	marcel
2004-05-26 21:59:01 +00:00
Josef El-Rayes f50d9ea1d4 Unbreak build if
options BKTR_USE_FREEBSD_SMBUS
is defined in kernel configuration.

Submitted by:   Tom Convery <tpc@tomfoo.com>
PR:             kern/60458
Approved by:    imp
2004-05-26 20:18:58 +00:00
Warner Losh dba6dd177b Move to generating pccarddevs.h on the fly, both for the kernel and
the modules.

Also generate usbdevs.h automatically now, but a non-kernel file is
stopping that at the moment.
2004-05-26 00:53:10 +00:00
Nate Lawson 841caa96b4 Enable GPE at runtime rather than suspend time. This is to match the
new behavior in ACPI-CA that defers GPE configuration.  This is a temporary
measure while reworking the GPE interface.
2004-05-25 16:17:39 +00:00
Yaroslav Tykhiy 8ef1f631f6 Teach fxp(4) to control VLAN_MTU in the hardware.
Now reception of extended frames can be toggled
through ioctl(SIOCSIFCAP).

The card will also receive extended frames when
in promiscuous mode.
2004-05-25 14:49:46 +00:00
Dag-Erling Smørgrav df7593b5a4 Set the IFCAP_VLAN_MTU bit in capenable as well.
Reminded by:	ru
2004-05-25 11:33:19 +00:00
Dag-Erling Smørgrav 912bf9d37c Set baudrate to 100 Mbps, and advertise our ability to handle extended
frames (802.1q).

Submitted by:	Steinar Haug <sthaug@nethelp.no>
2004-05-25 11:04:01 +00:00
Joerg Wunsch e0efc557e7 Round #1 of improving pcf(4).
This splits the driver into a bus-independant backend, plus bus-specific
frontends.  The old pcf(4) (i386/ISA) frontend is now in pcf_isa.c, the
frontend in envctrl.c is for sparc64/Ebus2 (Sun device name: SUNW,envctrl
from Sun E450 machines).  More frontends are expected to appear in future.

This is not yet ready for public consumption, but it basically works.
Nicolas will bring over his ISA-specific fixes soon.

Reviewed by:	nsouch
2004-05-25 07:42:45 +00:00
Nate Lawson 09a98d8ce9 Remove call to _INI for thermal devices. ACPI-CA now calls _INI for
Devices, ThermalZones, and Processors.
2004-05-25 04:18:22 +00:00
Nate Lawson f3fc4f8b4a Changes to implement 20040514:
* Add calls to AcpiSetGpeType.  We use wake/run as the type for lid and
button switches since wake-only causes Thinkpads to immediately wake on
the second suspend.  Note that with wake/run, some systems return both
wake and device-specific notifies so we don't register for system notifies
for lid and button switches.
* Remove the hw.acpi.osi_method tunable since it is not needed.
* Always print unknown notifies for all types.
* Add more cleanup for the EC if it fails to attach.
* Use the GPE handle now that we parse it.  This allows GPEs to be defined
in AML GPE blocks.
* Always use ACPI_NOT_ISR since it's ok to acquire a mutex in our thread
which processes queued requests.
2004-05-25 02:47:35 +00:00
Julian Elischer 86a91f8b89 Use NG_NODESIZ instead of (NG_NODELEN + 1)
Noted by: jhb
2004-05-24 20:45:53 +00:00
John Baldwin c0344cc19f Use PCI_BAR() rather than PCIR_MAPS.
Noticed by:	phk
2004-05-24 19:39:56 +00:00
John Baldwin 9930009eb6 Wrap the code to save/restore PCI config registers on suspend/resume in
#ifndef BURN_BRIDGES.

Noticed by:	phk
2004-05-24 19:39:23 +00:00
Maxime Henrion 670f5d73a0 Change a if (...) panic() to a KASSERT(). 2004-05-24 18:31:56 +00:00
Warner Losh ef77fe1a5b Use PCI_BAR() in preference to PCI_MAPS + x * 4.
Submitted by: jhb
2004-05-24 17:41:05 +00:00
Warner Losh 7138b71d5f Do not write to those config registers that are unambiguously defined
in the various pci specifications as readonly.  vendor, subvendor,
device and subdevice are required to be loaded in hardware by some
means that isn't the system BIOS or other system software (although
some devices do have ways of accomplishing this).  class and subclass
are defined to be read-only in section 6.2.1 (v2.2).  Apart from the
status register, which we weren't touching, these are the only
read-only registers I could find in the 2.2 spec.

progif is also defined as being read-only in section 6.2.1.  However,
the PCI IDE programming document specifically states that some of the
bits are read/write.  Since we may have to restore registers before we
have a driver attached, go ahead and restore this one byte when
transitioning between D3 and D0.

The PCI spec also says that writes to reserved and unimplemented
registers must be completed normally.  It makes no statements about
writes to read-only registers, so be as conservative as possible,
while covering the exception to the rule that is documented in a
subpart of the standard.

Requested by: socttl
2004-05-24 15:52:57 +00:00
Nate Lawson 51e2355882 Store the target handles in a separate list from normal commands. Add a
CTIO fast post routine to handle CTIO completions.

Submitted by:	mjacob
2004-05-24 07:02:25 +00:00
Paul Saab c001ccf2a3 Add support for BCM5705K
Submitted by:	candy@kgc.co.jp
PR:		kern/67110
2004-05-24 04:46:54 +00:00
Yaroslav Tykhiy 25fbb2c38c A handler for ioctl(SIOCSIFCAP) should not alter a bit in
if_capenable unless the interface driver is actually able
to toggle the respective capability on and off.

Reviewed by:	ru
2004-05-23 21:05:08 +00:00
Yaroslav Tykhiy a5820ecb77 According to the design of checksum offloading framework,
if_hwassist should be in accord with the IFCAP_TXCSUM bit
of if_capenable.
2004-05-23 20:22:40 +00:00
Yaroslav Tykhiy 88b404a610 Mark the VLAN_MTU capability as initially enabled since it's
hardcoded to "ON" for these interfaces.
2004-05-23 19:21:48 +00:00