diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/net/dl2k.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/net/dl2k.c')
-rw-r--r-- | drivers/net/dl2k.c | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index a2f238d20caa..23179dbcedd2 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c | |||
@@ -346,7 +346,7 @@ parse_eeprom (struct net_device *dev) | |||
346 | if (np->pdev->vendor == PCI_VENDOR_ID_DLINK) { /* D-Link Only */ | 346 | if (np->pdev->vendor == PCI_VENDOR_ID_DLINK) { /* D-Link Only */ |
347 | /* Check CRC */ | 347 | /* Check CRC */ |
348 | crc = ~ether_crc_le (256 - 4, sromdata); | 348 | crc = ~ether_crc_le (256 - 4, sromdata); |
349 | if (psrom->crc != crc) { | 349 | if (psrom->crc != cpu_to_le32(crc)) { |
350 | printk (KERN_ERR "%s: EEPROM data CRC error.\n", | 350 | printk (KERN_ERR "%s: EEPROM data CRC error.\n", |
351 | dev->name); | 351 | dev->name); |
352 | return -1; | 352 | return -1; |
@@ -465,7 +465,7 @@ rio_open (struct net_device *dev) | |||
465 | init_timer (&np->timer); | 465 | init_timer (&np->timer); |
466 | np->timer.expires = jiffies + 1*HZ; | 466 | np->timer.expires = jiffies + 1*HZ; |
467 | np->timer.data = (unsigned long) dev; | 467 | np->timer.data = (unsigned long) dev; |
468 | np->timer.function = &rio_timer; | 468 | np->timer.function = rio_timer; |
469 | add_timer (&np->timer); | 469 | add_timer (&np->timer); |
470 | 470 | ||
471 | /* Start Tx/Rx */ | 471 | /* Start Tx/Rx */ |
@@ -1189,10 +1189,10 @@ static int rio_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
1189 | cmd->transceiver = XCVR_INTERNAL; | 1189 | cmd->transceiver = XCVR_INTERNAL; |
1190 | } | 1190 | } |
1191 | if ( np->link_status ) { | 1191 | if ( np->link_status ) { |
1192 | cmd->speed = np->speed; | 1192 | ethtool_cmd_speed_set(cmd, np->speed); |
1193 | cmd->duplex = np->full_duplex ? DUPLEX_FULL : DUPLEX_HALF; | 1193 | cmd->duplex = np->full_duplex ? DUPLEX_FULL : DUPLEX_HALF; |
1194 | } else { | 1194 | } else { |
1195 | cmd->speed = -1; | 1195 | ethtool_cmd_speed_set(cmd, -1); |
1196 | cmd->duplex = -1; | 1196 | cmd->duplex = -1; |
1197 | } | 1197 | } |
1198 | if ( np->an_enable) | 1198 | if ( np->an_enable) |
@@ -1219,31 +1219,20 @@ static int rio_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
1219 | } else { | 1219 | } else { |
1220 | np->an_enable = 0; | 1220 | np->an_enable = 0; |
1221 | if (np->speed == 1000) { | 1221 | if (np->speed == 1000) { |
1222 | cmd->speed = SPEED_100; | 1222 | ethtool_cmd_speed_set(cmd, SPEED_100); |
1223 | cmd->duplex = DUPLEX_FULL; | 1223 | cmd->duplex = DUPLEX_FULL; |
1224 | printk("Warning!! Can't disable Auto negotiation in 1000Mbps, change to Manual 100Mbps, Full duplex.\n"); | 1224 | printk("Warning!! Can't disable Auto negotiation in 1000Mbps, change to Manual 100Mbps, Full duplex.\n"); |
1225 | } | 1225 | } |
1226 | switch(cmd->speed + cmd->duplex) { | 1226 | switch (ethtool_cmd_speed(cmd)) { |
1227 | 1227 | case SPEED_10: | |
1228 | case SPEED_10 + DUPLEX_HALF: | ||
1229 | np->speed = 10; | 1228 | np->speed = 10; |
1230 | np->full_duplex = 0; | 1229 | np->full_duplex = (cmd->duplex == DUPLEX_FULL); |
1231 | break; | ||
1232 | |||
1233 | case SPEED_10 + DUPLEX_FULL: | ||
1234 | np->speed = 10; | ||
1235 | np->full_duplex = 1; | ||
1236 | break; | ||
1237 | case SPEED_100 + DUPLEX_HALF: | ||
1238 | np->speed = 100; | ||
1239 | np->full_duplex = 0; | ||
1240 | break; | 1230 | break; |
1241 | case SPEED_100 + DUPLEX_FULL: | 1231 | case SPEED_100: |
1242 | np->speed = 100; | 1232 | np->speed = 100; |
1243 | np->full_duplex = 1; | 1233 | np->full_duplex = (cmd->duplex == DUPLEX_FULL); |
1244 | break; | 1234 | break; |
1245 | case SPEED_1000 + DUPLEX_HALF:/* not supported */ | 1235 | case SPEED_1000: /* not supported */ |
1246 | case SPEED_1000 + DUPLEX_FULL:/* not supported */ | ||
1247 | default: | 1236 | default: |
1248 | return -EINVAL; | 1237 | return -EINVAL; |
1249 | } | 1238 | } |
@@ -1753,8 +1742,6 @@ rio_close (struct net_device *dev) | |||
1753 | 1742 | ||
1754 | /* Free all the skbuffs in the queue. */ | 1743 | /* Free all the skbuffs in the queue. */ |
1755 | for (i = 0; i < RX_RING_SIZE; i++) { | 1744 | for (i = 0; i < RX_RING_SIZE; i++) { |
1756 | np->rx_ring[i].status = 0; | ||
1757 | np->rx_ring[i].fraginfo = 0; | ||
1758 | skb = np->rx_skbuff[i]; | 1745 | skb = np->rx_skbuff[i]; |
1759 | if (skb) { | 1746 | if (skb) { |
1760 | pci_unmap_single(np->pdev, | 1747 | pci_unmap_single(np->pdev, |
@@ -1763,6 +1750,8 @@ rio_close (struct net_device *dev) | |||
1763 | dev_kfree_skb (skb); | 1750 | dev_kfree_skb (skb); |
1764 | np->rx_skbuff[i] = NULL; | 1751 | np->rx_skbuff[i] = NULL; |
1765 | } | 1752 | } |
1753 | np->rx_ring[i].status = 0; | ||
1754 | np->rx_ring[i].fraginfo = 0; | ||
1766 | } | 1755 | } |
1767 | for (i = 0; i < TX_RING_SIZE; i++) { | 1756 | for (i = 0; i < TX_RING_SIZE; i++) { |
1768 | skb = np->tx_skbuff[i]; | 1757 | skb = np->tx_skbuff[i]; |