diff options
author | Dai Haruki <dai.haruki@freescale.com> | 2008-12-17 19:51:32 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-17 19:51:32 -0500 |
commit | c50a5d9aedef5b0b289d07f6d73934d394e50b3f (patch) | |
tree | 10b8310c60f448683bbb80ec7a01c42035a3052f /drivers/net/gianfar.c | |
parent | 4669bc907488f5a3ee399ced132deb6165e489a3 (diff) |
gianfar: Use interface name in interrupt name to distinguish the source.
Interface name (ex. eth0) is used as the prefix for the interrupt name,
with _rx, _tx, and _er appended to distinguish multiple interrupts on
the same interface.
Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r-- | drivers/net/gianfar.c | 30 |
1 files changed, 24 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; |