if (hz > 100) sc->sc_eatick = hz/100; else sc->sc_eatick = 1; timeout_set(&sc->sc_eato, noct_ea_tick, sc); timeout_add(&sc->sc_eato, sc->sc_eatick);
SIMPLEQ_INIT(&sc->sc_inq); SIMPLEQ_INIT(&sc->sc_chipq); SIMPLEQ_INIT(&sc->sc_outq);  crypto_register(sc->sc_cid, CRYPTO_MD5, 0, 0, noct_newsession, noct_freesession, noct_process); crypto_register(sc->sc_cid, CRYPTO_SHA1, 0, 0, NULL, NULL, NULL);  kthread_create_deferred(noct_ea_create_thread, sc);
noct_ea_init(sc)	struct noct_softc *sc;{	bus_dma_segment_t seg;	int rseg;	if (bus_dmamem_alloc(sc->sc_dmat, NOCT_EA_BUFSIZE,	    PAGE_SIZE, 0, &seg, 1, &rseg, BUS_DMA_NOWAIT)) {		printf("%s: failed ea buf alloc\n", sc->sc_dv.dv_xname);		goto fail;	}	if (bus_dmamem_map(sc->sc_dmat, &seg, rseg, NOCT_EA_BUFSIZE,	    (caddr_t *)&sc->sc_eacmd, BUS_DMA_NOWAIT)) {		printf("%s: failed ea buf map\n", sc->sc_dv.dv_xname);		goto fail_1;	}	if (bus_dmamap_create(sc->sc_dmat, NOCT_EA_BUFSIZE, rseg,	    NOCT_EA_BUFSIZE, 0, BUS_DMA_NOWAIT, &sc->sc_eamap)) {		printf("%s: failed ea map create\n", sc->sc_dv.dv_xname);		goto fail_2;	}	if (bus_dmamap_load_raw(sc->sc_dmat, sc->sc_eamap,	    &seg, rseg, NOCT_EA_BUFSIZE, BUS_DMA_NOWAIT)) {		printf("%s: failed ea buf load\n", sc->sc_dv.dv_xname);		goto fail_3;	}	noct_ea_disable(sc);	noct_ea_enable(sc);	if (hz > 100)		sc->sc_eatick = hz/100;	else		sc->sc_eatick = 1;	timeout_set(&sc->sc_eato, noct_ea_tick, sc);	timeout_add(&sc->sc_eato, sc->sc_eatick);	return;fail_3:	bus_dmamap_destroy(sc->sc_dmat, sc->sc_eamap);fail_2:	bus_dmamem_unmap(sc->sc_dmat,	    (caddr_t)sc->sc_eacmd, NOCT_EA_BUFSIZE);fail_1:	bus_dmamem_free(sc->sc_dmat, &seg, rseg);fail:	sc->sc_eacmd = NULL;	sc->sc_eamap = NULL;}