Commit Graph

85257 Commits

Author SHA1 Message Date
macallan 74ab06b7a7 when powering up the mediabay wait two seconds before looking for devices
Without this CDROM drives wouldn't be found when hotplugged.
2006-12-10 02:41:30 +00:00
uwe ba06ad7411 Add missing aprint_naive to the attach routine. 2006-12-10 00:40:10 +00:00
uwe d2a699ecf7 Print pci device info instead of "Power Management Controller". 2006-12-10 00:34:52 +00:00
uwe e8e4f16a5c aprint_naive("\n") to terminate "Found" line for quiet boot.
Use aprint_error to report that we are unable to establish power hook.
2006-12-10 00:33:11 +00:00
uwe 9ee91471c3 Properly def{flag,param} all PNPBIOS* options and consolidate them in
opt_pnpbios.h.  Update DEBUG config since PNPBIOSDEBUG_VALUE requires
parameter now.
2006-12-09 22:45:26 +00:00
chs 088fbfd7aa in fdloadfile(), fail if we can't read the entire exec header. 2006-12-09 22:11:36 +00:00
chs 975004d9f1 several ext2fs fixes provided by Barry Bouwsma:
- set ip->i_e2fs_dtime to time_second, not time_uptime.
 - don't allow ipref to go negative
 - fs->e2fs.e2fs_icount is a valid inode number, allow it.
2006-12-09 22:07:48 +00:00
chs 74234c1818 don't include <sys/endian.h> when building as a host tool. 2006-12-09 22:02:24 +00:00
chs 5115829218 feed /dev/null to awk for building modedef.c (for building on solaris). 2006-12-09 22:01:01 +00:00
manu 57cf012b11 Add support for 4 and 8 ports modem boards from Perle systems 2006-12-09 21:06:06 +00:00
dyoung 0aaca355b2 Fix misplaced ampersand. Noticed by Greg Troxel. 2006-12-09 19:29:18 +00:00
chs c398ae9734 a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
   these now always return the parent vnode locked.  namei() works as before.
   lookup() and various other paths no longer acquire vnode locks in the
   wrong order via vrele().  fixes PR 32535.
   as a nice side effect, path lookup is also up to 25% faster.
 - the above allows us to get rid of PDIRUNLOCK.
 - also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
 - remove an assumption in layer_node_find() that all file systems implement
   a recursive VOP_LOCK() (unionfs doesn't).
 - require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
   fill in eopnotsupp() for file systems that don't support being exported
   and remove the checks for NULL.  (layerfs calls these without checking.)
 - in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
   adjust which vnode is locked.  fixes PR 33374.
 - apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().
2006-12-09 16:11:50 +00:00
chs a8459c8cc1 in lockstatus(), report LK_EXCLOTHER if LK_WANT_EXCL or LK_WANT_UPGRADE
is set, since the thread that set either of those flags will be the next
one to get the lock.  fixes PR 35143.
2006-12-09 15:59:25 +00:00
tsutsui 6f7d423e1a Use "options<space><tab>" 2006-12-09 12:52:16 +00:00
tsutsui 8474274d47 Add the following network devices:
- pcn at pci
- wm at pci
- makphy at mii
- rgephy at mii
- rlphy at mii
2006-12-09 12:45:35 +00:00
bouyer 8f9ec90387 Remove extra ) causing compile failure when CONS_OVERRIDE is defined.
From Hideo Masuda in PR port-xen/35217.
2006-12-09 10:37:52 +00:00
dyoung cf7bb443ac Straggler from last: convert to rtflush(). 2006-12-09 06:32:58 +00:00
dyoung c308b1c661 Here are various changes designed to protect against bad IPv4
routing caused by stale route caches (struct route).  Route caches
are sprinkled throughout PCBs, the IP fast-forwarding table, and
IP tunnel interfaces (gre, gif, stf).

Stale IPv6 and ISO route caches will be treated by separate patches.

Thank you to Christoph Badura for suggesting the general approach
to invalidating route caches that I take here.

Here are the details:

Add hooks to struct domain for tracking and for invalidating each
domain's route caches: dom_rtcache, dom_rtflush, and dom_rtflushall.

Introduce helper subroutines, rtflush(ro) for invalidating a route
cache, rtflushall(family) for invalidating all route caches in a
routing domain, and rtcache(ro) for notifying the domain of a new
cached route.

Chain together all IPv4 route caches where ro_rt != NULL.  Provide
in_rtcache() for adding a route to the chain.  Provide in_rtflush()
and in_rtflushall() for invalidating IPv4 route caches.  In
in_rtflush(), set ro_rt to NULL, and remove the route from the
chain.  In in_rtflushall(), walk the chain and remove every route
cache.

In rtrequest1(), call rtflushall() to invalidate route caches when
a route is added.

In gif(4), discard the workaround for stale caches that involves
expiring them every so often.

Replace the pattern 'RTFREE(ro->ro_rt); ro->ro_rt = NULL;' with a
call to rtflush(ro).

Update ipflow_fastforward() and all other users of route caches so
that they expect a cached route, ro->ro_rt, to turn to NULL.

Take care when moving a 'struct route' to rtflush() the source and
to rtcache() the destination.

In domain initializers, use .dom_xxx tags.

