当前位置:   article > 正文

usb-skeleton.c 之 15--- usb_class_driver_usb_class_drver

usb_class_drver

*************************************************************

/*
 * usb class driver info in order to get a minor number from the usb core,
 * and to have the device registered with the driver core
 */    **usb 类驱动 信息 使我们 能 从usb core  usb核  得到一个次 设备

        **从而可以 使 设备被 注册 到 驱动内核中
static struct usb_class_driver skel_class = {
    .name =        "skel%d",
    .fops =        &skel_fops,
    .minor_base =    USB_SKEL_MINOR_BASE,    **开始的此设备号
};

 

对于字符设备而言,usb_class_driver 结构体的fops成员中的write read  ioctl等 函数的地位完全等于 详解 第6章 中的 file_operations

如果是其他类型的设备,如tty设备,则调用对应设备的注册函数

*************************************************************

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/246905
推荐阅读
相关标签
  

闽ICP备14008679号