Transcript
- Slide 1
- ARMLINUX hzlc : , , ,
- Slide 2
- Slide 3
- Slide 4
- Slide 5
- : /include/linux/netdevice.h : int dev_queue_xmit(struct sk_buff *skb); intnetif_rx(struct sk_buff *skb); Sk_buff
- Slide 6
- Sk_buff /linux/skbuff.h , Linux , ,
- Slide 7
- Linux
- Slide 8
- net_device net_device
- Slide 9
- & Net_device
- Slide 10
- , , , , Cirrus CS8900 . /drivers/net/cs89x0.c cs8900 datasheet :http://cst.mi.fu- berlin.de/proje... eets/old/CS8900.pdfhttp://cst.mi.fu- berlin.de/proje... eets/old/CS8900.pdf
- Slide 11
- /include/linux/netdevice.h API : Int register_netdev(struct net_device *dev) Void unregister_netdev(struct net_device *dev) net_device
- Slide 12
- net_device init() , net_device .init() cs89x0_probe() : struct net_device * __init cs89x0_probe(int unit)
- Slide 13
- (2) for (port = netcard_portlist; *port; port++) { /*netcard_portlist unsigned int cs89x0.c , cs8900 cs89x0_probe1 */ if (cs89x0_probe1(dev, *port, 0) == 0) /* , , cs8900 */
- Slide 14
- (3) static int __init cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) 1. 2. 3. net_device
- Slide 15
- /include/linux/netdevice.h void netif_start_queue(struct net_device *dev) I/O DMA void netif_stop_queue(struct net_device *dev)
- Slide 16
- TX_CMD TX_LENG PacketPage PP_BusST , 8 READY_FOR_TX_NOW, . CAUTION!! spin_lock_irq(&lp- >lock)
- Slide 17
- cs8900 , , , , netif_rx() . irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs * regs)
- Slide 18
- 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;
- Slide 19
- 3 Void net_rx(struct net_device *dev) 1. 2. 3. 4. 5. lp->stats.rx_packets++; lp->stats.rx_bytes += length;
- Slide 20
- , . net_device , . sk_buff, .
- Slide 21
- Slide 22