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