Пример #1
0
/*
 * 20100111,HSL@RK,use LUN to dicide call at task or irq.
 * lun==0: at irq , other at task.
 */
static int rkusb_function_call_callback( struct rkusb_dev *dev )
{
         int     ret;
         rk28printk("%s::cmd=%s,crash=%d\n" , __func__ , (char*) dev->req_out->buf , rk28_system_crash );
         if( !__rkusb_write_enable() ) {
                //if( !strcmp((char*) dev->req_out->buf , rkusb_en_read) ) {
                //        rk28_system_crash = 2;
                //        rkusb_send_csw_result( dev , rk28_system_crash);
                //        return RKUSB_CB_OK_NONE;
                //}
                if( !strcmp((char*) dev->req_out->buf , rkusb_en_write) ) {
                        rk28_system_crash = RKDBG_WRITE;
                        rkusb_send_csw_result( dev , rk28_system_crash);
                        return RKUSB_CB_OK_NONE;
                }
                return RKUSB_CB_FAILD;
        }
        if( DEV_LUN(dev) == 0 ) {
                ret = __rk28_scu_parse_cmd((char*) dev->req_out->buf);
                rk28printk("cmd ret = 0x%x(%d)" , ret ,ret );
                rkusb_send_csw_result( dev , ret );
        } else {
                rkusb_wakeup_thread( dev );
        }
        return RKUSB_CB_OK_NONE;
}
Пример #2
0
static int rkusb_do_func_call( struct rkusb_dev *dev )
{
        int ret = __rk28_scu_parse_cmd((char*) dev->req_out->buf);
        rkusb_send_csw_result( dev , ret );
        return RKUSB_CB_OK_NONE;
}
Пример #3
0
static int rkusb_do_get_taskcmd_cb( struct rkusb_dev *dev )
{
        rkusb_send_csw_result( dev , dev->buf[0].filled );
        return RKUSB_CB_OK_NONE;
}