Skip site navigation (1)Skip section navigation (2)

CVS log for src/sys/kern/subr_bus.c

[BACK] Up to [FreeBSD] / src / sys / kern

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.225.2.21: download - view: text, markup, annotated - select for diffs
Sun Jan 29 12:58:07 2012 UTC (11 days, 9 hours ago) by marius
Branches: RELENG_8
Diff to: previous 1.225.2.20: preferred, colored; branchpoint 1.225: preferred, colored; next MAIN 1.226: preferred, colored
Changes since revision 1.225.2.20: +5 -4 lines
SVN rev 230741 on 2012-01-29 12:58:07Z by marius

MFC: r228211

It doesn't make much sense to check whether child is NULL after already
having dereferenced it. We either should generally check the device_t's
supplied to bus functions before using them (which we seem to virtually
never do) or just assume that they are not NULL.
While at it make this code fit 78 columns.

Found with:	Coverity Prevent(tm)
CID:		4230

Revision 1.257.2.5: download - view: text, markup, annotated - select for diffs
Sun Jan 29 12:58:06 2012 UTC (11 days, 9 hours ago) by marius
Branches: RELENG_9
Diff to: previous 1.257.2.4: preferred, colored; branchpoint 1.257: preferred, colored; next MAIN 1.258: preferred, colored
Changes since revision 1.257.2.4: +5 -4 lines
SVN rev 230740 on 2012-01-29 12:58:06Z by marius

MFC: r228211

It doesn't make much sense to check whether child is NULL after already
having dereferenced it. We either should generally check the device_t's
supplied to bus functions before using them (which we seem to virtually
never do) or just assume that they are not NULL.
While at it make this code fit 78 columns.

Found with:	Coverity Prevent(tm)
CID:		4230

Revision 1.225.2.20: download - view: text, markup, annotated - select for diffs
Sun Jan 29 12:56:21 2012 UTC (11 days, 9 hours ago) by marius
Branches: RELENG_8
Diff to: previous 1.225.2.19: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.19: +15 -11 lines
SVN rev 230739 on 2012-01-29 12:56:21Z by marius

MFC: r228209

- In device_probe_child(9) check the return value of device_set_driver(9)
  when actually setting a driver as especially ENOMEM is fatal in these
  cases.
- Annotate other calls to device_set_devclass(9) and device_set_driver(9)
  without the return value being checked and that are okay to fail.

Reviewed by:	yongari (slightly earlier version)

Revision 1.257.2.4: download - view: text, markup, annotated - select for diffs
Sun Jan 29 12:56:18 2012 UTC (11 days, 9 hours ago) by marius
Branches: RELENG_9
Diff to: previous 1.257.2.3: preferred, colored; branchpoint 1.257: preferred, colored
Changes since revision 1.257.2.3: +15 -11 lines
SVN rev 230738 on 2012-01-29 12:56:18Z by marius

MFC: r228209

- In device_probe_child(9) check the return value of device_set_driver(9)
  when actually setting a driver as especially ENOMEM is fatal in these
  cases.
- Annotate other calls to device_set_devclass(9) and device_set_driver(9)
  without the return value being checked and that are okay to fail.

Reviewed by:	yongari (slightly earlier version)

Revision 1.225.2.19: download - view: text, markup, annotated - select for diffs
Sun Jan 29 00:41:08 2012 UTC (11 days, 21 hours ago) by marius
Branches: RELENG_8
Diff to: previous 1.225.2.18: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.18: +5 -0 lines
SVN rev 230696 on 2012-01-29 00:41:08Z by marius

MFC: r226175

In device_get_children() avoid malloc(0) in order to increase portability
to other operating systems.

PR:	154287

Revision 1.257.2.3: download - view: text, markup, annotated - select for diffs
Sun Jan 29 00:40:39 2012 UTC (11 days, 21 hours ago) by marius
Branches: RELENG_9
Diff to: previous 1.257.2.2: preferred, colored; branchpoint 1.257: preferred, colored
Changes since revision 1.257.2.2: +5 -0 lines
SVN rev 230695 on 2012-01-29 00:40:39Z by marius

MFC: r226175

In device_get_children() avoid malloc(0) in order to increase portability
to other operating systems.

PR:	154287

Revision 1.264: download - view: text, markup, annotated - select for diffs
Sun Jan 15 07:09:18 2012 UTC (3 weeks, 4 days ago) by eadler
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.263: preferred, colored
Changes since revision 1.263: +8 -2 lines
SVN rev 230125 on 2012-01-15 07:09:18Z by eadler

- Fix undefined behavior when device_get_name is null
- Make error message more informative

PR:		kern/149800
Submitted by:	olgeni
Approved by:	cperciva
MFC after:	1 week

Revision 1.257.2.2: download - view: text, markup, annotated - select for diffs
Sat Dec 31 15:31:34 2011 UTC (5 weeks, 5 days ago) by hselasky
Branches: RELENG_9
Diff to: previous 1.257.2.1: preferred, colored; branchpoint 1.257: preferred, colored
Changes since revision 1.257.2.1: +34 -1 lines
SVN rev 229118 on 2011-12-31 15:31:34Z by hselasky

MFC r227701, r227847 and r227849:
Move the device_delete_all_children() function from usb_util.c
to kern/subr_bus.c. Simplify this function so that it no longer
depends on malloc() to execute. Rename device_delete_all_children()
into device_delete_children(). Identify a few other places where
it makes sense to use device_delete_children().

Revision 1.263: download - view: text, markup, annotated - select for diffs
Fri Dec 2 22:03:27 2011 UTC (2 months, 1 week ago) by marius
Branches: MAIN
Diff to: previous 1.262: preferred, colored
Changes since revision 1.262: +5 -4 lines
SVN rev 228211 on 2011-12-02 22:03:27Z by marius

It doesn't make much sense to check whether child is NULL after already
having dereferenced it. We either should generally check the device_t's
supplied to bus functions before using them (which we seem to virtually
never do) or just assume that they are not NULL.
While at it make this code fit 78 columns.

Found with:	Coverity Prevent(tm)
CID:		4230

Revision 1.262: download - view: text, markup, annotated - select for diffs
Fri Dec 2 21:19:14 2011 UTC (2 months, 1 week ago) by marius
Branches: MAIN
Diff to: previous 1.261: preferred, colored
Changes since revision 1.261: +15 -11 lines
SVN rev 228209 on 2011-12-02 21:19:14Z by marius

- In device_probe_child(9) check the return value of device_set_driver(9)
  when actually setting a driver as especially ENOMEM is fatal in these
  cases.
- Annotate other calls to device_set_devclass(9) and device_set_driver(9)
  without the return value being checked and that are okay to fail.

Reviewed by:	yongari (slightly earlier version)

Revision 1.261: download - view: text, markup, annotated - select for diffs
Tue Nov 22 21:56:55 2011 UTC (2 months, 2 weeks ago) by hselasky
Branches: MAIN
Diff to: previous 1.260: preferred, colored
Changes since revision 1.260: +1 -1 lines
SVN rev 227849 on 2011-11-22 21:56:55Z by hselasky

Rename device_delete_all_children() into device_delete_children().

Suggested by:	jhb @ and marius @
MFC after:	1 week

Revision 1.260: download - view: text, markup, annotated - select for diffs
Tue Nov 22 21:53:19 2011 UTC (2 months, 2 weeks ago) by hselasky
Branches: MAIN
Diff to: previous 1.259: preferred, colored
Changes since revision 1.259: +2 -2 lines
SVN rev 227847 on 2011-11-22 21:53:19Z by hselasky

Style change.

Suggested by:	jhb @ and marius @
MFC after:	1 week

Revision 1.259: download - view: text, markup, annotated - select for diffs
Sat Nov 19 10:11:50 2011 UTC (2 months, 3 weeks ago) by hselasky
Branches: MAIN
Diff to: previous 1.258: preferred, colored
Changes since revision 1.258: +33 -0 lines
SVN rev 227701 on 2011-11-19 10:11:50Z by hselasky

Move the device_delete_all_children() function from usb_util.c
to kern/subr_bus.c. Simplify this function so that it no longer
depends on malloc() to execute. Identify a few other places where
it makes sense to use device_delete_all_children().

MFC after:	1 week

Revision 1.257.2.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (2 months, 4 weeks ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.257.2.1: preferred, colored; next MAIN 1.257.2.2: preferred, colored
Changes since revision 1.257.2.1: +0 -0 lines
SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)

Revision 1.258: download - view: text, markup, annotated - select for diffs
Sun Oct 9 21:21:37 2011 UTC (4 months ago) by marius
Branches: MAIN
Diff to: previous 1.257: preferred, colored
Changes since revision 1.257: +5 -0 lines
SVN rev 226175 on 2011-10-09 21:21:37Z by marius

In device_get_children() avoid malloc(0) in order to increase portability
to other operating systems.

PR:     154287

Revision 1.257.2.1: download - view: text, markup, annotated - select for diffs
Fri Sep 23 00:51:37 2011 UTC (4 months, 2 weeks ago) by kensmith
Branches: RELENG_9
CVS tags: RELENG_9_0_BP
Branch point for: RELENG_9_0
Diff to: previous 1.257: preferred, colored
Changes since revision 1.257: +0 -0 lines
SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)

Revision 1.257: download - view: text, markup, annotated - select for diffs
Fri Sep 16 13:58:51 2011 UTC (4 months, 3 weeks ago) by kmacy
Branches: MAIN
CVS tags: RELENG_9_BP
Branch point for: RELENG_9
Diff to: previous 1.256: preferred, colored
Changes since revision 1.256: +1 -1 lines
SVN rev 225617 on 2011-09-16 13:58:51Z by kmacy

In order to maximize the re-usability of kernel code in user space this
patch modifies makesyscalls.sh to prefix all of the non-compatibility
calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel
entry points and all places in the code that use them. It also
fixes an additional name space collision between the kernel function
psignal and the libc function of the same name by renaming the kernel
psignal kern_psignal(). By introducing this change now we will ease future
MFCs that change syscalls.

Reviewed by:	rwatson
Approved by:	re (bz)

Revision 1.225.2.18: download - view: text, markup, annotated - select for diffs
Fri Jun 24 16:06:50 2011 UTC (7 months, 2 weeks ago) by jhb
Branches: RELENG_8
Diff to: previous 1.225.2.17: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.17: +32 -0 lines
SVN rev 223507 on 2011-06-24 16:06:50Z by jhb

MFC 221231,221450,222600:
Add a new bus method, BUS_ADJUST_RESOURCE() that is intended to be a
wrapper around rman_adjust_resource().  Include a generic implementation,
bus_generic_adjust_resource() which passes the request up to the parent
bus.  There is currently no default implementation.  A
bus_adjust_resource() wrapper is provided for use in drivers.

Revision 1.256: download - view: text, markup, annotated - select for diffs
Fri Apr 29 21:36:45 2011 UTC (9 months, 1 week ago) by jhb
Branches: MAIN
Diff to: previous 1.255: preferred, colored
Changes since revision 1.255: +32 -0 lines
SVN rev 221231 on 2011-04-29 21:36:45Z by jhb

Add a new bus method, BUS_ADJUST_RESOURCE() that is intended to be a
wrapper around rman_adjust_resource().  Include a generic implementation,
bus_generic_adjust_resource() which passes the request up to the parent
bus.  There is currently no default implementation.  A
bus_adjust_resource() wrapper is provided for use in drivers.

Revision 1.255: download - view: text, markup, annotated - select for diffs
Mon Mar 21 09:40:01 2011 UTC (10 months, 3 weeks ago) by jeff
Branches: MAIN
Diff to: previous 1.254: preferred, colored
Changes since revision 1.254: +2 -2 lines
SVN rev 219819 on 2011-03-21 09:40:01Z by jeff

 - Merge changes to the base system to support OFED.  These include
   a wider arg2 for sysctl, updates to vlan code, IFT_INFINIBAND,
   and other miscellaneous small features.

Revision 1.225.2.17: download - view: text, markup, annotated - select for diffs
Fri Mar 11 16:14:06 2011 UTC (11 months ago) by jhb
Branches: RELENG_8
Diff to: previous 1.225.2.16: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.16: +81 -30 lines
SVN rev 219503 on 2011-03-11 16:14:06Z by jhb

MFC 219135:
Similar to 189574, properly handle subclasses of bus drivers when deleting
a driver during kldunload.  Specifically, recursively walk the tree of
subclasses of a given driver attachment's bus device class detaching all
instances of that driver for each class and its subclasses.

Revision 1.225.2.16: download - view: text, markup, annotated - select for diffs
Fri Mar 11 15:34:06 2011 UTC (11 months ago) by jhb
Branches: RELENG_8
Diff to: previous 1.225.2.15: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.15: +4 -0 lines
SVN rev 219493 on 2011-03-11 15:34:06Z by jhb

MFC 208898:
Call BUS_PROBE_NOMATCH() when device detached due to driver unload.
This allows bus to power-down device when driver unloaded on-flight.

Revision 1.254: download - view: text, markup, annotated - select for diffs
Tue Mar 1 14:43:37 2011 UTC (11 months, 1 week ago) by jhb
Branches: MAIN
Diff to: previous 1.253: preferred, colored
Changes since revision 1.253: +81 -30 lines
SVN rev 219135 on 2011-03-01 14:43:37Z by jhb

Similar to 189574, properly handle subclasses of bus drivers when deleting
a driver during kldunload.  Specifically, recursively walk the tree of
subclasses of a given driver attachment's bus device class detaching all
instances of that driver for each class and its subclasses.

Reported by:	bschmidt
Reviewed by:	imp
MFC after:	1 week

Revision 1.253: download - view: text, markup, annotated - select for diffs
Tue Jan 18 21:14:18 2011 UTC (12 months, 3 weeks ago) by mdf
Branches: MAIN
Diff to: previous 1.252: preferred, colored
Changes since revision 1.252: +6 -6 lines
SVN rev 217555 on 2011-01-18 21:14:18Z by mdf

Specify a CTLTYPE_FOO so that a future sysctl(8) change does not need
to rely on the format string.

Revision 1.225.2.15: download - view: text, markup, annotated - select for diffs
Tue Jan 18 10:42:13 2011 UTC (12 months, 3 weeks ago) by kib
Branches: RELENG_8
Diff to: previous 1.225.2.14: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.14: +2 -2 lines
SVN rev 217532 on 2011-01-18 10:42:13Z by kib

MFC r216952:
Mark some devices as eternal.

Revision 1.252: download - view: text, markup, annotated - select for diffs
Tue Jan 4 10:59:38 2011 UTC (13 months ago) by kib
Branches: MAIN
Diff to: previous 1.251: preferred, colored
Changes since revision 1.251: +2 -2 lines
SVN rev 216952 on 2011-01-04 10:59:38Z by kib

Finish r210923, 210926. Mark some devices as eternal.

MFC after:	2 weeks

Revision 1.201.2.14.2.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:10:29 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_7_4
CVS tags: RELENG_7_4_0_RELEASE
Diff to: previous 1.201.2.14: preferred, colored; next MAIN 1.201.4.1: preferred, colored
Changes since revision 1.201.2.14: +0 -0 lines
SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)

Revision 1.225.2.14.2.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:09:25 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_8_2
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.225.2.14: preferred, colored; next MAIN 1.225.2.15: preferred, colored
Changes since revision 1.225.2.14: +0 -0 lines
SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)

Revision 1.251: download - view: text, markup, annotated - select for diffs
Thu Dec 2 04:28:01 2010 UTC (14 months, 1 week ago) by imp
Branches: MAIN
Diff to: previous 1.250: preferred, colored
Changes since revision 1.250: +1 -2 lines
SVN rev 216112 on 2010-12-02 04:28:01Z by imp

removed tag is '-', not '+'.
remove extra return.

Revision 1.250: download - view: text, markup, annotated - select for diffs
Tue Nov 30 05:54:21 2010 UTC (14 months, 1 week ago) by imp
Branches: MAIN
Diff to: previous 1.249: preferred, colored
Changes since revision 1.249: +2 -37 lines
SVN rev 216070 on 2010-11-30 05:54:21Z by imp

Remove redundant (and bogus) insertion of pnp info when announcing new
and retiring devices.  That's already inserted elsewhere.

Submitted by:	n_hibma
MFC after:	3 days

Revision 1.201.2.14: download - view: text, markup, annotated - select for diffs
Fri Nov 19 17:24:03 2010 UTC (14 months, 3 weeks ago) by marius
Branches: RELENG_7
CVS tags: RELENG_7_4_BP
Branch point for: RELENG_7_4
Diff to: previous 1.201.2.13: preferred, colored; branchpoint 1.201: preferred, colored; next MAIN 1.202: preferred, colored
Changes since revision 1.201.2.13: +8 -0 lines
SVN rev 215537 on 2010-11-19 17:24:03Z by marius

MFC: r176965

Any driver that relies on its parent to set the devclass has no way to
know if has siblings that need an actual probe.  Introduce a specail
return value called BUS_PROBE_NOOWILDCARD.  If the driver returns
this, the probe is only successful for devices that have had a
specific devclass set for them.

Reviewed by: current@, jhb@, grehan@

Revision 1.249: download - view: text, markup, annotated - select for diffs
Wed Nov 17 22:28:04 2010 UTC (14 months, 3 weeks ago) by jhb
Branches: MAIN
Diff to: previous 1.248: preferred, colored
Changes since revision 1.248: +24 -0 lines
SVN rev 215443 on 2010-11-17 22:28:04Z by jhb

Add a resource_list_reserved() method that returns true if a resource
list entry contains a reserved resource.

Revision 1.201.2.13: download - view: text, markup, annotated - select for diffs
Mon Sep 20 11:18:20 2010 UTC (16 months, 2 weeks ago) by avg
Branches: RELENG_7
Diff to: previous 1.201.2.12: preferred, colored; branchpoint 1.201: preferred, colored
Changes since revision 1.201.2.12: +8 -8 lines
SVN rev 212895 on 2010-09-20 11:18:20Z by avg

MFC r212325: subr_bus: use hexadecimal representation for bit flags

Revision 1.225.2.14: download - view: text, markup, annotated - select for diffs
Mon Sep 20 11:15:23 2010 UTC (16 months, 2 weeks ago) by avg
Branches: RELENG_8
CVS tags: RELENG_8_2_BP
Branch point for: RELENG_8_2
Diff to: previous 1.225.2.13: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.13: +8 -8 lines
SVN rev 212894 on 2010-09-20 11:15:23Z by avg

MFC r212325: subr_bus: use hexadecimal representation for bit flags

Revision 1.201.2.12: download - view: text, markup, annotated - select for diffs
Mon Sep 20 11:09:31 2010 UTC (16 months, 2 weeks ago) by avg
Branches: RELENG_7
Diff to: previous 1.201.2.11: preferred, colored; branchpoint 1.201: preferred, colored
Changes since revision 1.201.2.11: +1 -1 lines
SVN rev 212893 on 2010-09-20 11:09:31Z by avg

MFC r212413: bus_add_child: change type of order parameter to u_int

Revision 1.225.2.13: download - view: text, markup, annotated - select for diffs
Mon Sep 20 07:31:08 2010 UTC (16 months, 2 weeks ago) by avg
Branches: RELENG_8
Diff to: previous 1.225.2.12: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.12: +1 -1 lines
SVN rev 212892 on 2010-09-20 07:31:08Z by avg

MFC r212413: bus_add_child: change type of order parameter to u_int

Revision 1.201.2.11: download - view: text, markup, annotated - select for diffs
Mon Sep 20 05:58:55 2010 UTC (16 months, 3 weeks ago) by avg
Branches: RELENG_7
Diff to: previous 1.201.2.10: preferred, colored; branchpoint 1.201: preferred, colored
Changes since revision 1.201.2.10: +4 -5 lines
SVN rev 212890 on 2010-09-20 05:58:55Z by avg

MFC r212213: struct device: widen type of flags and order fields to u_int

Revision 1.225.2.12: download - view: text, markup, annotated - select for diffs
Mon Sep 20 05:56:09 2010 UTC (16 months, 3 weeks ago) by avg
Branches: RELENG_8
Diff to: previous 1.225.2.11: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.11: +4 -5 lines
SVN rev 212889 on 2010-09-20 05:56:09Z by avg

