linux 网卡驱动分析,ARMLINUX 网卡驱动分析

ARMLINUXhzlc: , , ,

:/include/linux/netdevice.h:int dev_queue_xmit(struct sk_buff *skb);intnetif_rx(struct sk_buff *skb);Sk_buff

Sk_buff/linux/skbuff.h,Linux,,

Linux

net_devicenet_device

& Net_device

,,,,CirrusCS8900./drivers/net/cs89x0.c cs8900 datasheet:http://cst.mi.fu-berlin.de/proje ... eets/old/CS8900.pdf

/include/linux/netdevice.hAPI :Int register_netdev(struct net_device *dev)Void unregister_netdev(struct net_device *dev)net_device

net_deviceinit(),net_device.init()cs89x0_probe(): struct net_device * __init cs89x0_probe(int unit)

(2)for (port = netcard_portlist; *port; port++) { /*netcard_portlistunsigned intcs89x0.c,cs8900cs89x0_probe1*/ if (cs89x0_probe1(dev, *port, 0) == 0)/*, ,cs8900*/

(3) static int __init cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) net_device

/include/linux/netdevice.hvoid netif_start_queue(struct net_device *dev)I/ODMAvoid netif_stop_queue(struct net_device *dev)

TX_CMDTX_LENGPacketPagePP_BusST,8READY_FOR_TX_NOW ,.CAUTION!!spin_lock_irq(&lp->lock)

cs8900,,,,netif_rx().irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs * regs)

2 /**/ while ((status = readword(dev, ISQ_PORT))) { if (net_debug > 4)printk(%s: event=%04x\n, dev->name, status); handled = 1; switch(status & ISQ_EVENT_MASK) { case ISQ_RECEIVER_EVENT:/**/ net_rx(dev);/*, net_rx()*/ break;

3Void net_rx(struct net_device *dev) lp->stats.rx_packets++; lp->stats.rx_bytes += length;

,.net_device, .sk_buff,.

Function1:Queue a buffer for transmission to a network device. Function2:This function receives a packet from a device driver and queues it for the upper (protocol) levels to process.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值