xref: /freebsd/share/man/man9/devctl_notify.9 (revision 6b1d211602bd6d01d37be3091cbc8728d4ae3e8a)
1*6b1d2116SWarner Losh.\"
2*6b1d2116SWarner Losh.\" Copyright (c) 2020 M Warner Losh
3*6b1d2116SWarner Losh.\"
4*6b1d2116SWarner Losh.\" This program is free software.
5*6b1d2116SWarner Losh.\"
6*6b1d2116SWarner Losh.\" Redistribution and use in source and binary forms, with or without
7*6b1d2116SWarner Losh.\" modification, are permitted provided that the following conditions
8*6b1d2116SWarner Losh.\" are met:
9*6b1d2116SWarner Losh.\" 1. Redistributions of source code must retain the above copyright
10*6b1d2116SWarner Losh.\"    notice, this list of conditions and the following disclaimer.
11*6b1d2116SWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright
12*6b1d2116SWarner Losh.\"    notice, this list of conditions and the following disclaimer in the
13*6b1d2116SWarner Losh.\"    documentation and/or other materials provided with the distribution.
14*6b1d2116SWarner Losh.\"
15*6b1d2116SWarner Losh.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
16*6b1d2116SWarner Losh.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17*6b1d2116SWarner Losh.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18*6b1d2116SWarner Losh.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
19*6b1d2116SWarner Losh.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20*6b1d2116SWarner Losh.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21*6b1d2116SWarner Losh.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22*6b1d2116SWarner Losh.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23*6b1d2116SWarner Losh.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24*6b1d2116SWarner Losh.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*6b1d2116SWarner Losh.\"
26*6b1d2116SWarner Losh.\" $FreeBSD$
27*6b1d2116SWarner Losh.\"
28*6b1d2116SWarner Losh.Dd September 22, 2020
29*6b1d2116SWarner Losh.Dt DEVCTL_NOTIFY 9
30*6b1d2116SWarner Losh.Os
31*6b1d2116SWarner Losh.Sh NAME
32*6b1d2116SWarner Losh.Nm devctl_notify
33*6b1d2116SWarner Losh.Nd Send a message, via devctl, to userland
34*6b1d2116SWarner Losh.Sh SYNOPSIS
35*6b1d2116SWarner Losh.In sys/devctl.h
36*6b1d2116SWarner Losh.Ft void
37*6b1d2116SWarner Losh.Fn devctl_notify "const char *system" "const char *subsystem" "const char *type" "const char *data"
38*6b1d2116SWarner Losh.Sh DESCRIPTION
39*6b1d2116SWarner LoshSend a notification to user land via
40*6b1d2116SWarner Losh.Xr devctl 4 .
41*6b1d2116SWarner LoshSee
42*6b1d2116SWarner Losh.Xr devctl 4
43*6b1d2116SWarner Loshfor the format of these messages.
44*6b1d2116SWarner Losh.Pp
45*6b1d2116SWarner LoshThe
46*6b1d2116SWarner Losh.Nm
47*6b1d2116SWarner Loshfunction creates a string using the following template:
48*6b1d2116SWarner Losh.Bd -literal
49*6b1d2116SWarner Loshsnprintf(buffer, sizeof(buffer), "!system=%s subsystem=%s type=%s",
50*6b1d2116SWarner Losh   system, subsystem, type);
51*6b1d2116SWarner Losh.Ed
52*6b1d2116SWarner Losh.Pp
53*6b1d2116SWarner LoshThe
54*6b1d2116SWarner Losh.Va system ,
55*6b1d2116SWarner Losh.Va subsystem ,
56*6b1d2116SWarner Loshand
57*6b1d2116SWarner Losh.Va type
58*6b1d2116SWarner Loshpointers cannot be NULL.
59*6b1d2116SWarner Losh.Pp
60*6b1d2116SWarner LoshThe
61*6b1d2116SWarner Losh.Va data
62*6b1d2116SWarner Loshargument may be NULL (for no additions) or a message formatted
63*6b1d2116SWarner Loshproperly for
64*6b1d2116SWarner Losh.Xr devctl 4 .
65*6b1d2116SWarner LoshA space will be added to the above template and this argument copied
66*6b1d2116SWarner Loshverbatim to form the message passed to userland.
67*6b1d2116SWarner LoshSenders should balance between only passing data that userland can not
68*6b1d2116SWarner Loshdiscover itself and sending all the data userland will want to use to
69*6b1d2116SWarner Loshdecide what to do with the message.
70*6b1d2116SWarner Losh.Pp
71*6b1d2116SWarner LoshThe current total message length limit is just under 1kb.
72*6b1d2116SWarner LoshSenders should try to remain well below this limit.
73*6b1d2116SWarner Losh.Sh SEE ALSO
74*6b1d2116SWarner Losh.Xr devctl 4 ,
75*6b1d2116SWarner Losh.Xr devd 8
76*6b1d2116SWarner Losh.Sh AUTHORS
77*6b1d2116SWarner LoshThis manual page was written by
78*6b1d2116SWarner Losh.An M. Warner Losh
79