`
suoyihen
  • 浏览: 1358878 次
文章分类
社区版块
存档分类
最新评论

ARM-Linux驱动--DM9000网卡驱动分析(一)

 
阅读更多
<style type="text/css"> <!-- @page { margin: 0.79in } P { margin-bottom: 0.08in } PRE.cjk { font-family: "AR PL UMing HK", monospace } A:link { so-language: zxx } --> </style>

硬件平台:FL2440s3c2440

内核版本:2.6.35

主机平台:Ubuntu11.04

内核版本:2.6.39

原创作品,转载请标明出处http://blog.csdn.net/yming0221/article/details/6609742

1、下图是DM9000的引脚图

2、这里我们结合具体的开发板FL2440

下面是FL2440DM9000的引脚链接图

本人移植DM9000的时候将设备的资源定义放在了arch/arm/plat-s3c24xx/devs.c中,详情点击上一篇博文linux内核移植-移植2.6.35.4内核到s3c2440

下面是设备的资源定义

这里可以看到,DM9000网卡使用的地址空间资源在nGCS4地址区域,所以上图的DM9000地址使能引脚连接nGCS4引脚。中断使用的是EINT7外部中断。

接着定义平台数据和平台设备,代码如下:

最后导出函数符号,保存函数地址和名称

3、设备启动的初始化过程

而后会执行下面函数

下面是具体的设备列表

这样系统启动时,会给设备列表中的设备分配资源(地址资源和中断资源等)。

4、信息传输中的信息封装结构

4.1、sk_buff结构,定义在include/linux/skbuff.h

元素的含义如下(摘自内核,源码,版本2.6.35.4
*struct sk_buff - socket buffer
* @next: Next buffer inlist
* @prev: Previous buffer in list
* @sk: Socketwe are owned by
* @tstamp: Time we arrived
* @dev:Device we arrived on/are leaving by
* @transport_header:Transport layer header
* @network_header: Network layerheader
* @mac_header: Link layer header
*@_skb_refdst: destination entry (with norefcount bit)
* @sp:the security path, used for xfrm
* @cb: Control buffer. Freefor use by every layer. Put private vars here
* @len: Lengthof actual data
* @data_len: Data length
* @mac_len:Length of link layer header
* @hdr_len: writable headerlength of cloned skb
* @csum: Checksum (must includestart/offset pair)
* @csum_start: Offset from skb->headwhere checksumming should start
* @csum_offset: Offset fromcsum_start where checksum should be stored
* @local_df:allow local fragmentation
* @cloned: Head may be cloned(check refcnt to be sure)
* @nohdr: Payload reference only,must not modify header
* @pkt_type: Packet class
*@fclone: skbuff clone status
* @ip_summed: Driver fed us anIP checksum
* @priority: Packet queueing priority
*@users: User count - see {datagram,tcp}.c
* @protocol:Packet protocol from driver
* @truesize: Buffer size
*@head: Head of buffer
* @data: Data head pointer
*@tail: Tail pointer
* @end: End pointer
*@destructor: Destruct function
* @mark: Generic packetmark
* @nfct: Associated connection, if any
*@ipvs_property: skbuff is owned by ipvs
* @peeked: thispacket has been seen already, so stats have been
* done forit, don't do them again
* @nf_trace: netfilter packet traceflag
* @nfctinfo: Relationship of this skb to theconnection
* @nfct_reasm: netfilter conntrack re-assemblypointer
* @nf_bridge: Saved data about a bridged frame - seebr_netfilter.c
* @skb_iif: ifindex of device we arrivedon
* @rxhash: the packet hash computed on receive
*@queue_mapping: Queue mapping for multiqueue devices
*@tc_index: Traffic control index
* @tc_verd: traffic controlverdict
* @ndisc_nodetype: router type (from link layer)
*@dma_cookie: a cookie to one of several possible DMA operations
*done by skb DMA functions
* @secmark: security marking
*@vlan_tci: vlan tag control information

关于sk_buff的更多分析见另一篇转载的博文http://blog.csdn.net/yming0221/article/details/6609734

4.2、net_device

关于net_device一个非常庞大的结构体,定义在/inlcude/linux/netdevice.h中

如下:

我还没有细细的分析这个结构体,驱动程序在probe函数中使用register_netdev()注册该结构体指明的设备,将内核操作硬件的函数个内核联系起来。

更多见下一节分析ARM-Linux驱动--DM9000网卡驱动分析(二)


分享到:
评论

相关推荐

    dm9000网卡驱动程序分析

    arm9开发板上 dm9000网卡驱动程序分析

    dm9000网卡驱动

    linux dm9000网卡完全驱动 实现基本的网络通信经过大量测试 适合移植使用

    基于ARM_LINUX的多功能视频监控系统研究与实现.caj

    研究分析了Linux内核中经典的bus-device-driver框架结构及Linux内核中提供的输入子系统框架,以及LCD、触摸屏、网卡、摄像头驱动框架等,分别设计并实现了LCD、触摸屏、摄像头、按键四种设备驱动程序,并对DM9000网卡...

    Linux内核移植笔记 | 06 – 移植Linux 3.4.2 内核到JZ2440(移植DM9000网卡驱动,支持网络,支持NFS挂载)

    1. 移植DM9000网卡驱动 之前配置使用的SMDK2440开发板,默认不支持DM9000网卡驱动,但是其中的MINI2440开发板支持,所以要将MINI2440中的DM9000驱动移植到SMDK2440中。 进入内核源码目录里面,找到 arch/arm/mach-s3...

    单片机驱动DM9000

    本文主要介绍单片机驱动DM9000E网卡芯片的详细过程。从网卡电路的连接,到网卡初始化相关程序调试,再到ARP协议的实现,一步一步详细介绍调试过程。如果有时间也会把UDP和TCP通讯实验过程写出来。当然,会用单片机...

    ENC28J60 SPI网卡移植 linux 2.6.28 SAMSUNG 6410 ARM11

    linux2.6.28 开发板:飞凌TE6410 (256M RAM 2G NAND) 网卡:ENC28J60 SPI 测试用的工具:Saleae logic (逻辑分析仪),Iris 抓包工具 6410作为一颗强大的ARM11处理器,网卡模块已经是相当的成熟(如:DM9000/3 ...

    嵌入式Linux之我行系列

    ·嵌入式Linux之我行——Linux-2.6.30.4在2440上的移植之DM9000E网卡驱动 ·嵌入式Linux之我行——Linux-2.6.30.4在2440上的移植之USB驱动 ·嵌入式Linux之我行——Linux-2.6.30.4在2440上的移植之MMC/SD卡驱动 ·...

    PDF 资料 ENC28J60 SPI网卡移植 linux 2.6.28 SAMSUNG 6410 ARM11

    linux2.6.28 开发板:飞凌TE6410 (256M RAM 2G NAND) 网卡:ENC28J60 SPI 测试用的工具:Saleae logic (逻辑分析仪),Iris 抓包工具 6410作为一颗强大的ARM11处理器,网卡模块已经是相当的成熟(如:DM9000/3 ...

    基于ARM和DM9000的网卡接口设计与实现

    1 引言要实现小型嵌入式设备的Internet接入,TCP/IP首先要解决的是底层硬件问题,即协议的物理层。Ethernet具有成熟的技术...寄存器操作简单有效,有成熟的Linux驱动程序支持;3.3V接口电平;成本相当低廉;还可以使用

    Tiny6410内核移植及文件系统搭建的详细步骤

    涵盖2.6.36内核和文件系统搭建...注意:arm-none-linux-guneabi version 4.5.2;NAND FLASH 256M (SLC);DM9000 的网卡;yaffs2 文件系统。NAND FLASH是SLC 256M,并非MLC 2G,否则需要修改相应的nand flash 驱动。

    AT91SAM9263开发板SBC6300X.rar

    10/100M以太网卡DM9000驱动 以太网口2 CPU内部自带MAC层的以太网驱动 LCD 320x240,480x272,640x480,800x480四种屏的驱动 touch screen 触摸屏驱动 音频 音频驱动 MMC/SD SDIO模式驱动 USB host 可支持USB接口的...

    基于ARM的矿井综采面无线传感器网络的网关设计

    介绍了一种基于ARM的综采面无线传感器网络的网关设计。...阐述了网关的硬件设计,重点论述了无线收发模块和以太网接口模块,并介绍了DM9000以太网卡的移植,CC2420无线模块驱动的开发,以及上层应用程序等软件设计。

Global site tag (gtag.js) - Google Analytics