亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? usr_blk_dev.c

?? 包含MMC協議,驅動源碼. 在LINUX操作系統下通過.
?? C
?? 第 1 頁 / 共 5 頁
字號:
        usr_blk_dev_send_cmd_to_thread(attached ? USR_BLK_DEV_CMD_ID_INIT : USR_BLK_DEV_CMD_ID_REMOVE,                                       dev_num, USR_BLK_DEV_CMD_SRC_IRQ);    }    return true;}/*! * @brief Returns true if the device is attached. * * @param dev_num The number of the device which needs to be checked * * @return true if the device is attached *         false if the device is removed */static bool usr_blk_dev_check_dev_attached(unsigned int dev_num){    tracemsg("\n");    /* At this time only one device is supported. */    return (USR_BLK_DEV_IS_DEV1_ATTACHED);}/*! * @brief Enables or disables the detection interrupt for a device. * * @param dev_num The device number which must be enabled. * @param enable  true if the interrupt must be enabled.<BR> *                false if the interrupt must be disabled. */static void usr_blk_dev_set_irq_state(unsigned int dev_num, bool enable){    tracemsg("%d\n", enable);    /* Currently only one device is supported. */#ifndef CONFIG_ARCH_SCMA11    if (enable)    {        enable_irq(IRQ_GPIO(USR_BLK_DEV_DEV1_INT_GPIO));    }    else    {        disable_irq(IRQ_GPIO(USR_BLK_DEV_DEV1_INT_GPIO));    }#endif}/*! * @brief Called each time the attach signal must be polled. * * Checks the attach state of a device and updates the debounce state based * on the status.  Only the attached state is debounced.  For removal, a single * interrupt or poll indicating removal, is all that is necessary to indicate the * media has been removed.  This is to insure the proper power up sequence is * sent to the device if power was removed. * * The debounce is implemented as a state machine in order to handle the different * debounce counts for removal and insertion as well as special requirements for * sending the media state indication to the command handling thread.  If the * thread has not processed a previous card attach state change, a new state * change cannot be sent.  For this reason the "UPDATE" states are present.  See * USR_BLK_DEV_DEBOUNCE_STATE_T for more details. * * @param dev_num The device number to operate on * * @return true if the device is in a steady state.<BR> *         false if the debouncing must continue. */static bool usr_blk_dev_poll_card_attach(unsigned int dev_num){    bool attached;    bool debounce_done;    USR_BLK_DEV_INFO_T *info_p;    info_p = &usr_blk_dev_info[dev_num];    attached = usr_blk_dev_check_dev_attached(dev_num);    debounce_done = false;    tracemsg("debounce state: %d media_state: %d attached: %d\n",             info_p->debounce_state, info_p->media_state, attached);    switch (info_p->debounce_state)    {        /*         * The device is currently removed.         */        case USR_BLK_DEV_DEBOUNCE_STATE_REMOVED:            /* Move on to the next state if the device is now inserted. */            if (attached)            {                info_p->debounce_state = USR_BLK_DEV_DEBOUNCE_STATE_INSERTING;            }            else            {                debounce_done = true;            }            break;        /*         * The device has been detected as inserted but has not been debounced.         */        case USR_BLK_DEV_DEBOUNCE_STATE_INSERTING:        case USR_BLK_DEV_DEBOUNCE_STATE_INSERTING1:        case USR_BLK_DEV_DEBOUNCE_STATE_INSERTING2:        case USR_BLK_DEV_DEBOUNCE_STATE_INSERTING3:        case USR_BLK_DEV_DEBOUNCE_STATE_INSERTING4:            if (attached)            {                info_p->debounce_state++;            }            else            {                info_p->debounce_state = USR_BLK_DEV_DEBOUNCE_STATE_REMOVED;            }            break;                    /*         * The device has been detected as inserted and the driver needs to be         * informed of the new state.         */        case USR_BLK_DEV_DEBOUNCE_STATE_UPDATE_INSERT:            if (attached)            {                if (usr_blk_dev_set_attached_state(dev_num, attached))                {                    info_p->debounce_state = USR_BLK_DEV_DEBOUNCE_STATE_INSERTED;                }            }            else            {                /*                 * If the device has been removed and it has not been reported as                 * inserted, go back to the removed state.                 */                info_p->debounce_state = USR_BLK_DEV_DEBOUNCE_STATE_REMOVED;            }            break;        /*         * The device is currently inserted.         */        case USR_BLK_DEV_DEBOUNCE_STATE_INSERTED:            if (!attached)            {                info_p->debounce_state = USR_BLK_DEV_DEBOUNCE_STATE_UPDATE_REMOVAL;            }            else            {                debounce_done = true;            }            break;        /*         * The device has been detected as removed and the driver needs to be         * informed of the new state.         */        case USR_BLK_DEV_DEBOUNCE_STATE_UPDATE_REMOVAL:            if (usr_blk_dev_set_attached_state(dev_num, false))            {                info_p->debounce_state = USR_BLK_DEV_DEBOUNCE_STATE_REMOVED;            }            break;        default:            info_p->debounce_state = USR_BLK_DEV_DEBOUNCE_STATE_UPDATE_REMOVAL;            break;    }    return debounce_done;}/*! * @brief Timer function called to handle debouncing of the card detect signal. * * Function loops through the possible devices and debounces them if the * corresponding bit is set in the device_msk.  If any devices require * further debouncing the timer is restarted.  If no more debouncing is * needed for a device it's interrupt is re-enabled.  If further debouncing * is needed the interrupt will be disabled. * * @param device_msk A bit mask which has the bits set for the devices *                   which must be debounced. */static void usr_blk_dev_timer_poll(unsigned long device_msk){    unsigned int dev_num;    static unsigned int timer_msk = 0;    unsigned int check_msk;    tracemsg("\n");    for (dev_num = 0; dev_num < USR_BLK_DEV_NUM_DEVICES; dev_num++)    {        check_msk = 1<<dev_num;        if (check_msk & ((unsigned int)device_msk))        {            /* Update the state, and if it no longer a steady state, start polling. */            if (!usr_blk_dev_poll_card_attach(dev_num))            {                /* Disable the card detect interrupt until the next steady state is reached. */                usr_blk_dev_set_irq_state(dev_num, false);                        /* Set up a timer to poll for a steady state on the card detect signal. */                timer_msk |= check_msk;            }            else            {                /* No reason to continue checking this device. */                timer_msk &= ~check_msk;                /* Re-enable the interrupt for the next card attach event. */                usr_blk_dev_set_irq_state(dev_num, true);            }        }    }    /* Restart the timer if not done debouncing. */    if (timer_msk)    {        tracemsg("Setting up timer for poll in 1 jiffy.\n");         usr_blk_dev_timer.function = usr_blk_dev_timer_poll;        usr_blk_dev_timer.data = (unsigned long)timer_msk;        usr_blk_dev_timer.expires = jiffies+1;        /* If the timer is running for more than the devices checked, simply update it. */        if ((timer_msk & ~((unsigned int)device_msk)) != 0)        {            mod_timer(&usr_blk_dev_timer, usr_blk_dev_timer.expires);        }        else        {            add_timer(&usr_blk_dev_timer);        }    }}/*! * @brief Interrupt handler for when a card detect signal changes state. * * This function is called once a change in state is detected.  As a result of * this function being called the interrupt will be disabled and the debounce * timer will be started.  See usr_blk_dev_timer_poll() for all of the details * on debouncing. * * @param irq        Not used in this function, but required by the caller. * @param device_msk The device mask to operate on. * @param regs       Not used in this function, but required by the caller. */static void usr_blk_dev_attach_irq(int irq, void *device_msk, struct pt_regs *regs){    tracemsg("\n");    /* Take a sample and set up a timer if not in a steady state already. */    usr_blk_dev_timer_poll((unsigned long)device_msk);}/*! * @brief Clears out the data necessary once a command is processed. * * This function must be called once a command has been processed by the block * device thread and the data has been processed by the function which requested * the command.  For example if the request came from * usr_blk_dev_check_media_change(), usr_blk_dev_check_media_change() must call * this function to allow other commands to be processed.  Any commands requested * during the processing of this command will be waiting until this command is * processed. * * @param info_p  Pointer to the information structure for the device being *                operated upon. * @param cmd_src The source of the command. * * @todo  Only the GEN user actually needs to be woken up.  It may make more *        sense to move the wait queue out of the command structure. */static void usr_blk_dev_cmd_data_processed(    USR_BLK_DEV_INFO_T *info_p,    USR_BLK_DEV_CMD_SRC_T cmd_src){    struct usr_blk_dev_cmd_s *cmd_p;        tracemsg("\n");    cmd_p = &info_p->cmd[cmd_src];    cmd_p->data.id = USR_BLK_DEV_CMD_ID_NONE;    cmd_p->state = USR_BLK_DEV_CMD_STATE_NONE;    wake_up(&cmd_p->wait_for_completion);}/*! * @brief Sends a command to the thread and waits for the kernel thread to *        complete processing of the command. * * Sets up a command to be sent to kernel thread and waits for the kernel thread * to respond to the command.  This function will block until the response is * received from the user space driver and processed by the kernel thread.  It * should not be used from the request queue or an interrupt. * * @param info_p  Pointer to the information structure for the device being *                operated upon. * @param id      The command to send. * @param dev_num The device which the command must be sent to. * @param cmd_src The source of the command. * * @note: Do not call this from a context which cannot block.  For that *        case usr_blk_dev_send_cmd_to_thread() must be used. */static void usr_blk_dev_send_cmd_to_thread_and_wait(    USR_BLK_DEV_INFO_T *info_p,    USR_BLK_DEV_CMD_ID_T id,    unsigned int dev_num,    USR_BLK_DEV_CMD_SRC_T cmd_src){    struct usr_blk_dev_cmd_s *cmd_p;        tracemsg("id: %d cmd_src:%d\n", id, cmd_src);    cmd_p = &info_p->cmd[cmd_src];    usr_blk_dev_send_cmd_to_thread(id, dev_num, cmd_src);    /* Wait for thread to respond to the command. */    wait_event(cmd_p->wait_for_thread,               ((cmd_p->state == USR_BLK_DEV_CMD_STATE_THREAD_DONE) ||                (info_p->media_state == USR_BLK_DEV_MEDIA_STATE_ERROR)));    tracemsg("Thread command response received.\n");}/*! * @brief Clears out the data necessary once a command is processed. * * This must be called once the user block thread is done processing a command. * It will clear out the necessary data and set the state to * USR_BLK_DEV_CMD_STATE_THREAD_DONE.  If the command was not from an interrupt * or the request queue, the sending routine will be woken up. * * @param info_p  Pointer to the information structure for the device which *                the command has been completed. * * @todo  Only the GEN user actually needs to be woken up.  It may make more *        sense to move the wait queue out of the command structure. */static void usr_blk_dev_thread_cmd_done(USR_BLK_DEV_INFO_T *info_p){    struct usr_blk_dev_cmd_s *cmd_p;        tracemsg("id: %d cmd_src: %d\n", info_p->cmd[info_p->cmd_src].data.id, info_p->cmd_src);    cmd_p = &info_p->cmd[info_p->cmd_src];    cmd_p->state = USR_BLK_DEV_CMD_STATE_THREAD_DONE;    /*     * If the source of the command was the request queue or an interrupt, no completed     * ack or return data is supported.     */    if ((info_p->cmd_src == USR_BLK_DEV_CMD_SRC_IRQ) || (info_p->cmd_src == USR_BLK_DEV_CMD_SRC_REQ))    {        cmd_p->data.id = USR_BLK_DEV_CMD_ID_NONE;        cmd_p->state = USR_BLK_DEV_CMD_STATE_NONE;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
777午夜精品免费视频| 色综合欧美在线视频区| 热久久一区二区| 亚洲一区中文在线| 一区二区三区四区在线| 国产精品久久久久四虎| 久久伊99综合婷婷久久伊| 日韩一级片网址| 337p亚洲精品色噜噜噜| 欧美伊人久久久久久久久影院 | 日韩精品三区四区| 一区二区不卡在线播放| 一区二区三区在线视频观看58 | 欧美日韩国产成人在线免费| 国产成人精品免费网站| 国产揄拍国内精品对白| 国产麻豆91精品| 成人av片在线观看| 懂色av一区二区三区免费观看| 国产一区 二区 三区一级| 国产91精品露脸国语对白| 成人黄色a**站在线观看| 99久久伊人精品| 97久久超碰精品国产| 欧美艳星brazzers| 欧美一区二区三区视频在线观看| 日韩一区二区中文字幕| 久久综合中文字幕| 欧美国产乱子伦| 亚洲成人av资源| 国产毛片一区二区| 99精品视频在线免费观看| 欧美在线观看一二区| 日韩欧美精品三级| 国产日韩精品一区| 夜夜嗨av一区二区三区中文字幕 | 欧美在线不卡一区| 欧美一区二区福利视频| 国产精品卡一卡二卡三| 欧美情侣在线播放| 99久久夜色精品国产网站| 亚洲精品菠萝久久久久久久| 亚洲第一激情av| 国产麻豆日韩欧美久久| 91麻豆国产香蕉久久精品| 欧美精品乱码久久久久久| 久久精品一区蜜桃臀影院| 亚洲一二三区在线观看| 国产成人精品一区二区三区四区 | 一区二区视频免费在线观看| 久久69国产一区二区蜜臀| 91老司机福利 在线| 精品99999| 亚洲永久精品国产| 不卡的av网站| 久久综合久久久久88| 亚洲福利一区二区| 色哟哟在线观看一区二区三区| 日韩欧美一级特黄在线播放| 亚洲精品成人a在线观看| av在线这里只有精品| www激情久久| 日韩国产精品久久久久久亚洲| av一区二区三区在线| 国产亚洲一区字幕| 久久国产精品第一页| 欧美一区二区精美| 三级一区在线视频先锋| 欧美色精品在线视频| 亚洲欧洲无码一区二区三区| 国产精品白丝jk黑袜喷水| 日韩欧美三级在线| 美女尤物国产一区| 日韩免费高清av| 蜜桃视频一区二区| 日韩精品一区二区三区在线播放| 午夜久久久影院| 91精品国产综合久久蜜臀| 亚洲午夜精品一区二区三区他趣| 91色porny在线视频| 亚洲欧美电影一区二区| 欧洲视频一区二区| 亚洲高清免费一级二级三级| 在线区一区二视频| 一区二区三区免费在线观看| 色婷婷精品大在线视频| 亚洲国产一区二区视频| 欧美日韩久久久一区| 偷拍与自拍一区| 日韩欧美国产综合| 国产99久久久国产精品潘金| 国产精品视频第一区| 一本一本大道香蕉久在线精品 | 激情综合网最新| 精品日韩在线观看| 国产成人午夜电影网| 中文字幕日韩一区二区| 91精品办公室少妇高潮对白| 亚洲成人免费视频| 久久婷婷色综合| 国产不卡视频一区二区三区| 国产精品美女一区二区| 色综合亚洲欧洲| 天天影视网天天综合色在线播放| 欧美另类z0zxhd电影| 国产一区三区三区| 亚洲乱码国产乱码精品精小说| 欧美中文字幕久久| 国精品**一区二区三区在线蜜桃| 久久久久国色av免费看影院| 91视频com| 免费高清在线一区| 亚洲欧洲成人精品av97| 欧美日韩高清在线| 国产成人精品三级| 午夜私人影院久久久久| 国产欧美视频一区二区三区| 欧美亚洲高清一区二区三区不卡| 免费观看一级特黄欧美大片| 中文字幕在线一区二区三区| 欧美成人精品福利| 日本大香伊一区二区三区| 黄色小说综合网站| 亚洲国产精品久久一线不卡| 国产视频911| 日韩精品一区二区三区蜜臀 | 午夜视频在线观看一区二区三区| 久久日韩粉嫩一区二区三区| 欧美三区免费完整视频在线观看| 黑人巨大精品欧美一区| 亚洲高清免费一级二级三级| 国产欧美va欧美不卡在线| 宅男在线国产精品| 色菇凉天天综合网| 国产成人精品一区二区三区四区| 亚洲成人av在线电影| 亚洲精品成人悠悠色影视| 久久这里只有精品6| 欧美一级黄色片| 在线亚洲欧美专区二区| 成人av网在线| 不卡一二三区首页| 国产suv精品一区二区三区| 免费的成人av| 日韩av成人高清| 五月婷婷激情综合网| 一区二区欧美视频| 亚洲婷婷在线视频| 亚洲国产成人在线| 国产日韩精品一区| 欧美韩国日本一区| 国产日产欧美一区二区视频| 亚洲精品一区二区在线观看| 欧美一区二区三区精品| 777午夜精品视频在线播放| 在线成人午夜影院| 欧美一区二区免费视频| 欧美一区二区三级| 91精品国产欧美一区二区18| 91麻豆精品国产91久久久久久久久 | 成人精品鲁一区一区二区| 国产在线观看免费一区| 玖玖九九国产精品| 精东粉嫩av免费一区二区三区| 日本aⅴ亚洲精品中文乱码| 亚洲18女电影在线观看| 丝袜亚洲另类欧美| 久久国产三级精品| 国产乱人伦偷精品视频不卡| 国产自产高清不卡| 成人一区二区在线观看| 不卡av在线网| 欧美日韩一区二区三区在线| 欧美精品色一区二区三区| 欧美一区二区视频在线观看| 精品国产第一区二区三区观看体验| 日韩欧美精品在线| 欧美国产日产图区| 亚洲婷婷国产精品电影人久久| 亚洲午夜av在线| 六月丁香婷婷色狠狠久久| 国产成人自拍在线| a级高清视频欧美日韩| 欧美视频在线播放| 国产午夜亚洲精品理论片色戒| 日韩一区在线免费观看| 日韩av一区二区在线影视| 国产一区二区视频在线| 色哟哟一区二区在线观看| 日韩免费在线观看| 亚洲欧美在线高清| 男女男精品视频网| 一本久久精品一区二区| 精品久久久久久久人人人人传媒| 国产精品久久777777| 日本视频一区二区| 972aa.com艺术欧美| 日韩欧美一区二区在线视频| 亚洲女爱视频在线| 国产精品123区|