aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/gianfar.c30
-rw-r--r--drivers/net/gianfar.h7
2 files changed, 31 insertions, 6 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index dbbeee372ef8..854f2ae3e56e 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -304,8 +304,9 @@ static int gfar_probe(struct of_device *ofdev,
304 u32 tempval; 304 u32 tempval;
305 struct net_device *dev = NULL; 305 struct net_device *dev = NULL;
306 struct gfar_private *priv = NULL; 306 struct gfar_private *priv = NULL;
307 int err = 0;
308 DECLARE_MAC_BUF(mac); 307 DECLARE_MAC_BUF(mac);
308 int err = 0;
309 int len_devname;
309 310
310 /* Create an ethernet device instance */ 311 /* Create an ethernet device instance */
311 dev = alloc_etherdev(sizeof (*priv)); 312 dev = alloc_etherdev(sizeof (*priv));
@@ -447,6 +448,23 @@ static int gfar_probe(struct of_device *ofdev,
447 goto register_fail; 448 goto register_fail;
448 } 449 }
449 450
451 /* fill out IRQ number and name fields */
452 len_devname = strlen(dev->name);
453 strncpy(&priv->int_name_tx[0], dev->name, len_devname);
454 if (priv->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) {
455 strncpy(&priv->int_name_tx[len_devname],
456 "_tx", sizeof("_tx") + 1);
457
458 strncpy(&priv->int_name_rx[0], dev->name, len_devname);
459 strncpy(&priv->int_name_rx[len_devname],
460 "_rx", sizeof("_rx") + 1);
461
462 strncpy(&priv->int_name_er[0], dev->name, len_devname);
463 strncpy(&priv->int_name_er[len_devname],
464 "_er", sizeof("_er") + 1);
465 } else
466 priv->int_name_tx[len_devname] = '\0';
467
450 /* Create all the sysfs files */ 468 /* Create all the sysfs files */
451 gfar_init_sysfs(dev); 469 gfar_init_sysfs(dev);
452 470
@@ -1020,7 +1038,7 @@ int startup_gfar(struct net_device *dev)
1020 /* Install our interrupt handlers for Error, 1038 /* Install our interrupt handlers for Error,
1021 * Transmit, and Receive */ 1039 * Transmit, and Receive */
1022 if (request_irq(priv->interruptError, gfar_error, 1040 if (request_irq(priv->interruptError, gfar_error,
1023 0, "enet_error", dev) < 0) { 1041 0, priv->int_name_er, dev) < 0) {
1024 if (netif_msg_intr(priv)) 1042 if (netif_msg_intr(priv))
1025 printk(KERN_ERR "%s: Can't get IRQ %d\n", 1043 printk(KERN_ERR "%s: Can't get IRQ %d\n",
1026 dev->name, priv->interruptError); 1044 dev->name, priv->interruptError);
@@ -1030,7 +1048,7 @@ int startup_gfar(struct net_device *dev)
1030 } 1048 }
1031 1049
1032 if (request_irq(priv->interruptTransmit, gfar_transmit, 1050 if (request_irq(priv->interruptTransmit, gfar_transmit,
1033 0, "enet_tx", dev) < 0) { 1051 0, priv->int_name_tx, dev) < 0) {
1034 if (netif_msg_intr(priv)) 1052 if (netif_msg_intr(priv))
1035 printk(KERN_ERR "%s: Can't get IRQ %d\n", 1053 printk(KERN_ERR "%s: Can't get IRQ %d\n",
1036 dev->name, priv->interruptTransmit); 1054 dev->name, priv->interruptTransmit);
@@ -1041,7 +1059,7 @@ int startup_gfar(struct net_device *dev)
1041 } 1059 }
1042 1060
1043 if (request_irq(priv->interruptReceive, gfar_receive, 1061 if (request_irq(priv->interruptReceive, gfar_receive,
1044 0, "enet_rx", dev) < 0) { 1062 0, priv->int_name_rx, dev) < 0) {
1045 if (netif_msg_intr(priv)) 1063 if (netif_msg_intr(priv))
1046 printk(KERN_ERR "%s: Can't get IRQ %d (receive0)\n", 1064 printk(KERN_ERR "%s: Can't get IRQ %d (receive0)\n",
1047 dev->name, priv->interruptReceive); 1065 dev->name, priv->interruptReceive);
@@ -1051,10 +1069,10 @@ int startup_gfar(struct net_device *dev)
1051 } 1069 }
1052 } else { 1070 } else {
1053 if (request_irq(priv->interruptTransmit, gfar_interrupt, 1071 if (request_irq(priv->interruptTransmit, gfar_interrupt,
1054 0, "gfar_interrupt", dev) < 0) { 1072 0, priv->int_name_tx, dev) < 0) {
1055 if (netif_msg_intr(priv)) 1073 if (netif_msg_intr(priv))
1056 printk(KERN_ERR "%s: Can't get IRQ %d\n", 1074 printk(KERN_ERR "%s: Can't get IRQ %d\n",
1057 dev->name, priv->interruptError); 1075 dev->name, priv->interruptTransmit);
1058 1076
1059 err = -1; 1077 err = -1;
1060 goto err_irq_fail; 1078 goto err_irq_fail;
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index 7ef3cc5cabe9..06bac34c3b52 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -374,6 +374,8 @@ extern const char gfar_driver_version[];
374#define RXFCB_PERR_MASK 0x000c 374#define RXFCB_PERR_MASK 0x000c
375#define RXFCB_PERR_BADL3 0x0008 375#define RXFCB_PERR_BADL3 0x0008
376 376
377#define GFAR_INT_NAME_MAX IFNAMSIZ + 4
378
377struct txbd8 379struct txbd8
378{ 380{
379 union { 381 union {
@@ -796,6 +798,11 @@ struct gfar_private {
796 uint32_t msg_enable; 798 uint32_t msg_enable;
797 799
798 struct work_struct reset_task; 800 struct work_struct reset_task;
801
802 char int_name_tx[GFAR_INT_NAME_MAX];
803 char int_name_rx[GFAR_INT_NAME_MAX];
804 char int_name_er[GFAR_INT_NAME_MAX];
805
799 /* Network Statistics */ 806 /* Network Statistics */
800 struct gfar_extra_stats extra_stats; 807 struct gfar_extra_stats extra_stats;
801}; 808};