~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/net/ipg.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
486
486
        phyctrl = ipg_r8(PHY_CTRL);
487
487
        mac_ctrl_val = ipg_r32(MAC_CTRL);
488
488
 
489
 
        /* Set flags for use in resolving auto-negotation, assuming
 
489
        /* Set flags for use in resolving auto-negotiation, assuming
490
490
         * non-1000Mbps, half duplex, no flow control.
491
491
         */
492
492
        fullduplex = 0;
493
493
        txflowcontrol = 0;
494
494
        rxflowcontrol = 0;
495
495
 
496
 
        /* To accomodate a problem in 10Mbps operation,
 
496
        /* To accommodate a problem in 10Mbps operation,
497
497
         * set a global flag if PHY running in 10Mbps mode.
498
498
         */
499
499
        sp->tenmbpsmode = 0;
846
846
}
847
847
 
848
848
/*
849
 
 * Free all transmit buffers which have already been transfered
 
849
 * Free all transmit buffers which have already been transferred
850
850
 * via DMA to the IPG.
851
851
 */
852
852
static void ipg_nic_txfree(struct net_device *dev)
920
920
 
921
921
/*
922
922
 * For TxComplete interrupts, free all transmit
923
 
 * buffers which have already been transfered via DMA
 
923
 * buffers which have already been transferred via DMA
924
924
 * to the IPG.
925
925
 */
926
926
static void ipg_nic_txcleanup(struct net_device *dev)
1141
1141
 
1142
1142
                /* Increment detailed receive error statistics. */
1143
1143
                if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFIFOOVERRUN) {
1144
 
                        IPG_DEBUG_MSG("RX FIFO overrun occured.\n");
 
1144
                        IPG_DEBUG_MSG("RX FIFO overrun occurred.\n");
1145
1145
 
1146
1146
                        sp->stats.rx_fifo_errors++;
1147
1147
                }
1148
1148
 
1149
1149
                if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXRUNTFRAME) {
1150
 
                        IPG_DEBUG_MSG("RX runt occured.\n");
 
1150
                        IPG_DEBUG_MSG("RX runt occurred.\n");
1151
1151
                        sp->stats.rx_length_errors++;
1152
1152
                }
1153
1153
 
1156
1156
                 */
1157
1157
 
1158
1158
                if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXALIGNMENTERROR) {
1159
 
                        IPG_DEBUG_MSG("RX alignment error occured.\n");
 
1159
                        IPG_DEBUG_MSG("RX alignment error occurred.\n");
1160
1160
                        sp->stats.rx_frame_errors++;
1161
1161
                }
1162
1162
 
1421
1421
 
1422
1422
                        /* Increment detailed receive error statistics. */
1423
1423
                        if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFIFOOVERRUN) {
1424
 
                                IPG_DEBUG_MSG("RX FIFO overrun occured.\n");
 
1424
                                IPG_DEBUG_MSG("RX FIFO overrun occurred.\n");
1425
1425
                                sp->stats.rx_fifo_errors++;
1426
1426
                        }
1427
1427
 
1428
1428
                        if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXRUNTFRAME) {
1429
 
                                IPG_DEBUG_MSG("RX runt occured.\n");
 
1429
                                IPG_DEBUG_MSG("RX runt occurred.\n");
1430
1430
                                sp->stats.rx_length_errors++;
1431
1431
                        }
1432
1432
 
1436
1436
                         */
1437
1437
 
1438
1438
                        if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXALIGNMENTERROR) {
1439
 
                                IPG_DEBUG_MSG("RX alignment error occured.\n");
 
1439
                                IPG_DEBUG_MSG("RX alignment error occurred.\n");
1440
1440
                                sp->stats.rx_frame_errors++;
1441
1441
                        }
1442
1442
 
1460
1460
                        }
1461
1461
                } else {
1462
1462
 
1463
 
                        /* Adjust the new buffer length to accomodate the size
 
1463
                        /* Adjust the new buffer length to accommodate the size
1464
1464
                         * of the received frame.
1465
1465
                         */
1466
1466
                        skb_put(skb, framelen);
1488
1488
        }
1489
1489
 
1490
1490
        /*
1491
 
         * If there are more RFDs to proces and the allocated amount of RFD
 
1491
         * If there are more RFDs to process and the allocated amount of RFD
1492
1492
         * processing time has expired, assert Interrupt Requested to make
1493
1493
         * sure we come back to process the remaining RFDs.
1494
1494
         */
1886
1886
        /* Request TxComplete interrupts at an interval defined
1887
1887
         * by the constant IPG_FRAMESBETWEENTXCOMPLETES.
1888
1888
         * Request TxComplete interrupt for every frame
1889
 
         * if in 10Mbps mode to accomodate problem with 10Mbps
 
1889
         * if in 10Mbps mode to accommodate problem with 10Mbps
1890
1890
         * processing.
1891
1891
         */
1892
1892
        if (sp->tenmbpsmode)
2025
2025
 
2026
2026
        if (phyaddr != 0x1f) {
2027
2027
                u16 mii_phyctrl, mii_1000cr;
2028
 
                u8 revisionid = 0;
2029
2028
 
2030
2029
                mii_1000cr  = mdio_read(dev, phyaddr, MII_CTRL1000);
2031
2030
                mii_1000cr |= ADVERTISE_1000FULL | ADVERTISE_1000HALF |
2035
2034
                mii_phyctrl = mdio_read(dev, phyaddr, MII_BMCR);
2036
2035
 
2037
2036
                /* Set default phyparam */
2038
 
                pci_read_config_byte(sp->pdev, PCI_REVISION_ID, &revisionid);
2039
 
                ipg_set_phy_default_param(revisionid, dev, phyaddr);
 
2037
                ipg_set_phy_default_param(sp->pdev->revision, dev, phyaddr);
2040
2038
 
2041
2039
                /* Reset PHY */
2042
2040
                mii_phyctrl |= BMCR_RESET | BMCR_ANRESTART;
2100
2098
        struct ipg_nic_private *sp = netdev_priv(dev);
2101
2099
        int err;
2102
2100
 
2103
 
        /* Function to accomodate changes to Maximum Transfer Unit
 
2101
        /* Function to accommodate changes to Maximum Transfer Unit
2104
2102
         * (or MTU) of IPG NIC. Cannot use default function since
2105
2103
         * the default will not allow for MTU > 1500 bytes.
2106
2104
         */