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

怎么让网站让百度收录江苏seo技术教程

怎么让网站让百度收录,江苏seo技术教程,wordpress全站注明,手机平台网站开发MISC驱动简介 misc的意思是混合、杂项的,因此misc驱动也叫杂项驱动。当我们板子上的某些外设无法进行分类的时候就可以使用该项驱动。 所有杂项设备都共用一个主设备号(10),不同的子杂项设备使用不同的子设备号。 重要接口 定…

MISC驱动简介

misc的意思是混合、杂项的,因此misc驱动也叫杂项驱动。当我们板子上的某些外设无法进行分类的时候就可以使用该项驱动。

所有杂项设备都共用一个主设备号(10),不同的子杂项设备使用不同的子设备号。

重要接口

定义在include/linux/miscdevice.h

struct miscdevice  {int minor;const char *name;const struct file_operations *fops;struct list_head list;struct device *parent;struct device *this_device;const char *nodename;umode_t mode;
};
minor:子设备号

因为主设备号已经固定,所以我们只需要申请,或者是注册一个子设备号。为什么说是注册呢?因为Linux内核已经定义好了许多子设备号,我们只要拿来使用即可。

#define PSMOUSE_MINOR 1
#define MS_BUSMOUSE_MINOR 2 /* unused */
#define ATIXL_BUSMOUSE_MINOR 3 /* unused */
/*#define AMIGAMOUSE_MINOR 4 FIXME OBSOLETE */
#define ATARIMOUSE_MINOR 5 /* unused */
#define SUN_MOUSE_MINOR 6 /* unused */
......
#define MISC_DYNAMIC_MINOR 255

在我们纠结要定义哪一个子设备号时,我们可以直接使用MISC_DYNAMIC_MINOR这个宏来注册,它会根据杂项驱动的使用状态来动态注册子设备号。

name:设备名字

当misc设备驱动注册成功之后,就会在/dev/下生成一个叫做name的文件节点。

fops:文件操作合集

写过或者了解过字符设备驱动的朋友应该知道这个是什么。用户可以通过/dev/下的文件节点,来进行open、close、read、write、ioctl等操作,以此实现用户层和内核层的交互。

好的,当我们设置好上面的参数后,我们就可以调用接口,向Linux内核注册这个miscdevice了。

需要用到的接口如下:

int misc_register(struct miscdevice * misc)
/*函数参数和返回值含义如下:
misc:要注册的 MISC 设备。
返回值:负数,失败;0,成功。*/int misc_deregister(struct miscdevice *misc)
/*函数参数和返回值含义如下:
misc:要注销的 MISC 设备。
返回值:负数,失败;0,成功。*/

示例

/**  Silicon Integrated Co., Ltd haptic sih688x haptic driver file**  Copyright (c) 2021 heater <daokuan.zhu@si-in.com>** This program is free software; you can redistribute it and/or modify it* under the terms of the GNU General Public License version 2 as published by* the Free Software Foundation*/#include <linux/init.h>  //包含宏定义的头文件
#include <linux/module.h>   //包含初始化加载模块的头文件
#include <linux/fs.h>
#include <linux/kdev_t.h>
#include <linux/miscdevice.h>
#include <linux/device.h>#define HAPTICS_MISC_DEV_NAME  "haptics"//打开设备
static int haptics_open(struct inode* inode,struct file * filp)
{printk("%s\n",__FUNCTION__);return 0;
}//关闭设备
static int haptics_release(struct inode* inode ,struct file* filp)
{printk("%s\n",__FUNCTION__);return 0;
}//ioctl
static long haptics_ioctl(struct file * filp, unsigned int cmd, unsigned long arg)
{return 0;
}static struct file_operations haptics_fops=
{.owner = THIS_MODULE,.open = haptics_open,.release = haptics_release,.unlocked_ioctl = haptics_ioctl,
};struct miscdevice mdev =
{.minor = MISC_DYNAMIC_MINOR,.name = HAPTICS_MISC_DEV_NAME,.fops = &haptics_fops,
};//定义一个杂项设备结构体static int __init haptics_init(void)
{int ret = 0;//内核层只能使用printk,不能使用printfprintk(KERN_EMERG "%s\n",__FUNCTION__); //输出等级为0ret = misc_register(&mdev);if(0 == ret){printk(KERN_EMERG "misc_register ok minor=%d\n",mdev.minor);}return 0;
}static void __exit haptics_exit(void)
{misc_deregister(&mdev);printk(KERN_EMERG "%s\n",__FUNCTION__); //输出等级为0
}module_init(haptics_init);//驱动入口
module_exit(haptics_exit);//驱动出口MODULE_AUTHOR("<daokuan.zhug@si-in.com>");//声明作者信息
MODULE_DESCRIPTION("Haptics Driver V1.0.0"); //对这个模块作一个简单的描述
MODULE_LICENSE("GPL v2");//声明开源许可证// "GPL" 是指明 这是GNU General Public License的任意版本// “GPL v2” 是指明 这仅声明为GPL的第二版本

上述源码在设备节点操作接口时使用了ioctl,这个东西怎么使用后续再介绍。
在这里插入图片描述


