Commit Graph

13264 Commits

Author SHA1 Message Date
Joseph Koshy
c5153e190b Add convenience APIs pmc_width() and pmc_capabilities() to -lpmc.
Have pmcstat(8) and pmccontrol(8) use these APIs.

Return PMC class-related constants (PMC widths and capabilities)
with the OP GETCPUINFO call leaving OP PMCINFO to return only the
dynamic information associated with a PMC (i.e., whether enabled,
owner pid, reload count etc.).

Allow pmc_read() (i.e., OPS PMCRW) on active self-attached PMCs to
get upto-date values from hardware since we can guarantee that the
hardware is running the correct PMC at the time of the call.

Bug fixes:
 - (x86 class processors) Fix a bug that prevented an RDPMC
   instruction from being recognized as permitted till after the
   attached process had context switched out and back in again after
   a pmc_start() call.

   Tighten the rules for using RDPMC class instructions: a GETMSR
   OP is now allowed only after an OP ATTACH has been done by the
   PMC's owner to itself.  OP GETMSR is not allowed for PMCs that
   track descendants, for PMCs attached to processes other than
   their owner processes.

 - (P4/HTT processors only) Fix a bug that caused the MI and MD
   layers to get out of sync.  Add a new MD operation 'get_config()'
   as part of this fix.

 - Allow multiple system-mode PMCs at the same row-index but on
   different CPUs to be allocated.

 - Reject allocation of an administratively disabled PMC.

Misc. code cleanups and refactoring.  Improve a few comments.
2005-05-01 14:11:49 +00:00
Søren Schmidt
9ec5e87f63 Update on the last commit, the dma* funciton needs to be called with
a channel device, not an ata device, or we'll be out of luck in
reset/timeout where we dont have a device.
2005-05-01 12:24:45 +00:00
Søren Schmidt
1191f58127 Go back to the old way of finding the Promise metadata, the new way was
too simple causing older controllers metadata to get lost.
2005-05-01 08:45:12 +00:00
Søren Schmidt
0068f98f88 Take newbusification one step further, ie use the device_t more consequently
all way through the code down the layers, instead of the mix'n'match that
resulted from the conversion done earlier.

Sponsored by:	pair.com
2005-04-30 16:22:07 +00:00
Vinod Kashyap
b598979dc9 Make call to tw_cl_deferred_interrupt in twa_poll, not dependent on the
return value from tw_cl_interrupt.
2005-04-29 20:03:20 +00:00
Søren Schmidt
e47099593a Now that probing is working in the new fashion, we need to go back to
having ata_getparm issue an ata_request and not fool around with the HW
on its own.
Needed for new HW support.
2005-04-29 11:30:03 +00:00
Warner Losh
4e30440d7c Add a detach for pci bridge and pci bus drivers. This allows one to
theoretically unload pci bridges or pci drivers.  It will also allow
detach to work if one needed to detach a subtree.

This is inspired by looking at the p4 commits from bms to his 5.4
tree, but I didn't look at the final results.
2005-04-29 06:22:41 +00:00
Scott Long
a304e92b2b Only create the rdpti alias if the asr device creation succeeds. 2005-04-29 04:47:11 +00:00
Scott Long
1c7e93581d Don't bother pretending that CAM will send CAM_DATA_PHYS pointers. It's
a concept that is fundamentally broken with PAE.
2005-04-29 02:58:23 +00:00
Marcel Moolenaar
d98d9b126b In pcib_alloc_resource() check if the resource allocation request is
for the VGA I/O or memory ranges, when it's not within the default
ranges decoded by the bridge. When allocation for VGA addresses is
attempted, check that the bridge has the VGA Enable bit set before
allowing it.
As such, newbusified VGA drivers can allocate their resources when
the VGA adapter is behind a PCI-to-PCI bridge.

Reviewed by: imp@, jhb@
2005-04-29 02:15:40 +00:00
Marcel Moolenaar
9929ff6b5b Add pci_is_vga_ioport_range() and pci_is_vga_memory_range() as inline
functions. These functions centralize the details of which I/O port
and memory ranges belong to VGA.

