MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ccp_attach

Function ccp_attach

freebsd/crypto/ccp/ccp.c:172–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172static int
173ccp_attach(device_t dev)
174{
175 struct ccp_softc *sc;
176 int error;
177
178 sc = device_get_softc(dev);
179 sc->dev = dev;
180
181 sc->cid = crypto_get_driverid(dev, sizeof(struct ccp_session),
182 CRYPTOCAP_F_HARDWARE);
183 if (sc->cid < 0) {
184 device_printf(dev, "could not get crypto driver id\n");
185 return (ENXIO);
186 }
187
188 error = ccp_hw_attach(dev);
189 if (error != 0)
190 return (error);
191
192 mtx_init(&sc->lock, "ccp", NULL, MTX_DEF);
193
194 ccp_initialize_queues(sc);
195
196 if (g_ccp_softc == NULL) {
197 g_ccp_softc = sc;
198 if ((sc->hw_features & VERSION_CAP_TRNG) != 0)
199 random_source_register(&random_ccp);
200 }
201
202 return (0);
203}
204
205static int
206ccp_detach(device_t dev)

Callers

nothing calls this directly

Calls 6

device_get_softcFunction · 0.85
crypto_get_driveridFunction · 0.85
device_printfFunction · 0.85
ccp_hw_attachFunction · 0.85
mtx_initFunction · 0.85
ccp_initialize_queuesFunction · 0.85

Tested by

no test coverage detected