xref: /illumos-gate/usr/src/man/man9e/mc_start.9e (revision dc1b26915530081df6e78d0ada403a1b920a7b58)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright 2016 Joyent, Inc.
13.\"
14.Dd May 31, 2016
15.Dt MC_START 9E
16.Os
17.Sh NAME
18.Nm mc_start ,
19.Nm mc_stop
20.Nd start and stop device entry points
21.Sh SYNOPSIS
22.In sys/mac_provider.h
23.Ft int
24.Fo prefix_m_start
25.Fa "void *driver"
26.Fc
27.Ft void
28.Fo prefix_m_stop
29.Fa "void *driver"
30.Fc
31.Sh INTERFACE LEVEL
32illumos DDI specific
33.Sh PARAMETERS
34.Bl -tag -width Ds
35.It Fa driver
36A pointer to the driver's private data that was passed in via the
37.Sy m_pdata
38member of the
39.Xr mac_register 9S
40structure to the
41.Xr mac_register 9F
42function.
43.El
44.Sh DESCRIPTION
45The
46.Fn mc_start
47entry point for a driver indicates that it should initialize the chip
48to be ready to send or receive data. This entry point is guaranteed to
49be called before any entry points that are expected to be able to send
50and receive data. During this entry point, most devices will allocate
51DMA resources, enable the link, and finish performing any necessary
52device programming.
53.Pp
54The
55.Fn mc_stop
56entry point for a driver indicates that it should tear down any
57allocated resources for the driver and, after the function returns, it is
58not expected to perform any additional I/O.
59.Pp
60The driver has access to its private data in the
61.Fa driver
62argument to either function, which it should cast to the
63appropriate structure. The system guarantees that only one of the
64.Fn mc_start
65and
66.Fn mc_stop
67functions will be called at any given time for a given instance.
68Similarly, these should not be called at the same time as a device's
69.Xr attach 9E
70or
71.Xr detach 9E
72routine. However, the driver may have other ongoing routines that it
73needs to protect against.  The device driver should always apply the
74appropriate locking techniques needed to ensure that access to the data
75in its soft state is protected.
76.Sh RETURN VALUES
77Upon successful completion, device drivers should return
78.Sy 0
79for the
80.Fn mc_start
81entry point. Otherwise, they should return a non-zero positive error
82number to indicate the error that occurred.
83.Sh SEE ALSO
84.Xr mac 9E ,
85.Xr mac_register 9F ,
86.Xr mac_register 9S
87