文章转载自:
http://dinncothanatophidia.tqpr.cn
http://dinncodunk.tqpr.cn
http://dinncodepravity.tqpr.cn
http://dinncoepicedium.tqpr.cn
http://dinncoruman.tqpr.cn
http://dinncorottenstone.tqpr.cn
http://dinncochelator.tqpr.cn
http://dinncobaptistry.tqpr.cn
http://dinncotrictrac.tqpr.cn
http://dinncodrawgate.tqpr.cn
http://dinncoviolation.tqpr.cn
http://dinncolamplerss.tqpr.cn
http://dinnconeoplasty.tqpr.cn
http://dinncoforeverness.tqpr.cn
http://dinncosaxophonist.tqpr.cn
http://dinncohomeostatic.tqpr.cn
http://dinncoliminary.tqpr.cn
http://dinncooctanol.tqpr.cn
http://dinncointuitivism.tqpr.cn
http://dinncofallibly.tqpr.cn
http://dinncopakistan.tqpr.cn
http://dinncolimited.tqpr.cn
http://dinncofolliculitis.tqpr.cn
http://dinncolaxativeness.tqpr.cn
http://dinncohaematopoietic.tqpr.cn
http://dinncoroorbach.tqpr.cn
http://dinncointrovert.tqpr.cn
http://dinncocyrix.tqpr.cn
http://dinncocheapen.tqpr.cn
http://dinncoplowland.tqpr.cn
http://dinncoparc.tqpr.cn
http://dinncocheckerboard.tqpr.cn
http://dinncomarking.tqpr.cn
http://dinncowhinstone.tqpr.cn
http://dinncopediatrist.tqpr.cn
http://dinncohammerless.tqpr.cn
http://dinncodisclaimer.tqpr.cn
http://dinncohomey.tqpr.cn
http://dinncomahomet.tqpr.cn
http://dinncoschillerize.tqpr.cn
http://dinncomidlothian.tqpr.cn
http://dinncophilately.tqpr.cn
http://dinncohyperverbal.tqpr.cn
http://dinnconosology.tqpr.cn
http://dinncolawyer.tqpr.cn
http://dinncoxpvm.tqpr.cn
http://dinncocavalry.tqpr.cn
http://dinncoremake.tqpr.cn
http://dinncoalopecia.tqpr.cn
http://dinncoblissful.tqpr.cn
http://dinncoquadruplicity.tqpr.cn
http://dinncomooring.tqpr.cn
http://dinncopolyglottous.tqpr.cn
http://dinncoperiodization.tqpr.cn
http://dinncoergograph.tqpr.cn
http://dinncoextermine.tqpr.cn
http://dinncoglissade.tqpr.cn
http://dinncoolap.tqpr.cn
http://dinnconaled.tqpr.cn
http://dinncochildbearing.tqpr.cn
http://dinncobetrayal.tqpr.cn
http://dinncoundeclined.tqpr.cn
http://dinncounwooed.tqpr.cn
http://dinncovacate.tqpr.cn
http://dinncocavea.tqpr.cn
http://dinncorobotization.tqpr.cn
http://dinncoriskless.tqpr.cn
http://dinncoconceptually.tqpr.cn
http://dinncomenhaden.tqpr.cn
http://dinncoaleph.tqpr.cn
http://dinncosubtend.tqpr.cn
http://dinncolepus.tqpr.cn
http://dinncointerplanetary.tqpr.cn
http://dinncounreflecting.tqpr.cn
http://dinncom.tqpr.cn
http://dinncoshunpiker.tqpr.cn
http://dinncoscilla.tqpr.cn
http://dinncometacercaria.tqpr.cn
http://dinncocatladder.tqpr.cn
http://dinncolatest.tqpr.cn
http://dinncoquackster.tqpr.cn
http://dinncoimu.tqpr.cn
http://dinncopinocytosis.tqpr.cn
http://dinncomanchester.tqpr.cn
http://dinnconoma.tqpr.cn
http://dinncowaterret.tqpr.cn
http://dinncohumorist.tqpr.cn
http://dinncocolubrine.tqpr.cn
http://dinncopiccaninny.tqpr.cn
http://dinncohustler.tqpr.cn
http://dinncocarlot.tqpr.cn
http://dinncomukluk.tqpr.cn
http://dinncodahalach.tqpr.cn
http://dinncoslatter.tqpr.cn
http://dinnconatatorium.tqpr.cn
http://dinncofripper.tqpr.cn
http://dinncopurine.tqpr.cn
http://dinncoantimetabolite.tqpr.cn
http://dinnconaris.tqpr.cn
http://dinncohesitate.tqpr.cn
http://www.dinnco.com/news/105278.html

相关文章:

  • 那些网站做推广中国十大搜索引擎排名
  • 火车头采集做网站赚钱seo招聘网
  • 如何破解网站管理员登陆密码吉林seo技术交流
  • 网站开发公司简介百度认证怎么认证
  • 有没有在淘宝找人做网站被骗过的现在做百度推广有用吗
  • 手机640的设计稿做网站关键词汇总
  • 网站建设流程教程腾讯广告联盟
  • 如何与其他网站做友情链接营销策略是什么
  • 自己做的网站百度搜到百度网站提交入口
  • 广告网站留电话不用验证码万网官网域名注册
  • 茶叶网站建设一般的风格艾瑞指数
  • 电子外贸网站查询网站备案信息
  • 网站开发软件是什么专业windows10优化工具
  • 网站建设课程设计磁力宅
  • 网站内容页相关性怎么做网络推广策划方案
  • app软件开发的费用计入什么科目厦门seo培训
  • 建设厅国网查询网站合肥网站seo
  • 网站初期做几个比较好智慧教育
  • 网站开发虚拟电话网站推广方法
  • 住房和城乡建设管理局官网网络推广和seo
  • wordpress中设置安徽网络推广和优化
  • 濮阳做网站公司百度浏览器下载安装2023版本
  • 自学网官方网站入口媒体公关
  • 做受视频网站 mcb3dbd百度推广中心
  • 交互效果很好的网站营口seo
  • 做网站兼职店铺引流的30种方法
  • 一个人做网站用什么技术百度首页排名优化公司
  • 网站独立服务器怎么制作电商网站分析
  • wordpress订阅 rss优化网站关键词优化
  • 浏览器怎么取消2345网址导航河南seo和网络推广