linux kernel 工程师
全部博文(99)
发布时间:2014-03-17 16:58:23
static int __init i2c_dev_init(void){ int res; printk(KERN_INFO "i2c /dev entries driver\n"); /* 注册一个字符设备,为用户态程序访问i2c提供接口 */ res = register_chrdev(I2C_MAJOR, "i2c", &i2cdev_fops); if (res) goto out; /* 创建class, 在sys.........【阅读全文】
发布时间:2014-02-18 11:58:18
// family, 协议族,比如AF_INET// type, 比如SOCK_DGRAM, SOCK_DRAM// protocol, int __sock_create(struct net *net, int family, int type, int protocol, struct socket **res, int kern){ int err; struct socket *sock; // 这个socket结构最终赋值给res const struct ne.........【阅读全文】
发布时间:2014-02-17 16:01:19
1. e1000_probe 函数里面INIT_DELAYED_WORK(&adapter->watchdog_task, e1000_watchdog);初始化workqueue。2. 当需要更新link 状态时,使用schedule_delayed_work(&adapter->watchdog_task, 1);来调度watchdog_task3. e1000_watchdog 函数里面通过netif_carrier_on/netif_carrier_off 函数, 调.........【阅读全文】
发布时间:2014-02-17 15:41:04
// 如果长时间发送不出去,则报警// netdevice->watchdog_timer的初始化void dev_init_scheduler(struct net_device *dev){ dev->qdisc = &noop_qdisc; netdev_for_each_tx_queue(dev, dev_init_scheduler_queue, &noop_qdisc); if (dev_ingress_queue(dev)) dev_init_scheduler_qu.........【阅读全文】
发布时间:2014-02-14 10:40:48
dev_kfree_skb_any是一个释放skb的封装函数,它根据是否在irq环境下,决定直接释放skb还是等softirq去释放skbvoid dev_kfree_skb_irq(struct sk_buff *skb){ if (atomic_dec_and_test(&skb->users)) { struct softnet_data *sd; unsigned long flags; local_irq_save(.........【阅读全文】