首页 > 系统相关 >linux I2C驱动

linux I2C驱动

时间:2023-07-25 09:12:53浏览次数:32  
标签:i2c struct driver dev client linux 驱动 I2C ap3216c

1.linux IIC驱动 由于裸机的驱动迎合驱动的分离和分层的思想,分为IIC主机驱动(接口驱动)和IIC设备驱动. 这种思想的好处,请看我写的另外一篇文章Linux驱动的分离和分层。 其中上面说的裸机驱动请看这篇文章裸机驱动 但是裸机的驱动是没有加入操作系统的 本文也是遵循Linux驱动的分离和分层的思想,因此linux内核把IIC驱动分为两个部分IIC总线驱动和IIC设备驱动   总线驱动:SOC的IIC控制器驱动,也叫做IIC适配器驱动 设备驱动:IIC设备驱动就是针对具体的IIC设备而编写的驱动 1.1 I2C总线驱动 首先来看一下 I2C 总线,在讲 platform 的时候就说过,platform 是虚拟出来的一条总线,目的是为了实现总线、设备、驱动框架。想了解platform的知识,请看我这篇文章platform平台模型简述以及这篇文章platform总线 I2C 总线驱动重点是 I2C 适配器(也就是 SOC 的 I2C 接口控制器)驱动 I2C 总线驱动,或者说 I2C 适配器驱动的主要工作流程: 初始化 i2c_adapter 结构体变量, 然后设置i2c_algorithm中的master_xfer函数。 完成以后通过i2c_add_numbered_adapter或 i2c_add_adapter这两个函数向系统注册设置好的 i2c_adapter /* @ 定义在include/linux/i2c.h文件中 @ i2c_adapter 结构体  */ struct i2c_adapter {      struct module *owner;      unsigned int class;       /* classes to allow probing for */      const struct i2c_algorithm *algo; /* 总线访问算法 */      void *algo_data;        /* data fields that are valid for all devices   */      struct rt_mutex bus_lock;        int timeout;            /* in jiffies */      int retries;      struct device dev;      /* the adapter device */        int nr;      char name[48];      struct completion dev_released;        struct mutex userspace_clients_lock;      struct list_head userspace_clients;        struct i2c_bus_recovery_info *bus_recovery_info;      const struct i2c_adapter_quirks *quirks;  };    /* @ i2c_add_adapter 使用动态的总线号注册 @   而 i2c_add_numbered_adapter 使用静态总线号注册 @ adapter或adap   要添加到 Linux 内核中的 i2c_adapter,也就是I2C 适配器 @ 返回值:0,成功;负值,失败 */ int i2c_add_adapter(struct i2c_adapter *adapter)  int i2c_add_numbered_adapter(struct i2c_adapter *adap)    /* @ 删除I2C适配器的话使用 i2c_del_adapter函数 @ adap:要删除的 I2C 适配器 @ 返回值:无 */ void i2c_del_adapter(struct i2c_adapter * adap)      一般SOC的I2C 总线驱动都是由半导体厂商编写的。因此I2C 总线驱动对我们这些SOC 使用者来说是被屏蔽掉的,我们只要专注于 I2C设备驱动即可 1.2 I2C设备驱动 上面已经说了ic_adapter了,还剩下还剩下设备和驱动,i2c_client就是描述设备信息的,i2c_driver描述驱动内容,类似于 platform_driver。 i2c_client结构体   /* @ 描述设备信息 @ i2c_client 结构体  */ struct i2c_client {      unsigned short flags;          /* 标志             */      unsigned short addr;           /* 芯片地址,7 位,存在低 7 位  */  ......     char name[I2C_NAME_SIZE];       /* 名字           */      struct i2c_adapter *adapter;    /* 对应的 I2C 适配器       */      struct device dev;            /* 设备结构体         */      int irq;                      /* 中断             */      struct list_head detected;  ..  };    i2c_driver结构体   /* @ 定义在include/linux/i2c.h文件中 @   i2c_driver结构体  */ struct i2c_driver {      unsigned int class;        /* Notifies the driver that a new bus has appeared. You should        * avoid  using this, it will be removed in a near future.       */      int (*attach_adapter)(struct i2c_adapter *) __deprecated;        /* Standard driver model interfaces */      int (*probe)(struct i2c_client *, const struct i2c_device_id *);     int (*remove)(struct i2c_client *);        /* driver model interfaces that don't relate to enumeration  */      void (*shutdown)(struct i2c_client *);        /* Alert callback, for example for the SMBus alert protocol.       * The format and meaning of the data value depends on the        * protocol.For the SMBus alert protocol, there is a single bit       * of data passed  as the alert response's low bit ("event        flag"). */      void (*alert)(struct i2c_client *, unsigned int data);            /* a ioctl like command that can be used to perform specific        * functions with the device.       */      int (*command)(struct i2c_client *client, unsigned int cmd,   void *arg);          struct device_driver driver; /*如果使用设备树的话,需要设置 device_driver 的of_match_table成员变量,也就是驱动的兼容(compatible)属性*/     const struct i2c_device_id *id_table; /*id_table 是传统的、未使用设备树的设备匹配ID 表*/       /* Device detection callback for automatic device creation */      int (*detect)(struct i2c_client *, struct i2c_board_info *);      const unsigned short *address_list;      struct list_head clients;  };    有了上面的结构体,我们的目的就是1.构建2c_driver,2.向Linux内核注册这个i2c_driver /* @ i2c_driver注册函数为 int i2c_register_driver @ owner:一般为THIS_MODULE @ driver:要注册的 i2c_drive @ 返回值:0,成功;负值,失败 */ int i2c_register_driver(struct module *owner, struct i2c_driver *driver)  /* @ 将前面注册的 i2c_driver 从 Linux 内核中注销掉 @ driver:要注册的 i2c_drive @ 返回值:无 */ void i2c_del_driver(struct i2c_driver    *driver)    具体注册i2c_driver的注册流程: /* i2c 驱动的 probe 函数 */  static int xxx_probe(struct i2c_client *client,   const struct i2c_device_id *id)   {      /* 函数具体程序 */      /*标准字符设备驱动的那一套*/     return 0;   }      /* i2c 驱动的 remove 函数 */   static int xxx_remove(struct i2c_client *client)   {      /* 函数具体程序 */      return 0;   }      /* 传统匹配方式 ID 列表===无设备树的时候匹配 ID表 */   static const struct i2c_device_id xxx_id[] = {      {"xxx", 0},        {}   };      /* 设备树匹配列表====== */   static const struct of_device_id xxx_of_match[] = {      { .compatible = "xxx" },      { /* Sentinel */ }   };      /* i2c 驱动结构体 */    static struct i2c_driver xxx_driver = {      .probe = xxx_probe,      .remove = xxx_remove,      .driver = {              .owner = THIS_MODULE,              .name = "xxx",              .of_match_table = xxx_of_match,             },        .id_table = xxx_id,       };     /* 驱动入口函数 */   static int __init xxx_init(void)   {      int ret = 0;         ret = i2c_add_driver(&xxx_driver);      return ret;   }      /* 驱动出口函数 */   static void __exit xxx_exit(void)   {      i2c_del_driver(&xxx_driver);   }      module_init(xxx_init);   module_exit(xxx_exit);    2. 具体应用 上面bb了那么多,就是要说相比裸机驱动,由于Linux内核的介入,提供了很多供我们使用后的API,大大提高了效率和稳定性。 我们实际中,使用platfom驱动框架开开发I2C驱动。涉及到驱动、总线、设备模型。但是经过上面巴拉巴拉。我们只需要编写platform_driver. 这里要注意:设备信息从设备驱动中剥离开来。还是那句话”驱动的分离和分层思想“,这样涉及到是否使用到设备树(设备树给我们提供了方便,当然要用啦!) 2.1 设备信息描述 未使用设备树的时候   在未使用设备树的时候需要在 BSP 里面使用 i2c_board_info 结构体来描述一个具体的I2C 设备 /* @ i2c_board_info 结构体  */  struct i2c_board_info {       char        type[I2C_NAME_SIZE];    /* I2C 设备名字 */       unsigned short  flags;                /* 标志         */       unsigned short  addr;                 /* I2C 器件地址 */       void        *platform_data;                struct dev_archdata *archdata;       struct device_node *of_node;       struct fwnode_handle *fwnode;       int     irq;   };    在Linux 源码里面全局搜索i2c_board_info,你会找到大量以i2c_board_info 定义的I2C 设备信息,这些就是未使用设备树的时候I2C设备的描述方式,当采用了设备树以后就不会再使用i2c_board_info 来描述I2C 设备了 使用设备树的时候   使用设备树的时候 I2C 设备信息通过创建相应的节点就行了 打开 imx6ull-14x14-evk.dts 这个设备树文件   &i2c1 {         clock-frequency = <100000>;       pinctrl-names = "default";       pinctrl-0 = <&pinctrl_i2c1>;       status = "okay";          mag3110@0e { /*nodename@address of device*/          compatible = "fsl,mag3110"; /*用于匹配驱动*/          reg = <0x0e>; /*设置 mag3110 的器件地址*/          position = <2>;       };  ....   };    2.2 实例 此例子我们呢使用带有设备树描述设备信息的方式来编写platform_driver 修改设备树   1.修改 IO,AP3216C 用到了 I2C1 接口,打开imx6ull-alientek-emmc.dts文件 /* @ pinctrl_i2c1 子节点 ===用到了pinctrl系统 @ pinctrl_i2c1就是 I2C1 的IO 节点,这里将UART4_TXD 和UART4_RXD这两个IO分别复用为I2C1_SCL和I2C1_SDA,电气属性都设置为0x4001b8b0 */ pinctrl_i2c1: i2c1grp {       fsl,pins = <           MX6UL_PAD_UART4_TX_DATA__I2C1_SCL 0x4001b8b0           MX6UL_PAD_UART4_RX_DATA__I2C1_SDA 0x4001b8b0       >;   };    2.AP3216C 是连接到 I2C1上的,因此需要在 i2c1节点下添加ap3216c的设备子节点,在imx6ull-alientek-emmc.dts文件中找到i2c1节点 /* @ 添加 ap3216c 子节点以后的 i2c1 节点  */  &i2c1 {       clock-frequency = <100000>;       pinctrl-names = "default";       pinctrl-0 = <&pinctrl_i2c1>;       status = "okay";          ap3216c@1e {           compatible = "alientek,ap3216c";           reg = <0x1e>;       };   };    3.设备树修改完成以后使用“make dtbs”重新编译一下,然后使用新的设备树启动Linux内核。/sys/bus/i2c/devices 目录下存放着所有 I2C 设备,如果设备树修改正确的话,会在/sys/bus/i2c/devices目录下看到一个名为“0-001e”的子目录。说明修改成功 AP3216C驱动编写   #include <linux/types.h> #include <linux/kernel.h> #include <linux/delay.h> #include <linux/ide.h> #include <linux/init.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/gpio.h> #include <linux/cdev.h> #include <linux/device.h> #include <linux/of_gpio.h> #include <linux/semaphore.h> #include <linux/timer.h> #include <linux/i2c.h> #include <asm/mach/map.h> #include <asm/uaccess.h> #include <asm/io.h> #include "ap3216creg.h"   #define AP3216C_CNT 1 #define AP3216C_NAME "ap3216c"   struct ap3216c_dev { dev_t devid;/* 设备号 */ struct cdev cdev;/* cdev */ struct class *class;/* 类 */ struct device *device;/* 设备 */ struct device_node*nd; /* 设备节点 */ int major;/* 主设备号 */ void *private_data;/* 私有数据 */ unsigned short ir, als, ps;/* 三个光传感器数据 */ };   static struct ap3216c_dev ap3216cdev;   /*  * @description : 从ap3216c读取多个寄存器数据  * @param - dev:  ap3216c设备  * @param - reg:  要读取的寄存器首地址  * @param - val:  读取到的数据  * @param - len:  要读取的数据长度  * @return : 操作结果  */ static int ap3216c_read_regs(struct ap3216c_dev *dev, u8 reg, void *val, int len) { int ret; struct i2c_msg msg[2]; struct i2c_client *client = (struct i2c_client *)dev->private_data;   /* msg[0]为发送要读取的首地址 */ msg[0].addr = client->addr;/* ap3216c地址 */ msg[0].flags = 0;/* 标记为发送数据 */ msg[0].buf = &reg;/* 读取的首地址 */ msg[0].len = 1;/* reg长度*/   /* msg[1]读取数据 */ msg[1].addr = client->addr;/* ap3216c地址 */ msg[1].flags = I2C_M_RD;/* 标记为读取数据*/ msg[1].buf = val;/* 读取数据缓冲区 */ msg[1].len = len;/* 要读取的数据长度*/   ret = i2c_transfer(client->adapter, msg, 2); if(ret == 2) { ret = 0; } else { printk("i2c rd failed=%d reg=%06x len=%d\n",ret, reg, len); ret = -EREMOTEIO; } return ret; }   /*  * @description : 向ap3216c多个寄存器写入数据  * @param - dev:  ap3216c设备  * @param - reg:  要写入的寄存器首地址  * @param - val:  要写入的数据缓冲区  * @param - len:  要写入的数据长度  * @return   :   操作结果  */ static s32 ap3216c_write_regs(struct ap3216c_dev *dev, u8 reg, u8 *buf, u8 len) { u8 b[256]; struct i2c_msg msg; struct i2c_client *client = (struct i2c_client *)dev->private_data;   b[0] = reg;/* 寄存器首地址 */ memcpy(&b[1],buf,len);/* 将要写入的数据拷贝到数组b里面 */   msg.addr = client->addr;/* ap3216c地址 */ msg.flags = 0;/* 标记为写数据 */   msg.buf = b;/* 要写入的数据缓冲区 */ msg.len = len + 1;/* 要写入的数据长度 */   return i2c_transfer(client->adapter, &msg, 1); }   /*  * @description : 读取ap3216c指定寄存器值,读取一个寄存器  * @param - dev:  ap3216c设备  * @param - reg:  要读取的寄存器  * @return   :   读取到的寄存器值  */ static unsigned char ap3216c_read_reg(struct ap3216c_dev *dev, u8 reg) { u8 data = 0;   ap3216c_read_regs(dev, reg, &data, 1); return data;   #if 0 struct i2c_client *client = (struct i2c_client *)dev->private_data; return i2c_smbus_read_byte_data(client, reg); #endif }   /*  * @description : 向ap3216c指定寄存器写入指定的值,写一个寄存器  * @param - dev:  ap3216c设备  * @param - reg:  要写的寄存器  * @param - data: 要写入的值  * @return   :    无  */ static void ap3216c_write_reg(struct ap3216c_dev *dev, u8 reg, u8 data) { u8 buf = 0; buf = data; ap3216c_write_regs(dev, reg, &buf, 1); }   /*  * @description : 读取AP3216C的数据,读取原始数据,包括ALS,PS和IR, 注意!  * : 如果同时打开ALS,IR+PS的话两次数据读取的时间间隔要大于112.5ms  * @param - ir : ir数据  * @param - ps : ps数据  * @param - ps : als数据   * @return : 无。  */ void ap3216c_readdata(struct ap3216c_dev *dev) { unsigned char i =0;     unsigned char buf[6];   /* 循环读取所有传感器数据 */     for(i = 0; i < 6; i++)     {         buf[i] = ap3216c_read_reg(dev, AP3216C_IRDATALOW + i);     }       if(buf[0] & 0X80) /* IR_OF位为1,则数据无效 */ dev->ir = 0; else /* 读取IR传感器的数据   */ dev->ir = ((unsigned short)buf[1] << 2) | (buf[0] & 0X03);   dev->als = ((unsigned short)buf[3] << 8) | buf[2];/* 读取ALS传感器的数据 */         if(buf[4] & 0x40) /* IR_OF位为1,则数据无效 */ dev->ps = 0;    else /* 读取PS传感器的数据    */ dev->ps = ((unsigned short)(buf[5] & 0X3F) << 4) | (buf[4] & 0X0F);  }   /*  * @description : 打开设备  * @param - inode : 传递给驱动的inode  * @param - filp : 设备文件,file结构体有个叫做private_data的成员变量  *   一般在open的时候将private_data指向设备结构体。  * @return : 0 成功;其他 失败  */ static int ap3216c_open(struct inode *inode, struct file *filp) { filp->private_data = &ap3216cdev;   /* 初始化AP3216C */ ap3216c_write_reg(&ap3216cdev, AP3216C_SYSTEMCONG, 0x04);/* 复位AP3216C */ mdelay(50);/* AP3216C复位最少10ms */ ap3216c_write_reg(&ap3216cdev, AP3216C_SYSTEMCONG, 0X03);/* 开启ALS、PS+IR */ return 0; }   /*  * @description : 从设备读取数据   * @param - filp : 要打开的设备文件(文件描述符)  * @param - buf : 返回给用户空间的数据缓冲区  * @param - cnt : 要读取的数据长度  * @param - offt : 相对于文件首地址的偏移  * @return : 读取的字节数,如果为负值,表示读取失败  */ static ssize_t ap3216c_read(struct file *filp, char __user *buf, size_t cnt, loff_t *off) { short data[3]; long err = 0;   struct ap3216c_dev *dev = (struct ap3216c_dev *)filp->private_data;   ap3216c_readdata(dev);   data[0] = dev->ir; data[1] = dev->als; data[2] = dev->ps; err = copy_to_user(buf, data, sizeof(data)); return 0; }   /*  * @description : 关闭/释放设备  * @param - filp : 要关闭的设备文件(文件描述符)  * @return : 0 成功;其他 失败  */ static int ap3216c_release(struct inode *inode, struct file *filp) { return 0; }   /* AP3216C操作函数 */ static const struct file_operations ap3216c_ops = { .owner = THIS_MODULE, .open = ap3216c_open, .read = ap3216c_read, .release = ap3216c_release, };    /*   * @description     : i2c驱动的probe函数,当驱动与   *                    设备匹配以后此函数就会执行   * @param - client  : i2c设备   * @param - id      : i2c设备ID   * @return          : 0,成功;其他负值,失败   */ static int ap3216c_probe(struct i2c_client *client, const struct i2c_device_id *id) { /* 1、构建设备号 */ if (ap3216cdev.major) { ap3216cdev.devid = MKDEV(ap3216cdev.major, 0); register_chrdev_region(ap3216cdev.devid, AP3216C_CNT, AP3216C_NAME); } else { alloc_chrdev_region(&ap3216cdev.devid, 0, AP3216C_CNT, AP3216C_NAME); ap3216cdev.major = MAJOR(ap3216cdev.devid); }   /* 2、注册设备 */ cdev_init(&ap3216cdev.cdev, &ap3216c_ops); cdev_add(&ap3216cdev.cdev, ap3216cdev.devid, AP3216C_CNT);   /* 3、创建类 */ ap3216cdev.class = class_create(THIS_MODULE, AP3216C_NAME); if (IS_ERR(ap3216cdev.class)) { return PTR_ERR(ap3216cdev.class); }   /* 4、创建设备 */ ap3216cdev.device = device_create(ap3216cdev.class, NULL, ap3216cdev.devid, NULL, AP3216C_NAME); if (IS_ERR(ap3216cdev.device)) { return PTR_ERR(ap3216cdev.device); }   ap3216cdev.private_data = client;   return 0; }   /*  * @description     : i2c驱动的remove函数,移除i2c驱动的时候此函数会执行  * @param - client : i2c设备  * @return          : 0,成功;其他负值,失败  */ static int ap3216c_remove(struct i2c_client *client) { /* 删除设备 */ cdev_del(&ap3216cdev.cdev); unregister_chrdev_region(ap3216cdev.devid, AP3216C_CNT);   /* 注销掉类和设备 */ device_destroy(ap3216cdev.class, ap3216cdev.devid); class_destroy(ap3216cdev.class); return 0; }   /* 传统匹配方式ID列表 */ static const struct i2c_device_id ap3216c_id[] = { {"alientek,ap3216c", 0},   {} };   /* 设备树匹配列表 */ static const struct of_device_id ap3216c_of_match[] = { { .compatible = "alientek,ap3216c" }, { /* Sentinel */ } };   /* i2c驱动结构体 */ static struct i2c_driver ap3216c_driver = { .probe = ap3216c_probe, .remove = ap3216c_remove, .driver = { .owner = THIS_MODULE,    .name = "ap3216c",    .of_match_table = ap3216c_of_match,     }, .id_table = ap3216c_id, };     /*  * @description : 驱动入口函数  * @param : 无  * @return : 无  */ static int __init ap3216c_init(void) { int ret = 0;   ret = i2c_add_driver(&ap3216c_driver); return ret; }   /*  * @description : 驱动出口函数  * @param : 无  * @return : 无  */ static void __exit ap3216c_exit(void) { i2c_del_driver(&ap3216c_driver); }   /* module_i2c_driver(ap3216c_driver) */   module_init(ap3216c_init); module_exit(ap3216c_exit); MODULE_LICENSE("GPL"); MODULE_AUTHOR("zuozhongkai");     测试app编写   #include "stdio.h" #include "unistd.h" #include "sys/types.h" #include "sys/stat.h" #include "sys/ioctl.h" #include "fcntl.h" #include "stdlib.h" #include "string.h" #include <poll.h> #include <sys/select.h> #include <sys/time.h> #include <signal.h> #include <fcntl.h>   /*  * @description : main主程序  * @param - argc : argv数组元素个数  * @param - argv : 具体参数  * @return : 0 成功;其他 失败  */ int main(int argc, char *argv[]) { int fd; char *filename; unsigned short databuf[3]; unsigned short ir, als, ps; int ret = 0;   if (argc != 2) { printf("Error Usage!\r\n"); return -1; }   filename = argv[1]; fd = open(filename, O_RDWR); if(fd < 0) { printf("can't open file %s\r\n", filename); return -1; }   while (1) { ret = read(fd, databuf, sizeof(databuf)); if(ret == 0) { /* 数据读取成功 */ ir =  databuf[0]; /* ir传感器数据 */ als = databuf[1]; /* als传感器数据 */ ps =  databuf[2]; /* ps传感器数据 */ printf("ir = %d, als = %d, ps = %d\r\n", ir, als, ps); } usleep(200000); /*100ms */ } close(fd);/* 关闭文件 */ return 0; }    

