Commit Graph

12617 Commits

Author SHA1 Message Date
Poul-Henning Kamp
1ef0fc1d09 Include fcntl.h not vnode.h.
Include uio.h instead of relying on vnode.h to do so.
Check O_NONBLOCK not IO_NDELAY.
2004-12-22 17:30:38 +00:00
Poul-Henning Kamp
4c4a94cefe Check O_NONBLOCK not IO_NDELAY.
Don't include vnode.h
2004-12-22 17:29:37 +00:00
Poul-Henning Kamp
fe8fab266b #include fcntl.h not vnode.h. Check O_NONBLOCK not IO_NDELAY. 2004-12-22 17:29:02 +00:00
Poul-Henning Kamp
c04c3e007f #include of <sys/vnode.h> not necesary. 2004-12-22 17:28:34 +00:00
Ruslan Ermilov
e653b48c80 Start the dreaded NOFOO -> NO_FOO conversion.
OK'ed by:	core
2004-12-21 08:47:35 +00:00
Peter Grehan
d626a8a238 GEOMify the OFW disk driver. Code taken unashamedly from
the preload case in dev/md/md.c.
2004-12-21 02:23:35 +00:00
Julian Elischer
efba049184 Oops, this one isn't ready
back it out until fixed
2004-12-20 21:17:22 +00:00
Julian Elischer
f1e27f62c1 Add a bunch of USB definitions from NetBSD.
This is part of an ongoing cycle of commits on all the BSDs to
merge the USB vendor and device defintions..

A merge from OpenBSD is still pending.

Submitted by:	barry bouwsma (freebsd-misuser@NOSPAM.dyndns.dk)
Obtained from:	NetBSD
MFC after: 1 week
2004-12-20 20:41:55 +00:00
Julian Elischer
b3ea468624 Merge in a bunch of USB device and manufacturer definitions..
Submitted by:	barry bouwsma (freebsd-misuser@NOSPAM.dyndns.dk)
Obtained from:	Dragonfly
MFC after:	3 days
2004-12-20 20:10:57 +00:00
Nate Lawson
8c702862e4 Only use the current value if there's one IRQ. Some systems return
multiple IRQs (which is nonsense for _CRS) when the link hasn't been
programmed.  Before, this was a KASSERT.  A ServerWorks system was
seen returning IRQs of 0, 2 in response to _CRS before link setup.
Thanks to sam@ for quick testing and turnaround on this.

Tested by:	sam
2004-12-20 10:46:56 +00:00
Maxime Henrion
4ed53076ed Only try to use the 82503 serial interface for the 82557 chipsets. The
datasheet says it is only valid for such chipsets and shouldn't be used
with others.  This fixes some 82559 based cards which otherwise only
work at 10Mbit.

MFC after:	5 days
Tested by:	krion
2004-12-20 10:18:21 +00:00
Bjoern A. Zeeb
969e69711e Enable jumbo frames on Yukon variants of sk(4).
In contrast to OpenBSD we enable jumbo frame support
depending on MTU setting (like done for xmac).

Approved by:	pjd (mentor)
Obtained from:	OpenBSD if_sk.c r1.52 (YU_SMR_MFL_JUMBO flag)
Tested by:	Heinz Knocke <knockefreebsd at o2 dot pl>
MFC after:	5 days
2004-12-20 10:07:12 +00:00
Nate Lawson
54640fac34 Only report a critical battery level once until it's gone non-critical.
An improvement would be to check all batteries for critical state before
printing a message.

Reported by:	Kevin Oberman (oberman at es net)
2004-12-20 05:03:41 +00:00
Nate Lawson
6e0e5d3623 Move launching the worker thread from a SYSINIT to the first device's
attach.  This fixes the previous behavior where systems without hptmv
hardware always had a worker thread running.
2004-12-19 19:42:54 +00:00
Maxim Sobolev
d579f3e4fe Add support for FC929X, which apparently is just a PCI-X version of FC929.
MFC after:	3 days
2004-12-18 16:49:54 +00:00
Julian Elischer
53d4f8518a Slight change to formatting so that 'ctags' doesn't
give up on teh file half way through.. Might have been my
mistake earlier anyhow. No actual code change

MFC after:	5 days
2004-12-18 01:20:18 +00:00
Paul Saab
35ca8069a9 Add support for the 5721 which seems to be similar to the 5750/5751.
Tested by:	Vivek Khera vivek at khera dot org
2004-12-17 21:50:18 +00:00
Matthew N. Dodd
86906d256a Diff reduce wi_write_wep() relative to revision 1.168 2004-12-17 20:48:13 +00:00
Peter Wemm
d6ef0bf119 Recognize the 32-bit form of the twe binary passthrough ioctl()s so that
there is some hope for the 32-bit management utilities to run.  I've used
the cli successfully, but 3dm2 doesn't work for other reasons.  Of course,
a native binary of the 3dm2 and cli would be much better, but that doesn't
exist.
2004-12-17 17:45:29 +00:00
Sam Leffler
181ab45653 Fix wep operation for station mode:
o don't encapsulate on tx; the chip expect a raw frame w/o the crypto header
o clear the WEP bit in the 802.11 header on rx so the 802.11 layer doesn't
  try to strip the crypto header
o clobber the "drop unencoded frames" state bit when privacy is enabled so
  rx'd frames we pass up to the 802.11 layer are not discarded as unencrypted

