Lines Matching refs:dev
61 static int nfeth_open(struct net_device *dev) in nfeth_open() argument
63 struct nfeth_private *priv = netdev_priv(dev); in nfeth_open()
67 netdev_dbg(dev, "%s: %d\n", __func__, res); in nfeth_open()
70 netif_start_queue(dev); in nfeth_open()
75 static int nfeth_stop(struct net_device *dev) in nfeth_stop() argument
77 struct nfeth_private *priv = netdev_priv(dev); in nfeth_stop()
80 netif_stop_queue(dev); in nfeth_stop()
90 static inline void recv_packet(struct net_device *dev) in recv_packet() argument
92 struct nfeth_private *priv = netdev_priv(dev); in recv_packet()
99 netdev_dbg(dev, "%s: %u\n", __func__, pktlen); in recv_packet()
102 netdev_dbg(dev, "%s: pktlen == 0\n", __func__); in recv_packet()
103 dev->stats.rx_errors++; in recv_packet()
109 netdev_dbg(dev, "%s: out of mem (buf_alloc failed)\n", in recv_packet()
111 dev->stats.rx_dropped++; in recv_packet()
115 skb->dev = dev; in recv_packet()
121 skb->protocol = eth_type_trans(skb, dev); in recv_packet()
123 dev->stats.rx_packets++; in recv_packet()
124 dev->stats.rx_bytes += pktlen; in recv_packet()
144 static int nfeth_xmit(struct sk_buff *skb, struct net_device *dev) in nfeth_xmit() argument
148 struct nfeth_private *priv = netdev_priv(dev); in nfeth_xmit()
159 netdev_dbg(dev, "%s: send %u bytes\n", __func__, len); in nfeth_xmit()
163 dev->stats.tx_packets++; in nfeth_xmit()
164 dev->stats.tx_bytes += len; in nfeth_xmit()
170 static void nfeth_tx_timeout(struct net_device *dev, unsigned int txqueue) in nfeth_tx_timeout() argument
172 dev->stats.tx_errors++; in nfeth_tx_timeout()
173 netif_wake_queue(dev); in nfeth_tx_timeout()
187 struct net_device *dev; in nfeth_probe() local
196 dev = alloc_etherdev(sizeof(struct nfeth_private)); in nfeth_probe()
197 if (!dev) in nfeth_probe()
200 dev->irq = nfEtherIRQ; in nfeth_probe()
201 dev->netdev_ops = &nfeth_netdev_ops; in nfeth_probe()
203 eth_hw_addr_set(dev, mac); in nfeth_probe()
205 priv = netdev_priv(dev); in nfeth_probe()
208 err = register_netdev(dev); in nfeth_probe()
210 free_netdev(dev); in nfeth_probe()
219 netdev_info(dev, KBUILD_MODNAME " addr:%s (%s) HWaddr:%pM\n", host_ip, in nfeth_probe()
222 return dev; in nfeth_probe()