标签:i2c,struct,driver,dev,client,linux,驱动,I2C,ap3216c
From: https://www.cnblogs.com/kn-zheng/p/17578831.html

相关文章

  • 4 STM32MP1 Linux系统启动过程
    1.ROM代码  这是ST官方写的代码,在STM32MP1出厂时就已经烧录进去,不能被修改。ROM代码是上电以后首先执行的程序,它的主要工作就是读取STM32MP1的BOOT引脚电平,然后根据电平来判断当前启动设备,最后从选定的启动设备里面读取FSBL代码,将FSBL代码放在对应的RAM空间。  STM32MP1启......
  • 一分钟学一个 Linux 命令 - rm
    前言大家好,我是god23bin,欢迎回到咱们的《一分钟学一个Linux命令》系列,今天我要讲的是一个比较危险的命令,rm命令,没错,你可以没听过rm命令,但是删库跑路你不可能没听过吧?什么?没听过,没事,现在你就听过了,我刚刚已经讲了,哈哈哈。好了,废话不多说,现在开始吧!什么是rm?rm是单词rem......
  • linux 中 grep命令精准匹配制表符
     001、[root@PC1test02]#lsa.txt[root@PC1test02]#cata.txt##测试数据321971225792194632197622553381184532197222609449473219872253144109......
  • Linux那些查看或统计网卡流量的几种方式
    iftop是类似于top的实时流量监控工具,主要用来显示本机网络流量情况以及各个相互通信的流量集合,可以用来监控网卡的实时流量。 iftop的输出从整体上可以分为三大部分:iftop输出中最上面的一行,此行信息是流量刻度,用于显示网卡带宽流量。iftop输出中最大的一个部分,此部分又分......
  • 适用于Android手机的Debian GNU/Linux和Windows兼容环境
    Github地址:https://github.com/jinshulumengchuang/Debian-Wine-Android食用方法:从github下载release安装得到的apk文件把tarball放在内部存储的根目录给termux存储权限打开termux输入:cd..;tarxvf/sdcard/rootfs.tar.xz回车等候指令执行完成.($符号重新出现)......
  • linux下载安装fastdfs和fastdfs与nginx整合、springboot访问fastdfs
    文章目录需求分析分布式文件系统1FastDFS安装FastDFS和nginx整合2.整合java访问fastdfs服务文件上传查询下载测试整合springboot需求分析搭建fastDFS文件服务器1)安装fastDFStracker和storage2)在storageserver上安装nginx在storageserver上安装nginx的目的是对外通过http访问......
  • 关于菜鸡学习RHEL8的一些小笔记--->linux上的ssh远程
    远程:*在日常使用中,windows系统可以使用远程桌面来管理远程的windows操作系统*而在Linux上,可以使用openssh套件来进行管理(默认安装)在openssh上是使用安全加密的套接字通信方式openssh:openssh是一个典型的C/S架构,同时拥有openssh-clent客户端以及openssh-server服务端,如下所示:通过ssh......
  • 15个实用的Linux find命令示例
    译文出处:oschina-青崖白鹿。欢迎加入技术翻译小组。<!--divid="ad1"><scripttype="text/javascript">google_ad_client="ca-pub-7056282119617872";google_ad_slot="6645040531";google_ad_width=300;google_ad_height=250......
  • Linux 网络收包流程
    哈喽大家好,我是咸鱼我们在跟别人网上聊天的时候,有没有想过你发送的信息是怎么传到对方的电脑上的又或者我们在上网冲浪的时候,有没有想过HTML页面是怎么显示在我们的电脑屏幕上的无论是我们跟别人聊天还是上网冲浪,其实都依靠于计算机网络这项技术计算机网络是指将多台计算机......
  • Linux系列---【Aerospike的介绍】
    Aerospike的介绍工作模式默认:混合闪存,支持HDD(机械硬盘)和SSD(固态硬盘),推荐SSD,性能好。......