Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
[pandora-kernel.git] / drivers / net / cassini.c
index 521c5b7..f6e4030 100644 (file)
@@ -1995,7 +1995,6 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc,
                return -1;
 
        *skbref = skb;
-       skb->dev = cp->dev;
        skb_reserve(skb, swivel);
 
        p = skb->data;
@@ -2822,10 +2821,8 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring,
 
        ctrl = 0;
        if (skb->ip_summed == CHECKSUM_PARTIAL) {
-               u64 csum_start_off, csum_stuff_off;
-
-               csum_start_off = (u64) (skb->h.raw - skb->data);
-               csum_stuff_off = (u64) ((skb->h.raw + skb->csum) - skb->data);
+               const u64 csum_start_off = skb_transport_offset(skb);
+               const u64 csum_stuff_off = csum_start_off + skb->csum_offset;
 
                ctrl =  TX_DESC_CSUM_EN |
                        CAS_BASE(TX_DESC_CSUM_START, csum_start_off) |
@@ -2849,8 +2846,8 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring,
                              ctrl | TX_DESC_SOF, 0);
                entry = TX_DESC_NEXT(ring, entry);
 
-               memcpy(tx_tiny_buf(cp, ring, entry), skb->data +
-                      len - tabort, tabort);
+               skb_copy_from_linear_data_offset(skb, len - tabort,
+                             tx_tiny_buf(cp, ring, entry), tabort);
                mapping = tx_tiny_map(cp, ring, entry, tentry);
                cas_write_txd(cp, ring, entry, mapping, tabort, ctrl,
                              (nr_frags == 0));
@@ -3425,21 +3422,19 @@ done:
 static void cas_check_pci_invariants(struct cas *cp)
 {
        struct pci_dev *pdev = cp->pdev;
-       u8 rev;
 
        cp->cas_flags = 0;
-       pci_read_config_byte(pdev, PCI_REVISION_ID, &rev);
        if ((pdev->vendor == PCI_VENDOR_ID_SUN) &&
            (pdev->device == PCI_DEVICE_ID_SUN_CASSINI)) {
-               if (rev >= CAS_ID_REVPLUS)
+               if (pdev->revision >= CAS_ID_REVPLUS)
                        cp->cas_flags |= CAS_FLAG_REG_PLUS;
-               if (rev < CAS_ID_REVPLUS02u)
+               if (pdev->revision < CAS_ID_REVPLUS02u)
                        cp->cas_flags |= CAS_FLAG_TARGET_ABORT;
 
                /* Original Cassini supports HW CSUM, but it's not
                 * enabled by default as it can trigger TX hangs.
                 */
-               if (rev < CAS_ID_REV2)
+               if (pdev->revision < CAS_ID_REV2)
                        cp->cas_flags |= CAS_FLAG_NO_HW_CSUM;
        } else {
                /* Only sun has original cassini chips.  */
@@ -4066,9 +4061,9 @@ static int cas_alloc_rxds(struct cas *cp)
        return 0;
 }
 
-static void cas_reset_task(void *data)
+static void cas_reset_task(struct work_struct *work)
 {
-       struct cas *cp = (struct cas *) data;
+       struct cas *cp = container_of(work, struct cas, reset_task);
 #if 0
        int pending = atomic_read(&cp->reset_task_pending);
 #else
@@ -4922,10 +4917,13 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
        pci_cmd &= ~PCI_COMMAND_SERR;
        pci_cmd |= PCI_COMMAND_PARITY;
        pci_write_config_word(pdev, PCI_COMMAND, pci_cmd);
-       pci_set_mwi(pdev);
+       if (pci_try_set_mwi(pdev))
+               printk(KERN_WARNING PFX "Could not enable MWI for %s\n",
+                      pci_name(pdev));
+
        /*
         * On some architectures, the default cache line size set
-        * by pci_set_mwi reduces perforamnce.  We have to increase
+        * by pci_try_set_mwi reduces perforamnce.  We have to increase
         * it for this case.  To start, we'll print some configuration
         * data.
         */
@@ -5006,7 +5004,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
        atomic_set(&cp->reset_task_pending_spare, 0);
        atomic_set(&cp->reset_task_pending_mtu, 0);
 #endif
-       INIT_WORK(&cp->reset_task, cas_reset_task, cp);
+       INIT_WORK(&cp->reset_task, cas_reset_task);
 
        /* Default link parameters */
        if (link_mode >= 0 && link_mode <= 6)