Reviewed by: imp@, jhb@
2005-04-29 02:03:11 +00:00
Marcel Moolenaar
d1ee178775 Add defines for the Bridge Control Register bits.
Obtained from: jhb@
2005-04-29 01:58:27 +00:00
Søren Schmidt
ca8c70e9e3 Provide a default setmode method.
This shaves off multiple copies of the same setmode stub.
2005-04-28 22:15:44 +00:00
Søren Schmidt
8dad6b7be5 Rearrange the way the reset code is called.
Prepare for different looking controllers.
2005-04-28 22:08:08 +00:00
Paul Saab
4bb10cf193 Add support for the P600 and name the E400. 2005-04-28 14:40:23 +00:00
Joseph Koshy
6b8c8cd85f Return the correct register number in the 'get_msr()' MD function.
Only allow a process to use the x86 RDPMC instruction if it has
allocated and attached a PMC to itself.

Inform the MD layer of the "pseudo context switch out" that needs
to be done when the last thread of a process is exiting.
2005-04-28 08:13:19 +00:00
Marcel Moolenaar
ca83142fc3 Make the Z8530 more reliable as low-level console by making use of the
fact that access to RR0 does not need a prior write to the register
index because the index always reverts to 0 after the indexed register
has been accessed.

Typically when a RR or WR is to accessed, one programs the index (which
is a write to the control register), followed by a read or write to the
actual indexed register (a read pr write to the same control register).
When this non-atomic sequence is interrupted after having written the
index and low-level console I/O is done in that situation, the write to
program the index will actually write to the indexed register and nuke
state. This almost always yields a wedge.

By not programming the index register and instead just reading from RR0,
the worst case scenario is non-fatal. For if we don't actually read from
RR0 but some other register we get an invalid status, which may lead us
to conclude that the transit data register is empty when it's not or that
the receive data register contains data when it doesn't. Hence, we may
lose an output character or get a sporadic input character, but given
the situation this is a non-issue.

Full serialization is not possible due to the fact that this code needs
to work from DDB and before mutex initialization has happened.

In collaboration with: kris@, marius@
Tested by: kris@
MFC after: 1 day
X-MFC: 5.4-RELEASE candidate
2005-04-27 21:57:51 +00:00
Julian Elischer
7f05203a38 Add code from Kazuhito HONDA that allows the user to see
the available modes in /dev/sndstat.
e.g.
pcm1: <USB Audio> at addr ? (0p/1r/0v channels duplex)
        mode 1:(input) 1ch, 16/16bit, pcm, 44100Hz
	mode 2:(input) 1ch, 16/16bit, pcm, 22050Hz
	mode 3:(input) 1ch, 16/16bit, pcm, 11025Hz
	mode 4:(input) 1ch, 16/16bit, pcm, 8000Hz
2005-04-27 17:16:27 +00:00
David E. O'Brien
34eea30cf1 I missed a s/nv/nve/.
Submitted by:	Tai-hwa Liang <avatar@mmlab.cse.yzu.edu.tw>
2005-04-26 16:07:50 +00:00
Scott Long
4ef63bad69 Remove an extra mutex unlock in the morpheus interrupt handler.
PR: 80246
Submitted by: Dean Strik
MFC After: 3 days
2005-04-26 13:38:29 +00:00
Søren Schmidt
f1be1cdc88 Fix a bug introduced in r1.89 thats caused leak of requests, and possibly
bogus data to be written.
2005-04-26 06:42:33 +00:00
Bill Paul
627e5814bc Remove the extra EEPROM reload step I added before. vge_reset()
already does this anyway.
2005-04-25 23:26:20 +00:00
Scott Long
20fc2576fe Apply a torniquet to the problem of the drive unexpectedly disconnecting
during a data phase.  Before, we would try to recover the autosense, but
the DMA engine would still be active with interrupted transfer, and we'd
quickly spiral out of control and cause massive data corruption.  For now,
just reset the chip and cancel everything.  The better solution is to
cancel the DMA operation, but there is no clear way to do that right now.
The data corruption problem is severe enough to warrant this fix in the
interim.  Thanks to Kris Kenneway to sacrificing countless filesystems to
this bug.

