USB(4)

前面已经说了响应irq 请求的是uhc,由他来统一调度这些请求

我们写的usb驱动程序都是在得到了usb_interface结构体指针的前提下开始probe

通常root hub host controller 集成在一起

usb 子系统进行初始化的时候就要进行就要对root hub进行初始化了

看一下usb_init

关注一下关于usb_hub的初始化工作

int usb_hub_init(void)

{

       if (usb_register(&hub_driver) < 0) {

              printk(KERN_ERR "%s: can't register hub driver/n",

                     usbcore_name);

              return -1;

       }

 

       khubd_task = kthread_run(hub_thread, NULL, "khubd");

       if (!IS_ERR(khubd_task))

              return 0;

 

       /* Fall through if kernel_thread failed */

       usb_deregister(&hub_driver);

       printk(KERN_ERR "%s: can't start khubd/n", usbcore_name);

 

       return -1;

}

注册了这样一个hub driver

 

static struct usb_driver hub_driver = {

       .name =          "hub",

       .probe =  hub_probe,

       .disconnect =  hub_disconnect,

       .suspend =      hub_suspend,

       .resume =       hub_resume,

       .pre_reset =    hub_pre_reset,

       .post_reset =   hub_post_reset,

       .ioctl =    hub_ioctl,

       .id_table =      hub_id_table,

       .supports_autosuspend =       1,

};

 

注意其中的probe方法hub_probe

 

这个会在host usb controller 驱动初始化后调用

 

       khubd_task = kthread_run(hub_thread, NULL, "khubd");

 

创建了一个名为khubd 的内核进程

 

这个进程所做的操作如下

static int hub_thread(void *__unused)

{

       do {

              hub_events();

              wait_event_interruptible(khubd_wait,

                            !list_empty(&hub_event_list) ||

                            kthread_should_stop());

              try_to_freeze();

       } while (!kthread_should_stop() || !list_empty(&hub_event_list));

 

       pr_debug("%s: khubd exiting/n", usbcore_name);

       return 0;

}

 

hub.c 中有这样的结构体定义

static LIST_HEAD(hub_event_list);      /* List of hubs needing servicing */

 

需要服务的hub列表?

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
This chapter presents an overview of Universal Serial Bus 4 (USB4™) architecture and key concepts. USB4 is similar to earlier versions of USB in that it is a cable bus supporting data exchange between a host computer and a wide range of simultaneously accessible peripherals. However, USB4 also allows a host computer to setup data exchange between compatible peripherals. The attached peripherals share bandwidth as configured by the host computer. The bus allows peripherals to be attached, configured, used, and detached while the host and other peripherals are in operation. When configured over a USB Type-C® connector interface, USB4 functionally replaces USB 3.2 while retaining USB 2.0 bus operating in parallel. Enhanced SuperSpeed USB, as defined in USB 3.2, remains the fundamental architecture for USB data transfer on a USB4 Fabric. The difference with USB4 versus USB 3.2 is that USB4 is a connection -oriented, tunneling architecture designed to combine multiple protocols onto a single physical interface, so that the total speed and performance of the USB4 Fabric can be dynamically shared. USB4 allows for USB data transfers to operate in parallel with other independent protocols specific to display, load/store and host-to-host interfaces. Additionally, USB4 extends performance beyond the 20 Gbps (Gen 2 x 2) of USB 3.2 to 40 Gbps (Gen 3 x 2) over the same dual-lane, dual-simplex architecture. This specification introduces the concept of protocol tunneling to USB bus architecture. Besides tunneling Enhanced SuperSpeed USB (USB3), display tunneling based on DisplayPort (DP) protocol and load/store tunneling based on PCI Express (PCIe) are defined. These protocol tunnels operate independently over the USB4 transport and physical layers. Additionally, USB4 allocates packets for bus configuration and management, and packe ts can be allocated specifically for host-to-host data connections.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值