天嵌 ARM开发社区

 找回密码
 注册
查看: 2807|回复: 3

请教:DM9000驱动中DM9000_rx函数的skb_put

[复制链接]
liyunkebeyond 发表于 2011-8-11 21:27:30 | 显示全部楼层 |阅读模式
910                    && ((skb = dev_alloc_skb(RxLen + 4)) != NULL)) {
911                          skb_reserve(skb, 2);
912                          rdptr = (u8 *) skb_put(skb, RxLen - 4);

我知道RxLen是帧数据区的大小,
请问各位:1:dev_alloc_skb为什么要分配 (RxLen + 4) 呢?
               2:skb_reserve中的第二个参数:`2`是不是为某协议头空间大小,是一个,还是二个?
               3: skb_put 又为什么只扩充数据区大小为 RxLen - 4 , 而不是 RxLen  ?


谢谢各位--------
 楼主| liyunkebeyond 发表于 2011-8-12 00:45:57 | 显示全部楼层
skb_reserve(skb, 2);    /*Note that before copying, the code
reserves two bytes to align the IP header to a 16-byte boundary

Like skb_reserve, these functions don't really add
any data to the buffer; they simply move the pointers to its head or tail. The new data is supposed to be copied explicitly by other functions.

以上这些是从understanding linux network internal 找的说明------

但还是搞不明白其它两个函数的参数,希望大家指教一下--------------
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号 )

GMT+8, 2024-4-27 21:57 , Processed in 1.046875 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表