Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[pandora-kernel.git] / drivers / net / atl1 / atl1_main.c
index f23e13c..9200ee5 100644 (file)
@@ -76,7 +76,6 @@
 #include <linux/compiler.h>
 #include <linux/delay.h>
 #include <linux/mii.h>
-#include <linux/interrupt.h>
 #include <net/checksum.h>
 
 #include <asm/atomic.h>
@@ -121,7 +120,7 @@ static int __devinit atl1_sw_init(struct atl1_adapter *adapter)
        struct atl1_hw *hw = &adapter->hw;
        struct net_device *netdev = adapter->netdev;
 
-       hw->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
+       hw->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
        hw->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
 
        adapter->wol = 0;
@@ -689,7 +688,7 @@ static int atl1_change_mtu(struct net_device *netdev, int new_mtu)
 {
        struct atl1_adapter *adapter = netdev_priv(netdev);
        int old_mtu = netdev->mtu;
-       int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
+       int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
 
        if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) ||
            (max_frame > MAX_JUMBO_FRAME_SIZE)) {
@@ -854,8 +853,8 @@ static u32 atl1_configure(struct atl1_adapter *adapter)
        /* set Interrupt Clear Timer */
        iowrite16(adapter->ict, hw->hw_addr + REG_CMBDISDMA_TIMER);
 
-       /* set MTU, 4 : VLAN */
-       iowrite32(hw->max_frame_size + 4, hw->hw_addr + REG_MTU);
+       /* set max frame size hw will accept */
+       iowrite32(hw->max_frame_size, hw->hw_addr + REG_MTU);
 
        /* jumbo size & rrd retirement timer */
        value = (((u32) hw->rx_jumbo_th & RXQ_JMBOSZ_TH_MASK)
@@ -1368,7 +1367,6 @@ rrd_ok:
        if (count) {
                u32 tpd_next_to_use;
                u32 rfd_next_to_use;
-               u32 rrd_next_to_clean;
 
                spin_lock(&adapter->mb_lock);
 
@@ -1513,7 +1511,7 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
        unsigned int f;
        u16 tpd_next_to_use;
        u16 proto_hdr_len;
-       u16 i, m, len12;
+       u16 len12;
 
        first_buf_len -= skb->data_len;
        nr_frags = skb_shinfo(skb)->nr_frags;
@@ -1537,6 +1535,8 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
                        tpd_next_to_use = 0;
 
                if (first_buf_len > proto_hdr_len) {
+                       int i, m;
+
                        len12 = first_buf_len - proto_hdr_len;
                        m = (len12 + ATL1_MAX_TX_BUF_LEN - 1) /
                                ATL1_MAX_TX_BUF_LEN;
@@ -2210,8 +2210,14 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
                return err;
 
        /*
-        * 64-bit DMA currently has data corruption problems, so let's just
-        * use 32-bit DMA for now.  This is a big hack that is probably wrong.
+        * The atl1 chip can DMA to 64-bit addresses, but it uses a single
+        * shared register for the high 32 bits, so only a single, aligned,
+        * 4 GB physical address range can be used at a time.
+        *
+        * Supporting 64-bit DMA on this hardware is more trouble than it's
+        * worth.  It is far easier to limit to 32-bit DMA than update
+        * various kernel subsystems to support the mechanics required by a
+        * fixed-high-32-bit system.
         */
        err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
        if (err) {
@@ -2235,7 +2241,6 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
                err = -ENOMEM;
                goto err_alloc_etherdev;
        }
-       SET_MODULE_OWNER(netdev);
        SET_NETDEV_DEV(netdev, &pdev->dev);
 
        pci_set_drvdata(pdev, netdev);