1cefd51ecSDoug Rabson.\" -*- nroff -*-
2cefd51ecSDoug Rabson.\"
3cefd51ecSDoug Rabson.\" Copyright (c) 1998 Doug Rabson
4cefd51ecSDoug Rabson.\"
5cefd51ecSDoug Rabson.\" All rights reserved.
6cefd51ecSDoug Rabson.\"
7cefd51ecSDoug Rabson.\" This program is free software.
8cefd51ecSDoug Rabson.\"
9cefd51ecSDoug Rabson.\" Redistribution and use in source and binary forms, with or without
10cefd51ecSDoug Rabson.\" modification, are permitted provided that the following conditions
11cefd51ecSDoug Rabson.\" are met:
12cefd51ecSDoug Rabson.\" 1. Redistributions of source code must retain the above copyright
13cefd51ecSDoug Rabson.\"    notice, this list of conditions and the following disclaimer.
14cefd51ecSDoug Rabson.\" 2. Redistributions in binary form must reproduce the above copyright
15cefd51ecSDoug Rabson.\"    notice, this list of conditions and the following disclaimer in the
16cefd51ecSDoug Rabson.\"    documentation and/or other materials provided with the distribution.
17cefd51ecSDoug Rabson.\"
18cefd51ecSDoug Rabson.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
19cefd51ecSDoug Rabson.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20cefd51ecSDoug Rabson.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21cefd51ecSDoug Rabson.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
22cefd51ecSDoug Rabson.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23cefd51ecSDoug Rabson.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24cefd51ecSDoug Rabson.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25cefd51ecSDoug Rabson.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26cefd51ecSDoug Rabson.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27cefd51ecSDoug Rabson.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28cefd51ecSDoug Rabson.\"
297f3dea24SPeter Wemm.\" $FreeBSD$
30cefd51ecSDoug Rabson.\"
318d89b8f2SGlen Barber.Dd September 10, 2010
32def37e7cSMike Pritchard.Dt DEVCLASS_GET_MAXUNIT 9
333d45e180SRuslan Ermilov.Os
34cefd51ecSDoug Rabson.Sh NAME
35cefd51ecSDoug Rabson.Nm devclass_get_maxunit
36cefd51ecSDoug Rabson.Nd find the maximum unit number in the class
37cefd51ecSDoug Rabson.Sh SYNOPSIS
3832eef9aeSRuslan Ermilov.In sys/param.h
3932eef9aeSRuslan Ermilov.In sys/bus.h
40cefd51ecSDoug Rabson.Ft int
41cefd51ecSDoug Rabson.Fn devclass_get_maxunit "devclass_t dc"
42cefd51ecSDoug Rabson.Sh DESCRIPTION
434abfd70cSNate LawsonReturns the next unit number to be allocated to device instances in the
44cefd51ecSDoug Rabson.Dv devclass .
454abfd70cSNate LawsonThis is one greater than the highest currently allocated unit.
469d839c44SGlen Barber.Sh RETURN VALUES
479d839c44SGlen BarberThe
489d839c44SGlen Barber.Fn devclass_get_maxunit
499d839c44SGlen Barberfunction returns -1 if
509d839c44SGlen Barber.Fa dc
519d839c44SGlen Barberis
52*73bbeaa5SGlen Barber.Dv NULL ,
539d839c44SGlen Barberotherwise it returns the next unit
549d839c44SGlen Barbernumber in
559d839c44SGlen Barber.Fa dc's
569d839c44SGlen Barberdevclass.
579d839c44SGlen Barber.Sh ERRORS
589d839c44SGlen BarberNone.
59cefd51ecSDoug Rabson.Sh SEE ALSO
60cefd51ecSDoug Rabson.Xr devclass 9 ,
61cefd51ecSDoug Rabson.Xr device 9
62cefd51ecSDoug Rabson.Sh AUTHORS
63571dba6eSHiten PandyaThis manual page was written by
64cefd51ecSDoug Rabson.An Doug Rabson .
654abfd70cSNate Lawson.Sh BUGS
664abfd70cSNate LawsonThe name is confusing since it is one greater than the maximum unit.
67