This stuff will need to be redone if anyone decides to add WPA support.
2004-12-17 03:57:16 +00:00
Sam Leffler
14ae1a9deb set ic_ibss_chan when entering RUN state to match ic_bss so the channel
reported when associated to an AP is correct
2004-12-17 03:36:24 +00:00
Sam Leffler
407a27b151 remove power save logic from the tx path; the driver isn't ready to support
it so don't mislead folks
2004-12-17 03:05:30 +00:00
Julian Elischer
5f15e3ac21 Add a missing prototype.
MFC after:	1 week
2004-12-17 00:25:56 +00:00
Julian Elischer
080bb7c1dd Allow /sys/dev/bktr to support Pinnacle PCTV Rave cards
PR:		73669
Submitted by:	arne_woerner at yahoo dot com
MFC after:	1 week
2004-12-16 23:37:41 +00:00
Julian Elischer
b7ad4d221a Add some locking for -currnet/5.x
PR:		74305
Submitted by:	Anish Mistry <amistry at am-productions dot biz>
MFC after:	1 week
2004-12-16 23:19:57 +00:00
John Baldwin
f5517dc887 Add a new flag to the atkbd(4) driver to disable testing the keyboard
port during the device probe as this can cause hangs on some machines,
specifically Compaq R3000Z series amd64 laptops.  The flag is bit 3, or
0x8.

PR:		amd64/67745
Reported by:	Neil Winterbauer newntrbr at ucla dot edu, many others
Tested by:	ade, astrodog at gmail dot com, many others
MFC after:	1 week
2004-12-15 23:00:47 +00:00
Ruslan Ermilov
b7b28d26c4 Fixed compilation warnings with option VGA_NO_MODE_CHANGE.
PR:		kern/71130
2004-12-15 13:49:25 +00:00
Scott Long
ecefe5717e Add the PCI ID for the Adaptec 2230SLP card.
Submitted by: Ray Gilstrap
2004-12-15 07:03:21 +00:00
Suleiman Souhlal
4011d8a8c9 Use the SYSCTL_ADD_OID macro, instead of directly calling sysctl_add_oid().
Approved by:	anholt, grehan (mentor)
2004-12-15 06:22:33 +00:00
Peter Wemm
063896020b Like on the ath_rate_onoe component, make this compile on amd64. Convert
pointers to an integer via uintptr_t.

Fix an apparent bug that caused a compile failure.
ieee80211_iterate_nodes() takes ic->ic_sta as its first argument on the
onoe module.  It had just 'ic' here in the same context, which was a
mismatched argument.
2004-12-15 02:32:27 +00:00
Peter Wemm
6891c875c2 Make this amd64-clean. sizeof is long on amd64, so things that do a printf
of a sizeof, need to use %z to get the correct type on all our platforms.
Also, convert integers<->pointers via uintptr_t.

(I think Sam's instructions were for me to commit this.  If I
 misunderstood, then I apologize in advance.)
2004-12-15 02:25:21 +00:00
Roman Kurakin
64715608d7 Bring back ability to use FR support with sppp from Cronyx. 2004-12-14 23:13:08 +00:00
Matthew N. Dodd
84339b16c1 Add a callout to dump card status on command queue timeouts. 2004-12-14 17:45:30 +00:00
Matthew N. Dodd
fc601c53dc Modify ida_v3_done() to treat FIFO status of -1 as FIFO empty (0).
This is what ida_v4_done() does and seems to be necessary with some
firmware versions on v3 devices.
2004-12-14 17:41:51 +00:00
Matthew N. Dodd
b75ab906bc Reformat arguments bus_dma_tag_create(). 2004-12-14 17:23:01 +00:00
Poul-Henning Kamp
a884a1b0f2 Make LINT compile.
When leaving functions for ddb use don't make them static: it makes
gcc think they are unused.

Shouldn't this be in #ifdef DDB anyway ?
2004-12-14 07:46:28 +00:00
Julian Elischer
b96aca53dc A bunch more whitespace and formatting diff reductions for NetBSD.
Obtained from:	NetBSD
MFC after:	1 week
2004-12-14 04:47:24 +00:00
Julian Elischer
47f9e7b6ce Don't abandon ship just because the number of companions doesn't seem correct.
Obtained from:	NetBSD
MFC after:	1 week
2004-12-14 04:05:10 +00:00
Julian Elischer
80ee93cb22 Slightly reorganise part of the ohci_softintr() function
to better keep track of the total amoutn transferred during a
transfer. Seems similar to some code in the NetBSD version.
I notice they have incorporated matches from him so I don't know which
direction it went.

Submitted by:	damien.bergamini@free.fr
Obtained from:	patches to make the ueagle driver work
MFC after:	1 week
2004-12-14 03:59:24 +00:00
Julian Elischer
6e6281a3dc Small formatting change..
Move a declaration to the same place as in NetBSD.

Obtained from:	NetBSD
MFC after:	1 week
2004-12-14 03:54:08 +00:00
Nate Lawson
276cd9216d Unify ACPI_DEBUG support for all OEM drivers under ACPI_OEM. Since more than
one will never be supported on the same platform, this does not hurt
debugging.

MFC after:	3 days
2004-12-13 23:31:46 +00:00
Roman Kurakin
f41d84e53a Make code MPSAFE.
You could turn this off by debug.mpsafenet=0 for full network
stack or via debug.{cp|cx|ctau}.mpsafenet for cp(4), cx(4) and
ctau(4) accordingly.

MFC after:	10 days
2004-12-13 22:07:23 +00:00
Julian Elischer
1cc7d59e34 Might as well get the right $NetBSD$ string while we are at it.
MFC after:	1 week
2004-12-13 08:12:06 +00:00
Julian Elischer
cd015c5e87 Diff reduction to NetBSD.
Now only things that are different between us and NetBSD show up.
Means that these files are more of NetBSD style in some places but
since thay are NetBSD files, um, that's ok.

Obtained from:	NetBSD
MFC after: 1 week
2004-12-13 08:08:57 +00:00
Julian Elischer
18b5fd62f9 MFNetBSD
Whitespace diff reduction, formatting fixes and one actual
arithmetic error that NetBSD have fixed.

