[NET]: Rework dev_base via list_head (v3)
[safe/jmp/linux-2.6] / drivers / net / wireless / wavelan_cs.c
index f7724eb..67b867f 100644 (file)
@@ -603,7 +603,7 @@ static wavepoint_history *wl_new_wavepoint(unsigned short nwid, unsigned char se
   if(lp->wavepoint_table.num_wavepoints==MAX_WAVEPOINTS)
     return NULL;
   
-  new_wavepoint=(wavepoint_history *) kmalloc(sizeof(wavepoint_history),GFP_ATOMIC);
+  new_wavepoint = kmalloc(sizeof(wavepoint_history),GFP_ATOMIC);
   if(new_wavepoint==NULL)
     return NULL;
   
@@ -1168,7 +1168,7 @@ wv_mmc_show(struct net_device *   dev)
         m.mmr_unused0[6],
         m.mmr_unused0[7]);
 #endif /* DEBUG_SHOW_UNUSED */
-  printk(KERN_DEBUG "Encryption algorythm: %02X - Status: %02X\n",
+  printk(KERN_DEBUG "Encryption algorithm: %02X - Status: %02X\n",
         m.mmr_des_avail, m.mmr_des_status);
 #ifdef DEBUG_SHOW_UNUSED
   printk(KERN_DEBUG "mmc_unused1[]: %02X:%02X:%02X:%02X:%02X\n",
@@ -1837,7 +1837,7 @@ static void wl_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
        strncpy(info->driver, "wavelan_cs", sizeof(info->driver)-1);
 }
 
-static struct ethtool_ops ops = {
+static const struct ethtool_ops ops = {
        .get_drvinfo = wl_get_drvinfo
 };
 
@@ -2884,14 +2884,12 @@ wv_packet_read(struct net_device *              dev,
       return;
     }
 
-  skb->dev = dev;
-
   skb_reserve(skb, 2);
   fd_p = read_ringbuf(dev, fd_p, (char *) skb_put(skb, sksize), sksize);
   skb->protocol = eth_type_trans(skb, dev);
 
 #ifdef DEBUG_RX_INFO
-  wv_packet_info(skb->mac.raw, sksize, dev->name, "wv_packet_read");
+  wv_packet_info(skb_mac_header(skb), sksize, dev->name, "wv_packet_read");
 #endif /* DEBUG_RX_INFO */
      
   /* Statistics gathering & stuff associated.
@@ -2925,7 +2923,7 @@ wv_packet_read(struct net_device *                dev,
 #endif /* WAVELAN_ROAMING */
          
 #ifdef WIRELESS_SPY
-      wl_spy_gather(dev, skb->mac.raw + WAVELAN_ADDR_SIZE, stats);
+      wl_spy_gather(dev, skb_mac_header(skb) + WAVELAN_ADDR_SIZE, stats);
 #endif /* WIRELESS_SPY */
 #ifdef HISTOGRAM
       wl_his_gather(dev, stats);
@@ -3194,11 +3192,8 @@ wavelan_packet_xmit(struct sk_buff *     skb,
         * and we don't have the Ethernet specific requirement of beeing
         * able to detect collisions, therefore in theory we don't really
         * need to pad. Jean II */
-       if (skb->len < ETH_ZLEN) {
-               skb = skb_padto(skb, ETH_ZLEN);
-               if (skb == NULL)
-                       return 0;
-       }
+       if (skb_padto(skb, ETH_ZLEN))
+               return 0;
 
   wv_packet_write(dev, skb->data, skb->len);
 
@@ -3593,9 +3588,9 @@ wv_82593_config(struct net_device *       dev)
   cfblk.acloc = TRUE;           /* Disable source addr insertion by i82593 */
   cfblk.preamb_len = 0;         /* 2 bytes preamble (SFD) */
   cfblk.loopback = FALSE;
-  cfblk.lin_prio = 0;          /* conform to 802.3 backoff algoritm */
-  cfblk.exp_prio = 5;          /* conform to 802.3 backoff algoritm */
-  cfblk.bof_met = 1;           /* conform to 802.3 backoff algoritm */
+  cfblk.lin_prio = 0;          /* conform to 802.3 backoff algorithm */
+  cfblk.exp_prio = 5;          /* conform to 802.3 backoff algorithm */
+  cfblk.bof_met = 1;           /* conform to 802.3 backoff algorithm */
   cfblk.ifrm_spc = 0x20 >> 4;  /* 32 bit times interframe spacing */
   cfblk.slottim_low = 0x20 >> 5;       /* 32 bit times slot time */
   cfblk.slottim_hi = 0x0;
@@ -3942,11 +3937,8 @@ wv_hw_reset(struct net_device *  dev)
 static inline int
 wv_pcmcia_config(struct pcmcia_device *        link)
 {
-  tuple_t              tuple;
-  cisparse_t           parse;
   struct net_device *  dev = (struct net_device *) link->priv;
   int                  i;
-  u_char               buf[64];
   win_req_t            req;
   memreq_t             mem;
   net_local *          lp = netdev_priv(dev);
@@ -3956,36 +3948,6 @@ wv_pcmcia_config(struct pcmcia_device *  link)
   printk(KERN_DEBUG "->wv_pcmcia_config(0x%p)\n", link);
 #endif
 
-  /*
-   * This reads the card's CONFIG tuple to find its configuration
-   * registers.
-   */
-  do
-    {
-      tuple.Attributes = 0;
-      tuple.DesiredTuple = CISTPL_CONFIG;
-      i = pcmcia_get_first_tuple(link, &tuple);
-      if(i != CS_SUCCESS)
-       break;
-      tuple.TupleData = (cisdata_t *)buf;
-      tuple.TupleDataMax = 64;
-      tuple.TupleOffset = 0;
-      i = pcmcia_get_tuple_data(link, &tuple);
-      if(i != CS_SUCCESS)
-       break;
-      i = pcmcia_parse_tuple(link, &tuple, &parse);
-      if(i != CS_SUCCESS)
-       break;
-      link->conf.ConfigBase = parse.config.base;
-      link->conf.Present = parse.config.rmask[0];
-    }
-  while(0);
-  if(i != CS_SUCCESS)
-    {
-      cs_error(link, ParseTuple, i);
-      return FALSE;
-    }
-
   do
     {
       i = pcmcia_request_io(link, &link->io);
@@ -4120,24 +4082,14 @@ wv_pcmcia_release(struct pcmcia_device *link)
  */
 static irqreturn_t
 wavelan_interrupt(int          irq,
-                 void *        dev_id,
-                 struct pt_regs * regs)
+                 void *        dev_id)
 {
-  struct net_device *  dev;
+  struct net_device *  dev = dev_id;
   net_local *  lp;
   kio_addr_t   base;
   int          status0;
   u_int                tx_status;
 
-  if ((dev = dev_id) == NULL)
-    {
-#ifdef DEBUG_INTERRUPT_ERROR
-      printk(KERN_WARNING "wavelan_interrupt(): irq %d for unknown device.\n",
-            irq);
-#endif
-      return IRQ_NONE;
-    }
-
 #ifdef DEBUG_INTERRUPT_TRACE
   printk(KERN_DEBUG "%s: ->wavelan_interrupt()\n", dev->name);
 #endif