aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/myri10ge/myri10ge.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-03-02 10:55:08 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-02 10:55:08 -0500
commit6d6b89bd2e316b78d668f761d380837b81fa71ef (patch)
tree7e63c58611fc6181153526abbdafdd846ed1a19d /drivers/net/myri10ge/myri10ge.c
parent13dda80e48439b446d0bc9bab34b91484bc8f533 (diff)
parent2507c05ff55fbf38326b08ed27eaed233bc75042 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1341 commits) virtio_net: remove forgotten assignment be2net: fix tx completion polling sis190: fix cable detect via link status poll net: fix protocol sk_buff field bridge: Fix build error when IGMP_SNOOPING is not enabled bnx2x: Tx barriers and locks scm: Only support SCM_RIGHTS on unix domain sockets. vhost-net: restart tx poll on sk_sndbuf full vhost: fix get_user_pages_fast error handling vhost: initialize log eventfd context pointer vhost: logging thinko fix wireless: convert to use netdev_for_each_mc_addr ethtool: do not set some flags, if others failed ipoib: returned back addrlen check for mc addresses netlink: Adding inode field to /proc/net/netlink axnet_cs: add new id bridge: Make IGMP snooping depend upon BRIDGE. bridge: Add multicast count/interval sysfs entries bridge: Add hash elasticity/max sysfs entries bridge: Add multicast_snooping sysfs toggle ... Trivial conflicts in Documentation/feature-removal-schedule.txt
Diffstat (limited to 'drivers/net/myri10ge/myri10ge.c')
-rw-r--r--drivers/net/myri10ge/myri10ge.c198
1 files changed, 76 insertions, 122 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 3fcb1c356e0d..676c513e12fc 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -38,6 +38,8 @@
38 * Myricom, Inc., 325N Santa Anita Avenue, Arcadia, CA 91006 38 * Myricom, Inc., 325N Santa Anita Avenue, Arcadia, CA 91006
39 *************************************************************************/ 39 *************************************************************************/
40 40
41#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
42
41#include <linux/tcp.h> 43#include <linux/tcp.h>
42#include <linux/netdevice.h> 44#include <linux/netdevice.h>
43#include <linux/skbuff.h> 45#include <linux/skbuff.h>
@@ -75,7 +77,7 @@
75#include "myri10ge_mcp.h" 77#include "myri10ge_mcp.h"
76#include "myri10ge_mcp_gen_header.h" 78#include "myri10ge_mcp_gen_header.h"
77 79
78#define MYRI10GE_VERSION_STR "1.5.1-1.453" 80#define MYRI10GE_VERSION_STR "1.5.2-1.459"
79 81
80MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); 82MODULE_DESCRIPTION("Myricom 10G driver (10GbE)");
81MODULE_AUTHOR("Maintainer: help@myri.com"); 83MODULE_AUTHOR("Maintainer: help@myri.com");
@@ -819,9 +821,7 @@ static int myri10ge_change_pause(struct myri10ge_priv *mgp, int pause)
819 status = myri10ge_send_cmd(mgp, ctl, &cmd, 0); 821 status = myri10ge_send_cmd(mgp, ctl, &cmd, 0);
820 822
821 if (status) { 823 if (status) {
822 printk(KERN_ERR 824 netdev_err(mgp->dev, "Failed to set flow control mode\n");
823 "myri10ge: %s: Failed to set flow control mode\n",
824 mgp->dev->name);
825 return status; 825 return status;
826 } 826 }
827 mgp->pause = pause; 827 mgp->pause = pause;
@@ -837,8 +837,7 @@ myri10ge_change_promisc(struct myri10ge_priv *mgp, int promisc, int atomic)
837 ctl = promisc ? MXGEFW_ENABLE_PROMISC : MXGEFW_DISABLE_PROMISC; 837 ctl = promisc ? MXGEFW_ENABLE_PROMISC : MXGEFW_DISABLE_PROMISC;
838 status = myri10ge_send_cmd(mgp, ctl, &cmd, atomic); 838 status = myri10ge_send_cmd(mgp, ctl, &cmd, atomic);
839 if (status) 839 if (status)
840 printk(KERN_ERR "myri10ge: %s: Failed to set promisc mode\n", 840 netdev_err(mgp->dev, "Failed to set promisc mode\n");
841 mgp->dev->name);
842} 841}
843 842
844static int myri10ge_dma_test(struct myri10ge_priv *mgp, int test_type) 843static int myri10ge_dma_test(struct myri10ge_priv *mgp, int test_type)
@@ -1201,6 +1200,9 @@ myri10ge_alloc_rx_pages(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx,
1201{ 1200{
1202 struct page *page; 1201 struct page *page;
1203 int idx; 1202 int idx;
1203#if MYRI10GE_ALLOC_SIZE > 4096
1204 int end_offset;
1205#endif
1204 1206
1205 if (unlikely(rx->watchdog_needed && !watchdog)) 1207 if (unlikely(rx->watchdog_needed && !watchdog))
1206 return; 1208 return;
@@ -1242,9 +1244,9 @@ myri10ge_alloc_rx_pages(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx,
1242 1244
1243#if MYRI10GE_ALLOC_SIZE > 4096 1245#if MYRI10GE_ALLOC_SIZE > 4096
1244 /* don't cross a 4KB boundary */ 1246 /* don't cross a 4KB boundary */
1245 if ((rx->page_offset >> 12) != 1247 end_offset = rx->page_offset + bytes - 1;
1246 ((rx->page_offset + bytes - 1) >> 12)) 1248 if ((unsigned)(rx->page_offset ^ end_offset) > 4095)
1247 rx->page_offset = (rx->page_offset + 4096) & ~4095; 1249 rx->page_offset = end_offset & ~4095;
1248#endif 1250#endif
1249 rx->fill_cnt++; 1251 rx->fill_cnt++;
1250 1252
@@ -1482,19 +1484,15 @@ static inline void myri10ge_check_statblock(struct myri10ge_priv *mgp)
1482 1484
1483 if (mgp->link_state == MXGEFW_LINK_UP) { 1485 if (mgp->link_state == MXGEFW_LINK_UP) {
1484 if (netif_msg_link(mgp)) 1486 if (netif_msg_link(mgp))
1485 printk(KERN_INFO 1487 netdev_info(mgp->dev, "link up\n");
1486 "myri10ge: %s: link up\n",
1487 mgp->dev->name);
1488 netif_carrier_on(mgp->dev); 1488 netif_carrier_on(mgp->dev);
1489 mgp->link_changes++; 1489 mgp->link_changes++;
1490 } else { 1490 } else {
1491 if (netif_msg_link(mgp)) 1491 if (netif_msg_link(mgp))
1492 printk(KERN_INFO 1492 netdev_info(mgp->dev, "link %s\n",
1493 "myri10ge: %s: link %s\n", 1493 link_up == MXGEFW_LINK_MYRINET ?
1494 mgp->dev->name, 1494 "mismatch (Myrinet detected)" :
1495 (link_up == MXGEFW_LINK_MYRINET ? 1495 "down");
1496 "mismatch (Myrinet detected)" :
1497 "down"));
1498 netif_carrier_off(mgp->dev); 1496 netif_carrier_off(mgp->dev);
1499 mgp->link_changes++; 1497 mgp->link_changes++;
1500 } 1498 }
@@ -1503,9 +1501,8 @@ static inline void myri10ge_check_statblock(struct myri10ge_priv *mgp)
1503 ntohl(stats->rdma_tags_available)) { 1501 ntohl(stats->rdma_tags_available)) {
1504 mgp->rdma_tags_available = 1502 mgp->rdma_tags_available =
1505 ntohl(stats->rdma_tags_available); 1503 ntohl(stats->rdma_tags_available);
1506 printk(KERN_WARNING "myri10ge: %s: RDMA timed out! " 1504 netdev_warn(mgp->dev, "RDMA timed out! %d tags left\n",
1507 "%d tags left\n", mgp->dev->name, 1505 mgp->rdma_tags_available);
1508 mgp->rdma_tags_available);
1509 } 1506 }
1510 mgp->down_cnt += stats->link_down; 1507 mgp->down_cnt += stats->link_down;
1511 if (stats->link_down) 1508 if (stats->link_down)
@@ -1576,8 +1573,7 @@ static irqreturn_t myri10ge_intr(int irq, void *arg)
1576 if (send_done_count != tx->pkt_done) 1573 if (send_done_count != tx->pkt_done)
1577 myri10ge_tx_done(ss, (int)send_done_count); 1574 myri10ge_tx_done(ss, (int)send_done_count);
1578 if (unlikely(i > myri10ge_max_irq_loops)) { 1575 if (unlikely(i > myri10ge_max_irq_loops)) {
1579 printk(KERN_WARNING "myri10ge: %s: irq stuck?\n", 1576 netdev_err(mgp->dev, "irq stuck?\n");
1580 mgp->dev->name);
1581 stats->valid = 0; 1577 stats->valid = 0;
1582 schedule_work(&mgp->watchdog_work); 1578 schedule_work(&mgp->watchdog_work);
1583 } 1579 }
@@ -1614,16 +1610,14 @@ myri10ge_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
1614 */ 1610 */
1615 ptr = mgp->product_code_string; 1611 ptr = mgp->product_code_string;
1616 if (ptr == NULL) { 1612 if (ptr == NULL) {
1617 printk(KERN_ERR "myri10ge: %s: Missing product code\n", 1613 netdev_err(netdev, "Missing product code\n");
1618 netdev->name);
1619 return 0; 1614 return 0;
1620 } 1615 }
1621 for (i = 0; i < 3; i++, ptr++) { 1616 for (i = 0; i < 3; i++, ptr++) {
1622 ptr = strchr(ptr, '-'); 1617 ptr = strchr(ptr, '-');
1623 if (ptr == NULL) { 1618 if (ptr == NULL) {
1624 printk(KERN_ERR "myri10ge: %s: Invalid product " 1619 netdev_err(netdev, "Invalid product code %s\n",
1625 "code %s\n", netdev->name, 1620 mgp->product_code_string);
1626 mgp->product_code_string);
1627 return 0; 1621 return 0;
1628 } 1622 }
1629 } 1623 }
@@ -2009,17 +2003,15 @@ static int myri10ge_allocate_rings(struct myri10ge_slice_state *ss)
2009 mgp->small_bytes + MXGEFW_PAD, 0); 2003 mgp->small_bytes + MXGEFW_PAD, 0);
2010 2004
2011 if (ss->rx_small.fill_cnt < ss->rx_small.mask + 1) { 2005 if (ss->rx_small.fill_cnt < ss->rx_small.mask + 1) {
2012 printk(KERN_ERR 2006 netdev_err(dev, "slice-%d: alloced only %d small bufs\n",
2013 "myri10ge: %s:slice-%d: alloced only %d small bufs\n", 2007 slice, ss->rx_small.fill_cnt);
2014 dev->name, slice, ss->rx_small.fill_cnt);
2015 goto abort_with_rx_small_ring; 2008 goto abort_with_rx_small_ring;
2016 } 2009 }
2017 2010
2018 myri10ge_alloc_rx_pages(mgp, &ss->rx_big, mgp->big_bytes, 0); 2011 myri10ge_alloc_rx_pages(mgp, &ss->rx_big, mgp->big_bytes, 0);
2019 if (ss->rx_big.fill_cnt < ss->rx_big.mask + 1) { 2012 if (ss->rx_big.fill_cnt < ss->rx_big.mask + 1) {
2020 printk(KERN_ERR 2013 netdev_err(dev, "slice-%d: alloced only %d big bufs\n",
2021 "myri10ge: %s:slice-%d: alloced only %d big bufs\n", 2014 slice, ss->rx_big.fill_cnt);
2022 dev->name, slice, ss->rx_big.fill_cnt);
2023 goto abort_with_rx_big_ring; 2015 goto abort_with_rx_big_ring;
2024 } 2016 }
2025 2017
@@ -2358,7 +2350,7 @@ static int myri10ge_open(struct net_device *dev)
2358 mgp->running = MYRI10GE_ETH_STARTING; 2350 mgp->running = MYRI10GE_ETH_STARTING;
2359 status = myri10ge_reset(mgp); 2351 status = myri10ge_reset(mgp);
2360 if (status != 0) { 2352 if (status != 0) {
2361 printk(KERN_ERR "myri10ge: %s: failed reset\n", dev->name); 2353 netdev_err(dev, "failed reset\n");
2362 goto abort_with_nothing; 2354 goto abort_with_nothing;
2363 } 2355 }
2364 2356
@@ -2370,9 +2362,7 @@ static int myri10ge_open(struct net_device *dev)
2370 status = myri10ge_send_cmd(mgp, MXGEFW_CMD_ENABLE_RSS_QUEUES, 2362 status = myri10ge_send_cmd(mgp, MXGEFW_CMD_ENABLE_RSS_QUEUES,
2371 &cmd, 0); 2363 &cmd, 0);
2372 if (status != 0) { 2364 if (status != 0) {
2373 printk(KERN_ERR 2365 netdev_err(dev, "failed to set number of slices\n");
2374 "myri10ge: %s: failed to set number of slices\n",
2375 dev->name);
2376 goto abort_with_nothing; 2366 goto abort_with_nothing;
2377 } 2367 }
2378 /* setup the indirection table */ 2368 /* setup the indirection table */
@@ -2384,9 +2374,7 @@ static int myri10ge_open(struct net_device *dev)
2384 MXGEFW_CMD_GET_RSS_TABLE_OFFSET, 2374 MXGEFW_CMD_GET_RSS_TABLE_OFFSET,
2385 &cmd, 0); 2375 &cmd, 0);
2386 if (status != 0) { 2376 if (status != 0) {
2387 printk(KERN_ERR 2377 netdev_err(dev, "failed to setup rss tables\n");
2388 "myri10ge: %s: failed to setup rss tables\n",
2389 dev->name);
2390 goto abort_with_nothing; 2378 goto abort_with_nothing;
2391 } 2379 }
2392 2380
@@ -2400,9 +2388,7 @@ static int myri10ge_open(struct net_device *dev)
2400 status = myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_RSS_ENABLE, 2388 status = myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_RSS_ENABLE,
2401 &cmd, 0); 2389 &cmd, 0);
2402 if (status != 0) { 2390 if (status != 0) {
2403 printk(KERN_ERR 2391 netdev_err(dev, "failed to enable slices\n");
2404 "myri10ge: %s: failed to enable slices\n",
2405 dev->name);
2406 goto abort_with_nothing; 2392 goto abort_with_nothing;
2407 } 2393 }
2408 } 2394 }
@@ -2450,9 +2436,7 @@ static int myri10ge_open(struct net_device *dev)
2450 2436
2451 status = myri10ge_get_txrx(mgp, slice); 2437 status = myri10ge_get_txrx(mgp, slice);
2452 if (status != 0) { 2438 if (status != 0) {
2453 printk(KERN_ERR 2439 netdev_err(dev, "failed to get ring sizes or locations\n");
2454 "myri10ge: %s: failed to get ring sizes or locations\n",
2455 dev->name);
2456 goto abort_with_rings; 2440 goto abort_with_rings;
2457 } 2441 }
2458 status = myri10ge_allocate_rings(ss); 2442 status = myri10ge_allocate_rings(ss);
@@ -2465,9 +2449,7 @@ static int myri10ge_open(struct net_device *dev)
2465 if (slice == 0 || mgp->dev->real_num_tx_queues > 1) 2449 if (slice == 0 || mgp->dev->real_num_tx_queues > 1)
2466 status = myri10ge_set_stats(mgp, slice); 2450 status = myri10ge_set_stats(mgp, slice);
2467 if (status) { 2451 if (status) {
2468 printk(KERN_ERR 2452 netdev_err(dev, "Couldn't set stats DMA\n");
2469 "myri10ge: %s: Couldn't set stats DMA\n",
2470 dev->name);
2471 goto abort_with_rings; 2453 goto abort_with_rings;
2472 } 2454 }
2473 2455
@@ -2498,8 +2480,7 @@ static int myri10ge_open(struct net_device *dev)
2498 status |= 2480 status |=
2499 myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_BIG_BUFFER_SIZE, &cmd, 0); 2481 myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_BIG_BUFFER_SIZE, &cmd, 0);
2500 if (status) { 2482 if (status) {
2501 printk(KERN_ERR "myri10ge: %s: Couldn't set buffer sizes\n", 2483 netdev_err(dev, "Couldn't set buffer sizes\n");
2502 dev->name);
2503 goto abort_with_rings; 2484 goto abort_with_rings;
2504 } 2485 }
2505 2486
@@ -2511,8 +2492,7 @@ static int myri10ge_open(struct net_device *dev)
2511 cmd.data0 = 0; 2492 cmd.data0 = 0;
2512 status = myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_TSO_MODE, &cmd, 0); 2493 status = myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_TSO_MODE, &cmd, 0);
2513 if (status && status != -ENOSYS) { 2494 if (status && status != -ENOSYS) {
2514 printk(KERN_ERR "myri10ge: %s: Couldn't set TSO mode\n", 2495 netdev_err(dev, "Couldn't set TSO mode\n");
2515 dev->name);
2516 goto abort_with_rings; 2496 goto abort_with_rings;
2517 } 2497 }
2518 2498
@@ -2521,8 +2501,7 @@ static int myri10ge_open(struct net_device *dev)
2521 2501
2522 status = myri10ge_send_cmd(mgp, MXGEFW_CMD_ETHERNET_UP, &cmd, 0); 2502 status = myri10ge_send_cmd(mgp, MXGEFW_CMD_ETHERNET_UP, &cmd, 0);
2523 if (status) { 2503 if (status) {
2524 printk(KERN_ERR "myri10ge: %s: Couldn't bring up link\n", 2504 netdev_err(dev, "Couldn't bring up link\n");
2525 dev->name);
2526 goto abort_with_rings; 2505 goto abort_with_rings;
2527 } 2506 }
2528 2507
@@ -2575,15 +2554,12 @@ static int myri10ge_close(struct net_device *dev)
2575 status = 2554 status =
2576 myri10ge_send_cmd(mgp, MXGEFW_CMD_ETHERNET_DOWN, &cmd, 0); 2555 myri10ge_send_cmd(mgp, MXGEFW_CMD_ETHERNET_DOWN, &cmd, 0);
2577 if (status) 2556 if (status)
2578 printk(KERN_ERR 2557 netdev_err(dev, "Couldn't bring down link\n");
2579 "myri10ge: %s: Couldn't bring down link\n",
2580 dev->name);
2581 2558
2582 wait_event_timeout(mgp->down_wq, old_down_cnt != mgp->down_cnt, 2559 wait_event_timeout(mgp->down_wq, old_down_cnt != mgp->down_cnt,
2583 HZ); 2560 HZ);
2584 if (old_down_cnt == mgp->down_cnt) 2561 if (old_down_cnt == mgp->down_cnt)
2585 printk(KERN_ERR "myri10ge: %s never got down irq\n", 2562 netdev_err(dev, "never got down irq\n");
2586 dev->name);
2587 } 2563 }
2588 netif_tx_disable(dev); 2564 netif_tx_disable(dev);
2589 myri10ge_free_irq(mgp); 2565 myri10ge_free_irq(mgp);
@@ -2944,9 +2920,7 @@ abort_linearize:
2944 idx = (idx + 1) & tx->mask; 2920 idx = (idx + 1) & tx->mask;
2945 } while (idx != last_idx); 2921 } while (idx != last_idx);
2946 if (skb_is_gso(skb)) { 2922 if (skb_is_gso(skb)) {
2947 printk(KERN_ERR 2923 netdev_err(mgp->dev, "TSO but wanted to linearize?!?!?\n");
2948 "myri10ge: %s: TSO but wanted to linearize?!?!?\n",
2949 mgp->dev->name);
2950 goto drop; 2924 goto drop;
2951 } 2925 }
2952 2926
@@ -3043,8 +3017,8 @@ static void myri10ge_set_multicast_list(struct net_device *dev)
3043 3017
3044 err = myri10ge_send_cmd(mgp, MXGEFW_ENABLE_ALLMULTI, &cmd, 1); 3018 err = myri10ge_send_cmd(mgp, MXGEFW_ENABLE_ALLMULTI, &cmd, 1);
3045 if (err != 0) { 3019 if (err != 0) {
3046 printk(KERN_ERR "myri10ge: %s: Failed MXGEFW_ENABLE_ALLMULTI," 3020 netdev_err(dev, "Failed MXGEFW_ENABLE_ALLMULTI, error status: %d\n",
3047 " error status: %d\n", dev->name, err); 3021 err);
3048 goto abort; 3022 goto abort;
3049 } 3023 }
3050 3024
@@ -3058,14 +3032,13 @@ static void myri10ge_set_multicast_list(struct net_device *dev)
3058 err = myri10ge_send_cmd(mgp, MXGEFW_LEAVE_ALL_MULTICAST_GROUPS, 3032 err = myri10ge_send_cmd(mgp, MXGEFW_LEAVE_ALL_MULTICAST_GROUPS,
3059 &cmd, 1); 3033 &cmd, 1);
3060 if (err != 0) { 3034 if (err != 0) {
3061 printk(KERN_ERR 3035 netdev_err(dev, "Failed MXGEFW_LEAVE_ALL_MULTICAST_GROUPS, error status: %d\n",
3062 "myri10ge: %s: Failed MXGEFW_LEAVE_ALL_MULTICAST_GROUPS" 3036 err);
3063 ", error status: %d\n", dev->name, err);
3064 goto abort; 3037 goto abort;
3065 } 3038 }
3066 3039
3067 /* Walk the multicast list, and add each address */ 3040 /* Walk the multicast list, and add each address */
3068 for (mc_list = dev->mc_list; mc_list != NULL; mc_list = mc_list->next) { 3041 netdev_for_each_mc_addr(mc_list, dev) {
3069 memcpy(data, &mc_list->dmi_addr, 6); 3042 memcpy(data, &mc_list->dmi_addr, 6);
3070 cmd.data0 = ntohl(data[0]); 3043 cmd.data0 = ntohl(data[0]);
3071 cmd.data1 = ntohl(data[1]); 3044 cmd.data1 = ntohl(data[1]);
@@ -3073,18 +3046,16 @@ static void myri10ge_set_multicast_list(struct net_device *dev)
3073 &cmd, 1); 3046 &cmd, 1);
3074 3047
3075 if (err != 0) { 3048 if (err != 0) {
3076 printk(KERN_ERR "myri10ge: %s: Failed " 3049 netdev_err(dev, "Failed MXGEFW_JOIN_MULTICAST_GROUP, error status:%d %pM\n",
3077 "MXGEFW_JOIN_MULTICAST_GROUP, error status:" 3050 err, mc_list->dmi_addr);
3078 "%d\t", dev->name, err);
3079 printk(KERN_ERR "MAC %pM\n", mc_list->dmi_addr);
3080 goto abort; 3051 goto abort;
3081 } 3052 }
3082 } 3053 }
3083 /* Enable multicast filtering */ 3054 /* Enable multicast filtering */
3084 err = myri10ge_send_cmd(mgp, MXGEFW_DISABLE_ALLMULTI, &cmd, 1); 3055 err = myri10ge_send_cmd(mgp, MXGEFW_DISABLE_ALLMULTI, &cmd, 1);
3085 if (err != 0) { 3056 if (err != 0) {
3086 printk(KERN_ERR "myri10ge: %s: Failed MXGEFW_DISABLE_ALLMULTI," 3057 netdev_err(dev, "Failed MXGEFW_DISABLE_ALLMULTI, error status: %d\n",
3087 "error status: %d\n", dev->name, err); 3058 err);
3088 goto abort; 3059 goto abort;
3089 } 3060 }
3090 3061
@@ -3105,9 +3076,8 @@ static int myri10ge_set_mac_address(struct net_device *dev, void *addr)
3105 3076
3106 status = myri10ge_update_mac_address(mgp, sa->sa_data); 3077 status = myri10ge_update_mac_address(mgp, sa->sa_data);
3107 if (status != 0) { 3078 if (status != 0) {
3108 printk(KERN_ERR 3079 netdev_err(dev, "changing mac address failed with %d\n",
3109 "myri10ge: %s: changing mac address failed with %d\n", 3080 status);
3110 dev->name, status);
3111 return status; 3081 return status;
3112 } 3082 }
3113 3083
@@ -3122,12 +3092,10 @@ static int myri10ge_change_mtu(struct net_device *dev, int new_mtu)
3122 int error = 0; 3092 int error = 0;
3123 3093
3124 if ((new_mtu < 68) || (ETH_HLEN + new_mtu > MYRI10GE_MAX_ETHER_MTU)) { 3094 if ((new_mtu < 68) || (ETH_HLEN + new_mtu > MYRI10GE_MAX_ETHER_MTU)) {
3125 printk(KERN_ERR "myri10ge: %s: new mtu (%d) is not valid\n", 3095 netdev_err(dev, "new mtu (%d) is not valid\n", new_mtu);
3126 dev->name, new_mtu);
3127 return -EINVAL; 3096 return -EINVAL;
3128 } 3097 }
3129 printk(KERN_INFO "%s: changing mtu from %d to %d\n", 3098 netdev_info(dev, "changing mtu from %d to %d\n", dev->mtu, new_mtu);
3130 dev->name, dev->mtu, new_mtu);
3131 if (mgp->running) { 3099 if (mgp->running) {
3132 /* if we change the mtu on an active device, we must 3100 /* if we change the mtu on an active device, we must
3133 * reset the device so the firmware sees the change */ 3101 * reset the device so the firmware sees the change */
@@ -3356,7 +3324,7 @@ static int myri10ge_suspend(struct pci_dev *pdev, pm_message_t state)
3356 3324
3357 netif_device_detach(netdev); 3325 netif_device_detach(netdev);
3358 if (netif_running(netdev)) { 3326 if (netif_running(netdev)) {
3359 printk(KERN_INFO "myri10ge: closing %s\n", netdev->name); 3327 netdev_info(netdev, "closing\n");
3360 rtnl_lock(); 3328 rtnl_lock();
3361 myri10ge_close(netdev); 3329 myri10ge_close(netdev);
3362 rtnl_unlock(); 3330 rtnl_unlock();
@@ -3383,8 +3351,7 @@ static int myri10ge_resume(struct pci_dev *pdev)
3383 msleep(5); /* give card time to respond */ 3351 msleep(5); /* give card time to respond */
3384 pci_read_config_word(mgp->pdev, PCI_VENDOR_ID, &vendor); 3352 pci_read_config_word(mgp->pdev, PCI_VENDOR_ID, &vendor);
3385 if (vendor == 0xffff) { 3353 if (vendor == 0xffff) {
3386 printk(KERN_ERR "myri10ge: %s: device disappeared!\n", 3354 netdev_err(mgp->dev, "device disappeared!\n");
3387 mgp->dev->name);
3388 return -EIO; 3355 return -EIO;
3389 } 3356 }
3390 3357
@@ -3463,10 +3430,9 @@ static void myri10ge_watchdog(struct work_struct *work)
3463 * if the card rebooted due to a parity error 3430 * if the card rebooted due to a parity error
3464 * For now, just report it */ 3431 * For now, just report it */
3465 reboot = myri10ge_read_reboot(mgp); 3432 reboot = myri10ge_read_reboot(mgp);
3466 printk(KERN_ERR 3433 netdev_err(mgp->dev, "NIC rebooted (0x%x),%s resetting\n",
3467 "myri10ge: %s: NIC rebooted (0x%x),%s resetting\n", 3434 reboot,
3468 mgp->dev->name, reboot, 3435 myri10ge_reset_recover ? "" : " not");
3469 myri10ge_reset_recover ? " " : " not");
3470 if (myri10ge_reset_recover == 0) 3436 if (myri10ge_reset_recover == 0)
3471 return; 3437 return;
3472 rtnl_lock(); 3438 rtnl_lock();
@@ -3494,31 +3460,26 @@ static void myri10ge_watchdog(struct work_struct *work)
3494 if (cmd == 0xffff) { 3460 if (cmd == 0xffff) {
3495 pci_read_config_word(mgp->pdev, PCI_VENDOR_ID, &vendor); 3461 pci_read_config_word(mgp->pdev, PCI_VENDOR_ID, &vendor);
3496 if (vendor == 0xffff) { 3462 if (vendor == 0xffff) {
3497 printk(KERN_ERR 3463 netdev_err(mgp->dev, "device disappeared!\n");
3498 "myri10ge: %s: device disappeared!\n",
3499 mgp->dev->name);
3500 return; 3464 return;
3501 } 3465 }
3502 } 3466 }
3503 /* Perhaps it is a software error. Try to reset */ 3467 /* Perhaps it is a software error. Try to reset */
3504 3468
3505 printk(KERN_ERR "myri10ge: %s: device timeout, resetting\n", 3469 netdev_err(mgp->dev, "device timeout, resetting\n");
3506 mgp->dev->name);
3507 for (i = 0; i < mgp->num_slices; i++) { 3470 for (i = 0; i < mgp->num_slices; i++) {
3508 tx = &mgp->ss[i].tx; 3471 tx = &mgp->ss[i].tx;
3509 printk(KERN_INFO 3472 netdev_err(mgp->dev, "(%d): %d %d %d %d %d %d\n",
3510 "myri10ge: %s: (%d): %d %d %d %d %d %d\n", 3473 i, tx->queue_active, tx->req,
3511 mgp->dev->name, i, tx->queue_active, tx->req, 3474 tx->done, tx->pkt_start, tx->pkt_done,
3512 tx->done, tx->pkt_start, tx->pkt_done, 3475 (int)ntohl(mgp->ss[i].fw_stats->
3513 (int)ntohl(mgp->ss[i].fw_stats-> 3476 send_done_count));
3514 send_done_count));
3515 msleep(2000); 3477 msleep(2000);
3516 printk(KERN_INFO 3478 netdev_info(mgp->dev, "(%d): %d %d %d %d %d %d\n",
3517 "myri10ge: %s: (%d): %d %d %d %d %d %d\n", 3479 i, tx->queue_active, tx->req,
3518 mgp->dev->name, i, tx->queue_active, tx->req, 3480 tx->done, tx->pkt_start, tx->pkt_done,
3519 tx->done, tx->pkt_start, tx->pkt_done, 3481 (int)ntohl(mgp->ss[i].fw_stats->
3520 (int)ntohl(mgp->ss[i].fw_stats-> 3482 send_done_count));
3521 send_done_count));
3522 } 3483 }
3523 } 3484 }
3524 3485
@@ -3528,8 +3489,7 @@ static void myri10ge_watchdog(struct work_struct *work)
3528 } 3489 }
3529 status = myri10ge_load_firmware(mgp, 1); 3490 status = myri10ge_load_firmware(mgp, 1);
3530 if (status != 0) 3491 if (status != 0)
3531 printk(KERN_ERR "myri10ge: %s: failed to load firmware\n", 3492 netdev_err(mgp->dev, "failed to load firmware\n");
3532 mgp->dev->name);
3533 else 3493 else
3534 myri10ge_open(mgp->dev); 3494 myri10ge_open(mgp->dev);
3535 rtnl_unlock(); 3495 rtnl_unlock();
@@ -3580,14 +3540,10 @@ static void myri10ge_watchdog_timer(unsigned long arg)
3580 /* nic seems like it might be stuck.. */ 3540 /* nic seems like it might be stuck.. */
3581 if (rx_pause_cnt != mgp->watchdog_pause) { 3541 if (rx_pause_cnt != mgp->watchdog_pause) {
3582 if (net_ratelimit()) 3542 if (net_ratelimit())
3583 printk(KERN_WARNING 3543 netdev_err(mgp->dev, "slice %d: TX paused, check link partner\n",
3584 "myri10ge %s slice %d:" 3544 i);
3585 "TX paused, check link partner\n",
3586 mgp->dev->name, i);
3587 } else { 3545 } else {
3588 printk(KERN_WARNING 3546 netdev_warn(mgp->dev, "slice %d stuck:", i);
3589 "myri10ge %s slice %d stuck:",
3590 mgp->dev->name, i);
3591 reset_needed = 1; 3547 reset_needed = 1;
3592 } 3548 }
3593 } 3549 }
@@ -4085,7 +4041,7 @@ static void myri10ge_remove(struct pci_dev *pdev)
4085#define PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E 0x0008 4041#define PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E 0x0008
4086#define PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E_9 0x0009 4042#define PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E_9 0x0009
4087 4043
4088static struct pci_device_id myri10ge_pci_tbl[] = { 4044static DEFINE_PCI_DEVICE_TABLE(myri10ge_pci_tbl) = {
4089 {PCI_DEVICE(PCI_VENDOR_ID_MYRICOM, PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E)}, 4045 {PCI_DEVICE(PCI_VENDOR_ID_MYRICOM, PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E)},
4090 {PCI_DEVICE 4046 {PCI_DEVICE
4091 (PCI_VENDOR_ID_MYRICOM, PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E_9)}, 4047 (PCI_VENDOR_ID_MYRICOM, PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E_9)},
@@ -4127,13 +4083,11 @@ static struct notifier_block myri10ge_dca_notifier = {
4127 4083
4128static __init int myri10ge_init_module(void) 4084static __init int myri10ge_init_module(void)
4129{ 4085{
4130 printk(KERN_INFO "%s: Version %s\n", myri10ge_driver.name, 4086 pr_info("Version %s\n", MYRI10GE_VERSION_STR);
4131 MYRI10GE_VERSION_STR);
4132 4087
4133 if (myri10ge_rss_hash > MXGEFW_RSS_HASH_TYPE_MAX) { 4088 if (myri10ge_rss_hash > MXGEFW_RSS_HASH_TYPE_MAX) {
4134 printk(KERN_ERR 4089 pr_err("Illegal rssh hash type %d, defaulting to source port\n",
4135 "%s: Illegal rssh hash type %d, defaulting to source port\n", 4090 myri10ge_rss_hash);
4136 myri10ge_driver.name, myri10ge_rss_hash);
4137 myri10ge_rss_hash = MXGEFW_RSS_HASH_TYPE_SRC_PORT; 4091 myri10ge_rss_hash = MXGEFW_RSS_HASH_TYPE_SRC_PORT;
4138 } 4092 }
4139#ifdef CONFIG_MYRI10GE_DCA 4093#ifdef CONFIG_MYRI10GE_DCA