Obtained from:	NetBSD
MFC after: 1 week
2004-12-13 07:45:02 +00:00
Warner Losh
1239b0391a We don't need vnode.h, but do need uio.h in these files. vnode.h
shouldn't be included in drivers, generally, so remove them.

OK'd by: phk
2004-12-13 07:09:54 +00:00
Warner Losh
a9557e2194 Add sys/uio.h explicitly, and move sys/vnode.h include to be more
alphabetical.

# vnode.h should not be included here, but it is required for proper decoding
# of the flags args.  This may change in the future...
2004-12-13 07:08:22 +00:00
Nate Lawson
6c69283ca8 Re-enable link programming on resume. It appears the previous bounds
error had caused the hang and it has been corrected now.
2004-12-13 06:59:34 +00:00
Warner Losh
317ccb1fc3 sys/vnode.h is inappropriate for a driver. Use sys/uio.h instead. 2004-12-13 06:26:23 +00:00
Warner Losh
da5c87ba08 Crank down the lame-o-matic a notch by moving the = inside the /* */ rather
than outside to fix the build.
2004-12-13 05:41:33 +00:00
Scott Long
82d4da0f73 Allow the acpi_ibm module to be built with ACPI_DEBUG. 2004-12-13 03:22:11 +00:00
Julian Elischer
d0a9f61fea Try make code for teh M$ Intellimouse less obtrusive
when not using such a device.
2004-12-13 02:20:48 +00:00
Julian Elischer
22c2b56594 Don't export the 'dt' field as that would break the exisiting ABI.
keep the code but comment it out so that if the ABI changes we
can see easily what should be done.

Submitted by:	iedowse
2004-12-13 01:23:49 +00:00
Julian Elischer
0e7470486d Revert addition of Lide scanner entry..
It's a duplicate of an already exisiting entry. (with another name).
2004-12-13 00:25:03 +00:00
Warner Losh
6c5c0a5ac1 Separate mse driver into a core driver and a bus attachments. Separate out
the ISA and CBUS (called isa on pc98) attachments.  Eliminate all PC98
ifdefs in the process (the driver in pc98/pc98/mse.c was a copy of the one
in i386/isa/mse.c with PC98 ifdefs).  Create a module for this driver.

I've tested this my PC-9821RaS40 with moused.  I've not tested this on i386
because I have no InPort cards, or similar such things.  NEC standardized
on bus mice very early, long before ps/2 mice ports apeared, so all PC-98
machines supported by FreeBSD/pc98 have bus mice, I believe.

Reviewed by: nyan-san
2004-12-12 20:05:50 +00:00
Poul-Henning Kamp
2221dbebce Pass the file->flags down to geom ioctl handlers.
Reject certain ioctls if write permission is not indicated.

Bump geom API version.

Reported by:	Ruben de Groot <mail25@bzerk.org>
2004-12-12 10:09:05 +00:00
Julian Elischer
a09345e6cd Add support for Cannon LIDE 20 scanner
PR:	kern/74301
Submitted by:	Vlad Manilici <vman@tmok.com>
MFC after:	1 week
2004-12-12 08:35:21 +00:00
Sam Leffler
a2eafa5bcd record the bssid for an association
Tested by:	Daniel O'Connor
2004-12-12 07:45:42 +00:00
Julian Elischer
c29b0a0f7e Add support for USB Microsoft Intellimouse
PR:		kern/70607
Submitted by:	Matt Wright <matt@consultmatt.co.uk>
MFC after:	1 week
2004-12-12 05:34:20 +00:00
Julian Elischer
060cd8af25 Changes to cache endpoint descriptors for all the interfaces. this information
is not always available if we change interfaces.

Submitted by:	jamie at bishopston dot net  (jamie jones)
MFC after:	1 week
2004-12-12 02:27:30 +00:00
Marius Strobl
be063afc20 Some changes related to reading the MAC-address from the VPD on systems
without Open Firmware:
- The PCI data structure of some HME PROMs contains a non-zero interface
  revision in the class code. Thus remove the checks for matching class
  code and PCI data structure length and revsion. These were pretty much
  useless anyway as we only really need the pointer to the VPD which is
  located before the structure length and revision fields.
- On Sun QFE (Quad FastEthernet) cards read the Nth MAC-address for the
  Nth HME controller instead of always the first one for all four HMEs. [1]
- Improve the comment describing the used VPD format to better reflect
  reality.
- Minor clean-up.

Prodded by:	joerg [1]
2004-12-12 00:32:51 +00:00
Roman Kurakin
b32a140140 Add support for Tau-PCI-L model - one V.35/RS-232 or
RS-530(449)/X.21 interface.
2004-12-11 22:44:12 +00:00
Roman Kurakin
f7f4970012 Clean up from '#if __FreeBSD_version'. 2004-12-11 05:38:16 +00:00
Roman Kurakin
02a6dae6e0 Clean up from '#if __FreeBSD_version'. 2004-12-10 05:54:45 +00:00
Sam Leffler
2bd0e96db9 Fix compilation and correct mapping from struct ifnet to
struct ieee80211com after net80211 import.

Submitted by:	Tor Egge
2004-12-10 00:59:27 +00:00
Roman Kurakin
deb66525ae Partially backout 1.34. These ioctls and function cx_modem_status () are
used by sync part of driver, so put them back.
2004-12-09 23:43:03 +00:00
Scott Long
0b0594cd4f Complete the repo-copy of aac_ioctl.h from sys/dev/aac/to sys/sys. 2004-12-09 22:20:25 +00:00
Takanori Watanabe
06064893b3 Add IBM Laptop extra device driver.
This depends on ACPI and RTC registers.

