当前位置: 首页 > news >正文

专业制作彩铃网站建设网站要准备什么

专业制作彩铃网站,建设网站要准备什么,网站开发环境搭建,青海海东住房和城乡建设局网站以下内容源于朱有鹏嵌入式课程的学习与整理#xff0c;如有侵权请告知删除。 参考 Linux总线设备驱动模型的理解 struct class 和 struct class_device 前言 这里说的“总线式”#xff0c;包括I2C总线等具体物理总线#xff0c;以及平台总线这个虚拟总线。 rootubuntu:/sy…以下内容源于朱有鹏嵌入式课程的学习与整理如有侵权请告知删除。 参考 Linux总线设备驱动模型的理解 struct class 和 struct class_device 前言 这里说的“总线式”包括I2C总线等具体物理总线以及平台总线这个虚拟总线。 rootubuntu:/sys# ls block bus class dev devices firmware fs hypervisor kernel module power rootubuntu:/sys# cd bus/ rootubuntu:/sys/bus# ls ac97 eisa isa pci_express sdio virtio acpi event_source machinecheck platform serio workqueue clockevents gameport mdio_bus pnp spi xen clocksource hid mmc rapidio usb xen-backend cpu i2c pci scsi usb-serial rootubuntu:/sys/bus# cd platform/ rootubuntu:/sys/bus/platform# ls devices drivers drivers_autoprobe drivers_probe uevent rootubuntu:/sys/bus/platform# cd ../i2c rootubuntu:/sys/bus/i2c# ls devices drivers drivers_autoprobe drivers_probe uevent rootubuntu:/sys/bus/i2c# 1、总线struct bus_type结构体 1物理上的真实总线及其作用 2驱动框架中的总线式设计 总线管理设备有一个设备链表和驱动有一个驱动链表它们通过名字来匹配。 3结构体struct bus_type 该结构体位于x210kernel/inclue/linux/device.h文件中。 struct bus_type {const char *name; //总线的名字struct bus_attribute *bus_attrs;struct device_attribute *dev_attrs;struct driver_attribute *drv_attrs;//match函数负责设备和驱动的匹配 int (*match)(struct device *dev, struct device_driver *drv);int (*uevent)(struct device *dev, struct kobj_uevent_env *env);int (*probe)(struct device *dev);int (*remove)(struct device *dev);void (*shutdown)(struct device *dev);int (*suspend)(struct device *dev, pm_message_t state);int (*resume)(struct device *dev);const struct dev_pm_ops *pm;struct bus_type_private *p; }; 2、设备struct device结构体 1结构体struct device是硬件设备在内核驱动框架中的抽象。 该结构体位于x210kernel/inclue/linux/device.h文件中。 struct device {struct device *parent;struct device_private *p;struct kobject kobj;const char *init_name; /* initial name of the device */struct device_type *type;struct mutex mutex; /* mutex to synchronize calls to* its driver.*/struct bus_type *bus; /* type of bus device is on */struct device_driver *driver; /* which driver has allocated thisdevice */void *platform_data; /* Platform specific data, devicecore doesnt touch it */struct dev_pm_info power;#ifdef CONFIG_NUMAint numa_node; /* NUMA node this device is close to */ #endifu64 *dma_mask; /* dma mask (if dmaable device) */u64 coherent_dma_mask;/* Like dma_mask, but foralloc_coherent mappings asnot all hardware supports64 bit addresses for consistentallocations such descriptors. */struct device_dma_parameters *dma_parms;struct list_head dma_pools; /* dma pools (if dmable) */struct dma_coherent_mem *dma_mem; /* internal for coherent memoverride *//* arch specific additions */struct dev_archdata archdata; #ifdef CONFIG_OFstruct device_node *of_node; #endifdev_t devt; /* dev_t, creates the sysfs dev */spinlock_t devres_lock;struct list_head devres_head;struct klist_node knode_class;struct class *class;const struct attribute_group **groups; /* optional groups */void (*release)(struct device *dev); }; 2device_register由内核开发者提供的框架提供用于向内核驱动框架注册一个设备。 3struct device通常被包含在一个具体设备结构体中。 比如struct usb_device struct usb_device {int devnum;char devpath[16];u32 route;enum usb_device_state state;enum usb_device_speed speed;struct usb_tt *tt;int ttport;unsigned int toggle[2];struct usb_device *parent;struct usb_bus *bus;struct usb_host_endpoint ep0;struct device dev;struct usb_device_descriptor descriptor;struct usb_host_config *config;struct usb_host_config *actconfig;struct usb_host_endpoint *ep_in[16];struct usb_host_endpoint *ep_out[16];char **rawdescriptors;unsigned short bus_mA;u8 portnum;u8 level;unsigned can_submit:1;unsigned persist_enabled:1;unsigned have_langid:1;unsigned authorized:1;unsigned authenticated:1;unsigned wusb:1;int string_langid;/* static strings from the device */char *product;char *manufacturer;char *serial;struct list_head filelist; #ifdef CONFIG_USB_DEVICE_CLASSstruct device *usb_classdev; #endif #ifdef CONFIG_USB_DEVICEFSstruct dentry *usbfs_dentry; #endifint maxchild;struct usb_device *children[USB_MAXCHILDREN];u32 quirks;atomic_t urbnum;unsigned long active_duration;#ifdef CONFIG_PMunsigned long last_busy;int autosuspend_delay;unsigned long connect_time;unsigned do_remote_wakeup:1;unsigned reset_resume:1; #endifstruct wusb_dev *wusb_dev;int slot_id; }; 比如 struct platform_device struct platform_device {const char * name;int id;struct device dev;//!!!!u32 num_resources;struct resource * resource;const struct platform_device_id *id_entry;/* arch specific additions */struct pdev_archdata archdata; }; 3、驱动struct device_driver结构体 1结构体struct device_driver是驱动程序在内核驱动框架中的抽象。 该结构体位于x210kernel/inclue/linux/device.h文件中。 struct device_driver {const char *name; //驱动程序的名字,被用来作为驱动和设备的匹配依据struct bus_type *bus;struct module *owner;const char *mod_name; /* used for built-in modules */bool suppress_bind_attrs; /* disables bind/unbind via sysfs */#if defined(CONFIG_OF)const struct of_device_id *of_match_table; #endif//驱动程序的探测函数用来检测某个设备是否可以被该驱动所管理//比如该设备是否正常、以及一些初始化。见参考微博的描述。int (*probe) (struct device *dev);int (*remove) (struct device *dev);void (*shutdown) (struct device *dev);int (*suspend) (struct device *dev, pm_message_t state);int (*resume) (struct device *dev);const struct attribute_group **groups;const struct dev_pm_ops *pm;struct driver_private *p; };2struct platform_driver的内容如下 struct platform_driver {int (*probe)(struct platform_device *);int (*remove)(struct platform_device *);void (*shutdown)(struct platform_device *);int (*suspend)(struct platform_device *, pm_message_t state);int (*resume)(struct platform_device *);struct device_driver driver;const struct platform_device_id *id_table; }; 4、类struct class结构体 1相关结构体struct class类 和 struct class_device类下面的某个设备 结构体struct class在x210kernel/inclue/linux/device.h文件中定义 struct class {const char *name;struct module *owner;struct class_attribute *class_attrs;struct device_attribute *dev_attrs;struct kobject *dev_kobj;int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env);char *(*devnode)(struct device *dev, mode_t *mode);void (*class_release)(struct class *class);void (*dev_release)(struct device *dev);int (*suspend)(struct device *dev, pm_message_t state);int (*resume)(struct device *dev);const struct kobj_ns_type_operations *ns_type;const void *(*namespace)(struct device *dev);const struct dev_pm_ops *pm;struct class_private *p; }; 结构体struct class_device该结构体好像已经不再使用了怎么查询不到的 2udev的使用离不开class。class的意义在于作为同属于一个class的多个设备的容器。也就是说class是一种人造概念目的就是为了对各种设备进行分类管理。当然class在分类的同时还对每个类贴上了一些“标签”这也是设备驱动模型为我们写驱动提供的基础设施。 5、总结模型即面向对象的思想 1模型其实就是面向对象的思想。 2这些模型里全是一些结构体套结构体因此对基本功要求很高。
http://www.huolong8.cn/news/479056/

