| 203 | } |
| 204 | |
| 205 | static int |
| 206 | ccp_detach(device_t dev) |
| 207 | { |
| 208 | struct ccp_softc *sc; |
| 209 | |
| 210 | sc = device_get_softc(dev); |
| 211 | |
| 212 | mtx_lock(&sc->lock); |
| 213 | sc->detaching = true; |
| 214 | mtx_unlock(&sc->lock); |
| 215 | |
| 216 | crypto_unregister_all(sc->cid); |
| 217 | if (g_ccp_softc == sc && (sc->hw_features & VERSION_CAP_TRNG) != 0) |
| 218 | random_source_deregister(&random_ccp); |
| 219 | |
| 220 | ccp_hw_detach(dev); |
| 221 | ccp_free_queues(sc); |
| 222 | |
| 223 | if (g_ccp_softc == sc) |
| 224 | g_ccp_softc = NULL; |
| 225 | |
| 226 | mtx_destroy(&sc->lock); |
| 227 | return (0); |
| 228 | } |
| 229 | |
| 230 | static void |
| 231 | ccp_init_hmac_digest(struct ccp_session *s, const char *key, int klen) |
nothing calls this directly
no test coverage detected