Reviewed by: njl
2004-12-09 13:54:29 +00:00
Christian Brueffer
61af118148 URL of the data sheet has changed.
Obtained from:	OpenBSD
2004-12-09 13:27:44 +00:00
Søren Schmidt
241ce89e8c Compensate for off by one bugs in disk firmware for 48BIT addressing cutover. 2004-12-09 07:31:06 +00:00
Scott Mitchell
d49a36b1d5 Diff-reduction before merging if_axe to RELENG_4.
Approved by:	imp (mentor)
MFC after:	1 week
2004-12-08 22:02:58 +00:00
Søren Schmidt
fb81862424 Update the ICH6 support so all 4 SATA channels can be used.
We still use "normal" mode, AHCI mode is in the works still.

HW donated by:	Sentex
HW donated by:	Yahoo!
2004-12-08 18:00:46 +00:00
Sam Leffler
db1d51f3c7 Update for net80211 changes. 2004-12-08 17:36:51 +00:00
Sam Leffler
f48445578b o Update for net80211 changes
o Import some minor fixes from netbsd
2004-12-08 17:36:28 +00:00
Sam Leffler
c42a7b7e25 Update with last year of work. 2004-12-08 17:34:36 +00:00
Sam Leffler
05f1e03f00 Transmit rate control modules for the ath driver. 2004-12-08 17:32:02 +00:00
Søren Schmidt
88bdf804ed Add support for the ITE IT8212F controller.
HW donated by:	Yahoo!
2004-12-08 11:17:38 +00:00
Søren Schmidt
7f45e0f014 Reset timeout when we are back from interrupt. 2004-12-08 11:16:33 +00:00
Søren Schmidt
da9edda62d Add first shot on support for the new Promise SATAII chips.
HW donated by:	pil.dk
2004-12-08 10:02:41 +00:00
Søren Schmidt
6567c88566 Correct logical error, result was that retries wasn't always made but
failure reported instead.
2004-12-08 09:19:03 +00:00
Marcel Moolenaar
f5929532f1 Don't obtain the HCDP address directly from the bootinfo structure.
Use a function to keep the details at arms length from uart(4).
2004-12-08 05:46:54 +00:00
Sam Leffler
94f5c9cfc0 Cleanup link state change notification:
o add new if_link_state_change routine that deals with link state changes
o change mii to use if_link_state_change
2004-12-08 05:45:59 +00:00
Warner Losh
e50dccaec1 Fix comments to match last commit, and minor reformatting... 2004-12-08 04:35:19 +00:00
Warner Losh
6f2156545c It turns out that a lot of newer systems have 'base peripherals' on
the PCI bus.  We presently have no drivers for these devices, so they
are powered down.  This is undesirable behavior since it breaks the
system when the base peripherals go away suddenly in the middle of
boot.

# if we ever get generic drivers for memory and/or base peripherals, then
# we can remove the tests here.
2004-12-08 04:16:18 +00:00
Warner Losh
993fd0c509 PNP BIOS devices are fundamentally different than ISA PNP devices.
These devices should be probed first because they are at fixed
locations and cannot be turned off.  ISA PNP devices, on the other
hand, can be turned off and often can be flexible in the resources
they use.  Probe them last, as always.
2004-12-07 05:30:02 +00:00
Scott Mitchell
fb805ea785 Properly release allocated resources if adw(4) device fails to fully attach,
eg. if the firmware load fails.  Shortish MFC timeout so this can be merged
before the 4.11 freeze.

PR:		kern/34306
Submitted by:	gibbs
Approved by:	gibbs, imp (mentor)
MFC after:	5 days
2004-12-06 23:17:04 +00:00
Alan Cox
370abcb3e5 Update the Tigon 1 and 2 driver to use the sf_buf API for implementing
zero-copy receive of jumbo frames.  This eliminates the need for the
jumbo frame allocator implemented in kern/uipc_jumbo.c and sys/jumbo.h.
Remove it.

Note: Zero-copy receive of jumbo frames did not work without these changes;
I believe there was insufficient locking on the jumbo vm object.

Tested by: ken@
Discussed with: gallatin@
2004-12-06 00:43:40 +00:00
Scott Long
dc0ff2140b Fix a number of bugs and significantly alter the command execution path to
properly support bounce buffers and resource shortages.  This allows the
driver to work properly and reliably with more than 4GB of RAM.  Of the
three data paths that exist in the driver, (block, CAM, ioctl), the ioctl
path has not been well tested with these changes due to difficulty with
finding an application that uses it that actually works.

Sponsored by: The FreeBSD Foundation and FreeBSD Systems, Inc.
2004-12-05 23:48:17 +00:00
Nate Lawson
5d3d03f152 Grab Giant around calls to DEVICE_SUSPEND/RESUME in acpi_SetSleepState().
If we are resuming non-MPSAFE drivers, they need Giant held for them.
This may fix some obscure suspend/resume problems.  It has fixed keyrate
setting problems that were triggered by cardbus (MPSAFE) changing the
ordering for syscons resume (non-MPSAFE).  Also, add some asserts that
Giant is held in our suspend/resume and shutdown methods.

Found by:	iedowse
MFC after:	2 days
2004-12-05 01:35:18 +00:00
Roman Kurakin
052bf4427f Don not call pp_down()/pp_up() form XX_tlf()/XX_tls() in non PPP mode
to privent running of PPP's state machine in non PPP mode.

MFC: after 3 days.
2004-12-03 16:57:15 +00:00
Nate Lawson
8526ed739d ACPI is not on pc98 either.
Informed by:	nyan
2004-12-03 08:44:56 +00:00
Nate Lawson
161ad64e63 Non-x86 platforms cannot use the ACPI includes. This should be fixed but
for now, only include the headers for i386, amd64, or ia64.

