Make ar9170 use common ath reg code
[safe/jmp/linux-2.6] / drivers / net / arcnet / com20020.c
index 7cf0a25..651275a 100644 (file)
@@ -89,7 +89,7 @@ static void com20020_copy_to_card(struct net_device *dev, int bufnum,
 int com20020_check(struct net_device *dev)
 {
        int ioaddr = dev->base_addr, status;
-       struct arcnet_local *lp = dev->priv;
+       struct arcnet_local *lp = netdev_priv(dev);
 
        ARCRESET0;
        mdelay(RESETtime);
@@ -149,6 +149,14 @@ int com20020_check(struct net_device *dev)
        return 0;
 }
 
+const struct net_device_ops com20020_netdev_ops = {
+       .ndo_open       = arcnet_open,
+       .ndo_stop       = arcnet_close,
+       .ndo_start_xmit = arcnet_send_packet,
+       .ndo_tx_timeout = arcnet_timeout,
+       .ndo_set_multicast_list = com20020_set_mc_list,
+};
+
 /* Set up the struct net_device associated with this card.  Called after
  * probing succeeds.
  */
@@ -159,7 +167,7 @@ int com20020_found(struct net_device *dev, int shared)
 
        /* Initialize the rest of the device structure. */
 
-       lp = dev->priv;
+       lp = netdev_priv(dev);
 
        lp->hw.owner = THIS_MODULE;
        lp->hw.command = com20020_command;
@@ -170,8 +178,6 @@ int com20020_found(struct net_device *dev, int shared)
        lp->hw.copy_from_card = com20020_copy_from_card;
        lp->hw.close = com20020_close;
 
-       dev->set_multicast_list = com20020_set_mc_list;
-
        if (!dev->dev_addr[0])
                dev->dev_addr[0] = inb(ioaddr + BUS_ALIGN*8);   /* FIXME: do this some other way! */
 
@@ -233,20 +239,20 @@ int com20020_found(struct net_device *dev, int shared)
  */
 static int com20020_reset(struct net_device *dev, int really_reset)
 {
-       struct arcnet_local *lp = dev->priv;
+       struct arcnet_local *lp = netdev_priv(dev);
        u_int ioaddr = dev->base_addr;
        u_char inbyte;
 
        BUGMSG(D_DEBUG, "%s: %d: %s: dev: %p, lp: %p, dev->name: %s\n",
-               __FILE__,__LINE__,__FUNCTION__,dev,lp,dev->name);
+               __FILE__,__LINE__,__func__,dev,lp,dev->name);
        BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n",
               dev->name, ASTATUS());
 
-       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__FUNCTION__);
+       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__);
        lp->config = TXENcfg | (lp->timeout << 3) | (lp->backplane << 2);
        /* power-up defaults */
        SETCONF;
-       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__FUNCTION__);
+       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__);
 
        if (really_reset) {
                /* reset the card */
@@ -254,22 +260,22 @@ static int com20020_reset(struct net_device *dev, int really_reset)
                mdelay(RESETtime * 2);  /* COM20020 seems to be slower sometimes */
        }
        /* clear flags & end reset */
-       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__FUNCTION__);
+       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__);
        ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear);
 
        /* verify that the ARCnet signature byte is present */
-       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__FUNCTION__);
+       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__);
 
        com20020_copy_from_card(dev, 0, 0, &inbyte, 1);
-       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__FUNCTION__);
+       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__);
        if (inbyte != TESTvalue) {
-               BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__FUNCTION__);
+               BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__);
                BUGMSG(D_NORMAL, "reset failed: TESTvalue not present.\n");
                return 1;
        }
        /* enable extended (512-byte) packets */
        ACOMMAND(CONFIGcmd | EXTconf);
-       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__FUNCTION__);
+       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__);
 
        /* done!  return success. */
        return 0;
@@ -300,7 +306,7 @@ static int com20020_status(struct net_device *dev)
 
 static void com20020_close(struct net_device *dev)
 {
-       struct arcnet_local *lp = dev->priv;
+       struct arcnet_local *lp = netdev_priv(dev);
        int ioaddr = dev->base_addr;
 
        /* disable transmitter */
@@ -317,7 +323,7 @@ static void com20020_close(struct net_device *dev)
  */
 static void com20020_set_mc_list(struct net_device *dev)
 {
-       struct arcnet_local *lp = dev->priv;
+       struct arcnet_local *lp = netdev_priv(dev);
        int ioaddr = dev->base_addr;
 
        if ((dev->flags & IFF_PROMISC) && (dev->flags & IFF_UP)) {      /* Enable promiscuous mode */
@@ -342,20 +348,22 @@ static void com20020_set_mc_list(struct net_device *dev)
     defined(CONFIG_ARCNET_COM20020_CS_MODULE)
 EXPORT_SYMBOL(com20020_check);
 EXPORT_SYMBOL(com20020_found);
+EXPORT_SYMBOL(com20020_netdev_ops);
 #endif
 
 MODULE_LICENSE("GPL");
 
 #ifdef MODULE
 
-int init_module(void)
+static int __init com20020_module_init(void)
 {
        BUGLVL(D_NORMAL) printk(VERSION);
        return 0;
 }
 
-void cleanup_module(void)
+static void __exit com20020_module_exit(void)
 {
 }
-
+module_init(com20020_module_init);
+module_exit(com20020_module_exit);
 #endif                         /* MODULE */