MFC After: 3 days
2005-04-25 22:11:43 +00:00
Bill Paul
42559cd2af Correct the if_link_state_change() logic: when the link went down,
if_link_state_change() reported link up, and when the link went up,
if_link_state_change() reported link down. These should be swapped.
2005-04-25 18:37:27 +00:00
Bill Paul
bb74e5f6f9 Reading the EEPROM to learn the station address doesn't seem to work
on boards with VIA gigE controllers that are embedded in VIA chipsets.
Presumably, they don't have an external EEPROM and store the MAC
address somewhere else. To get around this, force an autoload and
read the station address from the RX filter registers instead.
This has been tested to work on both embedded and standalone
controllers.
2005-04-25 18:29:42 +00:00
Bjoern A. Zeeb
261a19c1ee Deal with failed malloc calls[1].
While there also check for failed device_add_child calls.

Found by:	Coventry Analysis tool[1].
Submitted by:	sam[1]
Approved by:	pjd (mentor)
MFC after:	1 week
2005-04-25 10:18:24 +00:00
Søren Schmidt
ecd6c15d6a Cosmetics 2005-04-25 07:57:04 +00:00
Søren Schmidt
6257850052 Only try to allocate and use the SATA resource if they are enabled
by the BIOS. It seems some BIOS's doesn't get this right, and that would
result in ATA panic'ing.
2005-04-25 07:50:51 +00:00
Poul-Henning Kamp
e4ee89af6f Retire the musycc E1/T1 driver 2005-04-25 07:08:42 +00:00
Bill Paul
96b50ea387 Throw the switch on the new driver generation/loading mechanism. From
here on in, if_ndis.ko will be pre-built as a module, and can be built
into a static kernel (though it's not part of GENERIC). Drivers are
created using the new ndisgen(8) script, which uses ndiscvt(8) under
the covers, along with a few other tools. The result is a driver module
that can be kldloaded into the kernel.

A driver with foo.inf and foo.sys files will be converted into
foo_sys.ko (and foo_sys.o, for those who want/need to make static
kernels). This module contains all of the necessary info from the
.INF file and the driver binary image, converted into an ELF module.
You can kldload this module (or add it to /boot/loader.conf) to have
it loaded automatically. Any required firmware files can be bundled
into the module as well (or converted/loaded separately).

Also, add a workaround for a problem in NdisMSleep(). During system
bootstrap (cold == 1), msleep() always returns 0 without actually
sleeping. The Intel 2200BG driver uses NdisMSleep() to wait for
the NIC's firmware to come to life, and fails to load if NdisMSleep()
doesn't actually delay. As a workaround, if msleep() (and hence
ndis_thsuspend()) returns 0, use a hard DELAY() to sleep instead).
This is not really the right thing to do, but we can't really do much
else. At the very least, this makes the Intel driver happy.

There are probably other drivers that fail in this way during bootstrap.
Unfortunately, the only workaround for those is to avoid pre-loading
them and kldload them once the system is running instead.
2005-04-24 20:21:22 +00:00
Eric Anholt
7c26ccfd22 Fix a panic on X startup for drivers that don't init maps themselves by storing
the return value of drm_ioremap in the right place again.

Submitted by:	tegge
2005-04-24 19:03:32 +00:00
Scott Long
2f28b97311 Fix the order of the lowaddr,highaddr arguments in the parent tag. This
coincidentally didn't cause any problems, but was definitely wrong.
2005-04-24 02:45:27 +00:00
Maxime Henrion
507feeafad Be more conservative when enabling extended features. There are fxp(4)
NICs out there that have an utterly bogus revision ID.

Reported by:	Denis Shaposhnikov <dsh@vlink.ru>
2005-04-22 13:05:53 +00:00
Warner Losh
8343165363 Sort Oxford Semi entires. Add entry for OXCB950, a PCI/CardBus
16C950.  Adding it here doesn't unlock any of the cool 16C950 features
(like the 128 byte fifo, the different prescalor, etc), but it does
seem to get it working for me in light testing.

Card Provided by: Ihsan Dogan
2005-04-22 07:49:35 +00:00
Scott Long
4bd55c43ea If we get interrupted during a data phase and the DMA engine is still
pumping data despite our scsi data counters being at 0, something has
gone massively wrong.  The consequence of happily ignoring this is more
DMA phase errors and a disk full of spammed sectors.  Instead, panic on
the first occurance to hopefully limit the damage.