Pointed out by:	grehan
2004-12-03 08:13:08 +00:00
Nate Lawson
834a79de94 Enable the relaxed behavior for op regions and other workarounds for
non-standard BIOSen.  We used to implement this in local patches but
now that ACPI-CA has merged/re-implemented most of our fixes, they were
no longer needed and we just needed to turn this knob on.  Also, remove
an unnecessary cast.

Tested by:	phk
2004-12-03 08:01:09 +00:00
David E. O'Brien
f0b078381d Specifically use the 32-bit version of fuword/suword since that's what
we really want vs. the size changing 'long' (i386 vs. AMD64).
This fixes the problem with DRM with Radeon's on AMD64.

Submitted by:	Jung-uk Kim <jkim@niksun.com>
2004-12-02 09:38:34 +00:00
Nate Lawson
10ce62b975 Turn ACPI and PCI devices off or to a lower power state in suspend and
back on again in resume.  Override the default of D3 with the value the
BIOS specifies in _SxD, if present.  Skip serial devices (PNP05xx) since
they seem to hang when set to D3 and may require special driver support.
Also, skip non-type 0 PCI devices (i.e., bridges) since our we don't yet
save/restore their config space and that seems to be necessary.

If this gives you trouble with suspend/resume, you can disable the new
ACPI and PCI power behavior separately with these tunables & sysctls:
    debug.acpi.do_powerstate
    hw.pci.do_powerstate

Approved by:	imp (pci)
Tested by:	acpi@ (numerous)
2004-12-02 08:07:12 +00:00
Nate Lawson
ef205c82ca Add the ACPI_PWR_FOR_SLEEP method. It takes a device and outputs the
appropriate power (Dx) state, if the BIOS suggests one.

MFC after:	3 weeks
2004-12-02 08:04:57 +00:00
Mark Santcroos
f8c60df7a6 Catch up with AcpiOsSleep() interface change.
Catch up with some #define's renaming.
Implement AcpiOsGetTimer() as per ACPI 3.0.

Approved by:	njl
MFC after:	1 week
2004-12-02 00:25:35 +00:00
John Baldwin
7e1f562e2a - Do a better job of handling any Dependent Functions (aka DPFs) that appear
in the _PRS or _CRS of link devices.  If faced with multiple DPFs in a
  _PRS, we just use the first one.  We assume that if _CRS has DPF tags they
  only contain a single set since multiple DPFs wouldn't make any sense.  In
  practice, the only DPFs I've seen so far for link devices are that the one
  IRQ resource is surrounded by a DPF tag pair for no apparent reason, and
  this should handle that case fine now.
- Only allocate link structures for IRQ resources for link devices rather
  than allocating a link structure for every resource.

Reviewed by:	njl
Tested by:	phk
2004-12-01 21:05:02 +00:00
Nate Lawson
ba1c3b5304 Completely back out 1.37. Something else is going on and John wants to
keep the locking and solve the real problem.
2004-12-01 05:49:26 +00:00
Scott Long
05d0bf79ed Remove the last vestiges of the userconfig option. None of this actually
did anything, so this commit should be considered a NO-OP.
2004-12-01 04:59:33 +00:00
David E. O'Brien
0297d51ea3 Fix "Lock ACPI PCI link not exclusively locked
@sys/dev/acpica/acpi_pci_link.c:153" panic by backing out rev 1.37 in the SMP
case.  It appears that on a dual-proc machine the assertions in the rev 1.37
commit log hold true.
2004-12-01 04:34:08 +00:00
Nate Lawson
06faf06ac5 Don't bother locking in attach(). At boot time, we're single-threaded
anyway and for some reason, witness seems confused about what's already
locked and triggers a false panic.
2004-11-30 17:48:10 +00:00
Nate Lawson
ad71daf0cb Make sure the link array is big enough to hold both _CRS and _PRS
resource lists.  It used to be sized based only on _CRS, hence _PRS could
perform an out-of-bounds access if it was larger (i.e., when there are
dependent functions).  Add asserts to detect this case.  Note, this is
only a temporary fix and I believe _PRS and _CRS should have separate
arrays.

Also, fix a typo where the wrong irq was being check for the APIC case.

