aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/hp/sim/simeth.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-03-08 15:01:18 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-08 15:26:30 -0500
commit6efb6b77ff6fd512e9ef45b29f1940cb924cd7a6 (patch)
treeaf1c250060eac5eed26608e8709ae7e4d3c4b287 /arch/ia64/hp/sim/simeth.c
parent035cfe5ac55d399169b7f61f7a111d3d7075190c (diff)
hpsim, initialize chip for assigned irqs
Currently, when assign_irq_vector is called and the irq connected in the simulator, the irq is not ready. request_irq will return ENOSYS immediately. It is because the irq chip is unset. Hence set the chip properly to irq_type_hp_sim. And make sure this is done from both users of simulated interrupts. Also we have to set handler here, otherwise we end up in handle_bad_int resulting in spam in logs and no irqs handled. We use handle_simple_irq as these are SW interrupts that need no ACK or anything. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/ia64/hp/sim/simeth.c')
-rw-r--r--arch/ia64/hp/sim/simeth.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c
index 47afcc61f6e5..e343357f80b9 100644
--- a/arch/ia64/hp/sim/simeth.c
+++ b/arch/ia64/hp/sim/simeth.c
@@ -129,17 +129,6 @@ netdev_probe(char *name, unsigned char *ether)
129 129
130 130
131static inline int 131static inline int
132netdev_connect(int irq)
133{
134 /* XXX Fix me
135 * this does not support multiple cards
136 * also no return value
137 */
138 ia64_ssc_connect_irq(NETWORK_INTR, irq);
139 return 0;
140}
141
142static inline int
143netdev_attach(int fd, int irq, unsigned int ipaddr) 132netdev_attach(int fd, int irq, unsigned int ipaddr)
144{ 133{
145 /* this puts the host interface in the right mode (start interrupting) */ 134 /* this puts the host interface in the right mode (start interrupting) */
@@ -226,15 +215,13 @@ simeth_probe1(void)
226 return err; 215 return err;
227 } 216 }
228 217
229 if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0)
230 panic("%s: out of interrupt vectors!\n", __func__);
231 dev->irq = rc;
232
233 /* 218 /*
234 * attach the interrupt in the simulator, this does enable interrupts 219 * attach the interrupt in the simulator, this does enable interrupts
235 * until a netdev_attach() is called 220 * until a netdev_attach() is called
236 */ 221 */
237 netdev_connect(dev->irq); 222 if ((rc = hpsim_get_irq(NETWORK_INTR)) < 0)
223 panic("%s: out of interrupt vectors!\n", __func__);
224 dev->irq = rc;
238 225
239 printk(KERN_INFO "%s: hosteth=%s simfd=%d, HwAddr", 226 printk(KERN_INFO "%s: hosteth=%s simfd=%d, HwAddr",
240 dev->name, simeth_device, local->simfd); 227 dev->name, simeth_device, local->simfd);