KNF here and there.
2006-12-09 05:33:04 +00:00
tsutsui 8c797b13b0 Add pcn(4) at pci. Tested on AlphaPC164. 2006-12-09 04:50:56 +00:00
enami 7edaf87909 The function wget() is always responsible to maintain length of component
not yet compared.  Otherwise pathname lookup fails on certain condition.
2006-12-08 22:04:56 +00:00
joerg 22f3b113a0 Remove now superflous {. 2006-12-08 17:20:05 +00:00
joerg c882b2cbc1 When a dynamic route is deleted in in_losing and in6_losing, rtrequest
is called, but the current reference via the PCB is not removed. This
is effectively a leaked reference. Call rtfree unconditional.
2006-12-08 16:06:22 +00:00
yamt 98cfc473c8 - pass intrframe by-pointer, not by-value.
- make i386 and xen use per-cpu interrupt stack.

xen part is reviewed by Manuel Bouyer.
2006-12-08 15:05:18 +00:00
yamt 4d5f3128d9 don't expose FILEASSOC_NHOOKS. 2006-12-08 13:23:22 +00:00
christos 3c71b5db0d - make so_linger unsigned short to double the range
- return 1 or 0 for the flag being set instead of the flag value
- check for range properly
2006-12-08 00:23:08 +00:00
xtraeme 2a45f1f640 * Rename pnow_cpu_quirk_check() to pnow_cpu_check().
* Add another model that needs to be added into the quirk table.
* Don't iterate over the pnow_cpu_quirk array if the two signatures
  are identical.

Patch sent privately by Olaf 'Rhialto' Seibert, thanks.
2006-12-07 22:50:12 +00:00
pooka 2911d34706 In case of an error, return an error. Otherwise the worst case was
that dostatvfs() wrote to a recently deceased struct mount.
2006-12-07 22:06:02 +00:00
plunky 24f1ec09dc Do not use the output buffer to store data unless we mean it to go in
the packet, as there is a problem with overwriting information while we
still need it (opt->length in particular) which causes connections to
fail.
2006-12-07 21:36:27 +00:00
ad f45632428c iostat: avoid sleeping with a held simple_lock. 2006-12-07 20:23:38 +00:00
ad ffa6c5cf99 sysctl_proc_corename(): do the second auth check against the correct
process.
2006-12-07 20:04:31 +00:00
joerg b49bdf49d7 Deinline rt_get_ifa. Keep it in route.c as it is part of the routing
API, even though rtsock.c is the only user right now.
2006-12-07 19:37:08 +00:00
joerg d87b42b41f Deinline rt_replace_ifa and move rt_set_ifa and rt_set_ifa1 to
route.c as they are not used outside that file.
2006-12-07 19:20:14 +00:00
pooka 251d9ef9df let implementation ultimately decide if mmap is supported - pass
VOP_MMAP to fs server
2006-12-07 16:58:39 +00:00
elad b8e4702fb2 Back out uvm_is_swap_device(). 2006-12-07 14:06:51 +00:00
macallan 793de63a0f add igsfb at ofbus 2006-12-07 03:11:15 +00:00
macallan 0e7f627c30 add glue for igsfb at ofbus 2006-12-07 03:10:14 +00:00
jdc 6d7a98c7bc Explicitly include <sys/device.h>, which we need for `struct device'.
This allows us to compile on !i386.  (On i386, <machine/cpu.h> pulled
in <sys/device.h> for us, thus hiding the compilation problem.)

OK by rpaulo@.
2006-12-06 21:42:38 +00:00
hauke 82e4e09423 Support for four nubus video cards:
Formac ProNitron 80.IVb (1024x768/8)
Relax 19" Model 200 (1024x768/8)
Apple Monochrome Video Card (640x480/1)
VillageTronic Mac Picasso 320 (up to 1920x1080/up to 24)

Nubus identifiers for Creative Solutions parallel & serial cards,
and a Becton Dickinson data acquisition card.
2006-12-06 21:21:12 +00:00
christos dbc497f58c simplify linger code. 2006-12-06 20:49:02 +00:00
christos 99f8337886 get the vmspace first before you try to use it. 2006-12-06 18:54:02 +00:00
tsutsui fba4e06d1b No need to include PCI header files. 2006-12-06 13:52:46 +00:00
skrll ecf6232588 Some installation fixes:
- add a ses(4) major number as the MI MAKEDEV tries to create the
	  nodes. hi elad.

	- create audio devices.

	- provide mount_kernfs and a dmesg command.

	- start sysinst automagically and fix backspace key.

Mostly prompted by David H. Gutteridge on port-hp700.
2006-12-06 10:27:00 +00:00
yamt a575dafacc use KSI_INIT rather than memset. no functional changes. 2006-12-06 10:02:22 +00:00
yamt 9c62b6fe1d nfs_disconnect: 2 -> SHUT_RDWR. no functional change. 2006-12-06 09:13:46 +00:00
yamt 8836e5995d add some more tcp mowners. 2006-12-06 09:10:45 +00:00
yamt f5830ee995 - make tcp_reass static.
- constify.
2006-12-06 09:08:27 +00:00
yamt 6c575a38c3 nfsrv_rcv: claim ownership of received mbufs. 2006-12-06 08:55:52 +00:00
dyoung 2bbeb90e43 Remove stray curly brace. Thanks, yamt! 2006-12-06 04:29:09 +00:00
dyoung 857f0ccbed KNF. 2006-12-06 00:50:34 +00:00
dyoung d7a8741d84 KNF. 2006-12-06 00:39:56 +00:00
dyoung 0394fe1e42 KNF. 2006-12-06 00:38:16 +00:00
pooka 380ec0e482 compile puffs_transport.c 2006-12-05 23:41:46 +00:00
pooka 997d4f41fa shuffle functions around a bit: move the transport (/dev/puffs) to
a different file from the messaging (request contents).  no functional
change
2006-12-05 23:41:24 +00:00
pooka a966070d38 adjust file size in write only if file grows. but since this change is
in the "never use ubc" branch, I don't think it matters except for cosmetics.
2006-12-05 23:07:42 +00:00
pooka 0435bcee31 Allow multiple requests to be transferred in each GET/PUTOP. For
a single request, the performance is still the same.
2006-12-05 23:03:28 +00:00
elad 97f57b38e7 PR/35021: Brian de Alwis: root cannot get/set rlimit information of user
processes through sysctl

Fix inverted logic in boolean assignment. This is why these tests should
not be done outside the secmodel code.

Thanks for the report.
2006-12-05 21:30:50 +00:00
macallan 27138de097 move int j into #ifdef COMPAT_30 to avoid an unused variable warning when
building without COMPAT_30
2006-12-05 20:45:36 +00:00
macallan f2ee53a3d8 Enable the .note.netbsd section for macppc 2006-12-05 20:41:46 +00:00
christos 682562feb0 fix compilation issues. 2006-12-05 17:35:35 +00:00
skrll 7e7373acc9 Enable the .note.netbsd section for hppa. 2006-12-05 16:58:11 +00:00
is f70b506cfb use m_adj instead of explicit pointer manipulation 2006-12-05 16:36:14 +00:00
is a1f6d5cc3f explain magic constant 2006-12-05 16:33:56 +00:00
martin fe8307c191 Enable the .note.netbsd section 2006-12-05 16:17:20 +00:00
martin 884e5dfbd6 Properly mark the .note.netbsd.ident section as ELF NOTE section.
While there, enable the mark for sparc64.
2006-12-05 16:15:53 +00:00
pavel 60ca34bcae Add forgotten #include "opt_compat_netbsd.h" because COMPAT_30 is used.
Should fix a build problem reported by Blair Sadewitz.
2006-12-05 08:17:03 +00:00
elad ca185532f5 sparc64: don't enable PaX MPROTECT by default for now.
sparc: add commented out 'FILEASSOC'.
2006-12-04 23:43:35 +00:00
elad edad69123e PR/25741: ITOH Yasufumi: ras(9) sequence is not protected against ptrace(2)
Okay christos@
2006-12-04 18:50:19 +00:00
christos 33b30b1ee3 From Nicolas Joly: restore previous behavior in procfs_validfile_linux, since
readdir passes a NULL lwp.
2006-12-04 18:27:52 +00:00
tsutsui 8687a698bd Add the following network devices:
- wm* at pci?
- makphy* at mii?
- rgephy* at mii?
- rlphy* at mii?
Tested with RTL8139C, RTL8169S-32, and i82544EI on EB164.
2006-12-04 17:33:41 +00:00
is 4fe0853ea1 Typo in comment. 2006-12-04 15:14:45 +00:00
dyoung dcabc5c2e5 Make code concise by removing uninformative #ifdef's. 2006-12-04 03:02:48 +00:00
dyoung 9534d9db92 Indent these macros for readability. People have to read this
code, too.
2006-12-04 02:59:35 +00:00
dyoung 1b9b487578 Lightly constify. Helps compile-time checking that we are not
scribbling over shared or read-only memory---e.g., in mbufs.
2006-12-04 02:58:06 +00:00
dyoung a291eaf06c KNF. 2006-12-04 02:53:17 +00:00
dyoung 627864e36f Per discussion on tech-net@, discard the address-munging hack that
let one create a tunnel with equal inner and outer destination IP
numbers.  Update gre(4) documentation for this change.

Extract subroutine  gre_update_route() from gre_compute_route(),
and always call it in gre_output() to freshen the route for
tunnel-encapsulated packets.
2006-12-04 02:40:15 +00:00
dyoung fdab81c3b0 No need for a struct route_in6 in pf_route6(). Replace it with a
sockaddr_in6.

In pf_calc_mss(), factor common code out of PF_INET and PF_INET6
switch cases.
2006-12-04 02:28:12 +00:00
dyoung 31730224f4 In gre_clone_destroy,
1 use splnet() to synchronize gre clone destruction with interrupts,
  and
2 wait to call if_detach() until after joining the gre kernel
  thread.
2006-12-04 01:49:47 +00:00
dyoung e45f67b8b4 Extract subroutines rn_walkfirst() and rn_walknext() from rn_walktree().
No functional change intended.

Add some new diagnostic code, bracketed by #ifdef RN_DEBUG, that
uses the two new subroutines to walk and print a tree.

XXX The format of the diagnostic print-outs needs improvement.
2006-12-04 01:45:50 +00:00
dyoung add8c1de7f Add rtw at pci to the GENERIC kernel. 2006-12-04 01:32:37 +00:00
dyoung 571fae988f Compile gre(4) into the GENERIC kernel. 2006-12-04 01:30:56 +00:00
dyoung 7e5a475027 Replace the temporary variable ndst with rt_key(rt). This will
simplify the application of RADIX_MPATH patches.

No functional change intended.
2006-12-04 00:56:44 +00:00
dyoung 8a5a3d2d66 Paranoid protection against use after free: in rtfree(), set rt_ifa
and rt_ifp to NULL.
2006-12-04 00:52:47 +00:00
dyoung b0520122af Cosmetic: remove extra empty line. 2006-12-04 00:48:59 +00:00
pavel 9b8e4189e5 Restore compatibility of USB_DEVICEINFO ioctl and reads from /dev/usb with
NetBSD 3.x. Patch from Stephan Thesing provided in
http://mail-index.netbsd.org/current-users/2006/03/21/0002.html, with some
modifications by me.
See also
http://mail-index.netbsd.org/current-users/2006/08/29/0017.html

The code is conditionally compiled depending on COMPAT_30.

Also fix a leak of struct usb_event in usbread() introduced while converting
on-stack variables to dynamic allocation.

Reviewed by martin@.
2006-12-03 22:34:58 +00:00
dyoung c8485f3e10 Remove superfluous parentheses. 2006-12-03 21:56:30 +00:00
dyoung 626b8f05e2 Fix spelling, s/straglers/stragglers/. 2006-12-03 19:17:41 +00:00
dsl 66a1a1560d Add -DUNALIGNED_ACCESS here, libsa/dosfs.c seems to need it.
Probably it ought to come from some generic .h file, but I've no idea
which - nor if any existing define has the same effect.
In any case this saves oodles of bytes in bootxx_msdos.
2006-12-03 19:14:08 +00:00
elad 8a806df7dc Move kauth(9) call to where it belongs. Noticed by Nicolas Joly, thanks! 2006-12-03 13:24:10 +00:00
macallan 5d88b0aa20 make /dev/openfirm work in GENERIC again 2006-12-03 04:13:55 +00:00
tsutsui b0f03bc527 - pull the following fix from FreeBSD's rgephy.c rev 1.14:
> - Don't set MIIF_NOISOLATE so rgephy(4) can be used in configurations
  >   with multiple PHYs and un-comment case IFM_NONE in case MII_MEDIACHG
  >   rgephy_service(). There doesn't seem to be a problem with isolating
  >   RTL8169S and their internal PHY.
  and rev 1.12:
  > - Fix some spelling in comments.
  > - Remove superfluous returns at the end of void functions.
  > - Remove unused static global rgephy_mii_model.
- remove #ifdef'ed out code whcih has also been removed in FreeBSD
- some style cosmetics
2006-12-03 03:16:48 +00:00
tls 53786c9e89 Add arch/xen/i386/gdt.c to list of kernel files that do variable-size
allocations on the stack.  This allocation could potentially be quite
large -- I am not sure how to best fix that.

Fixes USE_SSP i386 build.sh failure.
2006-12-03 01:45:57 +00:00
freza e388b581bd Welcome to evbppc/virtex -- port to Xilinx Virtex series FPGA's with embedded
ibm405d5 core.

OK by Simon Burge
2006-12-02 22:18:47 +00:00
dyoung 7b85ed030b In if_rt_walktree(), make absolutely certain not to leave a dangling
pointer, rt_ifp, from an rtentry to an interface that we are going
to destroy.
2006-12-02 20:48:13 +00:00
dyoung 8068916447 Synchronize access to the ifaddr list by in6_update_ifa() and
in6_control() with splnet()/splx().  I was being a bit paranoid
here.  Following a cursory analysis of the code, this still looked
necessary.  We don't spend a lot of time in these calls, so it
should not be too harmful to suspend network interrupts.

In in6_unlink_ifa(), call in6_delmulti() just once on each multicast
address (in6_multi).  Previously, in6_unlink_ifa() called in6_delmulti()
on each in6_multi until in6_delmulti() removed the in6_multi from
the list and freed its memory.  That's not justified: the multicast
list holds *one* reference.  All other references belong to other
entities.  We must wait to free the memory until the other entities
release their references, to protect against dereferencing a freed
in6_multi.

XXX I need to revisit in6_delmulti(), in6_unlink_ifa(), and friends,
XXX to pry apart the conditions where an in6_multi is removed from
XXX its list and where it is freed.  Following my change, above,
XXX we still risk dereferencing a freed in6_multi.

Prevent in6_update_ifa() and in6_addremloop() from creating dangling
pointers to interfaces in the routing table.  Previously, my NetBSD
tunnel concentrator, which adds and deletes a lot of P2P interfaces
with the same local address, crashed in 8 hours or less when it
dereferenced a dangling pointer to a deleted ifnet.  Now, its uptime
is greater than 3 days.
2006-12-02 20:40:58 +00:00
dyoung 3b46d8b708 Use the queue(3) macros instead of open-coding them. Shorten
staircases.  Remove unnecessary casts.  Where appropriate, s/8/NBBY/.
De-__P().  KNF.

No functional changes intended.
2006-12-02 18:59:17 +00:00
hannken 818b049a35 On snapshot creation be sure the snapshot vnode has valid quota information.
Fixes PR kern/35121
2006-12-02 17:21:11 +00:00
bouyer 13e29fff26 Don't call the done callback twice if a special action is waiting on the queue.
Don't forget to free the xfer in the normal bio path.
2006-12-02 13:35:52 +00:00
christos 456024195b revert previous commit (size_t -> int change). Thanks cube. 2006-12-02 06:22:09 +00:00
christos c54ef0193c restore binary compatibility. 2006-12-02 05:27:27 +00:00
christos 972b81c7cd int -> size_t 2006-12-02 05:16:01 +00:00
christos 6420383ae6 keep the note section 2006-12-02 04:49:37 +00:00
christos 5d02b2963e Enable NetBSD note on i386. Portmasters, please fix your ldscripts :-) 2006-12-02 04:48:34 +00:00
elad cbcd623862 We are required to hold uvm.swap_data_lock here too. 2006-12-02 03:23:38 +00:00
elad 432c309931 Change kauth(9) KPI for kauth_authorize_device_passthru() to add another
argument, u_long, serving as a bit-mask of generic requests for the
passthru request.

Discussed on tech-security@ and tech-kern@. Okay tls@.
2006-12-02 03:10:42 +00:00
riz 711957a279 Welcome to 4.99.5 2006-12-02 00:48:45 +00:00
dogcow 437f8cc149 make bootxx_msdos fit in 8k again; thanks, __internal_memset_, for spilling
registers all over the place.
2006-12-02 00:38:22 +00:00
martin 9be3ef677b On Christos' request, reinstantiate the packed->__packed__ part of the
backed out change.
2006-12-01 21:36:56 +00:00
martin 035130a4dd Fix PR kern/34202 differently, by aligning the variables "the traditional
way".
2006-12-01 21:23:57 +00:00
martin d5c3b27938 Back out align(4) for all struct decls - it breaks various things all
over the tree (for example esiop on sparc64 won't boot any more).
2006-12-01 21:11:26 +00:00
drochner af0d6b7f5e change some commented-out code to use the interrupt descriptor's polling
interval instead of an own (which isn't even defined)
2006-12-01 20:56:42 +00:00
drochner d395a37b84 -comment out transaction translator support for now, it doesn't do more
than allocating memory, and it does wrongly use the hub's capabilities
 but not the actual setting
-switch a high-speed hub to "multiple TTs" but ignore errors; since
 we don't care whether there is one or multiple this is a "best effort"
 thing
2006-12-01 20:48:50 +00:00
drochner c7a98882c8 don't specify the interrupt pipe polling interval explicitely; just rely
on the endpoint descriptor
approved by plunky
2006-12-01 20:41:23 +00:00
yamt 10cd898fb8 uvm_fault: fix an assertion. PR/35134 from Christos Zoulas.
it can be triggered by minherit as well.
2006-12-01 19:15:22 +00:00
is 07e04d08c3 Remove an overlapping struct copy from ether_input, which caused address
corruption for incoming netiso packets with recent (at least NetBSD-3 and
later) compilers. This is done in a way that the copy is avoided totally.
Code path tested with tcp+udp/ipv4+ipv6, arp and ISO cltp/clnp.
Visually ok'd by Christos@.
2006-12-01 18:43:40 +00:00
elad a6c2dfb16d Introduce uvm_is_swap_device(), to check if the passed struct vnode * is
used as a swap device or not.

Okay mrg@.
2006-12-01 16:06:09 +00:00
christos 491c94e1fc - remove size check; the init functions do it.
- fix size_t/int confusion
- caddr_t -> void *
2006-12-01 15:52:55 +00:00
he 25e5748c32 Add -Os to CFLAGS, so that the boot code fits within the constraints
again.  Sorry, I've not traced why this fit in the past, or what
changed to make it not fit anymore.
2006-12-01 13:52:46 +00:00
pooka ca5da47950 prefix kernel flags with PUFFS_KFLAG to have a separate namespace
from the library flags
2006-12-01 12:48:31 +00:00
pooka 74baaf5c7d don't call the fs server for all operations, only those it has told
us that it implements
2006-12-01 12:37:41 +00:00
tsutsui be41c8c2ea Free resouces on failure in vge_allocmem(). 2006-12-01 11:30:55 +00:00
tsutsui af1ca0f86d - vge_probe() -> vge_match()
- KNF, unwrap lines
2006-12-01 11:06:59 +00:00
cube ffb2095341 Now that we have a AHCI driver (thanks a bunch, Manuel!), we can remove the
nonsense quirk that switched operating mode on ICH7 and ICH8.

I removed the obvious candidates for ahcisata(4), and I'll have a closer
look later if there are others to be removed;  ahcisata(4) will take over
handling the device anyway, but there is no reason to keep AHCI devices in
that list.

Along the way, remove the code that tries to put the chip in Enhanced mode,
it makes absolutely no sense to do that, and some BIOSes might not have
prepared the BARs for that, as proven by PR#34885.  If people want to use
all IDE and SATA channels, they have to tell the BIOS.
2006-12-01 10:31:30 +00:00
bouyer 93df930ebb It's 3.0Gb/s, not GB/s. Pointed out by Thomas E. Spanjaard. 2006-11-30 23:07:31 +00:00
oster f654b0f228 Change a bunch of "#if DEBUG" to "#ifdef DEBUG". 2006-11-30 23:01:50 +00:00
christos c5fe3abeef regen 2006-11-30 22:34:27 +00:00
christos 6137742b24 PR/35163: Christian Groessler: support for Aztech MM Pro 16 III ISA-PNP
sound card
2006-11-30 22:34:01 +00:00
pooka 24f932e907 regen for VOP_FOO_DESCOFFSET change in vnode_if.sh 2006-11-30 21:07:36 +00:00
pooka d89a0720df Generate preprocessor macros for vop offsets in vfs op descs. And
use these symbols in the desc structures instead of magic numbers.
No functional change, except VOP_FOO_DESCOFFSET macros in vnode_if.h.

wrstuden ok
2006-11-30 21:06:29 +00:00
bouyer 7b4730a29f Add ahcisata(4), a driver for AHCI 1.0 and 1.1 controllers. Tested on the sata
ports of a Intel 63xxESB chipset. Does not support NCQ yet.
2006-11-30 21:01:15 +00:00
hannken 7d99324122 Enable WDC_CAPABILITY_WIDEREGS. With this change LBA48 operations no
longer wrap at 128GB.
Tested on an "ServerWorks HT-1000 SATA Controller (rev. 0x00)".

Approved by: Manuel Bouyer <bouyer@netbsd.org>
2006-11-30 19:32:37 +00:00
christos 409998ac55 Prevent kernel crashes caused by umass devices that return bogus mode sense
data, such as the "Cooler Master". From Rhialto. While there, clean up some
debugging code and make the offset unsigned.
2006-11-30 17:59:35 +00:00
christos d048649c18 Add a quirk for Initio drives (from Rhialto) 2006-11-30 17:39:25 +00:00
elad 7a71c77e81 More cleaning... split veriexec_delete() to veriexec_file_delete() to
handle a single entry and veriexec_table_delete() to handle an entire
table. veriexec_convert() now takes a struct vnode *, and made
veriexec_table_lookup() take struct mount * (that's entirely internal
now).

Tested on amd64, built successfully on amd64, i386, sparc, and sparc64.
2006-11-30 16:53:47 +00:00
drochner 263cbcd833 don't specify a polling interval for the interrupt pipe -- that's
what the descriptor is good for
2006-11-30 16:30:33 +00:00
drochner bdd5b724b5 in the interrupt endpoint descriptor of the simulated root hub, fix the
poll interval: since this is a highspeed device, it should be a "12"
(just for sanity; this stuff is not used by the kernel, only userland
usb exploration code might see it)
2006-11-30 16:25:28 +00:00
christos d5272d5b35 PR/34202: Dave Huang: Accessing cd device on alpha causes kernel trap
From the PR:
  Since struct scsipi_read_discinfo_data is an odd number of bytes long
  (35 bytes), ti ends up being unaligned. wdc_datain_pio() uses
  bus_space_read_multi_4() to read the response from the drive, and
  since ti is unaligned, it causes an unaligned access fault.

Add __aligned__(4) to all the structures.
2006-11-30 16:23:20 +00:00
christos 8c4a6d7ec4 PR/35151: Christian Groessler: file size reported incorrectly for files > 2GB
on a FAT32 file system on a 64bit host
2006-11-30 15:59:23 +00:00
oster 212a5b65f4 If the user has specified 'root on foo', then skip changing the booted_device
even if we've detected a 'root on raid' autoconfigure.  This change is really
only cosmetic, since setroot() will still do the right thing and honor
the 'root on foo' setting.
2006-11-30 15:12:17 +00:00
elad 3cd8d27403 Return 'error' in veriexec_unmountchk(), not always 0. 2006-11-30 13:42:46 +00:00
pooka 5f132bf76c * update comments before putpages(): the vm object is always returned
unlocked instead of locked.  chuq agrees
* use slock set to &uobj->vmobjlock also for the last simple lock
  operation to be consistent with the rest of the function
2006-11-30 06:11:03 +00:00
mhitch fd011e452f Something I've wanted to do for quite some time: while looking for the
RDSK block, check for a valid native NetBSD label.  If found, use the
NetBSD label.  When writedisklabel() gets called, if no RDB was found,
write out the native NetBSD label.  The disk won't be usable by AmigaDOS,
but is usable as a 'normal' NetBSD drive, with partition changes saved in
the disk label.
2006-11-30 05:14:24 +00:00
elad cc26e2da8f Make sure that memory freed as M_VERIEXEC was allocated with that type.
Pointed out by Jason Thorpe, thanks!
2006-11-30 01:42:21 +00:00
elad 0c67c581a5 Massive restructuring and cleanup of Veriexec, mainly in preparation
for work on some future functionality.

  - Veriexec data-structures are no longer exposed.

  - Thanks to using proplib for data passing now, the interface
    changes further to accomodate that.

    Introduce four new functions. First, veriexec_file_add(), to add
    a new file to be monitored by Veriexec, to replace both
    veriexec_load() and veriexec_hashadd(). veriexec_table_add(), to
    replace veriexec_newtable(), will be used to optimize hash table
    size (during preload), and finally, veriexec_convert(), to convert
    an internal entry to one userland can read.

  - Introduce veriexec_unmountchk(), to enforce Veriexec unmount
    policy. This cleans up a bit of code in kern/vfs_syscalls.c.

  - Rename veriexec_tblfind() with veriexec_table_lookup(), and make
    it static. More functions that became static: veriexec_fp_cmp(),
    veriexec_fp_calc().

  - veriexec_verify() no longer returns the entry as well, but just
    sets a boolean indicating whether an entry was found or not.

  - veriexec_purge() now takes a struct vnode *.

  - veriexec_add_fp_name() was merged into veriexec_add_fp_ops(), that
    changed its name to veriexec_fpops_add(). veriexec_find_ops() was
    also renamed to veriexec_fpops_lookup().

    Also on the fp-ops front, the three function types used to initialize,
    update, and finalize a hash context were renamed to
    veriexec_fpop_init_t, veriexec_fpop_update_t, and veriexec_fpop_final_t
    respectively.

  - Introduce a new malloc(9) type, M_VERIEXEC, and use it instead of
    M_TEMP, so we can tell exactly how much memory is used by Veriexec.

  - And, most importantly, whitespace and indentation nits.

Built successfuly for amd64, i386, sparc, and sparc64. Tested on amd64.
2006-11-30 01:09:47 +00:00
bouyer 49f9b08461 Use mstohz() for callout argument instead of local arithmetic. 2006-11-29 21:37:42 +00:00
drochner c054c36959 restore a nice little feature which got lost in some previous commit:
the d_typename field of the default disklabel is initialized with
text from the SCSI inquiry, so that one gets at least a vague idea which
disk he is dealing with
2006-11-29 21:06:49 +00:00
freza e2db2efb2e Instead of mapping whole RAM with reserved TLB entries, map just enough
to ensure trap code will work (that is 0 upto ${endkernel}) and leave the
rest to pmap_tlbmiss(). Mapping whole physmem into the kernel wired way
too many TLB entries, see

  http://mail-index.netbsd.org/port-powerpc/2006/10/27/0000.html

for performance analysis. While there, be a bit more descriptive in
pmap_tlbmiss() comment and use macro instead of numeric constant.

OK by Simon Burge
2006-11-29 19:56:46 +00:00
tsutsui bad6707cdd Get info of kernel symbol table from bootloader before calling consinit().
consinit() was moved before oea_init() in rev 1.136, but startsym and
endsym are not initialized at that point.
Now kernel symbols are usable (on ddb(4), ksyms(4) etc.) again on macppc.
2006-11-29 16:31:19 +00:00
drochner 9604fc283a -add two new FSB speeds from the latest Intel spec; this should fix
PR port-i386/35059 from Jaromir Dolecek
-fix rounding for another one (mostly cosmetic)
-add cache descriptor for L2 cache 4 MB 64B/line 16-way
2006-11-29 16:15:38 +00:00
drochner 93be0e3524 whitespace fix in console printout 2006-11-29 15:53:42 +00:00
elad aefed63a3e Replace ioctl identifier 'S' (which, obviously, belongs to the speaker)
with 'X', as it seems unassigned.
2006-11-29 14:52:11 +00:00
tsutsui 29fb2fb408 Remove mii_mediachg() call from re_init().
It causes a few second TRX stalls on each ioctls
(on ifconfig(8) or tcpdump(8) etc.) and PHY seems
initialized properly without it at least on RTL8169S
with internal rgephy(4) PHY. Closes PR kern/34517.

XXX: maybe we should also test this on the original RTL8169
     with external makphy(4).
2006-11-29 14:13:15 +00:00
tsutsui 92dc7b0c2c Fix #ifdef/#endif comment mismatch. 2006-11-29 14:01:53 +00:00
tsutsui 2af93ca79c KNF, ANSIfy, unwrap lines. 2006-11-29 13:57:59 +00:00
tsutsui da40bfc506 Pull some updates from the Realtek's driver:
- set RGEPHY_1000CTL_AHD in rge_reset()
- reset RGEPHY_MII_BMCR register in rge_reset() too

While here, use proper macro rather than magic numbers for
ANAR and BMCR registers there.
2006-11-29 13:49:24 +00:00
xtraeme fae6ff8d21 Add pseudo-device drvctl... needed for drvctl -p <device> to show
device properties dictionary.

IMHO this should be enabled by default in GENERIC.
2006-11-29 13:41:28 +00:00
dyoung 2f9c32c833 Fix a spelling error.
Annotate a memory leak.

When copying one multicast address list to another, IFAREF before IFAFREE
to protect against using an ifaddr after (accidentally) freeing it.

LIST_REMOVE() a multicast address from its old list before
LIST_INSERT_HEAD() on its new list.

Do not count on in6_delmulti() removing its multicast-record argument
from the multicast address list that the record belongs to, because
clearly that is not what it (always) does.
2006-11-29 03:05:12 +00:00
ad a80609203c Improve error handling. Related to PR/21900. 2006-11-28 23:06:33 +00:00
elad 646f2112d3 Make Veriexec use proplib(3) for kernel-userland data passing.
Obviously, this breaks the already unstable Veriexec ABI, but that's
it. Some cool additions are planned to be introduced, and this just
makes it so that NetBSD 4.0 users will be able to easily use them as
well.

This also removes the fingerprint type name limit, so relevant code
was adjusted.

Thoroughly tested (even uncovered a bug in proplib! thanks for fixing
that cube@!). Documentation updated.
2006-11-28 22:22:02 +00:00
drochner 0b5d054c71 Remove the code which tried to guess the toggle bit after a short
transfer. It was wrong because it didn't consider block boundaries.
Instead, use the updated toggle from the transfer descriptor -- this
is supposedly cheaper than modulo arithmetics.
This fixes a problem similar to PR kern/34070 for me.
2006-11-28 20:58:12 +00:00
ad dfe7788c29 Avoid sleeping with a held simple_lock. 2006-11-28 20:35:16 +00:00
ad 8b4b54cb8d Improve error handling. Related to PR/21900. 2006-11-28 20:29:14 +00:00
elad 233dc909a8 Kill process_checkioperm().
While here, adjust comments.
2006-11-28 17:58:10 +00:00
elad 8bb202af97 Move ktrace, ptrace, systrace, and procfs to use kauth(9).
First, remove process_checkioperm() calls from MD code. Similar checks
using kauth(9) routines (on the process scope, using appropriate action)
are done in the callers.

Add secmodel back-end to handle each subsystem.
2006-11-28 17:27:09 +00:00
christos cc00177a7d Separate -Os into COPTS; pointed out by Izumi Tsutsui. 2006-11-28 16:24:54 +00:00
christos edc54bf23f s/COPTS/CPUFLAGS/
s/-O2 //
2006-11-28 16:15:36 +00:00
christos 17a81bf4b3 PR/35146: George Michaelson: minor fix to let radeonfb.c compile 2006-11-28 13:38:39 +00:00
tsutsui 2e0739074e Pull fixes from FreeBSD's rgephy.c:
Revision 1.9:
> Make the rgephy driver advertise both 1000_FD and 1000_HD bits in
> autoneg mode. A couple of the devices don't autoneg correctly unless
> configured this way.

Revision 1.11:
> Due to the poor PHY documentation from RealTek I can't sure but I
> think the RealTek PHY needs driver to set RGEPHY_BMCR_AUTOEN bit of
> RGEPHY_MII_BMCR register and proper ANAR register setting for manual
> media type selection.
> This fixes long standing manual media type selection bug in rgephy(4).
2006-11-28 13:36:29 +00:00
pooka 898c6532b4 don't allow mmap if operating uncached 2006-11-28 13:20:03 +00:00
yamt c6970b82a3 uvm_fault: unwrap a short line. 2006-11-28 13:16:37 +00:00
yamt ec1dd90a2a uvmpdpol_pagedequeue: clear PQ_INITIALREF.
otherwise, dequeue/enqueue cycles (eg. page loaning) can cause
an assertion failure in clockpro_pageenqueue.
2006-11-28 13:14:53 +00:00
elad 64c69c4ece No need to copy fp_type twice. 2006-11-27 23:05:18 +00:00
dogcow 371dea6737 revert last change, as havard's fix is more general. 2006-11-27 20:29:12 +00:00
drochner aa18e3ca8f match ICH-7M / -DH
(The watchdog doesn't reset the box for me, but it is present according
to the datasheet.)
2006-11-27 19:58:20 +00:00
elad e0d8be4efc Move Veriexec's sysctl(9) setup routine and helper to kern_verifiedexec.c. 2006-11-27 17:45:36 +00:00
christos 0bc546e589 PR/35136: Gary Duzan: Enable Ultra/133 on newer aceride 2006-11-27 16:56:38 +00:00
skrll 6cff9cd2f4 Initialise the result rather than returning garbage. 2006-11-27 07:22:07 +00:00
elad 21bc112176 Implement Veriexec's raw disk policy on-top of kauth(9)'s device scope,
using both the rawio_spec and passthru actions to detect raw disk
activity. Same for kernel memory policy.

Update documentation (no longer need to expose veriexec_rawchk()) and
remove all Veriexec-related bits from specfs.
2006-11-26 20:27:27 +00:00
martin a6d16a29ee If no scsibus is configured, do not silently fail the attach but print
a message pointing at the usscanner(4) manual page.
Addresses PR port-i386/22393.
2006-11-26 20:14:41 +00:00
dyoung c11fb5eece Add 'volatile' to rx/tx descriptor fields. 2006-11-26 17:31:32 +00:00
elad f7fbd2e8b5 Add an XXX comment so we don't forget what we need to do here:
* XXX: This is bogus. We should be failing the request
* XXX: not only if this specific slice is mounted, but
* XXX: if it's on a disk with any other mounted slice.
2006-11-26 17:21:25 +00:00
tsutsui e2e881bcd1 Match BCM5752 PHY. From Matthias Drochner and FreeBSD/OpenBSD. 2006-11-26 16:31:48 +00:00
tsutsui b9957a3cdf Regen from miidevs rev 1.69:
> Add BCM5752 Gig-E PHY. From Matthias Drochner and FreeBSD/OpenBSD.
2006-11-26 16:28:19 +00:00
tsutsui 7437e6f3b5 Add BCM5752 Gig-E PHY. From Matthias Drochner and FreeBSD/OpenBSD. 2006-11-26 16:26:35 +00:00
elad df07d5d652 I wanted to do this for so long: veriexec_init_fp_ops() -> veriexec_init(). 2006-11-26 16:22:36 +00:00
tsutsui e2e52f2716 - add working vge* at pci? and ciphy* at mii?
- remove an obsolete comment
2006-11-26 16:14:03 +00:00
tsutsui 48100f0649 Fix stupid bugs found on sparc64:
- checking if dmamap != NULL is not valid because dmamap is not cleared
  in bus_dmamap_unload(9)
- no need check RX mbufs and call m_freem() and bus_dmamap_unload()
  in vge_init() since it's done in prior vge_stop()

Now vge(4) works fine on Ultra5.
2006-11-26 16:11:51 +00:00
tsutsui 2b15bbad22 Include <sys/device.h> for struct device. 2006-11-26 15:40:14 +00:00
bjh21 1372543b73 The ARM7500 ID is no longer a guess -- I've confirmed it on a real ARM7500. 2006-11-26 15:10:18 +00:00
tsutsui 8c8ebe8b93 - prepare inline functions to set 48 bit DMA address which avoid 64 bit
arithmetic on ILP32 (sizeof(bus_addr_t) == 4, exactly) hosts
- prepare and use VGE_PREV_TXDESC() macro
- use VGE_[TR]XDESCSYNC() calls more efficiently
- wrap a sanity check against VGE_RDSTS_OWN in vge_newbuf()
  with #ifdef DIAGNOSTIC since it should not happen
- use sc->sc_tx_free (number of free TX descs) to check if TX packets are
  queued or sent
- call vge_start() only if the interupt is actually handled by this driver
- some misc cosmetics
2006-11-26 15:04:15 +00:00
tsutsui cd5182f737 Introduce a new VGE_RX_BUFSIZE macro which represent default RX mbuf
length and define VGE_RX_PAD (which is 4 bytes) for ETHER_ALIGN (2 bytes)
padding only in !__NO_STRICT_ALIGNMENT case to avoid confusion.
As per comments from Murata Shuuichirou in PR kern/31323.
Tested on i386 and macppc.
2006-11-26 13:09:32 +00:00
cube 35d885e59a Introduce acpi_check() to inform the caller whether the acpi driver is
still enabled, as it could have been disabled through USERCONF.

Use it in amd64 and i386 mainbus code and skip all ACPI processing in case
it is disabled.
2006-11-26 12:30:05 +00:00
tsutsui 8632b7c3a3 Sync two alternative IDs with pcidevs. 2006-11-26 06:09:09 +00:00
tsutsui d4b56fbafe Regen from pcidevs rev 1.855:
> - add more Broadcom product IDs, and fix two alternative IDs
>   (from FreeBSD and OpenBSD)
> - sort by product ID
2006-11-26 06:07:48 +00:00
tsutsui 19ac8df8e6 - add more Broadcom product IDs, and fix two alternative IDs
(from FreeBSD and OpenBSD)
- sort by product ID
2006-11-26 06:06:20 +00:00
tsutsui ca6ff0c8b6 Fix a typo. 2006-11-26 05:58:05 +00:00
tsutsui c4d5f6498e Revert a CHIPID entry in the previous:
In OpenBSD's if_bgereg.h, CHIPID 0x4101000 is defined as BCM5750_B1
but our PR kern/31028 says it's BCM5751_A1 on BCM5751M on IBM T43p,
and the value seems reasonable.
2006-11-26 05:52:15 +00:00
itohy e73f75f98e If the block size reported by Read Capacity looks valid, just use it.
Use Request Sense only if Read Capacity succeeded and did not return
valid block size.
Discussed on tech-kern.
Fix the easier part of NetBSD PR kern/26537.
(The harder part is the device hangs on large (>= 8KB) transfer.
Possibly umass BBB problem?)

Remove scsipi_size() and scsipi_validate_secsize() from scsipi_base.c
and add their functions to sd.c since they are used only by sd.c.

Use SCSI term `block' instead of `sector' where applicable.
2006-11-26 05:01:09 +00:00
tsutsui 3267e61df1 Add and fix some BGE_CHIPIDs. From FreeBSD and OpenBSD. 2006-11-26 04:00:45 +00:00
tsutsui 6498cd88c4 TAB/space cleanup. 2006-11-26 03:08:02 +00:00
tsutsui 5a3995e0ab Add support for BCM5752M. from Matt Kolb on tech-kern and OpenBSD. 2006-11-26 03:02:04 +00:00