serial: add support for the Lava Quattro PCI quad-port 16550A card
[safe/jmp/linux-2.6] / drivers / net / pci-skeleton.c
index 0a575fe..0c44b48 100644 (file)
@@ -105,7 +105,7 @@ IVc. Errata
 
 static char version[] __devinitdata =
 KERN_INFO NETDRV_DRIVER_LOAD_MSG "\n"
-KERN_INFO "  Support available from http://foo.com/bar/baz.html\n";
+"  Support available from http://foo.com/bar/baz.html\n";
 
 /* define to 1 to enable PIO instead of MMIO */
 #undef USE_IO_OPS
@@ -728,6 +728,17 @@ err_out:
        return rc;
 }
 
+static const struct net_device_ops netdrv_netdev_ops = {
+       .ndo_open               = netdrv_open,
+       .ndo_stop               = netdrv_close,
+       .ndo_start_xmit         = netdrv_start_xmit,
+       .ndo_set_multicast_list = netdrv_set_rx_mode,
+       .ndo_do_ioctl           = netdrv_ioctl,
+       .ndo_tx_timeout         = netdrv_tx_timeout,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_set_mac_address    = eth_mac_addr,
+};
 
 static int __devinit netdrv_init_one (struct pci_dev *pdev,
                                       const struct pci_device_id *ent)
@@ -737,7 +748,6 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
        int i, addr_len, option;
        void *ioaddr = NULL;
        static int board_idx = -1;
-       DECLARE_MAC_BUF(mac);
 
 /* when built into the kernel, we only print version if device is found */
 #ifndef MODULE
@@ -770,19 +780,13 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
                ((u16 *) (dev->dev_addr))[i] =
                    le16_to_cpu (read_eeprom (ioaddr, i + 7, addr_len));
 
-       /* The Rtl8139-specific entries in the device structure. */
-       dev->open = netdrv_open;
-       dev->hard_start_xmit = netdrv_start_xmit;
-       dev->stop = netdrv_close;
-       dev->set_multicast_list = netdrv_set_rx_mode;
-       dev->do_ioctl = netdrv_ioctl;
-       dev->tx_timeout = netdrv_tx_timeout;
+       dev->netdev_ops = &netdrv_netdev_ops;
        dev->watchdog_timeo = TX_TIMEOUT;
 
        dev->irq = pdev->irq;
        dev->base_addr = (unsigned long) ioaddr;
 
-       /* dev->priv/tp zeroed and aligned in alloc_etherdev */
+       /* netdev_priv()/tp zeroed and aligned in alloc_etherdev */
        tp = netdev_priv(dev);
 
        /* note: tp->chipset set in netdrv_init_board */
@@ -797,11 +801,11 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
 
        tp->phys[0] = 32;
 
-       printk (KERN_INFO "%s: %s at 0x%lx, %sIRQ %d\n",
+       printk (KERN_INFO "%s: %s at 0x%lx, %pM IRQ %d\n",
                dev->name,
                board_info[ent->driver_data].name,
                dev->base_addr,
-               print_mac(mac, dev->dev_addr),
+               dev->dev_addr,
                dev->irq);
 
        printk (KERN_DEBUG "%s:  Identified 8139 chip type '%s'\n",
@@ -1352,7 +1356,7 @@ static int netdrv_start_xmit (struct sk_buff *skb, struct net_device *dev)
        DPRINTK ("%s: Queued Tx packet at %p size %u to slot %d.\n",
                 dev->name, skb->data, skb->len, entry);
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 
@@ -1566,7 +1570,6 @@ static void netdrv_rx_interrupt (struct net_device *dev,
 
                        skb->protocol = eth_type_trans (skb, dev);
                        netif_rx (skb);
-                       dev->last_rx = jiffies;
                        dev->stats.rx_bytes += pkt_size;
                        dev->stats.rx_packets++;
                } else {
@@ -1781,11 +1784,6 @@ static int netdrv_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
                break;
 
        case SIOCSMIIREG:               /* Write MII PHY register. */
-               if (!capable (CAP_NET_ADMIN)) {
-                       rc = -EPERM;
-                       break;
-               }
-
                spin_lock_irqsave (&tp->lock, flags);
                mdio_write (dev, data->phy_id & 0x1f, data->reg_num & 0x1f, data->val_in);
                spin_unlock_irqrestore (&tp->lock, flags);