MFC After: 3 days
2005-04-22 03:37:10 +00:00
Maxime Henrion
de57160389 Add a microcode to implement receive bundling for 82551 chipsets with
a revision ID of 0x0f (D102 E-step).

MFC after:	2 weeks
Tested by:	pav
2005-04-21 19:34:57 +00:00
Maxime Henrion
647ec60cc7 Enable extended RFDs and TCBs, and thus checksum offloading, for
latest 82550 and 82551 chipsets (revision IDs 0x0e, 0x0f and 0x10).
We were only enabling it for revisions 0x0c and 0x0d, now it's
enabled for any 8255x NIC with a revision ID bigger than 0x0c.  It
should be safe, and this is what Intel does in their open source
driver.

MFC after:	2 weeks
Tested by:	Pavel Lobach lobach_pavel at mail dot ru
2005-04-21 13:27:38 +00:00
Søren Schmidt
1d968d225f Rehash the timeout code to make it more simple.
This also removes the warning timeout on the taskqueues stalling as
I'm tired of getting ATA error reports for problems in other parts ;)
Misc cosmetic and comment cleanups now we are here.
2005-04-21 11:13:39 +00:00
Nate Lawson
98cc161947 Add the tunable "debug.acpi.max_threads" to allow users to set the
number of task threads to start on boot.  Go back to a default of 3
threads to work around lost battery state problems.  Users that need
a setting of 1 can set this via the tunable.  I am investigating the
underlying issues and this tunable can be removed once they are solved.

MFC after:	2 days
2005-04-21 06:13:48 +00:00
Marcel Moolenaar
7ad17ef97e Include <sys/pmc.h> instead of <machine/pmc_mdep.h>. The MI header
includes the MD header for us. Do not include <machine/specialreg.h>
as it is not a header file that can be included from MI files. It
is included from <machine/pmc_mdep.h> if so needed and possible.

Ok'd: jkoshy@
2005-04-20 20:26:39 +00:00
Søren Schmidt
46917bb6f4 When a rebuild is done, properly mark the arrays as functional again. 2005-04-20 14:14:08 +00:00
Søren Schmidt
77662bd705 Properly hook in devices found by SATA connect events.
This broke on the changes done to get atapicam happy earlier.
2005-04-20 12:51:54 +00:00
Joseph Koshy
e1691ef740 Remove dead variable. 2005-04-20 04:43:30 +00:00
Bill Paul
d365e2f833 Small cleanup of the WPA code additions. The SIOCG80211 and SIOCS80211
ioctls are now handled explicitly, but we can't really do anything
with them unless the NIC is up (trying to get/set a parameter when
the NDIS driver isn't running always yields an error). If something
invokes either of these ioctls and the NIC isn't initialized, punt
to the default ieee80211_ioctl() routine.
2005-04-20 02:17:53 +00:00
Warner Losh
e68792740e Remove unused variable that was horking up the LINT build 2005-04-19 21:40:49 +00:00
Warner Losh
869f4a8bc8 Minimal changes to get this to compile with -DDEBUG defined as well
as hack a couple used before set warnings for LINT happiness.
2005-04-19 21:12:57 +00:00
Bill Paul
c2ea1490f8 Add preliminary support for WPA-PSK using wpa_supplicant and the
net80211 code, graciously contributed by Arvind Srinivasan.

Submitted by:	Arvind Srinivasan arvind at celar daht us
2005-04-19 15:30:44 +00:00
Søren Schmidt
5345b2d755 CFA (Compact Flash) devices has a special config ID that fails the
normal ATA device check in ata-disk.c. Add support for the CFA magic.
2005-04-19 12:33:26 +00:00
Paul Saab
17c0792df6 Provide a way to soft reset a proxy controller such as an MSA20 or
MSA500.  This is useful if you need to reset one of the storage
arrays on reboot.
2005-04-19 06:11:16 +00:00
Søren Schmidt
e30a3e750f Fix indentation problem in the last commit 2005-04-19 05:28:08 +00:00