易截截图软件、单文件、免安装、纯绿色、仅160KB

Linux内核设备模型(5)

译者:郭少悲
2009/12/02
原文:linux/Documentation/driver-model/device.txt
基本的设备数据结构
~~~~~~~~~~~~~~~~~~
struct device {
        struct list_head g_list;
        struct list_head node;
        struct list_head bus_list;
        struct list_head driver_list;
        struct list_head intf_list;
        struct list_head children;
        struct device   * parent;
        char    name[DEVICE_NAME_SIZE];
        char    bus_id[BUS_ID_SIZE];
        spinlock_t      lock;
        atomic_t        refcount;
        struct bus_type * bus;
        struct driver_dir_entry dir;
    u32        class_num;
        struct device_driver *driver;
        void            *driver_data;
        void            *platform_data;
        u32             current_state;
        unsigned char *saved_state;
        void    (*release)(struct device * dev);
};

~~
g_list:    全局设备链表中的节点。
node: 设备的父亲的孩子链表中的节点(父子关系是树结构中的常用关系)。
bus_


相关文档:

实战Linux Bluetooth编程(三) HCI层编程

1. HCI层协议概述:
HCI提供一套统一的方法来访问Bluetooth底层。如图所示:
从图上可以看出,Host Controller Interface(HCI)  就是用来沟通Host和Module。Host通常就是PC, Module则是以各种物理连接形式(USB,serial,pc-card等)连接到PC上的bluetooth Dongle。
在Host这一端:application,SDP,L2cap等协议 ......

实战Linux Bluetooth编程 (七) SDP协议

Service Discovery Protocol(SDP)提供一种能力,让应用程序有方法发现哪种服务可用以及这种服务的特性。
服务发现协议(SDP或Bluetooth SDP)在蓝牙协议栈中对蓝牙环境中的应用程序有特殊的含意,发现哪个服务是可用的和确定这些可用服务的特征。SDP定义了bluetooth client发现可用bluetooth server服务和它们的特征的方法。 ......

linux 定时器使用一

#include <sys/time.h>
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
static char *runStatusFile   = "/syscfg/etc/runStatusFile";
//static char *runStatusFile   = "runStatusFile";
FILE *pFile = NULL;
char runCou ......

linux定时执行,脚本问题解决汇总

#!/bin/bash
yesterday=`date -d -1days "+%Y%m%d"`
 
cd /home/www/zdyzlog/
zgrep -P '.*CopyRightId\[A00009042202\].*实时策略开始.*'  /home/appusr/resin-3.0.18/log/log4j_daily_drmThreeWebService.log.$yesterday.gz  >> /home/www/zdyzlog/zhongduancelivkaishi_$yesterday.txt
zgr ......

linux下写程序检测ip冲突(ARP)

原理其实很简单,那就是广播一个arp包,然后recv,如果没有数据(这里要设置延时),那么说明这个ip是可用的,否则就检测这个数据是否为回复我们发出的arp的应答包.如果是则证明ip已被使用,否则继续等待.
这里可以看下busybox的dhcp中的检测程序。
networking/udhcp/arpping.c
C代码
/* vi: set sw=4 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号