MFC r212213: struct device: widen type of flags and order fields to u_int

Revision 1.248: download - view: text, markup, annotated - select for diffs
Fri Sep 17 16:05:25 2010 UTC (16 months, 3 weeks ago) by imp
Branches: MAIN
Diff to: previous 1.247: preferred, colored
Changes since revision 1.247: +0 -9 lines
SVN rev 212798 on 2010-09-17 16:05:25Z by imp

By popular demand, kill all the non GIANT related interrupt messages.
They are confusing and add little value.

Reviewed by:	jhb@

Revision 1.247: download - view: text, markup, annotated - select for diffs
Fri Sep 10 11:19:03 2010 UTC (17 months ago) by avg
Branches: MAIN
Diff to: previous 1.246: preferred, colored
Changes since revision 1.246: +1 -1 lines
SVN rev 212413 on 2010-09-10 11:19:03Z by avg

bus_add_child: change type of order parameter to u_int

This reflects actual type used to store and compare child device orders.
Change is mostly done via a Coccinelle (soon to be devel/coccinelle)
semantic patch.
Verified by LINT+modules kernel builds.

Followup to:	r212213
MFC after:	10 days

Revision 1.246: download - view: text, markup, annotated - select for diffs
Wed Sep 8 17:35:06 2010 UTC (17 months ago) by avg
Branches: MAIN
Diff to: previous 1.245: preferred, colored
Changes since revision 1.245: +8 -8 lines
SVN rev 212325 on 2010-09-08 17:35:06Z by avg

subr_bus: use hexadecimal representation for bit flags

It seems that this format is more custom in our code, and it is more
convenient too.

Suggested by:	jhb
No objection:	imp
MFC after:	1 week

Revision 1.245: download - view: text, markup, annotated - select for diffs
Sat Sep 4 17:28:29 2010 UTC (17 months ago) by avg
Branches: MAIN
Diff to: previous 1.244: preferred, colored
Changes since revision 1.244: +4 -5 lines
SVN rev 212213 on 2010-09-04 17:28:29Z by avg

struct device: widen type of flags and order fields to u_int

Also change int -> u_int for order parameter in device_add_child_ordered.
There should not be any ABI change as struct device is private to subr_bus.c
and the API change should be compatible.

To do: change int -> u_int for order parameter of bus_add_child method
and its implementations.  The change should also be API compatible, but
is a bit more churn.

Suggested by:	imp, jhb
MFC after:	1 week

Revision 1.244: download - view: text, markup, annotated - select for diffs
Thu Aug 12 19:26:27 2010 UTC (17 months, 4 weeks ago) by gibbs
Branches: MAIN
Diff to: previous 1.243: preferred, colored
Changes since revision 1.243: +1 -1 lines
SVN rev 211232 on 2010-08-12 19:26:27Z by gibbs

Properly indent a continue statement.  No functional changes.

Revision 1.225.2.11: download - view: text, markup, annotated - select for diffs
Sat Jul 3 17:57:59 2010 UTC (19 months, 1 week ago) by kib
Branches: RELENG_8
Diff to: previous 1.225.2.10: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.10: +21 -6 lines
SVN rev 209666 on 2010-07-03 17:57:59Z by kib

MFC r209104:
Add modifications of devctl_notify(9) functions that take flags. Use
flags to specify M_WAITOK/M_NOWAIT. M_WAITOK allows devctl to sleep for
the memory allocation.

Revision 1.243: download - view: text, markup, annotated - select for diffs
Mon Jun 21 09:55:56 2010 UTC (19 months, 2 weeks ago) by ed
Branches: MAIN
Diff to: previous 1.242: preferred, colored
Changes since revision 1.242: +3 -3 lines
SVN rev 209390 on 2010-06-21 09:55:56Z by ed

Use ISO C99 integer types in sys/kern where possible.

There are only about 100 occurences of the BSD-specific u_int*_t
datatypes in sys/kern. The ISO C99 integer types are used here more
often.

Revision 1.225.2.10.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 3 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.225.2.10: preferred, colored; next MAIN 1.225.2.11: preferred, colored
Changes since revision 1.225.2.10: +0 -0 lines
SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)

Revision 1.242: download - view: text, markup, annotated - select for diffs
Sat Jun 12 13:20:38 2010 UTC (19 months, 4 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.241: preferred, colored
Changes since revision 1.241: +21 -6 lines
SVN rev 209104 on 2010-06-12 13:20:38Z by kib

Add modifications of devctl_notify(9) functions that take flags. Use
flags to specify M_WAITOK/M_NOWAIT. M_WAITOK allows devctl to sleep for
the memory allocation.

As Warner noted, allowing the functions to sleep might cause
reordering of the queued notifications.

Reviewed by:	imp, jh
MFC after:	3 weeks

Revision 1.241: download - view: text, markup, annotated - select for diffs
Mon Jun 7 18:47:53 2010 UTC (20 months ago) by mav
Branches: MAIN
Diff to: previous 1.240: preferred, colored
Changes since revision 1.240: +4 -0 lines
SVN rev 208898 on 2010-06-07 18:47:53Z by mav

Call BUS_PROBE_NOMATCH() when device detached due to driver unload.
This allows bus to power-down device when driver unloaded on-flight.

Revision 1.225.2.10: download - view: text, markup, annotated - select for diffs
Sun Apr 25 19:13:08 2010 UTC (21 months, 2 weeks ago) by imp
Branches: RELENG_8
CVS tags: RELENG_8_1_BP
Branch point for: RELENG_8_1
Diff to: previous 1.225.2.9: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.9: +12 -3 lines
SVN rev 207198 on 2010-04-25 19:13:08Z by imp

MFC r206916

  Make sure that we free the passed in data message if we don't actually
  insert it onto the queue.  Also, fix a mtx leak if someone turns off
  devctl while we're processing a messages.

  MFC after:	5 days

Revision 1.240: download - view: text, markup, annotated - select for diffs
Tue Apr 20 20:39:42 2010 UTC (21 months, 3 weeks ago) by imp
Branches: MAIN
Diff to: previous 1.239: preferred, colored
Changes since revision 1.239: +12 -3 lines
SVN rev 206916 on 2010-04-20 20:39:42Z by imp

Make sure that we free the passed in data message if we don't actually
insert it onto the queue.  Also, fix a mtx leak if someone turns off
devctl while we're processing a messages.

MFC after:	5 days

Revision 1.201.2.10.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 10 00:26:20 2010 UTC (23 months, 4 weeks ago) by kensmith
Branches: RELENG_7_3
CVS tags: RELENG_7_3_0_RELEASE
Diff to: previous 1.201.2.10: preferred, colored; next MAIN 1.201.2.11: preferred, colored
Changes since revision 1.201.2.10: +0 -0 lines
SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)

Revision 1.239: download - view: text, markup, annotated - select for diffs
Sun Feb 7 18:00:13 2010 UTC (2 years ago) by gavin
Branches: MAIN
Diff to: previous 1.238: preferred, colored
Changes since revision 1.238: +1 -1 lines
SVN rev 203618 on 2010-02-07 18:00:13Z by gavin

Spelling nit

Revision 1.201.2.10: download - view: text, markup, annotated - select for diffs
Thu Jan 21 19:17:42 2010 UTC (2 years ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_3_BP
Branch point for: RELENG_7_3
Diff to: previous 1.201.2.9: preferred, colored; branchpoint 1.201: preferred, colored
Changes since revision 1.201.2.9: +1 -1 lines
SVN rev 202765 on 2010-01-21 19:17:42Z by jhb

MFC 198411:
- Fix several off-by-one errors when using MAXCOMLEN.  The p_comm[] and
  td_name[] arrays are actually MAXCOMLEN + 1 in size and a few places that
  created shadow copies of these arrays were just using MAXCOMLEN.
- Prefer using sizeof() of an array type to explicit constants for the
  array length in a few places.
- Ensure that all of p_comm[] is always zero'd during execve() to guard
  against any possible information leaks.  Previously trailing garbage in
  p_comm[] could be leaked to userland in ktrace record headers.

Revision 1.225.2.9: download - view: text, markup, annotated - select for diffs
Thu Jan 21 19:11:18 2010 UTC (2 years ago) by jhb
Branches: RELENG_8
Diff to: previous 1.225.2.8: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.8: +1 -1 lines
SVN rev 202764 on 2010-01-21 19:11:18Z by jhb

MFC 198411:
- Fix several off-by-one errors when using MAXCOMLEN.  The p_comm[] and
  td_name[] arrays are actually MAXCOMLEN + 1 in size and a few places that
  created shadow copies of these arrays were just using MAXCOMLEN.
- Prefer using sizeof() of an array type to explicit constants for the
  array length in a few places.
- Ensure that all of p_comm[] and td_name[] is always zero'd during
  execve() to guard against any possible information leaks.  Previously
  trailing garbage in p_comm[] could be leaked to userland in ktrace
  record headers via td_name[].

Revision 1.201.2.9: download - view: text, markup, annotated - select for diffs
Thu Jan 21 17:55:47 2010 UTC (2 years ago) by jhb
Branches: RELENG_7
Diff to: previous 1.201.2.8: preferred, colored; branchpoint 1.201: preferred, colored
Changes since revision 1.201.2.8: +40 -0 lines
SVN rev 202763 on 2010-01-21 17:55:47Z by jhb

MFC 198134,198149,198170,198171,198391,200948:
Add a facility for associating optional descriptions with active interrupt
handlers.  This is primarily intended as a way to allow devices that use
multiple interrupts (e.g. MSI) to meaningfully distinguish the various
interrupt handlers.
- Add a new BUS_DESCRIBE_INTR() method to the bus interface to associate
  a description with an active interrupt handler setup by BUS_SETUP_INTR.
  It has a default method (bus_generic_describe_intr()) which simply passes
  the request up to the parent device.
- Add a bus_describe_intr() wrapper around BUS_DESCRIBE_INTR() that supports
  printf(9) style formatting using var args.
- Reserve MAXCOMLEN bytes in the intr_handler structure to hold the name of
  an interrupt handler and copy the name passed to intr_event_add_handler()
  into that buffer instead of just saving the pointer to the name.
- Add a new intr_event_describe_handler() which appends a description string
  to an interrupt handler's name.
- Implement support for interrupt descriptions on amd64, i386, and sparc64 by
  having the nexus(4) driver supply a custom bus_describe_intr method that
  invokes a new intr_describe() MD routine which in turn looks up the
  associated interrupt event and invokes intr_event_describe_handler().

Revision 1.225.2.8: download - view: text, markup, annotated - select for diffs
Thu Jan 21 17:54:29 2010 UTC (2 years ago) by jhb
Branches: RELENG_8
Diff to: previous 1.225.2.7: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.7: +40 -0 lines
SVN rev 202762 on 2010-01-21 17:54:29Z by jhb

MFC 198134,198149,198170,198171,198391,200948:
Add a facility for associating optional descriptions with active interrupt
handlers.  This is primarily intended as a way to allow devices that use
multiple interrupts (e.g. MSI) to meaningfully distinguish the various
interrupt handlers.
- Add a new BUS_DESCRIBE_INTR() method to the bus interface to associate
  a description with an active interrupt handler setup by BUS_SETUP_INTR.
  It has a default method (bus_generic_describe_intr()) which simply passes
  the request up to the parent device.
- Add a bus_describe_intr() wrapper around BUS_DESCRIBE_INTR() that supports
  printf(9) style formatting using var args.
- Reserve MAXCOMLEN bytes in the intr_handler structure to hold the name of
  an interrupt handler and copy the name passed to intr_event_add_handler()
  into that buffer instead of just saving the pointer to the name.
- Add a new intr_event_describe_handler() which appends a description string
  to an interrupt handler's name.
- Implement support for interrupt descriptions on amd64, i386, and sparc64 by
  having the nexus(4) driver supply a custom bus_describe_intr method that
  invokes a new intr_describe() MD routine which in turn looks up the
  associated interrupt event and invokes intr_event_describe_handler().

Revision 1.238: download - view: text, markup, annotated - select for diffs
Wed Dec 30 22:37:28 2009 UTC (2 years, 1 month ago) by jhb
Branches: MAIN
Diff to: previous 1.237: preferred, colored
Changes since revision 1.237: +3 -3 lines
SVN rev 201287 on 2009-12-30 22:37:28Z by jhb

Actually set RLE_ALLOCATED when allocating a reserved resource so that
resource_list_release() will later release the resource instead of failing.

Revision 1.237: download - view: text, markup, annotated - select for diffs
Wed Dec 30 19:44:31 2009 UTC (2 years, 1 month ago) by jhb
Branches: MAIN
Diff to: previous 1.236: preferred, colored
Changes since revision 1.236: +12 -1 lines
SVN rev 201276 on 2009-12-30 19:44:31Z by jhb

- Assert that a reserved resource returned via resource_list_alloc() is not
  active.
- Fix bus_generic_rl_(alloc|release)_resource() to not attempt to fetch a
  resource list for grandchild devices, but just pass those requests up to
  the parent directly.  This worked by accident previously, but it is
  better to not let bus drivers try to operate on devices they do not
  manage.

Revision 1.236: download - view: text, markup, annotated - select for diffs
Wed Dec 9 21:52:53 2009 UTC (2 years, 2 months ago) by jhb
Branches: MAIN
Diff to: previous 1.235: preferred, colored
Changes since revision 1.235: +151 -2 lines
SVN rev 200315 on 2009-12-09 21:52:53Z by jhb

For some buses, devices may have active resources assigned even though they
are not allocated by the device driver.  These resources should still appear
allocated from the system's perspective so that their assigned ranges are
not reused by other resource requests.  The PCI bus driver has used a hack
to effect this for a while now where it uses rman_set_device() to assign
devices to the PCI bus when they are first encountered and later assigns
them to the actual device when a driver allocates a BAR.  A few downsides of
this approach is that it results in somewhat confusing devinfo -r output as
well as not being very easily portable to other bus drivers.

This commit adds generic support for "reserved" resources to the resource
list API used by many bus drivers to manage the resources of child devices.
A resource may be reserved via resource_list_reserve().  This will allocate
the resource from the bus' parent without activating it.
resource_list_alloc() recognizes an attempt to allocate a reserved resource.
When this happens it activates the resource (if requested) and then returns
the reserved resource.  Similarly, when a reserved resource is released via
resource_list_release(), it is deactivated (if it is active) and the
resource is then marked reserved again, but is left allocated from the
bus' parent.  To completely remove a reserved resource, a bus driver may
use resource_list_unreserve().  A bus driver may use resource_list_busy()
to determine if a reserved resource is allocated by a child device or if
it can be unreserved.

The PCI bus driver has been changed to use this framework instead of
abusing rman_set_device() to keep track of reserved vs allocated resources.

Submitted by:	imp (an older version many moons ago)
MFC after:	1 month

Revision 1.184.2.7: download - view: text, markup, annotated - select for diffs
Mon Nov 23 01:23:03 2009 UTC (2 years, 2 months ago) by emaste
Branches: RELENG_6
Diff to: previous 1.184.2.6: preferred, colored; branchpoint 1.184: preferred, colored; next MAIN 1.185: preferred, colored
Changes since revision 1.184.2.6: +2 -1 lines
SVN rev 199685 on 2009-11-23 01:23:03Z by emaste

MFC r199209:
  Fix a potential buffer boundaries overflow in devclass_add_device() by
  using all available int lenghts digits for storing the information.

Revision 1.201.2.8: download - view: text, markup, annotated - select for diffs
Sun Nov 22 23:51:51 2009 UTC (2 years, 2 months ago) by attilio
Branches: RELENG_7
Diff to: previous 1.201.2.7: preferred, colored; branchpoint 1.201: preferred, colored
Changes since revision 1.201.2.7: +2 -1 lines
SVN rev 199683 on 2009-11-22 23:51:51Z by attilio

MFC r199209:
Fix a potential buffer boundaries overflow in devclass_add_device() by
using all available int lenghts digits for storing the information.

Revision 1.225.2.7: download - view: text, markup, annotated - select for diffs
Sun Nov 22 15:53:39 2009 UTC (2 years, 2 months ago) by attilio
Branches: RELENG_8
Diff to: previous 1.225.2.6: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.6: +2 -1 lines
SVN rev 199649 on 2009-11-22 15:53:39Z by attilio

MFC r199209:
Fix a potential buffer boundaries overflow in devclass_add_device() by
using all available int lenghts digits for storing the information.

Sponsored by:	Sandvine Incorporated

Revision 1.235: download - view: text, markup, annotated - select for diffs
Thu Nov 12 00:52:14 2009 UTC (2 years, 2 months ago) by attilio
Branches: MAIN
Diff to: previous 1.234: preferred, colored
Changes since revision 1.234: +2 -1 lines
SVN rev 199209 on 2009-11-12 00:52:14Z by attilio

The building the dev nameunit string, in devclass_add_device() is based
on the assumption that the unit linked with the device is invariant but
that can change when calling devclass_alloc_unit() (because -1 is passed
or, more simply, because the unit choosen is beyond the table limits).
This results in a completely bogus string building.

Fix this by reserving the necessary room for all the possible characters
printable by a positive integer (we do not allow for negative unit
number).

Reported by:	Sandvine Incorporated
Reviewed by:	emaste
Sponsored by:	Sandvine Incorporated
MFC:		1 week

Revision 1.201.2.7: download - view: text, markup, annotated - select for diffs
Fri Nov 6 20:23:42 2009 UTC (2 years, 3 months ago) by jhb
Branches: RELENG_7
Diff to: previous 1.201.2.6: preferred, colored; branchpoint 1.201: preferred, colored
Changes since revision 1.201.2.6: +14 -24 lines
SVN rev 199001 on 2009-11-06 20:23:42Z by jhb

MFC 198367:
Set the devclass_t pointer specified in the DRIVER_MODULE() macro
sooner so it is always valid when a driver's identify routine is
called.

Revision 1.225.2.6: download - view: text, markup, annotated - select for diffs
Fri Nov 6 20:23:16 2009 UTC (2 years, 3 months ago) by jhb
Branches: RELENG_8
Diff to: previous 1.225.2.5: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.5: +14 -24 lines
SVN rev 199000 on 2009-11-06 20:23:16Z by jhb

MFC 198367:
Set the devclass_t pointer specified in the DRIVER_MODULE() macro
sooner so it is always valid when a driver's identify routine is
called.

Revision 1.225.2.5.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 25 01:10:29 2009 UTC (2 years, 3 months ago) by kensmith
Branches: RELENG_8_0
CVS tags: RELENG_8_0_0_RELEASE
Diff to: previous 1.225.2.5: preferred, colored; next MAIN 1.225.2.6: preferred, colored
Changes since revision 1.225.2.5: +0 -0 lines
SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)

