Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
Michael Ellerman | 38fcdcfe | 2005-06-30 15:16:28 +1000 | [diff] [blame] | 3 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | */ |
| 9 | |
| 10 | #include <linux/stddef.h> |
| 11 | #include <linux/kernel.h> |
| 12 | #include <linux/sched.h> |
Michael Ellerman | 512d31d | 2005-06-30 15:08:27 +1000 | [diff] [blame] | 13 | #include <linux/bootmem.h> |
Michael Ellerman | 7b01328 | 2005-06-30 15:08:44 +1000 | [diff] [blame] | 14 | #include <linux/seq_file.h> |
| 15 | #include <linux/proc_fs.h> |
Stephen Rothwell | cabb558 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 16 | #include <linux/module.h> |
| 17 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #include <asm/system.h> |
| 19 | #include <asm/paca.h> |
| 20 | #include <asm/iSeries/ItLpQueue.h> |
Kelly Daly | e45423e | 2005-11-02 12:08:31 +1100 | [diff] [blame^] | 21 | #include <asm/iseries/hv_lp_event.h> |
Kelly Daly | c0a8d05 | 2005-11-02 11:11:11 +1100 | [diff] [blame] | 22 | #include <asm/iseries/hv_call_event.h> |
Stephen Rothwell | 544cbba | 2005-09-28 02:18:47 +1000 | [diff] [blame] | 23 | #include <asm/iSeries/ItLpNaca.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | |
Michael Ellerman | ab354b6 | 2005-06-30 15:12:21 +1000 | [diff] [blame] | 25 | /* |
| 26 | * The LpQueue is used to pass event data from the hypervisor to |
| 27 | * the partition. This is where I/O interrupt events are communicated. |
| 28 | * |
| 29 | * It is written to by the hypervisor so cannot end up in the BSS. |
| 30 | */ |
Michael Ellerman | a618746 | 2005-06-30 15:15:32 +1000 | [diff] [blame] | 31 | struct hvlpevent_queue hvlpevent_queue __attribute__((__section__(".data"))); |
Michael Ellerman | ab354b6 | 2005-06-30 15:12:21 +1000 | [diff] [blame] | 32 | |
Michael Ellerman | ed09415 | 2005-06-30 15:16:09 +1000 | [diff] [blame] | 33 | DEFINE_PER_CPU(unsigned long[HvLpEvent_Type_NumTypes], hvlpevent_counts); |
| 34 | |
| 35 | static char *event_types[HvLpEvent_Type_NumTypes] = { |
Michael Ellerman | 9b04702 | 2005-06-30 15:16:18 +1000 | [diff] [blame] | 36 | "Hypervisor", |
| 37 | "Machine Facilities", |
| 38 | "Session Manager", |
| 39 | "SPD I/O", |
| 40 | "Virtual Bus", |
| 41 | "PCI I/O", |
| 42 | "RIO I/O", |
| 43 | "Virtual Lan", |
| 44 | "Virtual I/O" |
Michael Ellerman | 7b01328 | 2005-06-30 15:08:44 +1000 | [diff] [blame] | 45 | }; |
| 46 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | /* Array of LpEvent handler functions */ |
Stephen Rothwell | 544cbba | 2005-09-28 02:18:47 +1000 | [diff] [blame] | 48 | static LpEventHandler lpEventHandler[HvLpEvent_Type_NumTypes]; |
| 49 | static unsigned lpEventHandlerPaths[HvLpEvent_Type_NumTypes]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | |
Michael Ellerman | 937b31b | 2005-06-30 15:15:42 +1000 | [diff] [blame] | 51 | static struct HvLpEvent * get_next_hvlpevent(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | { |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 53 | struct HvLpEvent * event; |
| 54 | event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr; |
| 55 | |
| 56 | if (event->xFlags.xValid) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | /* rmb() needed only for weakly consistent machines (regatta) */ |
| 58 | rmb(); |
| 59 | /* Set pointer to next potential event */ |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 60 | hvlpevent_queue.xSlicCurEventPtr += ((event->xSizeMinus1 + |
| 61 | LpEventAlign) / LpEventAlign) * LpEventAlign; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 63 | /* Wrap to beginning if no room at end */ |
| 64 | if (hvlpevent_queue.xSlicCurEventPtr > |
| 65 | hvlpevent_queue.xSlicLastValidEventPtr) { |
| 66 | hvlpevent_queue.xSlicCurEventPtr = |
| 67 | hvlpevent_queue.xSlicEventStackPtr; |
| 68 | } |
| 69 | } else { |
| 70 | event = NULL; |
| 71 | } |
| 72 | |
| 73 | return event; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | } |
| 75 | |
Michael Ellerman | 0c885c1 | 2005-06-30 15:07:33 +1000 | [diff] [blame] | 76 | static unsigned long spread_lpevents = NR_CPUS; |
Michael Ellerman | bea248f | 2005-06-30 15:07:09 +1000 | [diff] [blame] | 77 | |
Michael Ellerman | 937b31b | 2005-06-30 15:15:42 +1000 | [diff] [blame] | 78 | int hvlpevent_is_pending(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | { |
Michael Ellerman | bea248f | 2005-06-30 15:07:09 +1000 | [diff] [blame] | 80 | struct HvLpEvent *next_event; |
| 81 | |
| 82 | if (smp_processor_id() >= spread_lpevents) |
| 83 | return 0; |
| 84 | |
Michael Ellerman | a618746 | 2005-06-30 15:15:32 +1000 | [diff] [blame] | 85 | next_event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr; |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 86 | |
| 87 | return next_event->xFlags.xValid | |
| 88 | hvlpevent_queue.xPlicOverflowIntPending; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | } |
| 90 | |
Michael Ellerman | 38fcdcfe | 2005-06-30 15:16:28 +1000 | [diff] [blame] | 91 | static void hvlpevent_clear_valid(struct HvLpEvent * event) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | { |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 93 | /* Tell the Hypervisor that we're done with this event. |
| 94 | * Also clear bits within this event that might look like valid bits. |
| 95 | * ie. on 64-byte boundaries. |
Michael Ellerman | 38fcdcfe | 2005-06-30 15:16:28 +1000 | [diff] [blame] | 96 | */ |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 97 | struct HvLpEvent *tmp; |
Michael Ellerman | 38fcdcfe | 2005-06-30 15:16:28 +1000 | [diff] [blame] | 98 | unsigned extra = ((event->xSizeMinus1 + LpEventAlign) / |
| 99 | LpEventAlign) - 1; |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 100 | |
Michael Ellerman | 38fcdcfe | 2005-06-30 15:16:28 +1000 | [diff] [blame] | 101 | switch (extra) { |
| 102 | case 3: |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 103 | tmp = (struct HvLpEvent*)((char*)event + 3 * LpEventAlign); |
| 104 | tmp->xFlags.xValid = 0; |
Michael Ellerman | 38fcdcfe | 2005-06-30 15:16:28 +1000 | [diff] [blame] | 105 | case 2: |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 106 | tmp = (struct HvLpEvent*)((char*)event + 2 * LpEventAlign); |
| 107 | tmp->xFlags.xValid = 0; |
Michael Ellerman | 38fcdcfe | 2005-06-30 15:16:28 +1000 | [diff] [blame] | 108 | case 1: |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 109 | tmp = (struct HvLpEvent*)((char*)event + 1 * LpEventAlign); |
| 110 | tmp->xFlags.xValid = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | } |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 112 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 113 | mb(); |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 114 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | event->xFlags.xValid = 0; |
| 116 | } |
| 117 | |
Michael Ellerman | 7488980 | 2005-06-30 15:15:53 +1000 | [diff] [blame] | 118 | void process_hvlpevents(struct pt_regs *regs) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 119 | { |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 120 | struct HvLpEvent * event; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 121 | |
| 122 | /* If we have recursed, just return */ |
Michael Ellerman | 719d1cd | 2005-06-30 15:17:02 +1000 | [diff] [blame] | 123 | if (!spin_trylock(&hvlpevent_queue.lock)) |
Michael Ellerman | 7488980 | 2005-06-30 15:15:53 +1000 | [diff] [blame] | 124 | return; |
Michael Ellerman | 38fcdcfe | 2005-06-30 15:16:28 +1000 | [diff] [blame] | 125 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | for (;;) { |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 127 | event = get_next_hvlpevent(); |
| 128 | if (event) { |
Michael Ellerman | 38fcdcfe | 2005-06-30 15:16:28 +1000 | [diff] [blame] | 129 | /* Call appropriate handler here, passing |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | * a pointer to the LpEvent. The handler |
| 131 | * must make a copy of the LpEvent if it |
| 132 | * needs it in a bottom half. (perhaps for |
| 133 | * an ACK) |
Michael Ellerman | 38fcdcfe | 2005-06-30 15:16:28 +1000 | [diff] [blame] | 134 | * |
| 135 | * Handlers are responsible for ACK processing |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 136 | * |
| 137 | * The Hypervisor guarantees that LpEvents will |
| 138 | * only be delivered with types that we have |
| 139 | * registered for, so no type check is necessary |
| 140 | * here! |
Michael Ellerman | 38fcdcfe | 2005-06-30 15:16:28 +1000 | [diff] [blame] | 141 | */ |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 142 | if (event->xType < HvLpEvent_Type_NumTypes) |
| 143 | __get_cpu_var(hvlpevent_counts)[event->xType]++; |
| 144 | if (event->xType < HvLpEvent_Type_NumTypes && |
| 145 | lpEventHandler[event->xType]) |
| 146 | lpEventHandler[event->xType](event, regs); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 147 | else |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 148 | printk(KERN_INFO "Unexpected Lp Event type=%d\n", event->xType ); |
Michael Ellerman | 38fcdcfe | 2005-06-30 15:16:28 +1000 | [diff] [blame] | 149 | |
Michael Ellerman | ffe1b7e | 2005-06-30 15:16:48 +1000 | [diff] [blame] | 150 | hvlpevent_clear_valid(event); |
Michael Ellerman | 38fcdcfe | 2005-06-30 15:16:28 +1000 | [diff] [blame] | 151 | } else if (hvlpevent_queue.xPlicOverflowIntPending) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | /* |
| 153 | * No more valid events. If overflow events are |
| 154 | * pending process them |
| 155 | */ |
Michael Ellerman | 38fcdcfe | 2005-06-30 15:16:28 +1000 | [diff] [blame] | 156 | HvCallEvent_getOverflowLpEvents(hvlpevent_queue.xIndex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | else |
| 158 | break; |
| 159 | } |
| 160 | |
Michael Ellerman | 719d1cd | 2005-06-30 15:17:02 +1000 | [diff] [blame] | 161 | spin_unlock(&hvlpevent_queue.lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 162 | } |
Michael Ellerman | 0c885c1 | 2005-06-30 15:07:33 +1000 | [diff] [blame] | 163 | |
| 164 | static int set_spread_lpevents(char *str) |
| 165 | { |
| 166 | unsigned long val = simple_strtoul(str, NULL, 0); |
| 167 | |
| 168 | /* |
| 169 | * The parameter is the number of processors to share in processing |
| 170 | * lp events. |
| 171 | */ |
| 172 | if (( val > 0) && (val <= NR_CPUS)) { |
| 173 | spread_lpevents = val; |
| 174 | printk("lpevent processing spread over %ld processors\n", val); |
| 175 | } else { |
| 176 | printk("invalid spread_lpevents %ld\n", val); |
| 177 | } |
| 178 | |
| 179 | return 1; |
| 180 | } |
| 181 | __setup("spread_lpevents=", set_spread_lpevents); |
| 182 | |
Michael Ellerman | 512d31d | 2005-06-30 15:08:27 +1000 | [diff] [blame] | 183 | void setup_hvlpevent_queue(void) |
| 184 | { |
| 185 | void *eventStack; |
| 186 | |
Stephen Rothwell | 7c7eb28 | 2005-10-24 15:21:52 +1000 | [diff] [blame] | 187 | /* Allocate a page for the Event Stack. */ |
Michael Ellerman | 512d31d | 2005-06-30 15:08:27 +1000 | [diff] [blame] | 188 | eventStack = alloc_bootmem_pages(LpEventStackSize); |
| 189 | memset(eventStack, 0, LpEventStackSize); |
| 190 | |
| 191 | /* Invoke the hypervisor to initialize the event stack */ |
| 192 | HvCallEvent_setLpEventStack(0, eventStack, LpEventStackSize); |
| 193 | |
Michael Ellerman | a618746 | 2005-06-30 15:15:32 +1000 | [diff] [blame] | 194 | hvlpevent_queue.xSlicEventStackPtr = (char *)eventStack; |
| 195 | hvlpevent_queue.xSlicCurEventPtr = (char *)eventStack; |
| 196 | hvlpevent_queue.xSlicLastValidEventPtr = (char *)eventStack + |
Michael Ellerman | 512d31d | 2005-06-30 15:08:27 +1000 | [diff] [blame] | 197 | (LpEventStackSize - LpEventMaxSize); |
Michael Ellerman | a618746 | 2005-06-30 15:15:32 +1000 | [diff] [blame] | 198 | hvlpevent_queue.xIndex = 0; |
Michael Ellerman | 512d31d | 2005-06-30 15:08:27 +1000 | [diff] [blame] | 199 | } |
Michael Ellerman | 7b01328 | 2005-06-30 15:08:44 +1000 | [diff] [blame] | 200 | |
Stephen Rothwell | 544cbba | 2005-09-28 02:18:47 +1000 | [diff] [blame] | 201 | /* Register a handler for an LpEvent type */ |
| 202 | int HvLpEvent_registerHandler(HvLpEvent_Type eventType, LpEventHandler handler) |
| 203 | { |
| 204 | if (eventType < HvLpEvent_Type_NumTypes) { |
| 205 | lpEventHandler[eventType] = handler; |
| 206 | return 0; |
| 207 | } |
| 208 | return 1; |
| 209 | } |
| 210 | EXPORT_SYMBOL(HvLpEvent_registerHandler); |
| 211 | |
| 212 | int HvLpEvent_unregisterHandler(HvLpEvent_Type eventType) |
| 213 | { |
| 214 | might_sleep(); |
| 215 | |
| 216 | if (eventType < HvLpEvent_Type_NumTypes) { |
| 217 | if (!lpEventHandlerPaths[eventType]) { |
| 218 | lpEventHandler[eventType] = NULL; |
| 219 | /* |
| 220 | * We now sleep until all other CPUs have scheduled. |
| 221 | * This ensures that the deletion is seen by all |
| 222 | * other CPUs, and that the deleted handler isn't |
| 223 | * still running on another CPU when we return. |
| 224 | */ |
| 225 | synchronize_rcu(); |
| 226 | return 0; |
| 227 | } |
| 228 | } |
| 229 | return 1; |
| 230 | } |
| 231 | EXPORT_SYMBOL(HvLpEvent_unregisterHandler); |
| 232 | |
| 233 | /* |
| 234 | * lpIndex is the partition index of the target partition. |
| 235 | * needed only for VirtualIo, VirtualLan and SessionMgr. Zero |
| 236 | * indicates to use our partition index - for the other types. |
| 237 | */ |
| 238 | int HvLpEvent_openPath(HvLpEvent_Type eventType, HvLpIndex lpIndex) |
| 239 | { |
| 240 | if ((eventType < HvLpEvent_Type_NumTypes) && |
| 241 | lpEventHandler[eventType]) { |
| 242 | if (lpIndex == 0) |
| 243 | lpIndex = itLpNaca.xLpIndex; |
| 244 | HvCallEvent_openLpEventPath(lpIndex, eventType); |
| 245 | ++lpEventHandlerPaths[eventType]; |
| 246 | return 0; |
| 247 | } |
| 248 | return 1; |
| 249 | } |
| 250 | |
| 251 | int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex) |
| 252 | { |
| 253 | if ((eventType < HvLpEvent_Type_NumTypes) && |
| 254 | lpEventHandler[eventType] && |
| 255 | lpEventHandlerPaths[eventType]) { |
| 256 | if (lpIndex == 0) |
| 257 | lpIndex = itLpNaca.xLpIndex; |
| 258 | HvCallEvent_closeLpEventPath(lpIndex, eventType); |
| 259 | --lpEventHandlerPaths[eventType]; |
| 260 | return 0; |
| 261 | } |
| 262 | return 1; |
| 263 | } |
| 264 | |
Michael Ellerman | 7b01328 | 2005-06-30 15:08:44 +1000 | [diff] [blame] | 265 | static int proc_lpevents_show(struct seq_file *m, void *v) |
| 266 | { |
Michael Ellerman | ed09415 | 2005-06-30 15:16:09 +1000 | [diff] [blame] | 267 | int cpu, i; |
| 268 | unsigned long sum; |
| 269 | static unsigned long cpu_totals[NR_CPUS]; |
| 270 | |
| 271 | /* FIXME: do we care that there's no locking here? */ |
| 272 | sum = 0; |
| 273 | for_each_online_cpu(cpu) { |
| 274 | cpu_totals[cpu] = 0; |
| 275 | for (i = 0; i < HvLpEvent_Type_NumTypes; i++) { |
| 276 | cpu_totals[cpu] += per_cpu(hvlpevent_counts, cpu)[i]; |
| 277 | } |
| 278 | sum += cpu_totals[cpu]; |
| 279 | } |
Michael Ellerman | 7b01328 | 2005-06-30 15:08:44 +1000 | [diff] [blame] | 280 | |
| 281 | seq_printf(m, "LpEventQueue 0\n"); |
Michael Ellerman | ed09415 | 2005-06-30 15:16:09 +1000 | [diff] [blame] | 282 | seq_printf(m, " events processed:\t%lu\n", sum); |
Michael Ellerman | 7b01328 | 2005-06-30 15:08:44 +1000 | [diff] [blame] | 283 | |
Michael Ellerman | ed09415 | 2005-06-30 15:16:09 +1000 | [diff] [blame] | 284 | for (i = 0; i < HvLpEvent_Type_NumTypes; ++i) { |
| 285 | sum = 0; |
| 286 | for_each_online_cpu(cpu) { |
| 287 | sum += per_cpu(hvlpevent_counts, cpu)[i]; |
| 288 | } |
| 289 | |
Michael Ellerman | 9b04702 | 2005-06-30 15:16:18 +1000 | [diff] [blame] | 290 | seq_printf(m, " %-20s %10lu\n", event_types[i], sum); |
Michael Ellerman | ed09415 | 2005-06-30 15:16:09 +1000 | [diff] [blame] | 291 | } |
Michael Ellerman | 7b01328 | 2005-06-30 15:08:44 +1000 | [diff] [blame] | 292 | |
| 293 | seq_printf(m, "\n events processed by processor:\n"); |
| 294 | |
Michael Ellerman | ed09415 | 2005-06-30 15:16:09 +1000 | [diff] [blame] | 295 | for_each_online_cpu(cpu) { |
| 296 | seq_printf(m, " CPU%02d %10lu\n", cpu, cpu_totals[cpu]); |
| 297 | } |
Michael Ellerman | 7b01328 | 2005-06-30 15:08:44 +1000 | [diff] [blame] | 298 | |
| 299 | return 0; |
| 300 | } |
| 301 | |
| 302 | static int proc_lpevents_open(struct inode *inode, struct file *file) |
| 303 | { |
| 304 | return single_open(file, proc_lpevents_show, NULL); |
| 305 | } |
| 306 | |
| 307 | static struct file_operations proc_lpevents_operations = { |
| 308 | .open = proc_lpevents_open, |
| 309 | .read = seq_read, |
| 310 | .llseek = seq_lseek, |
| 311 | .release = single_release, |
| 312 | }; |
| 313 | |
| 314 | static int __init proc_lpevents_init(void) |
| 315 | { |
| 316 | struct proc_dir_entry *e; |
| 317 | |
| 318 | e = create_proc_entry("iSeries/lpevents", S_IFREG|S_IRUGO, NULL); |
| 319 | if (e) |
| 320 | e->proc_fops = &proc_lpevents_operations; |
| 321 | |
| 322 | return 0; |
| 323 | } |
| 324 | __initcall(proc_lpevents_init); |
| 325 | |