相关文章:

  • 烟台网站建设多少钱视频推广方式
  • 做 在线观看免费网站郑州做网站加密的公司
  • 建设单位网站经费请示网站开发 弹窗
  • 如何上传ftp网站程序网站开发工作描述
  • 河南省城乡建设信息网南京谷歌优化
  • 网站建设的优势与不足淘宝关键词排名怎么查
  • 做网站都用什么工具宁波网站设计公司有几家
  • 做网站需要源码吗移动端网站建设的好处
  • 广告公司做的网站图片侵权企业营销网站的建设
  • 深圳网站见做网站怎么购买主机
  • 商城网站规划泉州网站公司建站
  • 杭州认证网站建设wordpress菜单栏菜单简介
  • 温州多语言网站建设泉州惠安网站建设
  • 各行各业网站建设网站备案密码重置
  • 网站的主机选择wordpress多站模式
  • 凡科怎么做网站秦皇岛市网站建设
  • 嘉兴品牌网站设计如何构建一个网站
  • 给网站做推广代理服务器地址是什么
  • iis7.5添加php网站小程序开发公司怎么选
  • wordpress企业网站教程婚庆公司一条龙一般多少钱
  • 广西城乡建设部网站国内好的crm系统
  • 教育类php开源网站广州网页设计制作
  • php手机网站开发工具wordpress后台密码
  • 外贸推广建站蓝颜seo牛正邦设计公司
  • 做网站运营需要有什么能力青海汽车网站建设
  • 百度ocpc怎么优化seo推广公司价格
  • 廊坊做网站多少钱徐州商城网站建设
  • 兼职做网站设计这么做输入文字的网站
  • 号网站开发河北企业自助建站
  • 做抽奖网站用什么cms自己如何建设个网站