Revision 1.234: download - view: text, markup, annotated - select for diffs
Fri Oct 23 15:14:54 2009 UTC (2 years, 3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.233: preferred, colored
Changes since revision 1.233: +1 -1 lines
SVN rev 198411 on 2009-10-23 15:14:54Z by jhb

- Fix several off-by-one errors when using MAXCOMLEN.  The p_comm[] and
  td_name[] arrays are actually MAXCOMLEN + 1 in size and a few places that
  created shadow copies of these arrays were just using MAXCOMLEN.
- Prefer using sizeof() of an array type to explicit constants for the
  array length in a few places.
- Ensure that all of p_comm[] and td_name[] is always zero'd during
  execve() to guard against any possible information leaks.  Previously
  trailing garbage in p_comm[] could be leaked to userland in ktrace
  record headers via td_name[].

Reviewed by:	bde

Revision 1.233: download - view: text, markup, annotated - select for diffs
Thu Oct 22 14:53:44 2009 UTC (2 years, 3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.232: preferred, colored
Changes since revision 1.232: +14 -24 lines
SVN rev 198367 on 2009-10-22 14:53:44Z by jhb

Set the devclass_t pointer specified in the DRIVER_MODULE() macro
sooner so it is always valid when a driver's identify routine is
called.  Previously, new-bus would attempt to create the devclass for
a newly loaded driver in two separate places, once in
devclass_add_driver(), and again after devclass_add_driver() returned
in driver_module_handler().  Only the second lookup attempted to set a
device class' parent and set the devclass_t pointer specified in the
DRIVER_MODULE() macro.  However, by the time it was executed, the
driver was already added to existing instances of the parent driver at
which point in time the new driver's identify routine would have been
invoked.  The fix is to merge the two attempts and only create the
devclass once in devclass_add_driver() including setting the
devclass_t pointer passed to DRIVER_MODULE() before the driver is
added to any existing bus devices.

Reported by:	avg
Reviewed by:	imp
MFC after:	2 weeks

Revision 1.232: download - view: text, markup, annotated - select for diffs
Thu Oct 15 14:54:35 2009 UTC (2 years, 3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.231: preferred, colored
Changes since revision 1.231: +40 -0 lines
SVN rev 198134 on 2009-10-15 14:54:35Z by jhb

Add a facility for associating optional descriptions with active interrupt
handlers.  This is primarily intended as a way to allow devices that use
multiple interrupts (e.g. MSI) to meaningfully distinguish the various
interrupt handlers.
- Add a new BUS_DESCRIBE_INTR() method to the bus interface to associate
  a description with an active interrupt handler setup by BUS_SETUP_INTR.
  It has a default method (bus_generic_describe_intr()) which simply passes
  the request up to the parent device.
- Add a bus_describe_intr() wrapper around BUS_DESCRIBE_INTR() that supports
  printf(9) style formatting using var args.
- Reserve MAXCOMLEN bytes in the intr_handler structure to hold the name of
  an interrupt handler and copy the name passed to intr_event_add_handler()
  into that buffer instead of just saving the pointer to the name.
- Add a new intr_event_describe_handler() which appends a description string
  to an interrupt handler's name.
- Implement support for interrupt descriptions on amd64 and i386 by having
  the nexus(4) driver supply a custom bus_describe_intr method that invokes
  a new intr_describe() MD routine which in turn looks up the associated
  interrupt event and invokes intr_event_describe_handler().

Requested by:	many
Reviewed by:	scottl
MFC after:	2 weeks

Revision 1.225.2.5: download - view: text, markup, annotated - select for diffs
Fri Sep 25 18:04:55 2009 UTC (2 years, 4 months ago) by mav
Branches: RELENG_8
CVS tags: RELENG_8_0_BP
Branch point for: RELENG_8_0
Diff to: previous 1.225.2.4: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.4: +1 -1 lines
SVN rev 197494 on 2009-09-25 18:04:55Z by mav

MFC rev. 197462:
Do not call BUS_DRIVER_ADDED() for detached buses (attach failed) on
driver load. This fixes crash on atapicam module load on systems, where
some ata channels (usually ata1) was probed, but failed to attach.

Reviewed by:    jhb, imp
Tested by:      many
Approved by:    re (kib)

Revision 1.231: download - view: text, markup, annotated - select for diffs
Thu Sep 24 17:03:32 2009 UTC (2 years, 4 months ago) by mav
Branches: MAIN
Diff to: previous 1.230: preferred, colored
Changes since revision 1.230: +1 -1 lines
SVN rev 197462 on 2009-09-24 17:03:32Z by mav

Do not call BUS_DRIVER_ADDED() for detached buses (attach failed) on
driver load. This fixes crash on atapicam module load on systems,
where some ata channels (usually ata1) was probed, but failed to attach.

Reviewed by:	jhb, imp
Tested by:	many

Revision 1.230: download - view: text, markup, annotated - select for diffs
Sun Sep 13 15:08:19 2009 UTC (2 years, 4 months ago) by attilio
Branches: MAIN
Diff to: previous 1.229: preferred, colored
Changes since revision 1.229: +2 -18 lines
SVN rev 197165 on 2009-09-13 15:08:19Z by attilio

Revert r196779 in order to implement a different scheme for newbus locking
methodology.

Requested by:	imp

Revision 1.225.2.4: download - view: text, markup, annotated - select for diffs
Sat Sep 5 08:03:29 2009 UTC (2 years, 5 months ago) by imp
Branches: RELENG_8
Diff to: previous 1.225.2.3: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.3: +62 -13 lines
SVN rev 196855 on 2009-09-05 08:03:29Z by imp

MFC r196529:
  Rather than having enabled/disabled, implement a max queue depth.
  While usually not an issue, this firewalls bugs in the code that may
  run us out of memory.

  Fix a memory exhaustion in the case where devctl was disabled, but the
  link was bouncing.  The check to queue was in the wrong place.

  Implement a new sysctl hw.bus.devctl_queue to control the depth.  Make
  compatibility hacks for hw.bus.devctl_disable to ease transition.

  Reviewed by:	emaste@
  Approved by:	re@ (kib)
  MFC after:	asap

Revision 1.229: download - view: text, markup, annotated - select for diffs
Thu Sep 3 13:40:41 2009 UTC (2 years, 5 months ago) by attilio
Branches: MAIN
Diff to: previous 1.228: preferred, colored
Changes since revision 1.228: +18 -2 lines
SVN rev 196779 on 2009-09-03 13:40:41Z by attilio

Add intermediate states for attaching and detaching that will be
reused by the enhached newbus locking once it is checked in.
This change can be easilly MFCed to STABLE_8 at the appropriate moment.

Reviewed by:	jhb, scottl
Tested by:	Giovanni Trematerra <giovanni dot trematerra at gmail dot com>

Revision 1.228: download - view: text, markup, annotated - select for diffs
Tue Aug 25 06:25:59 2009 UTC (2 years, 5 months ago) by imp
Branches: MAIN
Diff to: previous 1.227: preferred, colored
Changes since revision 1.227: +62 -13 lines
SVN rev 196529 on 2009-08-25 06:25:59Z by imp

Rather than havnig enabled/disabled, implement a max queue depth.
While usually not an issue, this firewalls bugs in the code that may
run us out of memory.

Fix a memory exhaustion in the case where devctl was disabled, but the
link was bouncing.  The check to queue was in the wrong place.

Implement a new sysctl hw.bus.devctl_queue to control the depth.  Make
compatibility hacks for hw.bus.devctl_disable to ease transition.

Reviewed by:	emaste@
Approved by:	re@ (kib)
MFC after:	asap

Revision 1.225.2.3: download - view: text, markup, annotated - select for diffs
Thu Aug 20 20:23:28 2009 UTC (2 years, 5 months ago) by jhb
Branches: RELENG_8
Diff to: previous 1.225.2.2: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.2: +6 -81 lines
SVN rev 196405 on 2009-08-20 20:23:28Z by jhb

MFC 196403: Temporarily revert the new-bus locking for 8.0 release.

Approved by:	re (kib)

Revision 1.227: download - view: text, markup, annotated - select for diffs
Thu Aug 20 19:17:53 2009 UTC (2 years, 5 months ago) by jhb
Branches: MAIN
Diff to: previous 1.226: preferred, colored
Changes since revision 1.226: +6 -81 lines
SVN rev 196403 on 2009-08-20 19:17:53Z by jhb

Temporarily revert the new-bus locking for 8.0 release.  It will be
reintroduced after HEAD is reopened for commits by re@.

Approved by:	re (kib), attilio

Revision 1.225.2.2: download - view: text, markup, annotated - select for diffs
Sun Aug 16 20:33:16 2009 UTC (2 years, 5 months ago) by ed
Branches: RELENG_8
Diff to: previous 1.225.2.1: preferred, colored; branchpoint 1.225: preferred, colored
Changes since revision 1.225.2.1: +1 -1 lines
SVN rev 196277 on 2009-08-16 20:33:16Z by ed

MFC r196276:

  Fix small style regression introduced by the MPSAFE newbus code.

Approved by:	re (rwatson)

Revision 1.226: download - view: text, markup, annotated - select for diffs
Sun Aug 16 19:55:53 2009 UTC (2 years, 5 months ago) by ed
Branches: MAIN
Diff to: previous 1.225: preferred, colored
Changes since revision 1.225: +1 -1 lines
SVN rev 196276 on 2009-08-16 19:55:53Z by ed

Fix small style regression introduced by the MPSAFE newbus code.

Approved by:	re (rwatson)

Revision 1.225.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 3 08:13:06 2009 UTC (2 years, 6 months ago) by kensmith
Branches: RELENG_8
Diff to: previous 1.225: preferred, colored
Changes since revision 1.225: +0 -0 lines
SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)

Revision 1.225: download - view: text, markup, annotated - select for diffs
Sun Aug 2 14:28:40 2009 UTC (2 years, 6 months ago) by attilio
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.224: preferred, colored
Changes since revision 1.224: +82 -7 lines
SVN rev 196037 on 2009-08-02 14:28:40Z by attilio

Make the newbus subsystem Giant free by adding the new newbus sxlock.
The newbus lock is responsible for protecting newbus internIal structures,
device states and devclass flags. It is necessary to hold it when all
such datas are accessed. For the other operations, softc locking should
ensure enough protection to avoid races.

Newbus lock is automatically held when virtual operations on the device
and bus are invoked when loading the driver or when the suspend/resume
take place. For other 'spourious' operations trying to access/modify
the newbus topology, newbus lock needs to be automatically acquired and
dropped.

For the moment Giant is also acquired in some key point (modules subsystem)
in order to avoid problems before the 8.0 release as module handlers could
make assumptions about it. This Giant locking should go just after
the release happens.

Please keep in mind that the public interface can be expanded in order
to provide more support, if there are really necessities at some point
and also some bugs could arise as long as the patch needs a bit of
further testing.

Bump __FreeBSD_version in order to reflect the newbus lock introduction.

Reviewed by:    ed, hps, jhb, imp, mav, scottl
No answer by:   ariff, thompsa, yongari
Tested by:      pho,
                G. Trematerra <giovanni dot trematerra at gmail dot com>,
                Brandon Gooch <jamesbrandongooch at gmail dot com>
Sponsored by:   Yahoo! Incorporated
Approved by:	re (ksmith)

Revision 1.224: download - view: text, markup, annotated - select for diffs
Wed Jun 10 01:02:38 2009 UTC (2 years, 8 months ago) by imp
Branches: MAIN
Diff to: previous 1.223: preferred, colored
Changes since revision 1.223: +0 -21 lines
SVN rev 193874 on 2009-06-10 01:02:38Z by imp

We can actually remove devclass_find_driver.

Revision 1.223: download - view: text, markup, annotated - select for diffs
Tue Jun 9 23:24:04 2009 UTC (2 years, 8 months ago) by imp
Branches: MAIN
Diff to: previous 1.222: preferred, colored
Changes since revision 1.222: +4 -4 lines
SVN rev 193871 on 2009-06-09 23:24:04Z by imp

As discussed on arch@, restire
devclass_{add,delete,find,quiesce}_driver.  They aren't needed or used
and complicate locking newbus.

Revision 1.222: download - view: text, markup, annotated - select for diffs
Tue Jun 9 14:26:23 2009 UTC (2 years, 8 months ago) by jhb
Branches: MAIN
Diff to: previous 1.221: preferred, colored
Changes since revision 1.221: +152 -12 lines
SVN rev 193833 on 2009-06-09 14:26:23Z by jhb

Add support for multiple passes of the device tree during the boot-time
probe.  The current device order is unchanged.  This commit just adds the
infrastructure and ABI changes so that it is easier to merge later changes
into 8.x.
- Driver attachments now have an associated pass level.  Attachments are
  not allowed to probe or attach to drivers until the system-wide pass level
  is >= the attachment's pass level.  By default driver attachments use the
  "last" pass level (BUS_PASS_DEFAULT).  Driver's that wish to probe during
  an earlier pass use EARLY_DRIVER_MODULE() instead of DRIVER_MODULE() which
  accepts the pass level as an additional parameter.
- A new method BUS_NEW_PASS has been added to the bus interface.  This
  method is invoked when the system-wide pass level is changed to kick off
  a rescan of the device tree so that drivers that have just been made
  "eligible" can probe and attach.
- The bus_generic_new_pass() function provides a default implementation of
  BUS_NEW_PASS().  It first allows drivers that were just made eligible for
  this pass to identify new child devices.  Then it propogates the rescan to
  child devices that already have an attached driver by invoking their
  BUS_NEW_PASS() method.  It also reprobes devices without a driver.
- BUS_PROBE_NOMATCH() is only invoked for devices that do not have
  an attached driver after being scanned during the final pass.
- The bus_set_pass() function is used during boot to raise the pass level.
  Currently it is only called once during root_bus_configure() to raise
  the pass level to BUS_PASS_DEFAULT.  This has the effect of probing all
  devices in a single pass identical to previous behavior.

Reviewed by:	imp
Approved by:	re (kib)

Revision 1.221: download - view: text, markup, annotated - select for diffs
Wed May 20 17:19:30 2009 UTC (2 years, 8 months ago) by jhb
Branches: MAIN
Diff to: previous 1.220: preferred, colored
Changes since revision 1.220: +1 -1 lines
SVN rev 192449 on 2009-05-20 17:19:30Z by jhb

Fix a typo.

Revision 1.220: download - view: text, markup, annotated - select for diffs
Wed May 20 16:58:16 2009 UTC (2 years, 8 months ago) by imp
Branches: MAIN
Diff to: previous 1.219: preferred, colored
Changes since revision 1.219: +4 -4 lines
SVN rev 192443 on 2009-05-20 16:58:16Z by imp

We no longer need to use d_thread_t for portability here, switch to
struct thread *.

Revision 1.201.2.6.2.1: download - view: text, markup, annotated - select for diffs
Wed Apr 15 03:14:26 2009 UTC (2 years, 9 months ago) by kensmith
Branches: RELENG_7_2
CVS tags: RELENG_7_2_0_RELEASE
Diff to: previous 1.201.2.6: preferred, colored; next MAIN 1.201.2.7: preferred, colored
Changes since revision 1.201.2.6: +0 -0 lines
SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)

Revision 1.201.2.6: download - view: text, markup, annotated - select for diffs
Fri Apr 3 10:38:24 2009 UTC (2 years, 10 months ago) by mav
Branches: RELENG_7
CVS tags: RELENG_7_2_BP
Branch point for: RELENG_7_2
Diff to: previous 1.201.2.5: preferred, colored; branchpoint 1.201: preferred, colored
Changes since revision 1.201.2.5: +12 -4 lines
SVN rev 190669 on 2009-04-03 10:38:24Z by mav

MFC rev. 188464.

Check for device_set_devclass() errors and skip driver probe/attach if any.
Attach called without devclass set crashes the system.

On attach/resume some ATA drivers sometimes trying to create duplicate adX
device. It is surely their own problem, but it is not a reason to crash here.

Approved by:	re (kib)

Revision 1.219: download - view: text, markup, annotated - select for diffs
Wed Mar 25 17:02:05 2009 UTC (2 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.218: preferred, colored
Changes since revision 1.218: +1 -1 lines
SVN rev 190417 on 2009-03-25 17:02:05Z by jhb

When looking up the parent devclass of a new devclass, create the parent
devclass if it doesn't already exist.

Revision 1.218: download - view: text, markup, annotated - select for diffs
Mon Mar 23 01:13:34 2009 UTC (2 years, 10 months ago) by kan
Branches: MAIN
Diff to: previous 1.217: preferred, colored
Changes since revision 1.217: +6 -0 lines
SVN rev 190305 on 2009-03-23 01:13:34Z by kan

Add safety check that does not allow empty strings to be queued
to the devctl notification queue. Empty strings cause devctl read
call to return 0 and result in devd exiting prematurely.

The actual offender (ugen notes for root hubs) will be fixed
by separate commit.

Revision 1.201.2.5: download - view: text, markup, annotated - select for diffs
Sun Mar 22 15:46:12 2009 UTC (2 years, 10 months ago) by n_hibma
Branches: RELENG_7
Diff to: previous 1.201.2.4: preferred, colored; branchpoint 1.201: preferred, colored
Changes since revision 1.201.2.4: +2 -1 lines
SVN rev 190267 on 2009-03-22 15:46:12Z by n_hibma

If the device marked itself quiet, make detachment quiet as well. This
avoids '<dev>XX: detached' messages when the 'attached' message was
suppressed.

Revision 1.217: download - view: text, markup, annotated - select for diffs
Wed Mar 11 08:19:31 2009 UTC (2 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.216: preferred, colored
Changes since revision 1.216: +2 -3 lines
SVN rev 189684 on 2009-03-11 08:19:31Z by imp

Minor nits notice by jhb@

Revision 1.201.2.4: download - view: text, markup, annotated - select for diffs
Tue Mar 10 18:16:03 2009 UTC (2 years, 11 months ago) by jhb
Branches: RELENG_7
Diff to: previous 1.201.2.3: preferred, colored; branchpoint 1.201: preferred, colored
Changes since revision 1.201.2.3: +11 -0 lines
SVN rev 189638 on 2009-03-10 18:16:03Z by jhb

MFC: Add sysctl_rename_oid() and use it in device_set_unit().

Revision 1.216: download - view: text, markup, annotated - select for diffs
Mon Mar 9 13:20:23 2009 UTC (2 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.215: preferred, colored
Changes since revision 1.215: +53 -9 lines
SVN rev 189574 on 2009-03-09 13:20:23Z by imp

Fix a long-standing bug in newbus.  It was introduced when subclassing
was introduced.  If you have a bus, say cardbus, that is derived from
a base-bus (say PCI), then ordinarily all PCI drivers would attach to
cardbus devices.  However, there had been one exception: kldload
wouldn't work.

The problem is in devclass_add_driver.  In this routine, all we did
was call to the pci device's BUS_DRIVER_ADDED routine.  However, since
cardbus bus instances had a different devclass, none of them were
called.

The solution is to call all subclass devclasses, recursively down the
tree, of the class that was loaded.  Since we don't have a 'children
class' pointer, we search the whole list of devclasses for a class
whose parent matches.  Since just done a kldload time, this isn't as
bad as it sounds.  In addition, we short-circuit the whole process by
marking those classes with subclasses with a flag.  We'll likely have
to reevaluate this method the number of devclasses with subclasses
gets large.

This means we can remove the "cardbus" lines from all the PCI drivers
since we have no cardbus specific attach device attachments in the
tree.

# Also: minor tweak to an error message

Revision 1.215: download - view: text, markup, annotated - select for diffs
Wed Feb 11 04:54:02 2009 UTC (2 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.214: preferred, colored
Changes since revision 1.214: +8 -8 lines
SVN rev 188476 on 2009-02-11 04:54:02Z by imp

o Use NULL in pereference to 0 in pointer contexts.
o Use newly minted KOBJMETHOD_END as appropriate
o fix prototype for root_setup_intr.

Revision 1.214: download - view: text, markup, annotated - select for diffs
Tue Feb 10 23:22:29 2009 UTC (2 years, 11 months ago) by mav
Branches: MAIN
Diff to: previous 1.213: preferred, colored
Changes since revision 1.213: +12 -4 lines
SVN rev 188464 on 2009-02-10 23:22:29Z by mav

Check for device_set_devclass() errors and skip driver probe/attach if any.
Attach call without devclass set crashes the system.

On resume AHCI driver sometimes tries to create duplicate adX device.
It is surely his own problem, but IMHO it is not a reason to crash here.
Other reasons are also possible.

Revision 1.213: download - view: text, markup, annotated - select for diffs
Tue Feb 3 00:10:21 2009 UTC (3 years ago) by imp
Branches: MAIN
Diff to: previous 1.212: preferred, colored
Changes since revision 1.212: +5 -5 lines
SVN rev 188037 on 2009-02-03 00:10:21Z by imp

Declare bus_data_devices to be static: it isn't used elsewhere.
Use NULL in a couple of places rather than 0 in the context of
pointers to be consistent with the rest of the file.

Revision 1.201.2.3.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 25 02:59:29 2008 UTC (3 years, 2 months ago) by kensmith
Branches: RELENG_7_1
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.201.2.3: preferred, colored; next MAIN 1.201.2.4: preferred, colored
Changes since revision 1.201.2.3: +0 -0 lines
SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)

Revision 1.212: download - view: text, markup, annotated - select for diffs
Tue Nov 18 21:01:54 2008 UTC (3 years, 2 months ago) by jhb
Branches: MAIN
Diff to: previous 1.211: preferred, colored
Changes since revision 1.211: +20 -4 lines
SVN rev 185059 on 2008-11-18 21:01:54Z by jhb

Allow device hints to wire the unit numbers of devices.
- An "at" hint now reserves a device name.
- A new BUS_HINT_DEVICE_UNIT method is added to the bus interface.  When
  determining the unit number of a device, this method is invoked to
  let the bus driver specify the unit of a device given a specific
  devclass.  This is the only way a device can be given a name reserved
  via an "at" hint.
- Implement BUS_HINT_DEVICE_UNIT() for the acpi(4) and isa(4) bus drivers.
  Both of these busses implement this by comparing the resources for a
  given hint device with the resources enumerated by ACPI/PnPBIOS and
  wire a unit if the hint resources are a subset of the "real" resources.
- Use bus_hinted_children() for adding hinted devices on isa(4) busses
  now instead of doing it by hand.
- Remove the unit kludging from sio(4) as it is no longer necessary.

Prodding from:	peter, imp
OK'd by:	marcel
MFC after:	1 month

Revision 1.211: download - view: text, markup, annotated - select for diffs
Thu Nov 13 21:46:19 2008 UTC (3 years, 2 months ago) by n_hibma
Branches: MAIN
Diff to: previous 1.210: preferred, colored
Changes since revision 1.210: +2 -1 lines
SVN rev 184942 on 2008-11-13 21:46:19Z by n_hibma

Silence detach messages if the device has marked itself quiet (u3g).

MFC after:	3 weeks

Revision 1.210: download - view: text, markup, annotated - select for diffs
Fri Oct 10 17:49:47 2008 UTC (3 years, 4 months ago) by imp
Branches: MAIN
Diff to: previous 1.209: preferred, colored
Changes since revision 1.209: +6 -4 lines
SVN rev 183750 on 2008-10-10 17:49:47Z by imp

Close, but not eliminate, a race condition.  It is one that properly
designed drivers would never hit, but was exposed in diving into
another problem...

When expanding the devclass array, free the old memory after updating
the pointer to the new memory.  For the following single race case,
this helps:

	allocate new memory
	copy to new memory
	free old memory
<interrupt>				read pointer to freed memory
	update pointer to new memory

Now we do
	allocate new memory
	copy to new memory
	update pointer to new memory
	free old memory

Which closes this problem, but doesn't even begin to address the
multicpu races, which all should be covered by Giant at the moment,
but likely aren't completely.

Note: reviewers were ok with this fix, but suggested the use case
wasn't one we wanted to encourage.

Reviewed by:	jhb, scottl.

Revision 1.184.2.6.4.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 02:57:24 2008 UTC (3 years, 4 months ago) by kensmith
Branches: RELENG_6_4
CVS tags: RELENG_6_4_0_RELEASE
Diff to: previous 1.184.2.6: preferred, colored; next MAIN 1.184.2.7: preferred, colored
Changes since revision 1.184.2.6: +0 -0 lines
SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)

Revision 1.201.2.3: download - view: text, markup, annotated - select for diffs
Sat Jun 28 23:54:51 2008 UTC (3 years, 7 months ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_1_BP
Branch point for: RELENG_7_1
Diff to: previous 1.201.2.2: preferred, colored; branchpoint 1.201: preferred, colored
Changes since revision 1.201.2.2: +31 -0 lines
SVN rev 180083 on 2008-06-28 23:54:51Z by jhb

MFC: Add a BUS_BIND_INTR() method to the bus interface to bind an IRQ
resource to a CPU.  A bus_bind_intr(9) wrapper routine similar to
bus_setup/teardown_intr() is added for device drivers to use.  Currently
it is supported on amd64, i386, and sparc64 via nexus(4) methods that
simply call the intr_bind() routine.

Revision 1.209: download - view: text, markup, annotated - select for diffs
Fri Jun 20 16:58:15 2008 UTC (3 years, 7 months ago) by imp
Branches: MAIN
Diff to: previous 1.208: preferred, colored
Changes since revision 1.208: +25 -6 lines
SVN rev 179893 on 2008-06-20 16:58:15Z by imp

Split out the probing magic of device_probe_and_attach into
device_probe() so that it can be used by busses that may wish to do
additional processing between probe and attach.

Reviewed by:	dfr@

Revision 1.201.2.2: download - view: text, markup, annotated - select for diffs
Sun May 25 14:37:33 2008 UTC (3 years, 8 months ago) by rpaulo
Branches: RELENG_7
Diff to: previous 1.201.2.1: preferred, colored; branchpoint 1.201: preferred, colored
Changes since revision 1.201.2.1: +1 -1 lines
MFC r1.208:
  devctl_process_running(): Check for devsoftc.inuse == 1 instead of
  devsoftc.async_proc != NULL because the latter might not be true
  sometimes.
  This way /etc/rc.suspend gets executed.

  Reviwed by:     njl
  Submitted by:   Mitsuru IWASAKI <iwasaki at jp.FreeBSD.org>
  Tested also by: Andreas Wetzel <mickey242 at gmx.net>

Revision 1.208: download - view: text, markup, annotated - select for diffs
Sun May 18 13:55:51 2008 UTC (3 years, 8 months ago) by rpaulo
Branches: MAIN
Diff to: previous 1.207: preferred, colored
Changes since revision 1.207: +1 -1 lines
devctl_process_running(): Check for devsoftc.inuse == 1 instead of
devsoftc.async_proc != NULL because the latter might not be true
sometimes.
This way /etc/rc.suspend gets executed.

Reviwed	by:	njl
Submitted by:	Mitsuru IWASAKI <iwasaki at jp.FreeBSD.org>
Tested also by:	Andreas Wetzel <mickey242 at gmx.net>
MFC after:	1 week

Revision 1.207: download - view: text, markup, annotated - select for diffs
Thu Mar 20 21:24:32 2008 UTC (3 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.206: preferred, colored
Changes since revision 1.206: +31 -0 lines
Implement a BUS_BIND_INTR() method in the bus interface to bind an IRQ
resource to a CPU.  The default method is to pass the request up to the
parent similar to BUS_CONFIG_INTR() so that all busses don't have to
explicitly implement bus_bind_intr.  A bus_bind_intr(9) wrapper routine
similar to bus_setup/teardown_intr() is added for device drivers to use.
Unbinding an interrupt is done by binding it to NOCPU.  The IRQ resource
must be allocated, but it can happen in any order with respect to
bus_setup_intr().  Currently it is only supported on amd64 and i386 via
nexus(4) methods that simply call the intr_bind() routine.

Tested by:	gallatin

Revision 1.206: download - view: text, markup, annotated - select for diffs
Mon Mar 10 01:48:25 2008 UTC (3 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.205: preferred, colored
Changes since revision 1.205: +18 -19 lines
Tiny bit of KNF to make bus_setup_intr() look like the rest of this
function.

Revision 1.205: download - view: text, markup, annotated - select for diffs
Sun Mar 9 05:10:22 2008 UTC (3 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.204: preferred, colored
Changes since revision 1.204: +8 -0 lines
Any driver that relies on its parent to set the devclass has no way to
know if has siblings that need an actual probe.  Introduce a specail
return value called BUS_PROBE_NOOWILDCARD.  If the driver returns
this, the probe is only successful for devices that have had a
specific devclass set for them.

Reviewed by: current@, jhb@, grehan@

Revision 1.201.4.1: download - view: text, markup, annotated - select for diffs
Wed Feb 6 03:35:40 2008 UTC (4 years ago) by iwasaki
Branches: RELENG_7_0
CVS tags: RELENG_7_0_0_RELEASE
Diff to: previous 1.201: preferred, colored; next MAIN 1.202: preferred, colored
Changes since revision 1.201: +9 -0 lines
MFC revision:	subr_bus.c:1.204,  bus.h:1.79, acpi.c:1.244

o Add devctl_process_running() so that power management system driver
  can check whether devd(8) is running.
o Enter the sleep state immediately without waiting for timeout if
  devd(8) is not running such as the system in single user mode.

Approved by:	re (kensmith)

Revision 1.201.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 6 01:34:18 2008 UTC (4 years ago) by iwasaki
Branches: RELENG_7
Diff to: previous 1.201: preferred, colored
Changes since revision 1.201: +9 -0 lines
MFC revision:	subr_bus.c:1.204,  bus.h:1.79

Add devctl_process_running() so that power management system driver
can check whether devd(8) is running.

Approved by:	re (kensmith)

Revision 1.204: download - view: text, markup, annotated - select for diffs
Sun Jan 27 16:06:37 2008 UTC (4 years ago) by iwasaki
Branches: MAIN
Diff to: previous 1.203: preferred, colored
Changes since revision 1.203: +9 -0 lines
Add devctl_process_running() so that power management system driver
can check whether devd(8) is running.

MFC after:	1 week

Revision 1.203: download - view: text, markup, annotated - select for diffs
Wed Dec 19 22:05:07 2007 UTC (4 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.202: preferred, colored
Changes since revision 1.202: +4 -1 lines
When devclass_get_maxunit is passed a NULL, return -1 to indicate that
there's nothing allocated at all yet.

Revision 1.202: download - view: text, markup, annotated - select for diffs
Fri Nov 30 21:30:14 2007 UTC (4 years, 2 months ago) by peter
Branches: MAIN
Diff to: previous 1.201: preferred, colored
Changes since revision 1.201: +11 -0 lines
Deal with the possibility of device_set_unit() being called when attaching
the associated devinfo sysctl tree.

Revision 1.184.2.6: download - view: text, markup, annotated - select for diffs
Mon Nov 5 11:49:44 2007 UTC (4 years, 3 months ago) by phk
Branches: RELENG_6
CVS tags: RELENG_6_4_BP, RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3
Branch point for: RELENG_6_4
Diff to: previous 1.184.2.5: preferred, colored; branchpoint 1.184: preferred, colored
Changes since revision 1.184.2.5: +33 -0 lines
MFC:
	bus_alloc_resources() convenience API

Revision 1.201: download - view: text, markup, annotated - select for diffs
Fri Jul 27 11:59:56 2007 UTC (4 years, 6 months ago) by rwatson
Branches: MAIN
CVS tags: RELENG_7_BP, RELENG_7_0_BP
Branch point for: RELENG_7_0, RELENG_7
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +0 -3 lines
First in a series of changes to remove the now-unused Giant compatibility
framework for non-MPSAFE network protocols:

- Remove debug_mpsafenet variable, sysctl, and tunable.
- Remove NET_NEEDS_GIANT() and associate SYSINITSs used by it to force
  debug.mpsafenet=0 if non-MPSAFE protocols are compiled into the kernel.
- Remove logic to automatically flag interrupt handlers as non-MPSAFE if
  debug.mpsafenet is set for an INTR_TYPE_NET handler.
- Remove logic to automatically flag netisr handlers as non-MPSAFE if
  debug.mpsafenet is set.
- Remove references in a few subsystems, including NFS and Cronyx drivers,
  which keyed off debug_mpsafenet to determine various aspects of their own
  locking behavior.
- Convert NET_LOCK_GIANT(), NET_UNLOCK_GIANT(), and NET_ASSERT_GIANT into
  no-op's, as their entire behavior was determined by the value in
  debug_mpsafenet.
- Alias NET_CALLOUT_MPSAFE to CALLOUT_MPSAFE.

Many remaining references to NET_.*_GIANT() and NET_CALLOUT_MPSAFE are still
present in subsystems, and will be removed in followup commits.

Reviewed by:	bz, jhb
Approved by:	re (kensmith)

Revision 1.200: download - view: text, markup, annotated - select for diffs
Wed May 23 17:28:21 2007 UTC (4 years, 8 months ago) by sam
Branches: MAIN
Diff to: previous 1.199: preferred, colored
Changes since revision 1.199: +1 -1 lines
fix comment typo

Revision 1.199: download - view: text, markup, annotated - select for diffs
Mon Feb 26 19:28:18 2007 UTC (4 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.198: preferred, colored
Changes since revision 1.198: +26 -26 lines
Use NULL rather than 0 for various pointer constants.

Revision 1.198: download - view: text, markup, annotated - select for diffs
Fri Feb 23 12:19:01 2007 UTC (4 years, 11 months ago) by piso
Branches: MAIN
Diff to: previous 1.197: preferred, colored
Changes since revision 1.197: +14 -7 lines
o break newbus api: add a new argument of type driver_filter_t to
  bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@

Revision 1.184.2.5: download - view: text, markup, annotated - select for diffs
Thu Dec 28 22:13:26 2006 UTC (5 years, 1 month ago) by jhb
Branches: RELENG_6
Diff to: previous 1.184.2.4: preferred, colored; branchpoint 1.184: preferred, colored
Changes since revision 1.184.2.4: +11 -1 lines
MFC: When loading a driver that is a subclass of another driver don't set
the devclass's parent pointer if the two drivers share the same devclass.

Revision 1.54.2.11: download - view: text, markup, annotated - select for diffs
Wed Dec 6 22:00:46 2006 UTC (5 years, 2 months ago) by jhb
Branches: RELENG_4
Diff to: previous 1.54.2.10: preferred, colored; branchpoint 1.54: preferred, colored; next MAIN 1.55: preferred, colored
Changes since revision 1.54.2.10: +37 -0 lines
Add an MI bus_dmamap_load_mbuf_sg() that wraps around
bus_dmamap_load_mbuf() using a simple callback to make it easier to
keep drivers in sync between 4.x and 6.x.

Not objected to by:	scottl

Revision 1.184.2.4: download - view: text, markup, annotated - select for diffs
Fri Sep 22 18:49:14 2006 UTC (5 years, 4 months ago) by jhb
Branches: RELENG_6
CVS tags: RELENG_6_2_BP, RELENG_6_2_0_RELEASE, RELENG_6_2
Diff to: previous 1.184.2.3: preferred, colored; branchpoint 1.184: preferred, colored
Changes since revision 1.184.2.3: +7 -0 lines
MFC: Add bus_generic_add_child().

Approved by:	re (mux)

Revision 1.197: download - view: text, markup, annotated - select for diffs
Mon Sep 11 19:41:31 2006 UTC (5 years, 5 months ago) by jhb
Branches: MAIN
Diff to: previous 1.196: preferred, colored
Changes since revision 1.196: +7 -0 lines
Add a default method for BUS_ADD_CHILD() that just calls
device_add_child_ordered().  Previously, a device driver that wanted to
add a new child device in its identify routine had to know if the parent
driver had a custom bus_add_child method and use BUS_ADD_CHILD() in that
case, otherwise use device_add_child().  Getting it wrong in either
direction would result in panics or failure to add the child device.  Now,
BUS_ADD_CHILD() always works isolating child drivers from having to know
intimate details about the parent driver.

Discussed with:	imp
MFC after:	1 week

Revision 1.196: download - view: text, markup, annotated - select for diffs
Sun Sep 3 00:27:42 2006 UTC (5 years, 5 months ago) by jmg
Branches: MAIN
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +33 -0 lines
add a newbus method for obtaining the bus's bus_dma_tag_t...  This is
required by arches like sparc64 (not yet implemented) and sun4v where there
are seperate IOMMU's for each PCI bus...  For all other arches, it will
end up returning NULL, which makes it a no-op...

Convert a few drivers (the ones we've been working w/ on sun4v) to the
new convection...  Eventually all drivers will need to replace the parent
tag of NULL, w/ bus_get_dma_tag(dev), though dev is usually different for
each driver, and will require hand inspection...

Reviewed by:	scottl (earlier version)

Revision 1.195: download - view: text, markup, annotated - select for diffs
Fri Aug 4 07:56:35 2006 UTC (5 years, 6 months ago) by yar
Branches: MAIN
Diff to: previous 1.194: preferred, colored
Changes since revision 1.194: +1 -1 lines
Commit the results of the typo hunt by Darren Pilgrim.
This change affects documentation and comments only,
no real code involved.

PR:		misc/101245
Submitted by:	Darren Pilgrim <darren pilgrim bitfreak org>
Tested by:	md5(1)
MFC after:	1 week

Revision 1.184.2.3: download - view: text, markup, annotated - select for diffs
Sat Jul 15 22:53:53 2006 UTC (5 years, 6 months ago) by njl
Branches: RELENG_6
Diff to: previous 1.184.2.2: preferred, colored; branchpoint 1.184: preferred, colored
Changes since revision 1.184.2.2: +13 -1 lines
MFC 1.190: notify devd of resume events

Revision 1.184.2.2: download - view: text, markup, annotated - select for diffs
Wed Jul 12 22:57:57 2006 UTC (5 years, 7 months ago) by imp
Branches: RELENG_6
Diff to: previous 1.184.2.1: preferred, colored; branchpoint 1.184: preferred, colored
Changes since revision 1.184.2.1: +34 -0 lines
MFC:	subr_bus.c 1.194, bus_if.m 1.30, bus.h 1.75:

	Create bus_enumerate_hinted_children.  This routine will allow
	drivers to use the hinted child system.  Bus drivers that use
	this need to implmenet the bus_hinted_child method, where they
	actually add the child to their bus, as they see fit.  The bus
	is repsonsible for getting the attribtues for the child,
	adding it in the right order, etc.  ISA hinting will be
	updated to use this method.

Revision 1.194: download - view: text, markup, annotated - select for diffs
Sat Jul 8 17:06:14 2006 UTC (5 years, 7 months ago) by imp
Branches: MAIN
Diff to: previous 1.193: preferred, colored
Changes since revision 1.193: +34 -0 lines
Create bus_enumerate_hinted_children.  This routine will allow drivers
to use the hinted child system.  Bus drivers that use this need to
implmenet the bus_hinted_child method, where they actually add the
child to their bus, as they see fit.  The bus is repsonsible for
getting the attribtues for the child, adding it in the right order,
etc.  ISA hinting will be updated to use this method.

MFC After: 3 days

Revision 1.193: download - view: text, markup, annotated - select for diffs
Wed Jun 21 17:48:59 2006 UTC (5 years, 7 months ago) by jhb
Branches: MAIN
Diff to: previous 1.192: preferred, colored
Changes since revision 1.192: +7 -19 lines
Whoops, revert accidental commit.

Revision 1.192: download - view: text, markup, annotated - select for diffs
Wed Jun 21 17:48:03 2006 UTC (5 years, 7 months ago) by jhb
Branches: MAIN
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +19 -7 lines
Fix two comments and a style fix.

Revision 1.191: download - view: text, markup, annotated - select for diffs
Thu Apr 20 01:44:16 2006 UTC (5 years, 9 months ago) by jmg
Branches: MAIN
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +4 -2 lines
const'ify resource_spec to note that we won't be changing anything while
releasing resources... also, NULL out the resources as we free them...

Revision 1.190: download - view: text, markup, annotated - select for diffs
Sun Jan 22 01:06:25 2006 UTC (6 years ago) by njl
Branches: MAIN
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +13 -1 lines
Add a devd(8) event that is sent after the system resumes.  This can be
used by utilities to reset moused(8), for example.  The syntax is:

    !system=kern subsystem=power type=resume

Note that it would be nice to have notification of suspend, but it's more
difficult since there would have to be a method of doing request/ack
to userland and automatically timing out if no response.  apm(4) has a
similar mechanism.

MFC after:	2 weeks

Revision 1.189: download - view: text, markup, annotated - select for diffs
Fri Jan 20 21:59:13 2006 UTC (6 years ago) by jhb
Branches: MAIN
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +11 -1 lines
When loading a driver that is a subclass of another driver don't set the
devclass's parent pointer if the two drivers share the same devclass.  This
can happen if the drivers use the same new-bus name.  For example, we
currently have 3 drivers that use the name "pci": the generic PCI bus
driver, the ACPI PCI bus driver, and the OpenFirmware PCI bus driver.  If
the ACPI PCI bus driver was defined as a subclass of the generic PCI bus
driver, then without this check the "pci" devclass would point to itself
as its parent and device_probe_child() would spin forever when it
encountered the first PCI device that did have a matching driver.

Reviewed by:	dfr, imp, new-bus@

Revision 1.188: download - view: text, markup, annotated - select for diffs
Sat Jan 14 09:41:35 2006 UTC (6 years ago) by phk
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +1 -1 lines
Correct STAILQ usage in purge of resourcelist.

Found with:   Coverity Prevent(tm)

Revision 1.184.2.1: download - view: text, markup, annotated - select for diffs
Thu Oct 6 23:15:18 2005 UTC (6 years, 4 months ago) by imp
Branches: RELENG_6
CVS tags: RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1, RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +6 -2 lines
MFC: if data is NULL, don't pass that to userland as (null)

Approved by: re@ (scottl)

Revision 1.187: download - view: text, markup, annotated - select for diffs
Tue Oct 4 22:25:14 2005 UTC (6 years, 4 months ago) by imp
Branches: MAIN
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +6 -2 lines
When data passed into devctl_notify is NULL, don't print (null).  Instead
don't print anything at all.

# this fixes a problem that I noticed with devd.pipe not terminating lines
# with \n correctly sometimes.

Revision 1.186: download - view: text, markup, annotated - select for diffs
Sat Sep 24 19:31:10 2005 UTC (6 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +31 -0 lines
Add two convenience functions for device drivers:  bus_alloc_resources()
and bus_free_resources().  These functions take a list of resources
and handle them all in one go.  A flag makes it possible to mark
a resource as optional.

A typical device driver can save 10-30 lines of code by using these.

Usage examples will follow RSN.

MFC:	A good idea, eventually.

Revision 1.185: download - view: text, markup, annotated - select for diffs
Sun Sep 18 01:32:09 2005 UTC (6 years, 4 months ago) by imp
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +1 -1 lines
MFp4: Expose device_probe_child()

Revision 1.184: download - view: text, markup, annotated - select for diffs
Thu Jun 9 05:50:01 2005 UTC (6 years, 8 months ago) by imp
Branches: MAIN
CVS tags: RELENG_6_BP
Branch point for: RELENG_6
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +3 -12 lines
Simplify the code a bit after the bzero().

Revision 1.183: download - view: text, markup, annotated - select for diffs
Fri May 20 05:04:22 2005 UTC (6 years, 8 months ago) by njl
Branches: MAIN
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +1 -1 lines
Document that the returned pointer should be freed even if the number
of items returned is 0.

Revision 1.156.2.5.2.1: download - view: text, markup, annotated - select for diffs
Fri May 6 02:51:09 2005 UTC (6 years, 9 months ago) by cperciva
Branches: RELENG_5_4
CVS tags: RELENG_5_4_0_RELEASE
Diff to: previous 1.156.2.5: preferred, colored; next MAIN 1.156.2.6: preferred, colored
Changes since revision 1.156.2.5: +3 -0 lines
If we are going to
1. Copy a NULL-terminated string into a fixed-length buffer, and
2. copyout that buffer to userland,
we really ought to
0. Zero the entire buffer
first.

Security: FreeBSD-SA-05:08.kmem
Approved by: re (kensmith)

Revision 1.156.2.2.2.1: download - view: text, markup, annotated - select for diffs
Fri May 6 02:50:34 2005 UTC (6 years, 9 months ago) by cperciva
Branches: RELENG_5_3
Diff to: previous 1.156.2.2: preferred, colored; next MAIN 1.156.2.3: preferred, colored
Changes since revision 1.156.2.2: +3 -0 lines
If we are going to
1. Copy a NULL-terminated string into a fixed-length buffer, and
2. copyout that buffer to userland,
we really ought to
0. Zero the entire buffer
first.

Security: FreeBSD-SA-05:08.kmem
Approved by: so (cperciva)

Revision 1.156.2.7: download - view: text, markup, annotated - select for diffs
Fri May 6 02:50:00 2005 UTC (6 years, 9 months ago) by cperciva
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5
Diff to: previous 1.156.2.6: preferred, colored; branchpoint 1.156: preferred, colored; next MAIN 1.157: preferred, colored
Changes since revision 1.156.2.6: +3 -0 lines
If we are going to
1. Copy a NULL-terminated string into a fixed-length buffer, and
2. copyout that buffer to userland,
we really ought to
0. Zero the entire buffer
first.

Security: FreeBSD-SA-05:08.kmem

Revision 1.182: download - view: text, markup, annotated - select for diffs
Fri May 6 02:48:20 2005 UTC (6 years, 9 months ago) by cperciva
Branches: MAIN
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +1 -0 lines
If we are going to
1. Copy a NULL-terminated string into a fixed-length buffer, and
2. copyout that buffer to userland,
we really ought to
0. Zero the entire buffer
first.

Security: FreeBSD-SA-05:08.kmem

Revision 1.54.2.10: download - view: text, markup, annotated - select for diffs
Thu Apr 28 00:14:08 2005 UTC (6 years, 9 months ago) by julian
Branches: RELENG_4
Diff to: previous 1.54.2.9: preferred, colored; branchpoint 1.54: preferred, colored
Changes since revision 1.54.2.9: +6 -0 lines
MFC a helper routine that will be used in a USB MFC.

Revision 1.156.2.6: download - view: text, markup, annotated - select for diffs
Thu Apr 14 04:54:15 2005 UTC (6 years, 9 months ago) by njl
Branches: RELENG_5
Diff to: previous 1.156.2.5: preferred, colored; branchpoint 1.156: preferred, colored
Changes since revision 1.156.2.5: +45 -1 lines
MFC: devclass_get_maxunit() fix and docs, add devclass_get_drivers()

Revision 1.181: download - view: text, markup, annotated - select for diffs
Tue Apr 12 15:20:36 2005 UTC (6 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +21 -0 lines
resource_list_purge: release the resources in this list, and purge the
elements of this list (eg, reset it).

Man page to follow

Revision 1.180: download - view: text, markup, annotated - select for diffs
Tue Apr 12 04:22:17 2005 UTC (6 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +3 -2 lines
Return the resource created/found in resource_list_add to avoid an extra
resouce_list_find in some places.

Suggested by: sam
Found by: Coventry Analysis tool.

Revision 1.179: download - view: text, markup, annotated - select for diffs
Mon Apr 4 15:37:59 2005 UTC (6 years, 10 months ago) by njl
Branches: MAIN
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +3 -0 lines
Document that devclass_get_maxunit(9) returns one greater than the current
highest unit.

Reviewed by:	dfr
MFC after:	2 weeks

Revision 1.178: download - view: text, markup, annotated - select for diffs
Mon Apr 4 15:26:50 2005 UTC (6 years, 10 months ago) by njl
Branches: MAIN
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +41 -0 lines
Add devclass_get_drivers(9) which provides an array of pointers to driver
instances in a given devclass.  This is useful for systems that want to
call code in driver static methods, similar to device_identify().

Reviewed by:	dfr
MFC after:	2 weeks

Revision 1.177: download - view: text, markup, annotated - select for diffs
Sun Apr 3 22:23:18 2005 UTC (6 years, 10 months ago) by njl
Branches: MAIN
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +1 -1 lines
maxunit is actually one higher than the greatest currently-allocated unit
in a devclass.  All the other uses of maxunit are correct and this one was
safe since it checks the return value of devclass_get_device(), which would
always say that the highest unit device doesn't exist.

Reviewed by:	dfr
MFC after:	3 days

Revision 1.176: download - view: text, markup, annotated - select for diffs
Thu Mar 31 22:49:31 2005 UTC (6 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +2 -1 lines
- Denote a few places where kobj class references are manipulated without
  holding the appropriate lock.
- Add a comment explaining why we bump a driver's kobj class reference
  when loading a module.

Revision 1.175: download - view: text, markup, annotated - select for diffs
Thu Mar 24 18:13:11 2005 UTC (6 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +0 -87 lines
Move implementation of hw.bus.rman sysctl to subr_rman.c so that
subr_bus.c doesn't need to peek inside struct resource.

OK from:	imp

Revision 1.174: download - view: text, markup, annotated - select for diffs
Fri Mar 18 05:19:50 2005 UTC (6 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +7 -7 lines
Use STAILQ in preference to SLIST for the resources.  Insert new resources
last in the list rather than first.

This makes the resouces print in the 4.x order rather than the 5.x order
(eg fdc0 at 0x3f0-0x3f5,0x3f7 is 4.x, but 0x3f7,0x3f0-0x3f5 is 5.x).  This
also means that the pci code will once again print the resources in BAR
ascending order.

Revision 1.173: download - view: text, markup, annotated - select for diffs
Sun Feb 27 21:59:52 2005 UTC (6 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +0 -2 lines
Use dynamic major number allocation.

Revision 1.156.2.5: download - view: text, markup, annotated - select for diffs
Fri Feb 25 20:25:36 2005 UTC (6 years, 11 months ago) by njl
Branches: RELENG_5
CVS tags: RELENG_5_4_BP
Branch point for: RELENG_5_4
Diff to: previous 1.156.2.4: preferred, colored; branchpoint 1.156: preferred, colored
Changes since revision 1.156.2.4: +15 -5 lines
MFC: Allow device_find_child() to find any child with the given class.

Revision 1.172: download - view: text, markup, annotated - select for diffs
Wed Feb 23 00:43:00 2005 UTC (6 years, 11 months ago) by sam
Branches: MAIN
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +1 -7 lines
kill dead code

Noticed by:	Coverity Prevent analysis tool

Revision 1.171: download - view: text, markup, annotated - select for diffs
Tue Feb 8 18:03:17 2005 UTC (7 years ago) by njl
Branches: MAIN
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +1 -1 lines
Maxunit is inclusive so fix off-by-one in previous commit.

Revision 1.170: download - view: text, markup, annotated - select for diffs
Tue Feb 8 18:00:29 2005 UTC (7 years ago) by njl
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +15 -5 lines
Update device_find_child(9) to return the first matching child if unit
is set to -1.

Reviewed by:	dfr, imp

Revision 1.156.2.4: download - view: text, markup, annotated - select for diffs
Sun Feb 6 13:33:33 2005 UTC (7 years ago) by obrien
Branches: RELENG_5
Diff to: previous 1.156.2.3: preferred, colored; branchpoint 1.156: preferred, colored
Changes since revision 1.156.2.3: +2 -2 lines
Quite booting by hiding GIANT-LOCKED and INTR_FAST behind verboseboot.
(note coding style chosen to reduce diffs to 6-CURRENT)

Revision 1.169: download - view: text, markup, annotated - select for diffs
Sat Jan 29 22:04:30 2005 UTC (7 years ago) by rwatson
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +1 -1 lines
Correct a minr whitespace inconsistency introduced in revision 1.159:
add a tab between #define and DF_REBID instead of a space.

Revision 1.168: download - view: text, markup, annotated - select for diffs
Wed Jan 19 06:52:19 2005 UTC (7 years ago) by imp
Branches: MAIN
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +8 -0 lines
Introduce bus_free_resource.  It is a convenience function which wraps
bus_release_resource by grabbing the rid from the resource.

Revision 1.156.2.3: download - view: text, markup, annotated - select for diffs
Sat Jan 15 03:52:23 2005 UTC (7 years ago) by njl
Branches: RELENG_5
Diff to: previous 1.156.2.2: preferred, colored; branchpoint 1.156: preferred, colored
Changes since revision 1.156.2.2: +19 -7 lines
MFC: Add devclass_get_count(9)

Revision 1.167: download - view: text, markup, annotated - select for diffs
Fri Dec 31 20:47:51 2004 UTC (7 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +101 -0 lines
Implement device_quiesce.  This method means 'you are about to be
unloaded, cleanup, or return ebusy of that's inconvenient.'  The
default module hanlder for newbus will now call this when we get a
MOD_QUIESCE event, but in the future may call this at other times.

This shouldn't change any actual behavior until drivers start to use it.

Revision 1.166: download - view: text, markup, annotated - select for diffs
Wed Dec 8 02:39:56 2004 UTC (7 years, 2 months ago) by njl
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +19 -7 lines
Add the devclass_get_count(9) function and man page.  It gets a count of
the number of devices in a devclass and is a subset of
devclass_get_devices(9).

Reviewed by:	imp, dfr

Revision 1.165: download - view: text, markup, annotated - select for diffs
Sun Dec 5 20:58:56 2004 UTC (7 years, 2 months ago) by obrien
Branches: MAIN
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +2 -1 lines
When panicing in device_unbusy(), actually tell what device has the issue.

Revision 1.164: download - view: text, markup, annotated - select for diffs
Sun Dec 5 07:55:30 2004 UTC (7 years, 2 months ago) by imp
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +6 -0 lines
Start to add GIANT_REQUIRED; macros in places where giant is required
and that I've verified things seem to basically work.  I was able to
boot and hot plug usb devices.  Please let me know if this causes
problems for anybody.

The push down of giant has proceeded to the point that this will start
to matter more and more.

Revision 1.163: download - view: text, markup, annotated - select for diffs
Wed Nov 3 09:06:45 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +1 -1 lines
Don't print the singularly unhelpful message:

	unknown: not probled (disabled)

During verbose boot.

Revision 1.156.2.2: download - view: text, markup, annotated - select for diffs
Fri Oct 15 16:03:19 2004 UTC (7 years, 3 months ago) by njl
Branches: RELENG_5
CVS tags: RELENG_5_3_BP, RELENG_5_3_0_RELEASE
Branch point for: RELENG_5_3
Diff to: previous 1.156.2.1: preferred, colored; branchpoint 1.156: preferred, colored
Changes since revision 1.156.2.1: +12 -0 lines
MFC: Set device flags before probing.

Approved by:	re (kensmith)

Revision 1.162: download - view: text, markup, annotated - select for diffs
Thu Oct 14 17:14:56 2004 UTC (7 years, 3 months ago) by njl
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +14 -5 lines
Update flags patch for the !ISA case.

* Get flags first, in case there is no devclass.
* Reset flags after each probe in case the next driver has no hints so it
  doesn't inherit the old ones.
* Set them again before the winning probe.

Tested ok both with and without ACPI for ISA device flags.

Reviewed by:	imp
MFC after:	1 day

Revision 1.161: download - view: text, markup, annotated - select for diffs
Wed Oct 13 07:10:41 2004 UTC (7 years, 3 months ago) by njl
Branches: MAIN
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +5 -1 lines
Set flags for devices before probing them.  In the non-ISA case, flags set
via hints were not getting passed to the child.

PR:		kern/72489
MFC after:	1 day

Revision 1.156.2.1: download - view: text, markup, annotated - select for diffs
Mon Sep 6 04:29:40 2004 UTC (7 years, 5 months ago) by imp
Branches: RELENG_5
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +1 -1 lines
MFC: 1.157

Clear the description when detaching a driver from a node in the tree.

Approved by: re@

Revision 1.160: download - view: text, markup, annotated - select for diffs
Mon Aug 30 05:48:49 2004 UTC (7 years, 5 months ago) by imp
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +1 -1 lines
Fix BUS_DEBUG case

Revision 1.159: download - view: text, markup, annotated - select for diffs
Sun Aug 29 18:25:21 2004 UTC (7 years, 5 months ago) by imp
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +36 -4 lines
Initial support (disabled) for rebidding devices.  I've been running
this in my tree for a while and in its disabled state there are no
issues.  It isn't enabled yet because some drivers (in acpi) have side
effects in their probe routines that need to be resolved in some
manner before this can be turned on.  The consensus at the last
developer's summit was to provide a static method for each driver
class that will return characteristics of the driver, one of which is
if can be reprobed idempotently.

Revision 1.158: download - view: text, markup, annotated - select for diffs
Sun Aug 29 18:11:10 2004 UTC (7 years, 5 months ago) by imp
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +26 -12 lines
MFp4: Merge in the patches, submitted long ago by someone whose email
address I've lost, that move the location information to the atttach
routine as well.  While one could use devinfo to get this data, that
is difficult and error prone and subject to races for short lived
devices.

Would make a good MT5 candidate.

Revision 1.157: download - view: text, markup, annotated - select for diffs
Tue Aug 24 05:19:15 2004 UTC (7 years, 5 months ago) by imp
Branches: MAIN
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +1 -1 lines
Set the description to NULL in the right detach routine.  This should
keep dangling pointers to strings in loaded modules from hanging
around after the drivers are unloaded.

Revision 1.156: download - view: text, markup, annotated - select for diffs
Sun Jul 18 16:30:31 2004 UTC (7 years, 6 months ago) by dfr
Branches: MAIN
CVS tags: RELENG_5_BP
Branch point for: RELENG_5
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +919 -46 lines
Add doxygen doc comments for most of newbus and the BUS interface.

Revision 1.155: download - view: text, markup, annotated - select for diffs
Thu Jul 15 08:26:05 2004 UTC (7 years, 6 months ago) by phk
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +5 -0 lines
Do a pass over all modules in the kernel and make them return EOPNOTSUPP
for unknown events.

A number of modules return EINVAL in this instance, and I have left
those alone for now and instead taught MOD_QUIESCE to accept this
as "didn't do anything".

Revision 1.154: download - view: text, markup, annotated - select for diffs
Wed Jun 30 16:54:10 2004 UTC (7 years, 7 months ago) by imp
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +1 -0 lines
Hide struct resource and struct rman.  You must define
__RMAN_RESOURCE_VISIBLE to see inside these now.

Reviewed by: dfr, njl (not njr)

Revision 1.153: download - view: text, markup, annotated - select for diffs
Wed Jun 30 02:46:25 2004 UTC (7 years, 7 months ago) by imp
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +38 -2 lines
Include more information about the device in the devadded and
devremoved events.  This reduces the races around these events.  We
now include the pnp info in both.  This lets one do more interesting
thigns with devd on device insertion.

Submitted by: Bernd Walter

Revision 1.152: download - view: text, markup, annotated - select for diffs
Mon Jun 28 03:40:23 2004 UTC (7 years, 7 months ago) by imp
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +2 -2 lines
Turns out that jhb didn't really like this.  And nate pointed out that
it wasn't a good idea to have the test for NULL on only a limited
subset.  Go back because I'm not sure adding NULL to all the others is
a good idea.

Revision 1.151: download - view: text, markup, annotated - select for diffs
Mon Jun 28 02:24:04 2004 UTC (7 years, 7 months ago) by imp
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +2 -2 lines
Allow dev to be NULL and assume that a device is not alive or not
attached.

Reviewed by: njl(?) and jhb

Revision 1.150: download - view: text, markup, annotated - select for diffs
Wed Jun 16 09:47:12 2004 UTC (7 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +6 -6 lines
Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.

Revision 1.149: download - view: text, markup, annotated - select for diffs
Sat Jun 5 11:39:05 2004 UTC (7 years, 8 months ago) by mux
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +4 -8 lines
When we don't have any meaningful value to print for the device sysctl
tree, output an empty string instead of "?".  This is already what
happened with DEVICE_SYSCTL_LOCATION and DEVICE_SYSCTL_PNPINFO.  This
makes the output of "sysctl dev" much nicer (it won't display those
empty sysctls).

Reviewed by:	des

Revision 1.148: download - view: text, markup, annotated - select for diffs
Fri Jun 4 10:23:00 2004 UTC (7 years, 8 months ago) by des
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +64 -10 lines
Add a devclass level to the dev sysctl tree, in order to support per-
class variables in addition to per-device variables.  In plain English,
this means that dev.foo0.bar is now called dev.foo.0.bar, and it is
possible to to have dev.foo.bar as well.

Revision 1.147: download - view: text, markup, annotated - select for diffs
Wed Jun 2 22:43:35 2004 UTC (7 years, 8 months ago) by mux
Branches: MAIN
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +12 -13 lines
As discussed on arch@, flatten the device sysctl tree to make it
more convenient to deal with.  The notion of hierarchy is however
preserved by adding a new %parent node.

Revision 1.146: download - view: text, markup, annotated - select for diffs
Wed May 26 16:36:32 2004 UTC (7 years, 8 months ago) by pjd
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +2 -3 lines
Sysctl hw.bus.devctl_disable shouldn't be writtable from inside a jail.

Approved by:	imp

Revision 1.145: download - view: text, markup, annotated - select for diffs
Tue May 25 12:06:26 2004 UTC (7 years, 8 months ago) by des
Branches: MAIN
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +153 -29 lines
As previously threatened, give each device its own sysctl context and
subtree (under the new dev top-level node).  This should greatly simplify
drivers which need per-device sysctl variables (such as ndis).

Revision 1.144: download - view: text, markup, annotated - select for diffs
Thu Apr 1 07:18:42 2004 UTC (7 years, 10 months ago) by scottl
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +1 -1 lines
Don't print out 'GIANT-LOCKED' for INTR_FAST drivers.

Revision 1.143: download - view: text, markup, annotated - select for diffs
Wed Mar 24 16:49:37 2004 UTC (7 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +1 -1 lines
Conform to local file sytle and prefer (a && (b & flag)).

Revision 1.142: download - view: text, markup, annotated - select for diffs
Tue Mar 23 01:58:09 2004 UTC (7 years, 10 months ago) by obrien
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +1 -1 lines
Change the !MPSAFE boot string to something that doesn't potentially
scare users that the kernel won't run on MP systems.

Revision 1.141: download - view: text, markup, annotated - select for diffs
Mon Mar 22 22:36:11 2004 UTC (7 years, 10 months ago) by obrien
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +3 -1 lines
Rather than display which interrupts are MPSAFE, display those that aren't.
This way we can take stock of the work to be done.  boot -v will note those
interrupts that are MPSAFE.

Revision 1.140: download - view: text, markup, annotated - select for diffs
Tue Feb 24 19:31:30 2004 UTC (7 years, 11 months ago) by des
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +4 -4 lines
Whitespace cleanup

Revision 1.139: download - view: text, markup, annotated - select for diffs
Sat Feb 21 21:10:52 2004 UTC (7 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +2 -0 lines
Device megapatch 4/6:

Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.

Revision 1.138: download - view: text, markup, annotated - select for diffs
Wed Nov 5 23:42:50 2003 UTC (8 years, 3 months ago) by sam
Branches: MAIN
CVS tags: RELENG_5_2_BP, RELENG_5_2_1_RELEASE, RELENG_5_2_0_RELEASE, RELENG_5_2
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +0 -10 lines
o make debug_mpsafenet globally visible
o move it from subr_bus.c to netisr.c where it more properly belongs
o add NET_PICKUP_GIANT and NET_DROP_GIANT macros that will be used to
  grab Giant as needed when MPSAFE operation is enabled

Supported by:	FreeBSD Foundation

Revision 1.137: download - view: text, markup, annotated - select for diffs
Wed Nov 5 06:14:48 2003 UTC (8 years, 3 months ago) by imp
Branches: MAIN
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +8 -8 lines
Minor style(9) nit

Revision 1.136: download - view: text, markup, annotated - select for diffs
Tue Nov 4 02:01:42 2003 UTC (8 years, 3 months ago) by sam
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +1 -1 lines
disable MPSAFE network drivers; we aren't ready yet`

Revision 1.135: download - view: text, markup, annotated - select for diffs
Wed Oct 29 18:29:50 2003 UTC (8 years, 3 months ago) by sam
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +13 -0 lines
Add a temporary mechanism to disble INTR_MPSAFE from network interface
drivers.  This is prepatory to running more parts of the network system
w/o Giant.

Revision 1.134: download - view: text, markup, annotated - select for diffs
Fri Oct 24 22:41:54 2003 UTC (8 years, 3 months ago) by imp
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +61 -19 lines
Convenience functions to generate notifications from the kernel.  The ACPI
code will start using these shortly.

Reviewed by: njl

Revision 1.133: download - view: text, markup, annotated - select for diffs
Thu Oct 16 09:16:28 2003 UTC (8 years, 3 months ago) by dfr
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +102 -66 lines
* Add multiple inheritance to kobj. Each class can have zero or more base
  classes and if a method is not found in a given class, its base classes
  are searched (in the order they were declared). This search is recursive,
  i.e. a method may be define in a base class of a base class.
* Change the kobj method lookup algorithm to one which is SMP-safe. This
  relies only on the constraint that an observer of a sequence of writes
  of pointer-sized values will see exactly one of those values, not a
  mixture of two or more values. This assumption holds for all processors
  which FreeBSD supports.
* Add locking to kobj class initialisation.
* Add a simpler form of 'inheritance' for devclasses. Each devclass can
  have a parent devclass. Searches for drivers continue up the chain of
  devclasses until either a matching driver is found or a devclass is
  reached which has no parent. This can allow, for instance, pci drivers
  to match cardbus devices (assuming that cardbus declares pci as its
  parent devclass).
* Increment __FreeBSD_version.

This preserves the driver API entirely except for one minor feature used
by the ISA compatibility shims. A workaround for ISA compatibility will
be committed separately. The kobj and newbus ABI has changed - all modules
must be recompiled.

Revision 1.132: download - view: text, markup, annotated - select for diffs
Tue Oct 14 06:22:07 2003 UTC (8 years, 3 months ago) by imp
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +4 -3 lines
With DIAGNOSTICS, sometimes we get weird crashes when some driver
accesses softc after it is freed.  Use a different malloc type for
softc than the rest of the bus code to make it more clear when these
things happen that it is the driver that's at fault, not the bus code.

Suggested by: sam and/or phk (I think)

Revision 1.131: download - view: text, markup, annotated - select for diffs
Wed Sep 10 21:37:10 2003 UTC (8 years, 5 months ago) by marcel
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +11 -0 lines
Introduce BUS_CONFIG_INTR(). The method allows devices to tell parents
about interrupt trigger mode and interrupt polarity. This allows ACPI
for example to pass interrupt resource information up the hierarchy.
The default implementation of the method therefore is to pass the
request to the parent.

Reviewed by: jhb, njl

Revision 1.130: download - view: text, markup, annotated - select for diffs
Fri Sep 5 22:51:18 2003 UTC (8 years, 5 months ago) by sam
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +14 -4 lines
Print a message at boot for interrupt handlers created with INTR_MPSAFE
and/or INTR_FAST.  This belongs elsehwere and perhaps under bootverbose;
I'm committing it for now as it's uesful to know which drivers have
been converted and which have not.

Revision 1.129: download - view: text, markup, annotated - select for diffs
Wed Jun 11 00:56:57 2003 UTC (8 years, 8 months ago) by obrien
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +3 -2 lines
Use __FBSDID().

Revision 1.128: download - view: text, markup, annotated - select for diffs
Wed Apr 30 12:57:39 2003 UTC (8 years, 9 months ago) by markm
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +2 -2 lines
Fix some easy, global, lint warnings. In most cases, this means
making some local variables static. In a couple of cases, this means
removing an unused variable.

Revision 1.127: download - view: text, markup, annotated - select for diffs
Mon Apr 21 18:19:08 2003 UTC (8 years, 9 months ago) by imp
Branches: MAIN
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +6 -0 lines
Create a new function, device_is_attached(), that is like
device_is_alive() that tells us if the device has successfully
attached.  device_is_alive just tells us that the device has
successfully probed.

Revision 1.126: download - view: text, markup, annotated - select for diffs
Mon Apr 21 05:58:51 2003 UTC (8 years, 9 months ago) by imp
Branches: MAIN
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +5 -11 lines
Fix /dev/devctl's implementation of poll.  We should only be setting
the poll bits when there's actually something in the queue.
Otherwise, select always returned '2' when there were no items to be
read, and '3' when there were.  This would preclude being able to read
in a threaded (libc_r) program, as well as checking to see if there
were pending events or not.

Revision 1.125: download - view: text, markup, annotated - select for diffs
Wed Apr 2 21:54:51 2003 UTC (8 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +7 -2 lines
Lock the process before sending it a SIGIO.  Not doing so is a panic(2)
implementation with INVARIANTS.

Revision 1.124: download - view: text, markup, annotated - select for diffs
Thu Mar 13 06:29:44 2003 UTC (8 years, 11 months ago) by alfred
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +1 -1 lines
Make sure we actually have a dev before dereferencing in case someone
botches and sends us a NULL pointer.  The other code in this file seems
to expect it to be able to handle it behaving this way.

Revision 1.123: download - view: text, markup, annotated - select for diffs
Mon Mar 3 12:15:51 2003 UTC (8 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +7 -13 lines
Gigacommit to improve device-driver source compatibility between

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)

Revision 1.122: download - view: text, markup, annotated - select for diffs
Sun Jan 19 00:34:17 2003 UTC (9 years ago) by imp
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +3 -13 lines
Fix comment about what we do when there are no listeners.

Revision 1.121: download - view: text, markup, annotated - select for diffs
Wed Jan 15 14:58:07 2003 UTC (9 years ago) by davidxu
Branches: MAIN
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +3 -2 lines
Don't forget to disconnect object from class.

Revision 1.120: download - view: text, markup, annotated - select for diffs
Fri Jan 10 09:54:51 2003 UTC (9 years, 1 month ago) by davidxu
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +6 -6 lines
Don't record thread pointer, it's not permanent in process life cycle,
use process pointer instead.

Revision 1.117.2.1: download - view: text, markup, annotated - select for diffs
Tue Jan 7 05:24:03 2003 UTC (9 years, 1 month ago) by imp
Branches: RELENG_5_0
CVS tags: RELENG_5_0_0_RELEASE
Diff to: previous 1.117: preferred, colored; next MAIN 1.118: preferred, colored
Changes since revision 1.117: +4 -3 lines
MFC: change the default permission from 644 to 600 on devctl until
such time as devctl is a cloneable device.  Also MFC the grammar
change to a comment.

Approved by: re@ (rwatson)

Revision 1.119: download - view: text, markup, annotated - select for diffs
Wed Jan 1 18:48:54 2003 UTC (9 years, 1 month ago) by schweikh
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +2 -2 lines
Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.

Revision 1.118: download - view: text, markup, annotated - select for diffs
Wed Jan 1 03:43:58 2003 UTC (9 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +2 -1 lines
Use 0600 for permissions for /dev/devctl until it is cloneable.
Use UID_ROOT and GID_WHEEL rather than 0.

Prompted by: rwatson

Revision 1.117: download - view: text, markup, annotated - select for diffs
Sat Nov 30 00:49:43 2002 UTC (9 years, 2 months ago) by imp
Branches: MAIN
CVS tags: RELENG_5_0_BP
Branch point for: RELENG_5_0
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +38 -21 lines
devd kernel improvements:
1) Record all device events when devctl is enabled, rather than just when
   devd has devctl open.  This is necessary to prevent races between when
   a device arrives, and when devd starts.
2) Add hw.bus.devctl_disable to disable devctl, this can also be set as a
   tunable.
3) Fix async support. Reset nonblocking and async_td in open.  remove
   async flags.
4) Free all memory when devctl is disabled.

Approved by: re (blanket)

Revision 1.116: download - view: text, markup, annotated - select for diffs
Thu Nov 7 22:38:04 2002 UTC (9 years, 3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +1 -1 lines
Use %z to quiet a warning.

Revision 1.115: download - view: text, markup, annotated - select for diffs
Tue Oct 15 18:56:13 2002 UTC (9 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +4 -5 lines
Use ; not , as statement separator in PDEBUG() macro.

Ignoring a NULL dev in device_set_ivars() sounds wrong, KASSERT it to
non-NULL instead.

Do the same for device_get_ivars() for reasons of symmetry, though
it probably would have yielded a panic anyway, this gives more precise
diagnostics.

Absentmindedly nodded OK to by:	jhb

Revision 1.54.2.9: download - view: text, markup, annotated - select for diffs
Thu Oct 10 15:13:32 2002 UTC (9 years, 4 months ago) by jhb
Branches: RELENG_4
CVS tags: RELENG_4_9_BP, RELENG_4_9_0_RELEASE, RELENG_4_9, RELENG_4_8_BP, RELENG_4_8_0_RELEASE, RELENG_4_8, RELENG_4_11_BP, RELENG_4_11_0_RELEASE, RELENG_4_11, RELENG_4_10_BP, RELENG_4_10_0_RELEASE, RELENG_4_10
Diff to: previous 1.54.2.8: preferred, colored; branchpoint 1.54: preferred, colored
Changes since revision 1.54.2.8: +29 -1 lines
MFC: Add resource_list_print_type().

Sponsored by:	The Weather Channel

Revision 1.114: download - view: text, markup, annotated - select for diffs
Mon Oct 7 23:17:44 2002 UTC (9 years, 4 months ago) by imp
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +326 -2 lines
Introducing /dev/devctl.  This device reports events in the
configuration device hierarchy.  Device arrival, departure and not
matched are presently reported.  This will be the basis for devd, which
I still need to polish a little more before I commit it.  If you don't
use /dev/devctl, it will be a noop.

Revision 1.113: download - view: text, markup, annotated - select for diffs
Mon Oct 7 23:15:40 2002 UTC (9 years, 4 months ago) by imp
Branches: MAIN
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +3 -0 lines
Two minor bugfixes:
o Allow the bus_debug variable to be set via the bus.debug tunable.
o Return pnpinfo and location info via the devinfo interface to userland.
  devinfo(8) needs to be updated to print it.

Revision 1.112: download - view: text, markup, annotated - select for diffs
Mon Oct 7 07:08:00 2002 UTC (9 years, 4 months ago) by imp
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +28 -2 lines
Add wrappers around the newly created bus_child_pnpinfo_str and
bus_child_location_str.

Revision 1.111: download - view: text, markup, annotated - select for diffs
Mon Oct 7 06:50:35 2002 UTC (9 years, 4 months ago) by imp
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +20 -21 lines
Minor string handling cleanup that I've had in my tree for a while:

Don't use snprintf where strlcpy() will do the job.
Also, a NUL is '\0' not 0 in our style (C doesn't care), so spell it like.
Remove useless {} and () in the general area of this change.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Mon Oct 7 06:26:17 2002 UTC (9 years, 4 months ago) by imp
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +0 -1 lines
Don't need to NUL terminate after snprintf

Revision 1.109: download - view: text, markup, annotated - select for diffs
Wed Oct 2 09:34:29 2002 UTC (9 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +75 -1 lines
Absorb <sys/bus_private.h> into kern/subr_bus.c to prevent misunderstandings.

Suggested by:	bde
Approved by:	dfr

Revision 1.108: download - view: text, markup, annotated - select for diffs
Sat Sep 28 21:38:35 2002 UTC (9 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +1 -1 lines
Move includ of <sys/bus_priate.h> later to get semantic identity of
device_t the same throughout kernel.

This is a very fine point of C which fortunatly does not make any
difference in normal circumstances but which due to the pervasiveness
of device_t in the kernel can make a lint barf a lot.

Revision 1.107: download - view: text, markup, annotated - select for diffs
Sat Sep 14 19:15:12 2002 UTC (9 years, 4 months ago) by imp
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +5 -0 lines
Add additional information returned to userland by the device querying
functions.  We add pnpinfo, locationinfo, devflags (the newbus flags
on the device), flags (the flags that device_get_flags returns) and
state to the list of things we return.

pnpinfo and locationinfo are place holders at the moment that will be
filled in by the device's parent (optionally).  Userland programs will
likely use this information from time to time and take appropriate
actions.

Improvements to devinfo to follow.

Revision 1.106: download - view: text, markup, annotated - select for diffs
Thu Sep 12 13:45:38 2002 UTC (9 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +5 -5 lines
Fixed style bugs in resource_list_add_next().

Revision 1.105: download - view: text, markup, annotated - select for diffs
Wed Sep 11 07:13:28 2002 UTC (9 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +10 -7 lines
Include <vm/uma.h> instead of depending on namespace pollution in
<sys/malloc.h>.

Sorted includes as much as possible.  Removed banal comment(s) attached to
includes.

Revision 1.104: download - view: text, markup, annotated - select for diffs
Sun Jul 21 03:28:43 2002 UTC (9 years, 6 months ago) by imp
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +26 -0 lines
Add bus_child_present and the child_present method to bus_if.m

Revision 1.103: download - view: text, markup, annotated - select for diffs
Tue Apr 23 15:48:23 2002 UTC (9 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +1 -1 lines
Don't call malloc(9) to allocate zero bytes softc data for devices.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Fri Mar 29 06:42:54 2002 UTC (9 years, 10 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +13 -0 lines
Add resource_list_add_next() which returns the RID for the resource added.

Revision 1.101: download - view: text, markup, annotated - select for diffs
Wed Mar 6 11:34:02 2002 UTC (9 years, 11 months ago) by bde
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +3 -1 lines
Don't (blindly) truncate the unit number to 4 digits when formatting the
string returned by device_get_nameunit().

Revision 1.100: download - view: text, markup, annotated - select for diffs
Tue Feb 26 16:17:45 2002 UTC (9 years, 11 months ago) by bde
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +4 -3 lines
Fixed 3 regressions in rev.1.99 (clobbering of the English fix in rev.1.98,
and 2 unformattings).

Revision 1.99: download - view: text, markup, annotated - select for diffs
Tue Feb 26 10:38:33 2002 UTC (9 years, 11 months ago) by sos
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +4 -4 lines
Hide "bla bla exists, skipping it" behind bootverbose.

Revision 1.98: download - view: text, markup, annotated - select for diffs
Fri Dec 28 18:32:13 2001 UTC (10 years, 1 month ago) by bde
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +4 -4 lines
Fixed an apparent typo ("-" before ":") and an English error (comma
splice) in the "already exists" message.

Fixed some minor style bugs (KNFization to "return (foo)" had rotted
in 2 out of 177 cases).

Revision 1.97: download - view: text, markup, annotated - select for diffs
Fri Dec 21 21:45:09 2001 UTC (10 years, 1 month ago) by tmm
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +30 -2 lines
Add a generic __BUS_ACCESSOR macro to construct ivar accessor functions,
and a generic resource_list_print_type() function to print all resouces
of a certain type in a resource list.
Use ulmin()/ulmax() instead of min()/max() in two places to handle
u_longs correctly.

Revision 1.96: download - view: text, markup, annotated - select for diffs
Mon Dec 10 05:51:45 2001 UTC (10 years, 2 months ago) by obrien
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +1 -1 lines
Update to C99, s/__FUNCTION__/__func__/.

Revision 1.95: download - view: text, markup, annotated - select for diffs
Mon Nov 5 22:27:46 2001 UTC (10 years, 3 months ago) by arr
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +0 -2 lines
o No need to set values to 0 when we utilize M_ZERO

Approved by: peter

Revision 1.94: download - view: text, markup, annotated - select for diffs
Fri Nov 2 17:33:06 2001 UTC (10 years, 3 months ago) by imp
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +2 -3 lines
Don't hide the failure to allocate device behind boot verbose.  It is
still telling us of real problems so should remain until it stops
doing that.

Submitted by: OGAWA Takaya <t-ogawa@triaez.kaisei.org>

Revision 1.93: download - view: text, markup, annotated - select for diffs
Thu Nov 1 05:07:28 2001 UTC (10 years, 3 months ago) by ache
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +10 -0 lines
Add new interface function
int	devclass_find_free_unit(devclass_t dc, int unit);
which return first free unit in given class starting from 'unit'.

Revision 1.92: download - view: text, markup, annotated - select for diffs
Sun Oct 28 23:32:35 2001 UTC (10 years, 3 months ago) by ache
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +9 -9 lines
1) In devclass_alloc_unit(), skip duplicated wired devices (i.e. with fixed
number) instead of allocating next free unit for them.  If someone needs
fixed place, he must specify it correctly. "Allocating next" is especially bad
because leads to double device detection and to "repeat make_dev panic" as
result.  This can happens if the same devices present somewhere on PCI bus,
hints and  ACPI.  Making them present in one place only not always
possible, "sc" f.e.  can't be removed from hints, it results to no console at
all.

2) In make_device(), detect when devclass_add_device() fails, free dev and
return. I.e. add missing error checking. This part needed to finish fix in 1),
but must be done this way in anycase, with old variant too.

Revision 1.91: download - view: text, markup, annotated - select for diffs
Sat Jul 14 08:25:18 2001 UTC (10 years, 6 months ago) by peter
Branches: MAIN
CVS tags: KSE_PRE_MILESTONE_2, KSE_MILESTONE_2
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +1 -300 lines
Move the hints gunk to a seperate file.  It isn't really part of the
newbus structure (no more than subr_rman.c is anyway).

Revision 1.90: download - view: text, markup, annotated - select for diffs
Sat Jul 14 00:23:10 2001 UTC (10 years, 7 months ago) by peter
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +43 -18 lines
Go back to having either static OR dynamic hints, with fallback
support.  Trying to fix the merged set where dynamic overrode
static was getting more and more complicated by the day.

This should fix the duplicate atkbd, psm, fd* etc in GENERIC.  (which
paniced the alpha, but not the i386)

Revision 1.89: download - view: text, markup, annotated - select for diffs
Tue Jun 12 09:40:02 2001 UTC (10 years, 8 months ago) by peter
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +275 -466 lines
Hints overhaul:
- Replace some very poorly thought out API hacks that should have been
  fixed a long while ago.
- Provide some much more flexible search functions (resource_find_*())
- Use strings for storage instead of an outgrowth of the rather
  inconvenient temporary ioconf table from config().  We already had a
  fallback to using strings before malloc/vm was running anyway.

Revision 1.54.2.8: download - view: text, markup, annotated - select for diffs
Thu Jan 18 00:19:50 2001 UTC (11 years ago) by n_hibma
Branches: RELENG_4
CVS tags: RELENG_4_7_BP, RELENG_4_7_0_RELEASE, RELENG_4_7, RELENG_4_6_BP, RELENG_4_6_2_RELEASE, RELENG_4_6_1_RELEASE, RELENG_4_6_0_RELEASE, RELENG_4_6, RELENG_4_5_BP, RELENG_4_5_0_RELEASE, RELENG_4_5, RELENG_4_4_BP, RELENG_4_4_0_RELEASE, RELENG_4_4, RELENG_4_3_BP, RELENG_4_3_0_RELEASE, RELENG_4_3
Diff to: previous 1.54.2.7: preferred, colored; branchpoint 1.54: preferred, colored
Changes since revision 1.54.2.7: +5 -1 lines
MFC r1.88: Reset the devclass if attach fails.

Revision 1.88: download - view: text, markup, annotated - select for diffs
Mon Jan 8 22:16:26 2001 UTC (11 years, 1 month ago) by n_hibma
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +5 -1 lines
Unset the devclass if the attach fails and the devclass was not set to
begin with.

Reviewed by:	dfr

Revision 1.87: download - view: text, markup, annotated - select for diffs
Fri Jan 5 07:29:54 2001 UTC (11 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +963 -971 lines
Make this file conform mostly to style(9):
o Use 8 space hard tabs
o Eliminate trailing white space (while I'm here, just in a couple of places)
o wrap mostly at 80 columns (printf literal strings being the notable
  exception)
o use return (foo) consistantly
o use 0 vs NULL more consistantly
o use queue(3) xxx_FOREACH macros where appropriate (some places used it
  before, others didn't).
o use BSD line continuation parameters

Pendants will likely notice minor style(9) violations, but for the
most part the file now looks much much closer to style(9) and is
mostly self-consistant.

Approved in principle by: dfr
Reviewed by: md5 (no changes to the .o)

Revision 1.86: download - view: text, markup, annotated - select for diffs
Fri Dec 8 21:50:36 2000 UTC (11 years, 2 months ago) by dwmalone
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +8 -15 lines
Convert more malloc+bzero to malloc+M_ZERO.

Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>

Revision 1.85: download - view: text, markup, annotated - select for diffs
Fri Dec 8 20:08:26 2000 UTC (11 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +2 -2 lines
Staticize some malloc M_ instances.

Revision 1.84: download - view: text, markup, annotated - select for diffs
Tue Nov 28 06:49:15 2000 UTC (11 years, 2 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +18 -24 lines
Alter the return value and arguments of the GET_RESOURCE_LIST bus method.
Alter consumers of this method to conform to the new convention.
Minor cosmetic adjustments to bus.h.

This isn't of concern as this interface isn't in use yet.

Revision 1.83: download - view: text, markup, annotated - select for diffs
Tue Nov 14 20:46:02 2000 UTC (11 years, 2 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +3 -5 lines
In preparation for deprecating CIRCLEQ macros in favor of TAILQ
macros which provide the same functionality and are a bit more
efficient, convert use of CIRCLEQ's in resource manager to TAILQ's.

Approved by:	Garrett Wollman <wollman@khavrinen.lcs.mit.edu>

Revision 1.82: download - view: text, markup, annotated - select for diffs
Thu Nov 9 10:21:20 2000 UTC (11 years, 3 months ago) by msmith
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +214 -143 lines
Implement a trivial but effective interface for obtaining the kernel's
device tree and resource manager contents.  This is the kernel side of
the upcoming libdevinfo, which will expose this information to userspace
applications in a trivial fashion.

Remove the now-obsolete DEVICE_SYSCTLS code.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Wed Oct 18 05:15:39 2000 UTC (11 years, 3 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +93 -1 lines
Add new bus method 'GET_RESOURCE_LIST' and appropriate generic
implementation.

Add bus_generic_rl_{get,set,delete,release,alloc}_resource() functions
which provide generic operations for devices using resource list style
resource management.

This should simplify a number of bus drivers.  Further commits to follow.

Revision 1.80: download - view: text, markup, annotated - select for diffs
Sun Sep 17 23:57:52 2000 UTC (11 years, 4 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +2 -2 lines
Initialize 'hints_loaded' to 0.

This allows static hints to work properly.

Revision 1.79: download - view: text, markup, annotated - select for diffs
Tue Sep 5 00:30:46 2000 UTC (11 years, 5 months ago) by peter
Branches: MAIN
CVS tags: PRE_SMPNG
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +4 -4 lines
When we are picking the next available unit number, specifically say
what we picked.  Otherwise it is anybody's guess as to where the
device ended up.

Revision 1.78: download - view: text, markup, annotated - select for diffs
Mon Aug 28 21:08:12 2000 UTC (11 years, 5 months ago) by dfr
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +7 -4 lines
* Remove a bogus call to kobj_init() from make_device().
* Add a non-empty implementation of root_print_child().

Revision 1.77: download - view: text, markup, annotated - select for diffs
Fri Aug 25 19:48:10 2000 UTC (11 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +29 -11 lines
If the config program found a hints file and included it as a fallback,
then treat it as such.  This isn't perfect, but should do for things
like GENERIC.  When in fallback mode, they will be used if there are NO
other hints.

Revision 1.54.2.7: download - view: text, markup, annotated - select for diffs
Thu Aug 3 06:36:38 2000 UTC (11 years, 6 months ago) by imp
Branches: RELENG_4
CVS tags: RELENG_4_2_0_RELEASE, RELENG_4_1_1_RELEASE
Diff to: previous 1.54.2.6: preferred, colored; branchpoint 1.54: preferred, colored
Changes since revision 1.54.2.6: +20 -1 lines
MFC: device_set_unit, don't use this, but it is needed for pci modem.
	sys/bus.h       1.31
	kern/subr_bus.c 1.56

Revision 1.54.2.6: download - view: text, markup, annotated - select for diffs
Thu Aug 3 00:25:22 2000 UTC (11 years, 6 months ago) by peter
Branches: RELENG_4
Diff to: previous 1.54.2.5: preferred, colored; branchpoint 1.54: preferred, colored
Changes since revision 1.54.2.5: +23 -9 lines
MFC: add device_set_softc()

Revision 1.54.2.5: download - view: text, markup, annotated - select for diffs
Thu Aug 3 00:09:32 2000 UTC (11 years, 6 months ago) by ps
Branches: RELENG_4
Diff to: previous 1.54.2.4: preferred, colored; branchpoint 1.54: preferred, colored
Changes since revision 1.54.2.4: +3 -3 lines
MFC: Sanitize SYSCTL_HANDLER_ARGS.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Fri Jul 28 22:41:56 2000 UTC (11 years, 6 months ago) by peter
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +2 -2 lines
Fix a const related warning.

Revision 1.54.2.4: download - view: text, markup, annotated - select for diffs
Wed Jul 19 09:18:48 2000 UTC (11 years, 6 months ago) by alc
Branches: RELENG_4
CVS tags: RELENG_4_1_0_RELEASE
Diff to: previous 1.54.2.3: preferred, colored; branchpoint 1.54: preferred, colored
Changes since revision 1.54.2.3: +8 -13 lines
MFC: [rev 1.66] If devclass_alloc_unit() is called with a wired unit #,
 and this # is busy, only search upwards for a free slot to use.  This
 broke unit numbering on ATA systems where PCI attached controllers
 come before the mainboard ones.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Tue Jul 18 06:08:27 2000 UTC (11 years, 6 months ago) by peter
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +10 -4 lines
Patch up some bogons in the resource_find() vs resource_find_hard()
interfaces.  The original resource_find() returned a pointer to an internal
resource table entry.  resource_find_hard() dereferences the actual
passed in value (oops!) - effectively trashing random memory due to
the pointer being passed in with a random initial value.

Submitted by:  bde

Revision 1.74: download - view: text, markup, annotated - select for diffs
Tue Jul 4 11:25:23 2000 UTC (11 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +3 -3 lines
Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.

Pointed out by:	bde

Revision 1.73: download - view: text, markup, annotated - select for diffs
Mon Jul 3 13:06:29 2000 UTC (11 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +22 -8 lines
Add device_set_softc() which does the obvious.

Not objected to by:	dfr

Revision 1.72: download - view: text, markup, annotated - select for diffs
Mon Jul 3 09:35:10 2000 UTC (11 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +3 -3 lines
Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:

Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our
sources:

        -sysctl_vm_zone SYSCTL_HANDLER_ARGS
        +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)

Revision 1.71: download - view: text, markup, annotated - select for diffs
Mon Jun 26 09:53:37 2000 UTC (11 years, 7 months ago) by peter
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +10 -10 lines
Some changes and fixes from Bruce:
  Use strtoul(), not strtol() in the hints decoder so that
    'flags 0xa0ffa0ff' is not truncated to 0x7fffffff.
  Use a stack buffer instead of a static 100 byte bss buffer.
  Use \0 for the NUL character.
  Remove some ``excessive'' parens.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Thu Jun 15 09:57:20 2000 UTC (11 years, 7 months ago) by peter
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +59 -5 lines
As a bit of a gross hack, allow earlier access to both the static and
dynamic hints.  This allows the resource_XXX_value() calls to work
before malloc() has started.  This gets the serial console working as well
as a few other things.

Revision 1.69: download - view: text, markup, annotated - select for diffs
Thu Jun 15 04:12:17 2000 UTC (11 years, 7 months ago) by peter
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +4 -4 lines
Fix a stray debug output.  change if (1 || bootverbose) to if (bootverbose)

Revision 1.14.2.2: download - view: text, markup, annotated - select for diffs
Wed Jun 14 16:01:57 2000 UTC (11 years, 7 months ago) by bde
Branches: RELENG_3
CVS tags: RELENG_3_5_0_RELEASE
Diff to: previous 1.14.2.1: preferred, colored; branchpoint 1.14: preferred, colored; next MAIN 1.15: preferred, colored
Changes since revision 1.14.2.1: +2 -3 lines
MFC (1.67: fixed allocation of unit numbers).

Revision 1.54.2.3: download - view: text, markup, annotated - select for diffs
Wed Jun 14 15:56:27 2000 UTC (11 years, 7 months ago) by bde
Branches: RELENG_4
Diff to: previous 1.54.2.2: preferred, colored; branchpoint 1.54: preferred, colored
Changes since revision 1.54.2.2: +2 -3 lines
MFC (1.67: fixed allocation of unit numbers).

Revision 1.68: download - view: text, markup, annotated - select for diffs
Tue Jun 13 22:28:48 2000 UTC (11 years, 7 months ago) by peter
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +98 -63 lines
Borrow phk's axe and apply the next stage of config(8)'s evolution.

Use Warner Losh's "hint" driver to decode ascii strings to fill the
resource table at boot time.

config(8) no longer generates an ioconf.c table - ie: the configuration
no longer has to be compiled into the kernel.  You can reconfigure your
isa devices with the likes of this at loader(8) time:
  set hint.ed.0.port=0x320

userconfig will be rewritten to use this style interface one day and will
move to /boot/userconfig.4th or something like that.

It is still possible to statically compile in a set of hints into a kernel
if you do not wish to use loader(8).  See the "hints" directive in GENERIC
as an example.

All device wiring has been moved out of config(8).  There is a set of
helper scripts (see i386/conf/gethints.pl, and the same for alpha and pc98)
that extract the 'at isa? port foo irq bar' from the old files and produces
a hints file.  If you install this file as /boot/device.hints (and update
/boot/defaults/loader.conf - You can do a build/install in sys/boot) then
loader will load it automatically for you.  You can also compile in the
hints directly with:  hints "device.hints"  as well.

There are a few things that I'm not too happy with yet.  Under this scheme,
things like LINT would no longer be useful as "documentation" of settings.
I have renamed this file to 'NOTES' and stored the example hints strings
in it.  However... this is not something that config(8) understands, so
there is a script that extracts the build-specific data from the
documentation file (NOTES) to produce a LINT that can be config'ed and
built.  A stack of man4 pages will need updating. :-/

Also, since there is no longer a difference between 'device' and
'pseudo-device' I collapsed the two together, and the resulting 'device'
takes a 'number of units' for devices that still have it statically
allocated.  eg:  'device fe 4' will compile the fe driver with NFE set
to 4.  You can then set hints for 4 units (0 - 3).  Also note that
'device fe0' will be interpreted as "zero units of 'fe'" which would be
bad, so there is a config warning for this.  This is only needed for
old drivers that still have static limits on numbers of units.
All the statically limited drivers that I could find were marked.

Please exercise EXTREME CAUTION when transitioning!

Moral support by: phk, msmith, dfr, asmodai, imp, and others

Revision 1.67: download - view: text, markup, annotated - select for diffs
Sun Jun 11 07:19:20 2000 UTC (11 years, 8 months ago) by bde
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +2 -3 lines
Fixed allocation of unit numbers.  Allocate the amount of space actually
required (rounded up a little) instead of twice the previous amount (or
a fixed amount for the first allocation).

The bug caused memory corruption when a new unit number for a devclass
was more than about twice the previous maximum one (or more than 3 for
the first one), so it corrupted memory (which happened to be the atkbdc
port resource list) in the reporter's configuration with sio unit
numbers { 0, 25, 1, 2, ... }.

Reviewed by:	dfr
Reported by:	Leonid Lukiyanets <stalwar78@hotmail.com>

Revision 1.54.2.2: download - view: text, markup, annotated - select for diffs
Sat May 27 21:31:42 2000 UTC (11 years, 8 months ago) by imp
Branches: RELENG_4
Diff to: previous 1.54.2.1: preferred, colored; branchpoint 1.54: preferred, colored
Changes since revision 1.54.2.1: +2 -1 lines
MFC rev 1.58

Revision 1.66: download - view: text, markup, annotated - select for diffs
Fri May 26 13:59:05 2000 UTC (11 years, 8 months ago) by sos
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +8 -13 lines
If devclass_alloc_unit() is called with a wired unit #, and this is
buzy, only search upwards for a free slot to use..

This broke unit numbering on ATA systems where PCI attached controllers
come before the mainboard ones...

Reviewed by: dfr

Revision 1.65: download - view: text, markup, annotated - select for diffs
Fri May 26 02:04:35 2000 UTC (11 years, 8 months ago) by jake
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +2 -2 lines
Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others

Revision 1.64: download - view: text, markup, annotated - select for diffs
Tue May 23 20:37:16 2000 UTC (11 years, 8 months ago) by jake
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +2 -2 lines
Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd

Revision 1.54.2.1: download - view: text, markup, annotated - select for diffs
Sun May 7 20:26:50 2000 UTC (11 years, 9 months ago) by n_hibma
Branches: RELENG_4
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +21 -14 lines
MFC: If selecting a new unit number for a new device, don't pick the
first free one at the end of the list, use the first free one in the
list. This avoids ever increasing unit numbers.

Also, call BUS_NOMATCH only once, at boot. Avoids the unneeded claiming
of devices by chip whenever a PCI module is loaded.

Revision 1.63: download - view: text, markup, annotated - select for diffs
Wed May 3 17:45:04 2000 UTC (11 years, 9 months ago) by paul
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +7 -2 lines
If BUS_DEBUG is defined then create a sysctl, debug.bus_debug, that
is used to control whether the debug messages are output at runtime.
It defaults to on so that if you define BUS_DEBUG in your kernel
then you get all the debugging info when you boot.

It's very useful for disabling all the debugging info when you're
developing a loadable device driver and you're doing lots of loads
and unloads but don't always want to see all the debugging info.

Revision 1.62: download - view: text, markup, annotated - select for diffs
Mon May 1 10:45:15 2000 UTC (11 years, 9 months ago) by dfr
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +5 -8 lines
* Move the driver_t::refs field to kobj_t to replace kobj_t::instances.
* Back out a couple of workarounds for the confusion between
  kobj_t::instances and driver_t::refs.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Sat Apr 29 13:24:35 2000 UTC (11 years, 9 months ago) by peter
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +2 -1 lines
The newer module dependency code exposes an apparent bug in the
bus/driver/kobj system.  I am not 100% sure that this is the correct fix,
but it is harmless and does seem to solve the problem.  At worst, it could
cause a tiny memory leak at unload time - this is better than a free(NULL)
and subsequent panic.  I'm waiting for comments from Doug about this.
This may yet be backed out and fixed differently.

The change itself is to increment the reference count on drivers in one
case where it appears to have been missed.  When everything is unloaded,
kobj_class_free() was being called twice in some cases, and panicing the
second time.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Sat Apr 22 15:03:08 2000 UTC (11 years, 9 months ago) by dfr
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +6 -1 lines
Make sure the driver's ops table has been initialised before calling
static methods.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Mon Apr 17 08:09:43 2000 UTC (11 years, 9 months ago) by dfr
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +2 -19 lines
Fix LINT.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Mon Apr 17 04:30:48 2000 UTC (11 years, 9 months ago) by imp
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +2 -1 lines
Issue a detached message after detaching the device.

Not Objected to by: new-bus@

Revision 1.57: download - view: text, markup, annotated - select for diffs
Sat Apr 8 14:17:10 2000 UTC (11 years, 10 months ago) by dfr
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +27 -195 lines
* Factor out the object system from new-bus so that it can be used by
  non-device code.
* Re-implement the method dispatch to improve efficiency. The new system
  takes about 40ns for a method dispatch on a 300Mhz PII which is only
  10ns slower than a direct function call on the same hardware.

This changes the new-bus ABI slightly so make sure you re-compile any
driver modules which you use.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Sat Apr 1 06:06:37 2000 UTC (11 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +20 -1 lines
device_set_unit() DO NOT USE THIS.  This was approved before 4.0
release for inclusion into the release, but bde talked me out of
committing the module that needs this until after the release.  It is
after the release now. :-)

Revision 1.55: download - view: text, markup, annotated - select for diffs
Thu Mar 16 09:32:58 2000 UTC (11 years, 10 months ago) by n_hibma
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +21 -14 lines
Instead of using the next unit available, use the first unit available.
This avoids the unit number from going up indefinitely when
diconnecting and connecting 2 devices alternately.

Noticed by: nsayer (quite a while ago)

And stop calling DEVICE_NOMATCH at probe repeatedly. This stops the
message on the PCI VGA board from being printed when loading a PCI driver.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Tue Feb 29 09:36:25 2000 UTC (11 years, 11 months ago) by dfr
Branches: MAIN
CVS tags: RELENG_4_BP, RELENG_4_0_0_RELEASE
Branch point for: RELENG_4
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +4 -2 lines
If a driver probe fails, unset it from the device. This fixes a problem
with certain multiport cards.

Approved by: jkh

Revision 1.53: download - view: text, markup, annotated - select for diffs
Sun Feb 20 10:07:28 2000 UTC (11 years, 11 months ago) by sos
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +3 -2 lines
Hide the "devclass_alloc_unit: %s%d already exists, using next available..."
behind bootverbose

Approved by: jkh

Revision 1.52: download - view: text, markup, annotated - select for diffs
Tue Feb 15 19:23:34 2000 UTC (11 years, 11 months ago) by joerg
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +3 -1 lines
Hide the boring ``not probed (disabled)'' messages behind `bootverbose'.
This unspams the boot messages, concentrating on the drivers that have
actually been probed.

This basically resurrects revision 1.106 from old /sys/i386/isa/isa.c.

Reviewed by:	jkh, dfr

Revision 1.51: download - view: text, markup, annotated - select for diffs
Fri Dec 24 16:21:15 1999 UTC (12 years, 1 month ago) by dfr
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +13 -2 lines
* Set the devclass of a device before calling the probe method. This allows
  device_printf() etc. to print something intelligible.
* Allow device_set_devclass(dev, 0) for clearing the devclass.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Fri Dec 3 09:10:04 1999 UTC (12 years, 2 months ago) by mjacob
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +2 -2 lines
correct incomplete last change

Revision 1.49: download - view: text, markup, annotated - select for diffs
Fri Dec 3 08:41:18 1999 UTC (12 years, 2 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +21 -13 lines
Remove the 'ivars' arguement to device_add_child() and
device_add_child_ordered().  'ivars' may now be set using the
device_set_ivars() function.

This makes it easier for us to change how arbitrary data structures are
associated with a device_t.  Eventually we won't be modifying device_t
to add additional pointers for ivars, softc data etc.

Despite my best efforts I've probably forgotten something so let me know
if this breaks anything.  I've been running with this change for months
and its been quite involved actually isolating all the changes from
the rest of the local changes in my tree.

Reviewed by:	peter, dfr

Revision 1.48: download - view: text, markup, annotated - select for diffs
Thu Dec 2 16:30:21 1999 UTC (12 years, 2 months ago) by n_hibma
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +1 -4 lines
Remove check for attached state.

   sc = devclass_get_softc(devclass, unit);

doesn't return NULL during attach anymore, and produces the sc,
identical to (for devclass_get_unit(devclass, unit) != NULL that is):

   sc = device_get_softc(devclass_get_unit(devclass, unit));

Reviewed-by:   dfr

Revision 1.47: download - view: text, markup, annotated - select for diffs
Tue Nov 30 07:06:03 1999 UTC (12 years, 2 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +9 -7 lines
Reduce code duplication.

Hopefully this clears up some confusion about the nature of
devclass_get_softc() vs. device_get_softc() as well.

The check against DS_ATTACHED remains as this is not
a change that modifies functionality.

Reviewed by:	Peter "in principle" Wemm

Revision 1.46: download - view: text, markup, annotated - select for diffs
Thu Nov 18 06:05:30 1999 UTC (12 years, 2 months ago) by peter
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +18 -15 lines
'const'ify a bunch of pointers in the resource_*() functions for accessing
the config hint tables.  This fixes a few warnings elsewhere (eg: fd).

Revision 1.45: download - view: text, markup, annotated - select for diffs
Tue Oct 12 21:35:50 1999 UTC (12 years, 4 months ago) by dfr
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +65 -18 lines
* Add struct resource_list* argument to resource_list_alloc and
  resource_list_release. This removes the dependancy on the
  layout of ivars.

* Move set_resource, get_resource and delete_resource from
  isa_if.m to bus_if.m.

* Simplify driver code by providing wrappers to those methods:

     bus_set_resource(dev, type, rid, start, count);
     bus_get_resource(dev, type, rid, startp, countp);
     bus_get_resource_start(dev, type, rid);
     bus_get_resource_count(dev, type, rid);
     bus_delete_resource(dev, type, rid);

* Delete isa_get_rsrc and use bus_get_resource_start instead.

* Fix a stupid typo in isa_alloc_resource reported by Takahashi
  Yoshihiro <nyan@FreeBSD.org>.

* Print a diagnostic message if we can't assign resources to a PnP
  device.

* Change device_print_prettyname() so that it doesn't print
  "(no driver assigned)-1" for anonymous devices.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Mon Oct 11 15:19:10 1999 UTC (12 years, 4 months ago) by peter
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +5 -3 lines
Trim unused options (or #ifdef for undoc options).

Submitted by:	phk

Revision 1.43: download - view: text, markup, annotated - select for diffs
Sat Oct 9 03:48:18 1999 UTC (12 years, 4 months ago) by imp
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +2 -1 lines
Call DEVICE_IDENIFY in bus_generic_driver_added to allow devices to
add nodes to the tree.  Also, default to bus_generic_driver_added for
the BUS_DRIVER_ADDED method.

This allows newbus busses to be kldload'd.

Reviewed by: dfr

Revision 1.42: download - view: text, markup, annotated - select for diffs
Fri Sep 10 21:11:23 1999 UTC (12 years, 5 months ago) by phk
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +24 -22 lines
Create and use a dedicated malloc type for bus related stuff.

Reviewed by:	dfr

Revision 1.41: download - view: text, markup, annotated - select for diffs
Tue Sep 7 08:42:48 1999 UTC (12 years, 5 months ago) by dfr
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +14 -1 lines
Change isa_get/set_flags() to device_get/set_flags().

Revision 1.14.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 29 16:26:05 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_3
CVS tags: RELENG_3_4_0_RELEASE, RELENG_3_3_0_RELEASE
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.40: download - view: text, markup, annotated - select for diffs
Sat Aug 28 00:46:17 1999 UTC (12 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Aug 16 21:44:14 1999 UTC (12 years, 5 months ago) by n_hibma
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +7 -3 lines
Change calling of chained event handler from always after
the attach/detach to
1) MOD_LOAD before attach
2) MOD_UNLOAD after detach

The driver specific event handler can now be used to function as
driver specific init/deinit function (compare to device specific
init/deinit functions: attach & detach).

Revision 1.38: download - view: text, markup, annotated - select for diffs
Sat Aug 14 13:32:25 1999 UTC (12 years, 5 months ago) by n_hibma
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +2 -1 lines
add debugging message in unregister_method

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sat Aug 14 13:20:04 1999 UTC (12 years, 5 months ago) by n_hibma
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +2 -2 lines
Minor spelling glitch

Revision 1.36: download - view: text, markup, annotated - select for diffs
Sat Aug 14 05:11:01 1999 UTC (12 years, 6 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +2 -2 lines
Grrrr. Fix a really lame bug that I tripped over while testing my miibus
stuff: unregister_methods() is horribly broken. The idea, if I'm not mistaken,
is that the refcount on a method is decremented, and only when it reaches
zero is the method freed. However desc->method is set to NULL unconditionally
regardless of the refcount, which means the method pointer is trashed the
first time the method is deallocated. The obvious detrimental effect is
that memory is leaked. The not so obvious effect is that when you call
unregister_method() the second time on the same method, you get a NULL
pointer dereference and a panic.

Now I can successfully unload network device drivers and the miibus module
without crashing the system.

*sigh*

Revision 1.35: download - view: text, markup, annotated - select for diffs
Wed Aug 11 22:55:39 1999 UTC (12 years, 6 months ago) by peter
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +6 -6 lines
Make subr_bus.c actually compile with -DBUS_DEBUG

Revision 1.34: download - view: text, markup, annotated - select for diffs
Wed Aug 11 22:05:17 1999 UTC (12 years, 6 months ago) by peter
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +3 -12 lines
Zap some stray references to DRIVER_TYPE_foo in the BUS_DEBUG case, as
discovered by Bill Paul.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Thu Jul 29 01:51:49 1999 UTC (12 years, 6 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +2 -2 lines
Fix a typo.
Back out a few lines that I haven't dealt with properly yet.

Snickered at by: Mike Smith

Revision 1.32: download - view: text, markup, annotated - select for diffs
Thu Jul 29 01:02:58 1999 UTC (12 years, 6 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +38 -11 lines
Alter the behavior of sys/kern/subr_bus.c:device_print_child()

	- device_print_child() either lets the BUS_PRINT_CHILD
	  method produce the entire device announcement message or
	  it prints "foo0: not found\n"

Alter sys/kern/subr_bus.c:bus_generic_print_child() to take on
the previous behavior of device_print_child() (printing the
"foo0: <FooDevice 1.1>" bit of the announce message.)

Provide bus_print_child_header() and bus_print_child_footer()
to actually print the output for bus_generic_print_child().
These functions should be used whenever possible (unless you can
just use bus_generic_print_child())

The BUS_PRINT_CHILD method now returns int instead of void.

Modify everything else that defines or uses a BUS_PRINT_CHILD
method to comply with the above changes.

	- Devices are 'on' a bus, not 'at' it.
	- If a custom BUS_PRINT_CHILD method does the same thing
	  as bus_generic_print_child(), use bus_generic_print_child()
	- Use device_get_nameunit() instead of both
	  device_get_name() and device_get_unit()
	- All BUS_PRINT_CHILD methods return the number of
	  characters output.

Reviewed by: dfr, peter

Revision 1.31: download - view: text, markup, annotated - select for diffs
Sat Jul 24 09:34:12 1999 UTC (12 years, 6 months ago) by dfr
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +8 -6 lines
This makes the in kernel printf routines conform to the documented
behavior of their userland counterparts with respect to return values.

Submitted by: Matthew N. Dodd <winter@jurai.net>

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sun Jul 11 13:42:37 1999 UTC (12 years, 7 months ago) by dfr
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +3 -1 lines
Add a hook for a bus to detect child devices which didn't find drivers.
This allows the bus to print an informative message about unknown devices.

Submitted by: Matthew N. Dodd <winter@jurai.net>

Revision 1.29: download - view: text, markup, annotated - select for diffs
Sun May 30 10:27:11 1999 UTC (12 years, 8 months ago) by dfr
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +8 -2 lines
* Add a function devclass_create() which looks up the named devclass and
  creates it if it doesn't exist.
* Rename resource_list_remove() to resource_list_delete() for consistency.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Fri May 28 09:25:10 1999 UTC (12 years, 8 months ago) by dfr
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +23 -20 lines
* Change device_add_child_after() to device_add_child_ordered() which is
  easier to use and more flexible.
* Change BUS_ADD_CHILD to take an order argument instead of a place.
* Define a partial ordering for isa devices so that sensitive devices are
  probed before non-sensitive ones.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Thu May 27 07:18:41 1999 UTC (12 years, 8 months ago) by dfr
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +3 -3 lines
Fix an embarrasing typo in device_add_child_after(). I can't understand
how this hasn't caused problems before.

Submitted by: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sat May 22 14:57:15 1999 UTC (12 years, 8 months ago) by dfr
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +149 -1 lines
Add some helper functions to make it easier to write a driver for a bus
which needs to manage resources for its children.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Sat May 22 09:52:21 1999 UTC (12 years, 8 months ago) by peter
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +3 -1 lines
Add seatbelt like in previous function..

Revision 1.24: download - view: text, markup, annotated - select for diffs
Fri May 21 08:23:58 1999 UTC (12 years, 8 months ago) by dfr
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +2 -2 lines
Silently return NULL from devclass_get_device if dc == NULL. The caller
should be handling NULL returns already.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>

Revision 1.23: download - view: text, markup, annotated - select for diffs
Fri May 14 11:22:42 1999 UTC (12 years, 9 months ago) by dfr
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +17 -1 lines
* Define a new static method DEVICE_IDENTIFY which is called to add device
  instances to a parent bus.
* Define a new method BUS_ADD_CHILD which can be called from DEVICE_IDENTIFY
  to add new instances.
* Add a generic implementation of DEVICE_PROBE which calls DEVICE_IDENTIFY
  for each driver attached to the parent's devclass.
* Move the hint-based isa probe from the isa driver to a new isahint driver
  which can be shared between i386 and alpha.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Fri May 14 09:13:43 1999 UTC (12 years, 9 months ago) by dfr
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +8 -1 lines
Adjust method dispatch to ensure that default methods are called properly.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Mon May 10 17:06:14 1999 UTC (12 years, 9 months ago) by dfr
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +55 -6 lines
* Augment the interface language to allow arbitrary C code to be 'passed
  through' to the C compiler.
* Allow the interface to specify a default implementation for methods.
* Allow 'static' methods which are not device specific.
* Add a simple scheme for probe routines to return a priority value. To
  make life simple, priority values are negative numbers (positive numbers
  are standard errno codes) with zero being the highest priority. The
  driver which returns the highest priority will be chosen for the device.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Sat May 8 21:59:35 1999 UTC (12 years, 9 months ago) by dfr
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +8 -7 lines
Move the declaration of the interrupt type from the driver structure
to the BUS_SETUP_INTR call.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Sat May 8 18:08:59 1999 UTC (12 years, 9 months ago) by peter
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +9 -16 lines
Change resource_set_*() to be more useful.  BTW; resource_find() is a
bit odd, it looks like the wildcard stuff isn't right.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Mon Apr 19 19:39:08 1999 UTC (12 years, 9 months ago) by peter
Branches: MAIN
CVS tags: PRE_VFS_BIO_NFS_PATCH, PRE_SMP_VMSHARE, POST_VFS_BIO_NFS_PATCH, POST_SMP_VMSHARE
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +1 -4 lines
GC some stray debugging printf()s...

Revision 1.17: download - view: text, markup, annotated - select for diffs
Fri Apr 16 21:22:39 1999 UTC (12 years, 9 months ago) by peter
Branches: MAIN
CVS tags: POST_NEWBUS
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +344 -42 lines
Bring the 'new-bus' to the i386.  This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic.
Most old drivers compile and run without modification via 'compatability
shims' to enable a smoother transition.  eisa, isapnp and pccard* are
not yet using the new resource manager.  Once fully converted, all drivers
will be loadable, including PCI and ISA.

(Some other changes appear to have snuck in, including a port of Soren's
 ATA driver to the Alpha.  Soren, back this out if you need to.)

This is a checkpoint of work-in-progress, but is quite functional.

The bulk of the work was done over the last few years by Doug Rabson and
Garrett Wollman.

Approved by:	core

Revision 1.16: download - view: text, markup, annotated - select for diffs
Mon Mar 29 08:54:20 1999 UTC (12 years, 10 months ago) by dfr
Branches: MAIN
CVS tags: PRE_NEWBUS
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +303 -42 lines
Add some useful functions to the device framework:

* bus_setup_intr() as a wrapper for BUS_SETUP_INTR
* bus_teardown_intr() as a wrapper for BUS_TEARDOWN_INTR
* device_get_nameunit() which returns e.g. "foo0" for name "foo" and unit 0.
* device_set_desc_copy() malloc a copy of the description string.
* device_quiet(), device_is_quiet(), device_verbose() suppress probe message.

Add one method to the BUS interface, BUS_CHILD_DETACHED() which is called
after the child has been detached to allow the bus to clean up any memory
which it allocated on behalf of the child.

I also fixed a bug which corrupted the list of drivers in a devclass if
a driver was added to more than one devclass.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Wed Jan 27 21:49:57 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +7 -7 lines
        Fix warnings in preparation for adding -Wall -Wcast-qual to the
        kernel compile

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sat Jan 16 17:44:09 1999 UTC (13 years ago) by dfr
Branches: MAIN
CVS tags: RELENG_3_BP, RELENG_3_2_PAO_BP, RELENG_3_2_PAO, RELENG_3_2_0_RELEASE, RELENG_3_1_0_RELEASE
Branch point for: RELENG_3
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +75 -4 lines
A few small improvements to the bus code:

* A function device_printf() to make pretty-printing driver messages easier.
* A function device_get_children() to query the children of a device.
* Generic implementations of BUS_ALLOC_RESOURCE and BUS_RELEASE_RESOURCE.
* Change bus_generic_print_child() so that it is actually useful.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sun Jan 10 22:04:05 1999 UTC (13 years, 1 month ago) by n_hibma
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +1 -3 lines
Remove warning

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sat Dec 12 11:30:04 1998 UTC (13 years, 2 months ago) by n_hibma
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +5 -5 lines
When no driver was found for a device, the message 'not probed' appeared
This is odd, especially in the case of USB where the driver is found
in several tries: vendor specific, class specific, interface specific.
The mouse driver is found at the interface specific level...
Reviewed by:	Doug Rabson (dfr@freebsd.org)

Revision 1.11: download - view: text, markup, annotated - select for diffs
Sun Nov 15 18:11:21 1998 UTC (13 years, 2 months ago) by dfr
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +10 -4 lines
A couple of minor sanity checks.

Submitted by: Nick Hibma <nick.hibma@jrc.it>

Revision 1.10: download - view: text, markup, annotated - select for diffs
Sat Nov 14 21:58:51 1998 UTC (13 years, 2 months ago) by wollman
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +199 -66 lines
My changes to the new device interface:

	- Interface wth the new resource manager.
	- Allow for multiple drivers implementing a single devclass.
	- Remove ordering dependencies between header files.
	- Style cleanup.
	- Add DEVICE_SUSPEND and DEVICE_RESUME methods.
	- Move to a single-phase interrupt setup scheme.

Kernel builds on the Alpha are brken until Doug gets a chance to incorporate
these changes on that side.

Agreed to in principle by: dfr

Revision 1.9: download - view: text, markup, annotated - select for diffs
Fri Nov 13 09:39:37 1998 UTC (13 years, 3 months ago) by dfr
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +10 -2 lines
A couple of fixes to device_delete_child() to delete all children of
the device and to free the device which is being deleted (not its
parent - oops).

Submitted by: Nick Hibma <nick.hibma@jrc.it>

Revision 1.8: download - view: text, markup, annotated - select for diffs
Tue Oct 27 09:21:43 1998 UTC (13 years, 3 months ago) by dfr
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +338 -25 lines
Lots of debugging code and some bugfixes.

Submitted by: Nick Hibma <nick.hibma@jrc.it>

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sun Oct 25 17:44:51 1998 UTC (13 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +1 -7 lines
Nitpicking and dusting performed on a train.  Removes trivial warnings
about unused variables, labels and other lint.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sat Oct 3 08:55:29 1998 UTC (13 years, 4 months ago) by dfr
Branches: MAIN
CVS tags: RELENG_3_0_0_RELEASE
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +4 -4 lines
Don't call DEVICE_DETACH directly, always go through the device_detach()
wrapper which checks to make sure the device isn't currently open.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Sat Sep 5 13:24:39 1998 UTC (13 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +2 -2 lines
Fixed recently perpetrated printf format errors.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Wed Jul 22 08:35:52 1998 UTC (13 years, 6 months ago) by dfr
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +123 -1 lines
Add some very simple support for a compiled in (from config(8)) resource
database.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sun Jul 12 16:20:52 1998 UTC (13 years, 7 months ago) by dfr
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +16 -6 lines
Change interrupt api to be closer to intr_create/intr_connect.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sun Jun 14 13:45:58 1998 UTC (13 years, 8 months ago) by dfr
Branches: MAIN
CVS tags: PRE_NOBDEV
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +229 -166 lines
Major changes to the generic device framework for FreeBSD/alpha:

* Eliminate bus_t and make it possible for all devices to have
  attached children.

* Support dynamically extendable interfaces for drivers to replace
  both the function pointers in driver_t and bus_ops_t (which has been
  removed entirely.  Two system defined interfaces have been defined,
  'device' which is mandatory for all devices and 'bus' which is
  recommended for all devices which support attached children.

* In addition, the alpha port defines two simple interfaces 'clock'
  for attaching various real time clocks to the system and 'mcclock'
  for the many different variations of mc146818 clocks which can be
  attached to different alpha platforms.  This eliminates two more
  function pointer tables in favour of the generic method dispatch
  system provided by the device framework.

Future device interfaces may include:

* cdev and bdev interfaces for devfs to use in replacement for specfs
  and the fixed interfaces bdevsw and cdevsw.

* scsi interface to replace struct scsi_adapter (not sure how this
  works in CAM but I imagine there is something similar there).

* various tailored interfaces for different bus types such as pci,
  isa, pccard etc.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Wed Jun 10 10:56:45 1998 UTC (13 years, 8 months ago) by dfr
Branches: MAIN
Add initial support for the FreeBSD/alpha kernel.  This is very much a
work in progress and has never booted a real machine.  Initial
development and testing was done using SimOS (see
http://simos.stanford.edu for details).  On the SimOS simulator, this
port successfully reaches single-user mode and has been tested with
loads as high as one copy of /bin/ls :-).

Obtained from: partly from NetBSD/alpha

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options