FreeBSD/sys/mips/nlm/dev/sec/nlmrsa.c
/* This function is called from an interrupt handler */
This function is called from an interrupt handler
This function is called from an interrupt handler
void
nlm_xlprsaecc_msgring_handler(int vc, int size, int code, int src_id,
    struct nlm_fmn_msg *msg, void *data)
{
	struct xlp_rsa_command *cmd;
	struct xlp_rsa_softc *sc;
	struct crparam *outparam;
	int ostart;
	KASSERT(code == FMN_SWCODE_RSA,
	    ("%s: bad code = %d, expected code = %d\n", __func__, code,
	    FMN_SWCODE_RSA));
	sc = data;
	KASSERT(src_id >= sc->rsaecc_vc_start && src_id <= sc->rsaecc_vc_end,
	    ("%s: bad src_id = %d, expect %d - %d\n", __func__,
	    src_id, sc->rsaecc_vc_start, sc->rsaecc_vc_end));
	cmd = (struct xlp_rsa_command *)(uintptr_t)msg->msg[1];
	KASSERT(cmd != NULL, ("%s:cmd not received properly\n", __func__));
	if (RSA_ERROR(msg->msg[0]) != 0) {
		printf("%s: Message rcv msg0 %llx msg1 %llx err %x \n",
		    __func__, (unsigned long long)msg->msg[0],
		    (unsigned long long)msg->msg[1],
		    (int)RSA_ERROR(msg->msg[0]));
		cmd->krp->krp_status = EBADMSG;
	}
	if (cmd->krp != NULL) {
		ostart = cmd->krp->krp_iparams;
		outparam = &cmd->krp->krp_param[ostart];
		xlp_rsa_inp2hwformat(cmd->rsasrc + cmd->rsaopsize * ostart,
		    outparam->crp_p,
		    howmany(outparam->crp_nbits, 8),
		    1);
		crypto_kdone(cmd->krp);
	}
	xlp_free_cmd_params(cmd);
}
void nlm_xlprsaecc_msgring_handler ( int vc , int size , int code , int src_id , struct nlm_fmn_msg * msg , void * data ) { struct xlp_rsa_command * cmd ; struct xlp_rsa_softc * sc ; struct crparam * outparam ; int ostart ; KASSERT ( code == FMN_SWCODE_RSA , ( " \n " , __func__ , code , FMN_SWCODE_RSA ) ) ; sc = data ; KASSERT ( src_id >= sc -> rsaecc_vc_start && src_id <= sc -> rsaecc_vc_end , ( " \n " , __func__ , src_id , sc -> rsaecc_vc_start , sc -> rsaecc_vc_end ) ) ; cmd = ( struct xlp_rsa_command * ) ( uintptr_t ) msg -> msg [ 1 ] ; KASSERT ( cmd != NULL , ( " \n " , __func__ ) ) ; if ( RSA_ERROR ( msg -> msg [ 0 ] ) != 0 ) { printf ( " \n " , __func__ , ( unsigned long long ) msg -> msg [ 0 ] , ( unsigned long long ) msg -> msg [ 1 ] , ( int ) RSA_ERROR ( msg -> msg [ 0 ] ) ) ; cmd -> krp -> krp_status = EBADMSG ; } if ( cmd -> krp != NULL ) { ostart = cmd -> krp -> krp_iparams ; outparam = & cmd -> krp -> krp_param [ ostart ] ; xlp_rsa_inp2hwformat ( cmd -> rsasrc + cmd -> rsaopsize * ostart , outparam -> crp_p , howmany ( outparam -> crp_nbits , 8 ) , 1 ) ; crypto_kdone ( cmd -> krp ) ; } xlp_free_cmd_params ( cmd ) ; }
This function is called from an interrupt handler
This function is called from an interrupt handler