Submitted by:	tegge
2004-11-30 06:55:43 +00:00
Nate Lawson
a811035e4f Instead of translating PCI to ACPI power states, just use a CTASSERT
that they are equivalent.
2004-11-29 18:48:51 +00:00
Warner Losh
669f5ef94f Attach the device at acpi_sony instead of acpi_snc. Rename some
internal variables as well to reflect the change.
2004-11-29 16:40:30 +00:00
Ian Dowse
01a95e0acf Add support for the TwinMOS Memory Disk IV.
PR:		kern/73766
Submitted by:	Valentin Nechayev
MFC after:	1 week
2004-11-28 21:49:30 +00:00
Ian Dowse
104f472f30 Add the device ID for the 3Com 3CRSHEW696 wireless adapter.
PR:		kern/73286
Submitted by:	Daan Vreeken
2004-11-28 21:40:36 +00:00
Ian Dowse
3589f4d21c Add support for the Trumpion/Comotron C3310 MP3 player. 2004-11-28 21:36:39 +00:00
Marius Strobl
36bdb858fa - Don't blindly use the return value of uart_cpu_channel() to calculate
the address of a channel on a SCC, it returns 0 on failure. [1]
- Hardcode channel 1 for the keyboard on Z8530, the information present
  in the Open Firmware device tree doesn't allow to determine this via
  uart_cpu_channel(). This makes the keyboard (if one backs out rev. 1.5
  of sys/dev/puc/puc_sbus.c and has both keyboard and mouse plugged in to
  avoid the hang that revision works around) and consequently syscons(4)
  on Ultra 2 work. There's a problem with the keyboard LEDs similar to
  the one on Ultra 60 (LEDs don't get lit under X) though, instead of
  lighting just a specific single one all get lit and can't be turned off
  again. [1]
- Add comments about what uart_cpu_channel() and uart_cpu_getdev_keyboard()
  do and their constraints.
- Improve the comments about what uart_cpu_getdev_[console,dbgport]() do,
  they don't return an address (as in bus) but an Open Firmware package
  handle.

Reviewed by:	marcel (modulo the comments) [1]
2004-11-28 16:00:36 +00:00
Nate Lawson
4a29e1698c Temporarily disable programming IRQ links on resume. The new code hangs
several of my systems.
2004-11-26 23:31:59 +00:00
Bjoern A. Zeeb
098df78052 With mii.h rev 1.4 changes to BMSR_MEDIAMASK merged in from
NetBSD got activated. NetBSD has an additional change in
 their mii.c rev 1.26 which got missed with that merger:

 : When probing for a PHY, look at the EXTSTAT bit in the BMSR, as well,
 : not just the media mask.  This prevents PHYs/TBIs that only support
 : Gigabit media from slipping through the cracks.

With this GE only ones like from the SK-9844 are detected again.

PR:		i386/63313, i386/71733, kern/73725
Tested by:	matt baker <matt at sevenone dot com>, Jin Guojun <jin at george dot lbl dot gov>
Approved by:	rwatson (mentor)
Obtained from:	NetBSD mii.c rev 1.26
MFC after:	1 week
2004-11-26 19:42:40 +00:00
Scott Long
4161b1a1e9 Don't use PAGE_SIZE to calculate controller-specific attributes.
PR: kern/21220
Submitted by: Dennis Lindroos
MFC After: 1 week
2004-11-25 12:15:49 +00:00
Søren Schmidt
39c7a710c6 Return ATA register values in the request struct when ATAREQUEST returns. 2004-11-24 10:47:26 +00:00
John Baldwin
2dacd5d401 - Remove some no longer used constants.
- Sort function prototypes.
2004-11-23 22:30:03 +00:00
John Baldwin
5e1ba6d4ae Rework the ACPI PCI link code.
- Use a new-bus device driver for the ACPI PCI link devices.  The devices
  are called pci_linkX.  The driver includes suspend/resume support so that
  the ACPI bridge drivers no longer have to poke the links to get them
  to handle suspend/resume.  Also, the code to handle which IRQs a link is
  routed to and choosing an IRQ when a link is not already routed is all
  contained in the link driver.  The PCI bridge drivers now ask the link
  driver which IRQ to use once they determine that a _PRT entry does not
  use a hardwired interrupt number.
- The new link driver includes support for multiple IRQ resources per
  link device as well as preserving any non-IRQ resources when adjusting
  the IRQ that a link is routed to.
- The entire approach to routing when using a link device is now
  link-centric rather than pci bus/device/pin specific.  Thus, when
  using a tunable to override the default IRQ settings, one now uses
  a single tunable to route an entire link rather than routing a single
  device that uses the link (which has great foot-shooting potential if
  the user tries to route the same link to two different IRQs using two
  different pci bus/device/pin hints).  For example, to adjust the IRQ
  that \_SB_.LNKA uses, one would set 'hw.pci.link.LNKA.irq=10' from the
  loader.
- As a side effect of having the link driver, unused link devices will now
  be disabled when they are probed.
- The algorithm for choosing an IRQ for a link that doesn't already have an
  IRQ assigned is now much closer to the one used in $PIR routing.  When a
  link is routed via an ISA IRQ, only known-good IRQs that the BIOS has
  already used are used for routing instead of using probabilities to
  guess at which IRQs are probably not used by an ISA device.  One change
  from $PIR is that the SCI is always considered a viable ISA IRQ, so that
  if the BIOS does not setup any IRQs the kernel will degenerate to routing
  all interrupts over the SCI.  For non ISA IRQs, interrupts are picked
  from the possible pool using a simplistic weighting algorithm.

Tested by:	ru, scottl, others on acpi@
Reviewed by:	njl
2004-11-23 22:26:44 +00:00
Pyun YongHyeon
38fa13a6a2 Make hme(4) mpsafe
- Let hme_start()/hme_init() acquire lock and then call
   hme_start_locked()/hme_init_locked() respectivly.
 - Teardown interrupt handler before hme_detach().
 - Remove IFF_NEEDSGIANT flag and mark interrupt handler INTR_MPSAFE.
 - Set callout handler to CALLOUT_MPSAFE.
 - Add locks in hme MII interface.

Reviewed by:	jake
Tested by:	Julian C. Dunn  <jdunn at opentrend dot net>
MFC after:	2 weeks
2004-11-22 06:46:30 +00:00
Warner Losh
4b87c653f9 Properly wither the geom container on detach. This will allow one to
then later reload fdc and not have duplicate fd devices in dev.

# Maybe this should be moved to a convenience function.

Reviewed by: phk
2004-11-21 16:25:21 +00:00
Yoshihiro Takahashi
ea54c3694c uart_i8251_ops is gone. 2004-11-21 15:18:35 +00:00
Scott Long
1248408df3 Don't force busdma to pre-allocate bounce pages for static allocations. 2004-11-21 04:03:29 +00:00
Scott Long
8a40c10eb9 Don't force busdma to pre-allocate bounce pages for the parent tag. 2004-11-21 04:02:36 +00:00
Max Laier
ed0cf68945 Commit ALTQ-patch for ed(4).
Requested and tested by:	pav
MFC after:			1 week
2004-11-21 02:42:09 +00:00
Marcel Moolenaar
57a8f01dc1 o Support for the i8251 wasn't there. Remove the files.
o  Remove the headers with IC register definitions. The headers are
   now taken from sys/dev/ic
2004-11-21 01:51:37 +00:00
Marcel Moolenaar
0204ed7a3f Include the header with the register definitions from sys/dev/ic. They
are shared now.
2004-11-21 01:43:27 +00:00
Marcel Moolenaar
43f0d5705e This file was repocopied from sys/dev/uart/uart_dev_z8530.h. 2004-11-21 01:34:15 +00:00
Marcel Moolenaar
caf45b058e This file was repocopied from sys/dev/uart/uart_dev_sab82532.h. 2004-11-21 01:33:39 +00:00
Marcel Moolenaar
76563bea53 Include the common <dev/ic/ns16550.h> instead of the private
<dev/uart_dev_ns8250.h>. The latter can be removed now.
2004-11-20 23:22:04 +00:00
Marcel Moolenaar
4f5d62fbc6 o Remove the com_thr, com_rhr, com_isr and com_lctl defines. They are
not used and aliases for other defines.
o  Add REG_DATA as an alias for com_data. Likewise for other register
   defines.
o  Add LCR_SBREAK and make CFCR_SBREAK an alias for it. Likewise for
   the other LCR register bits that are known with the CFCR prefix.
o  Add MCR_IE and make MCR_IENABLE an alias for it.
o  Add LSR_TEMT and make LSR_TSRE an alias for it.
o  Add LSR_THRE and make LSR_TXRDY as alias for it.
o  Add FCR_ENABLE and make FIFO_ENABLE as alias for it. Likewise for
   the other FCR register bits that are known with the FIFO prefix.
o  Add EFR_CTS and make EFR_AUTOCTS an alias for it.
o  Add EFR_RTS and make EFR_AUTORTS an alias for it.

This is a first step in cleaning up the definitions in this file.
2004-11-20 23:19:42 +00:00
Justin T. Gibbs
803bbd69c4 Add some useful target mode diagnostics for incoming commands
under the AHC_SHOW_TQIN debug flag.
2004-11-18 20:33:43 +00:00
Justin T. Gibbs
ad32f91b6b Revert to basing all timeout/timer values in ms rather than us. The switch
to us was to help out the Linux port, but really just invited overflow.
In fact, the request sense timer was overflowing prior to this change making
it much shorter than intended.

aic_osm_lib.h:
	Be more careful about overflow in all timer/timeout primitives.
2004-11-18 20:22:31 +00:00
Christian Brueffer
b0103a491a Correct URL of the programming manual. 2004-11-17 23:36:11 +00:00
Christian Brueffer
b0452ccacc Add missing /* DEVICE_POLLING */ 2004-11-17 23:33:56 +00:00
John-Mark Gurney
39189ef797 only clear the IFF_OACTIVE flag when we have a chance of being able to
queue a packet to the hardware... instead of when the hardware queue is
empty..

don't initalize cur_tx now that it doesn't need to be...

Pointed out by:	bde
2004-11-17 21:35:22 +00:00
Marius Strobl
37f37506de Remove the whole uart_cpu_identify() stuff again. Now that it's no longer
used on sparc64 they are only stubs on all architectures and it doesn't
look like if we would need it in the near future again.

Ok'ed by:	marcel
2004-11-17 20:01:43 +00:00
Marius Strobl
f46d4a6741 Add a driver back end for MC146818 and compatible clocks based on the
respective NetBSD driver for use with the genclock interface.
It's first use will be on sparc64 but it was also tested on alpha with
a preliminary patch to switch alpha to use the genclock code together
with this driver instead of the respective code in alpha/alpha/clock.c
and the rather MD mcclock(4). Using it on i386 and amd64 won't be that
hard but some changes/extensions to improve the genclock code in general
should be done first, e.g. add locking and make it easier to access the
NVRAM usually coupled with RTCs.
2004-11-17 16:37:25 +00:00
Marius Strobl
8ff995cc5f o sparc64/isa/isa.c:
- The claim in the commit log of rev. 1.11 of dev/uart/uart_cpu_sparc64.c
    etc. that UARTs are the only relevant ISA devices on sparc64 turned out
    to be false. While there are sparc64 models where UARTs are the only
    devices on the ISA bus there are in fact also low-cost models where all
    devices traditionally found on the EBus are hooked up to the ISA bus.
    There are also models that use a mix between EBus and ISA devices with
    things like an AT keyboard controller and other rather interesting
    devices that we might want to support in the futute hook up to the ISA
    bus.
    In order to not need to add sparc64 specific device_identify methods to
    all of the respective ISA drivers and also not add OFW specific code to
    the common ISA code make the sparc64 ISA bus code fake up PnP devices so
    most ISA drivers probe their devices without further changes.
    Unfortunately Sun doesn't adhere to the ISA bindings defined in IEEE
    1275-1994 for the properties of most of the ISA devices which would
    allow to obtain the vendor and logical IDs from their properties. So we
    we just use a simple table which maps the name properties to PnP IDs.
    This could be done in a more sophisticated way but I courrently don't
    see the need for this. [1]
  - Add the children with fully mapped and specified resources (in the OFW
    sense) similar to what is done in the EBus code for the IRQ resources
    of the children as adjusting the resources and the resource list entries
    respectively in isa_alloc_resource() as done perviously causes trouble
    with drivers which use rman_get_start(), pass-through or allocate and
    release resources multiple times, etc.
    Adjusting the resources might be better off in a bus_activate_resource
    method but the common ISA code currently doesn't allow for an
    isa_activate_resource(). [2]
    With this change:
    - ppbus(4) and lpt(4) attach and work (modulo ECP mode, which requires
      real ISADMA code but it currently only consists of stubs on sparc64).
    - atkbdc(4) and atkbdc(4) attach, no further testing done.
    - fdc(4) itself attaches but causes a hang while attaching fd0 also
      when is DMA disabled, further work in fdc(4) is required here as e.g.
      fd0 uses the address of fd1 on sparc64 (not sure if sparc64 supports
      more than one floppy drive at all).
    All of these drivers previously caused panics in the sparc64 ISA code.
  - Minor changes, e.g. use __FBSDID, remove a dupe word in a comment and
    declare one global variable which isn't used outside of isa.c static.
o dev/uart/uart_cpu_sparc64.c and modules/uart/Makefile:
  - Remove the code for registering the UARTs on the ISA bus from the
    sparc64 uart_cpu_identify() again and rely on probing them via PnP.

Original idea by:	tmm [1]
No objections by:	tmm [1], [2]
2004-11-17 14:44:10 +00:00
Marius Strobl
2d86abb059 o Sync with the NetBSD mk48txx driver (the result simplyfies some changes
I have in mind for the genclock interface):
  - Recognize the MK48T18 as well (differs from the MK48T08 only in
    packaging options and voltages).
  - Allow MD code to provide functions for reading/writing NVRAM/RTC
    locations.
    If passed NULL, the old behaviour using bus_space_{read,write}_1() is
    used. Otherwise, all access to the chip goes via the MD functions.
    This is necessary for mvmeppc boards where the mk48txx NVRAM/RTC is
    not directly addressable.
  - Cleanup MI mk48txx(4) todclock driver:
    - Prepare mk48txxvar.h and leave only register definitions in
      mk48txxreg.h.
    - Define struct mk48txx_softc as usual devices and allocate necessary
      members in it.
    - Change mk48txx_attach() to only take a device_t.
o While converting the sparc64 eeprom driver to the above changes:
  - Remove some dead code and stale comments.
  - Use the NVRAM size provided by the mk48txx driver instead of hardcoding
    it as suggested by a comment.
  - Add a comment about why it doesn't make much sense to read the hostid
    directly from the NVRAM except for displaying it when attaching.
  - Don't print the hostid if it reads all zero because it's stored
    elsewhere.
2004-11-17 12:54:12 +00:00
Scott Long
5f26d98581 Don't set the BUS_DMA_ALLOCNOW flag for the parent tag or the tags that are
used for static memory allocations.

Discussed with: sos
2004-11-17 11:27:30 +00:00
Pyun YongHyeon
94a4f968c1 Make interrupt coalescing work on big endian systems.
Also change struct ucode.length to be in number of elements (u_int32_t)
to help endian handling.

MFC after:	2 weeks
2004-11-17 04:25:10 +00:00
Nate Lawson
ae56b59f8b Enable throttling/C3 quirks for PIIX4 parts. Defer checking quirks until
after boot so that PCI is initialized and we can probe for the problem
chipsets.  Note that while probed but unusable states are disabled, they
aren't freed yet.  In the future, it may make sense to detach them.

Tested by:	Adam K Kirchoff <adamk at voicenet com>
MFC after:	2 days
2004-11-16 18:47:42 +00:00
Maksim Yevmenkin
f89a7b24b4 Add virtual AT keyboard driver vkbd(4).
Not yet connected to the build.
2004-11-16 16:59:23 +00:00
Ian Dowse
f6b587096b Fix just the worst of the timeout race conditions that the previous
backed out commits were trying to address: when cancelling the timeout
callout, also cancel the abort_task event, since it is possible that
the timeout has already fired and set up an abort_task.
2004-11-16 00:48:27 +00:00
John-Mark Gurney
c42f170477 move the lock after the NULL check so we don't have a hard(er) to diagnose
panic...

Pointed out by:	Bjoern A. Zeeb
2004-11-15 22:24:32 +00:00
Warner Losh
2451114ab1 Remove more debugging 2004-11-15 20:08:44 +00:00
John-Mark Gurney
069114c230 fix the missing lock in sk_jfree (verified w/ an assert)
also fix up handling and proding of the tx, _OACTIVE is now handled
better...

Submitted by:	Peter Edwards (sk_jfree)
Obtained from:	OpenBSD and/or NetBSD (tx prod)
2004-11-15 19:37:21 +00:00
Warner Losh
c2aed5122b After discussions with Nate, repo copy the acpi assist drivers from
i386 to dev/acpi_support.  In theory, these devices could be found
other than in i386 machines only as amd64 becomes more popular.  These
drivers don't appear to do anything i386 specific, so move them to
dev/acpi_support.  Move config lines to files so that those
architectures that don't support kernel modules can build them into
the kernel.  At the same time, rename acpi_snc to acpi_sony to follow
the lead of all the other specialty devices.
2004-11-15 05:54:15 +00:00
Warner Losh
b42dda8abf Merge 1.3 from acpi_snc.c: don't use return_VALUE() macro
Improve style(9) compliance.
2004-11-15 05:12:17 +00:00
Marcel Moolenaar
982ea33b89 Apply a bandaid to avoid hangs on Ultra 2 machines. The second Z8530
connects to the keyboard and mouse and needs some special treatment.
Until this is fully understood, implemented and tested, simply avoid
probing the second Z8530. This is also what the zs(4) driver does.
2004-11-15 02:47:37 +00:00
Marcel Moolenaar
bfa307a39c Be slightly more paranoid about using the divisor in a division and
the calculated baudrate. Neither should be 0.
2004-11-15 00:00:24 +00:00
Marcel Moolenaar
d8518925d0 Implement UART_IOCTL_BAUD. Consequently, when the baudrate was unset
for the console, we emit the actual baudrate during bus enumeration.
2004-11-14 23:31:19 +00:00
Marcel Moolenaar
54e2bcc7ad Add UART_IOCTL_BAUD to allow us to query the hardware about the
current baudrate setting. Use this ioctl() when we don't know the
baudrate of the sysdev (as represented by a 0 value). When the
ioctl() fails, e.g. when the backend hasn't implemented it or the
hardware doesn't provide the means to determine its current baudrate
setting, we invalidate the baudrate setting by setting it to -1.
None of the backends currently implement the new ioctl().
2004-11-14 23:12:14 +00:00