Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / net / typhoon.c
index 8f33929..d9258d4 100644 (file)
@@ -134,7 +134,7 @@ static const int multicast_filter_limit = 32;
 #include "typhoon.h"
 #include "typhoon-firmware.h"
 
-static char version[] __devinitdata =
+static const char version[] __devinitdata =
     "typhoon.c: version " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
 
 MODULE_AUTHOR("David Dillow <dave@thedillows.org>");
@@ -178,7 +178,7 @@ enum typhoon_cards {
 };
 
 /* directly indexed by enum typhoon_cards, above */
-static struct typhoon_card_info typhoon_card_info[] __devinitdata = {
+static const struct typhoon_card_info typhoon_card_info[] __devinitdata = {
        { "3Com Typhoon (3C990-TX)",
                TYPHOON_CRYPTO_NONE},
        { "3Com Typhoon (3CR990-TX-95)",
@@ -208,7 +208,7 @@ static struct typhoon_card_info typhoon_card_info[] __devinitdata = {
 };
 
 /* Notes on the new subsystem numbering scheme:
- * bits 0-1 indicate crypto capabilites: (0) variable, (1) DES, or (2) 3DES
+ * bits 0-1 indicate crypto capabilities: (0) variable, (1) DES, or (2) 3DES
  * bit 4 indicates if this card has secured firmware (we don't support it)
  * bit 8 indicates if this is a (0) copper or (1) fiber card
  * bits 12-16 indicate card type: (0) client and (1) server
@@ -419,10 +419,9 @@ typhoon_reset(void __iomem *ioaddr, int wait_type)
                           TYPHOON_STATUS_WAITING_FOR_HOST)
                                goto out;
 
-                       if(wait_type == WaitSleep) {
-                               set_current_state(TASK_UNINTERRUPTIBLE);
-                               schedule_timeout(1);
-                       } else
+                       if(wait_type == WaitSleep)
+                               schedule_timeout_uninterruptible(1);
+                       else
                                udelay(TYPHOON_UDELAY);
                }
 
@@ -789,7 +788,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
        /* we have two rings to choose from, but we only use txLo for now
         * If we start using the Hi ring as well, we'll need to update
         * typhoon_stop_runtime(), typhoon_interrupt(), typhoon_num_free_tx(),
-        * and TXHI_ENTIRES to match, as well as update the TSO code below
+        * and TXHI_ENTRIES to match, as well as update the TSO code below
         * to get the right DMA address
         */
        txRing = &tp->txLoRing;
@@ -1661,7 +1660,7 @@ typhoon_alloc_rx_skb(struct typhoon *tp, u32 idx)
 #endif
 
        skb->dev = tp->dev;
-       dma_addr = pci_map_single(tp->pdev, skb->tail,
+       dma_addr = pci_map_single(tp->pdev, skb->data,
                                  PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
 
        /* Since no card does 64 bit DAC, the high bits will never
@@ -1721,7 +1720,7 @@ typhoon_rx(struct typhoon *tp, struct basic_ring *rxRing, volatile u32 * ready,
                        pci_dma_sync_single_for_cpu(tp->pdev, dma_addr,
                                                    PKT_BUF_SZ,
                                                    PCI_DMA_FROMDEVICE);
-                       eth_copy_and_sum(new_skb, skb->tail, pkt_len, 0);
+                       eth_copy_and_sum(new_skb, skb->data, pkt_len, 0);
                        pci_dma_sync_single_for_device(tp->pdev, dma_addr,
                                                       PKT_BUF_SZ,
                                                       PCI_DMA_FROMDEVICE);
@@ -1906,9 +1905,9 @@ typhoon_sleep(struct typhoon *tp, pci_power_t state, u16 events)
         */
        netif_carrier_off(tp->dev);
 
-       pci_enable_wake(tp->pdev, pci_choose_state(pdev, state), 1);
+       pci_enable_wake(tp->pdev, state, 1);
        pci_disable_device(pdev);
-       return pci_set_power_state(pdev, pci_choose_state(pdev, state));
+       return pci_set_power_state(pdev, state);
 }
 
 static int
@@ -2274,7 +2273,7 @@ typhoon_suspend(struct pci_dev *pdev, pm_message_t state)
                goto need_resume;
        }
 
-       if(typhoon_sleep(tp, state, tp->wol_events) < 0) {
+       if(typhoon_sleep(tp, pci_choose_state(pdev, state), tp->wol_events) < 0) {
                printk(KERN_ERR "%s: unable to put card to sleep\n", dev->name);
                goto need_resume;
        }