lowlevel.c (1da177e4c3f41524e886b7f1b8a0c1fc7321cac2) lowlevel.c (278d72ae8803ffcd16070c95fe1d53f4466dc741)
1/*
2 * IBM ASM Service Processor Device Driver
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *

--- 32 unchanged lines hidden (view full) ---

41 if (!mfa)
42 return 1;
43
44 command_size = get_dot_command_size(command->buffer);
45 header.message_size = outgoing_message_size(command_size);
46
47 message = get_i2o_message(sp->base_address, mfa);
48
1/*
2 * IBM ASM Service Processor Device Driver
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *

--- 32 unchanged lines hidden (view full) ---

41 if (!mfa)
42 return 1;
43
44 command_size = get_dot_command_size(command->buffer);
45 header.message_size = outgoing_message_size(command_size);
46
47 message = get_i2o_message(sp->base_address, mfa);
48
49 memcpy(&message->header, &header, sizeof(struct i2o_header));
50 memcpy(&message->data, command->buffer, command_size);
49 memcpy_toio(&message->header, &header, sizeof(struct i2o_header));
50 memcpy_toio(&message->data, command->buffer, command_size);
51
52 set_mfa_inbound(sp->base_address, mfa);
53
54 return 0;
55}
56
57irqreturn_t ibmasm_interrupt_handler(int irq, void * dev_id, struct pt_regs *regs)
58{
59 u32 mfa;
60 struct service_processor *sp = (struct service_processor *)dev_id;
61 void __iomem *base_address = sp->base_address;
51
52 set_mfa_inbound(sp->base_address, mfa);
53
54 return 0;
55}
56
57irqreturn_t ibmasm_interrupt_handler(int irq, void * dev_id, struct pt_regs *regs)
58{
59 u32 mfa;
60 struct service_processor *sp = (struct service_processor *)dev_id;
61 void __iomem *base_address = sp->base_address;
62 char tsbuf[32];
62
63 if (!sp_interrupt_pending(base_address))
64 return IRQ_NONE;
65
63
64 if (!sp_interrupt_pending(base_address))
65 return IRQ_NONE;
66
67 dbg("respond to interrupt at %s\n", get_timestamp(tsbuf));
68
66 if (mouse_interrupt_pending(sp)) {
69 if (mouse_interrupt_pending(sp)) {
67 ibmasm_handle_mouse_interrupt(sp);
68 mfa = get_mfa_outbound(base_address);
70 ibmasm_handle_mouse_interrupt(sp, regs);
69 clear_mouse_interrupt(sp);
71 clear_mouse_interrupt(sp);
70 set_mfa_outbound(base_address, mfa);
71 return IRQ_HANDLED;
72 }
73
74 mfa = get_mfa_outbound(base_address);
75 if (valid_mfa(mfa)) {
76 struct i2o_message *msg = get_i2o_message(base_address, mfa);
77 ibmasm_receive_message(sp, &msg->data, incoming_data_size(msg));
72 }
73
74 mfa = get_mfa_outbound(base_address);
75 if (valid_mfa(mfa)) {
76 struct i2o_message *msg = get_i2o_message(base_address, mfa);
77 ibmasm_receive_message(sp, &msg->data, incoming_data_size(msg));
78 }
78 } else
79 dbg("didn't get a valid MFA\n");
80
79 set_mfa_outbound(base_address, mfa);
81 set_mfa_outbound(base_address, mfa);
82 dbg("finished interrupt at %s\n", get_timestamp(tsbuf));
83
80 return IRQ_HANDLED;
81}
84 return IRQ_HANDLED;
85}