zoukankan      html  css  js  c++  java
  • ehci ohci 驱动逻辑

    1. EHCI

    ehci_platform_probe:
        platform_get_irq
            usb_hcd_request_irqs
                usb_hcd_irq        使用的是ehci的irq
                    hcd->driver->irq(hcd)    调用ehci的usb_hcd的irq
        usb_create_hcd() 使用的ehci_platform_hc_driver是被ehci-hcd覆盖过的,值拷贝,创建一个主机控制器驱动
        usb_add_hcd()
            hcd_buffer_create() 创建DMA buff
            usb_register_bus()  注册这条USB总线
            usb_alloc_dev()     分配root hub设备
            usb_hcd_request_irqs() 申请中断服务函数usb_hcd_irq
            register_root_hub()  注册root-hub
            sysfs_create_group() 创建root-hub的sysfs文件
    
    ehci_hc_driver结构体:
        1.ehci_setup
            ehci_init
            ehci_halt
            ehci_reset
    
        2.ehci_run
            add_sysfs_files
    
        3.ehci_stop
            remove_sysfs_files
    
        4.ehci_shutdown
            hrtimer_cancel
    
        5.ehci_hub_control
            体现出各种typeReq的实际操作!可以看出支持哪些feature,例如GetHubStatus是不支持的!
    
        6.reset = ehci_setup
            但是使用的不是这个函数,见ehci_init_driver(),调用的是函数:ehci_platform_reset(),但是最终还是会调用到这个函数

    2. OHCI

    ohci-platform中只是获取一个设备树中的中断号和映射寄存器io内存,然后执行下面的操作,剩下的全归ohci-hcd.c做了
    ohci_platform_probe
        platform_get_irq
            usb_hcd_request_irqs
                usb_hcd_irq        使用的是ohci的irq
                    hcd->driver->irq(hcd)    调用ohci的usb_hcd的irq
        usb_create_hcd
            usb_bus_init
        usb_add_hcd
            hcd_buffer_create
            usb_register_bus
            usb_alloc_dev    
            register_root_hub
            sysfs_create_group

    参考:https://blog.csdn.net/chenliang0224/article/details/79692374

  • 相关阅读:
    SpringBoot之使用外部的启动类
    CCF——最小差值(2017-12)
    CCF——买菜(2018-09)
    CCF——卖菜(2018-09)
    2792. Grammar Lessons
    2756. Lucky Transformation
    2776. String Task
    2794. Petya and Strings
    2810. Palindromic Times
    14. Football
  • 原文地址:https://www.cnblogs.com/hellokitty2/p/9744989.html
Copyright © 2011-2022 走看看