aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-xp/xp_main.c
diff options
context:
space:
mode:
authorDean Nelson <dcn@sgi.com>2008-04-22 15:48:01 -0400
committerTony Luck <tony.luck@intel.com>2008-04-22 18:08:29 -0400
commit4a3ad2ddc0b920cd3ead84b0c67599be02d689ca (patch)
tree244e6cc7fefcf5c8c5d8245c5ac9923835a7e366 /drivers/misc/sgi-xp/xp_main.c
parent45d9ca492e4bd1522d1b5bd125c2908f1cee3d4a (diff)
[IA64] run some drivers/misc/sgi-xp through scripts/Lindent
Ran patches through scripts/Lindent (part 1). Signed-off-by: Dean Nelson <dcn@sgi.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'drivers/misc/sgi-xp/xp_main.c')
-rw-r--r--drivers/misc/sgi-xp/xp_main.c98
1 files changed, 44 insertions, 54 deletions
diff --git a/drivers/misc/sgi-xp/xp_main.c b/drivers/misc/sgi-xp/xp_main.c
index 5f9f9c2e9298..bb9257642fcf 100644
--- a/drivers/misc/sgi-xp/xp_main.c
+++ b/drivers/misc/sgi-xp/xp_main.c
@@ -6,7 +6,6 @@
6 * Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved. 6 * Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved.
7 */ 7 */
8 8
9
10/* 9/*
11 * Cross Partition (XP) base. 10 * Cross Partition (XP) base.
12 * 11 *
@@ -15,7 +14,6 @@
15 * 14 *
16 */ 15 */
17 16
18
19#include <linux/kernel.h> 17#include <linux/kernel.h>
20#include <linux/interrupt.h> 18#include <linux/interrupt.h>
21#include <linux/module.h> 19#include <linux/module.h>
@@ -24,49 +22,49 @@
24#include <asm/sn/sn_sal.h> 22#include <asm/sn/sn_sal.h>
25#include "xp.h" 23#include "xp.h"
26 24
27
28/* 25/*
29 * Target of nofault PIO read. 26 * Target of nofault PIO read.
30 */ 27 */
31u64 xp_nofault_PIOR_target; 28u64 xp_nofault_PIOR_target;
32 29
33
34/* 30/*
35 * xpc_registrations[] keeps track of xpc_connect()'s done by the kernel-level 31 * xpc_registrations[] keeps track of xpc_connect()'s done by the kernel-level
36 * users of XPC. 32 * users of XPC.
37 */ 33 */
38struct xpc_registration xpc_registrations[XPC_NCHANNELS]; 34struct xpc_registration xpc_registrations[XPC_NCHANNELS];
39 35
40
41/* 36/*
42 * Initialize the XPC interface to indicate that XPC isn't loaded. 37 * Initialize the XPC interface to indicate that XPC isn't loaded.
43 */ 38 */
44static enum xpc_retval xpc_notloaded(void) { return xpcNotLoaded; } 39static enum xpc_retval
40xpc_notloaded(void)
41{
42 return xpcNotLoaded;
43}
45 44
46struct xpc_interface xpc_interface = { 45struct xpc_interface xpc_interface = {
47 (void (*)(int)) xpc_notloaded, 46 (void (*)(int))xpc_notloaded,
48 (void (*)(int)) xpc_notloaded, 47 (void (*)(int))xpc_notloaded,
49 (enum xpc_retval (*)(partid_t, int, u32, void **)) xpc_notloaded, 48 (enum xpc_retval(*)(partid_t, int, u32, void **))xpc_notloaded,
50 (enum xpc_retval (*)(partid_t, int, void *)) xpc_notloaded, 49 (enum xpc_retval(*)(partid_t, int, void *))xpc_notloaded,
51 (enum xpc_retval (*)(partid_t, int, void *, xpc_notify_func, void *)) 50 (enum xpc_retval(*)(partid_t, int, void *, xpc_notify_func, void *))
52 xpc_notloaded, 51 xpc_notloaded,
53 (void (*)(partid_t, int, void *)) xpc_notloaded, 52 (void (*)(partid_t, int, void *))xpc_notloaded,
54 (enum xpc_retval (*)(partid_t, void *)) xpc_notloaded 53 (enum xpc_retval(*)(partid_t, void *))xpc_notloaded
55}; 54};
56 55
57
58/* 56/*
59 * XPC calls this when it (the XPC module) has been loaded. 57 * XPC calls this when it (the XPC module) has been loaded.
60 */ 58 */
61void 59void
62xpc_set_interface(void (*connect)(int), 60xpc_set_interface(void (*connect) (int),
63 void (*disconnect)(int), 61 void (*disconnect) (int),
64 enum xpc_retval (*allocate)(partid_t, int, u32, void **), 62 enum xpc_retval (*allocate) (partid_t, int, u32, void **),
65 enum xpc_retval (*send)(partid_t, int, void *), 63 enum xpc_retval (*send) (partid_t, int, void *),
66 enum xpc_retval (*send_notify)(partid_t, int, void *, 64 enum xpc_retval (*send_notify) (partid_t, int, void *,
67 xpc_notify_func, void *), 65 xpc_notify_func, void *),
68 void (*received)(partid_t, int, void *), 66 void (*received) (partid_t, int, void *),
69 enum xpc_retval (*partid_to_nasids)(partid_t, void *)) 67 enum xpc_retval (*partid_to_nasids) (partid_t, void *))
70{ 68{
71 xpc_interface.connect = connect; 69 xpc_interface.connect = connect;
72 xpc_interface.disconnect = disconnect; 70 xpc_interface.disconnect = disconnect;
@@ -77,28 +75,27 @@ xpc_set_interface(void (*connect)(int),
77 xpc_interface.partid_to_nasids = partid_to_nasids; 75 xpc_interface.partid_to_nasids = partid_to_nasids;
78} 76}
79 77
80
81/* 78/*
82 * XPC calls this when it (the XPC module) is being unloaded. 79 * XPC calls this when it (the XPC module) is being unloaded.
83 */ 80 */
84void 81void
85xpc_clear_interface(void) 82xpc_clear_interface(void)
86{ 83{
87 xpc_interface.connect = (void (*)(int)) xpc_notloaded; 84 xpc_interface.connect = (void (*)(int))xpc_notloaded;
88 xpc_interface.disconnect = (void (*)(int)) xpc_notloaded; 85 xpc_interface.disconnect = (void (*)(int))xpc_notloaded;
89 xpc_interface.allocate = (enum xpc_retval (*)(partid_t, int, u32, 86 xpc_interface.allocate = (enum xpc_retval(*)(partid_t, int, u32,
90 void **)) xpc_notloaded; 87 void **))xpc_notloaded;
91 xpc_interface.send = (enum xpc_retval (*)(partid_t, int, void *)) 88 xpc_interface.send = (enum xpc_retval(*)(partid_t, int, void *))
92 xpc_notloaded; 89 xpc_notloaded;
93 xpc_interface.send_notify = (enum xpc_retval (*)(partid_t, int, void *, 90 xpc_interface.send_notify = (enum xpc_retval(*)(partid_t, int, void *,
94 xpc_notify_func, void *)) xpc_notloaded; 91 xpc_notify_func,
92 void *))xpc_notloaded;
95 xpc_interface.received = (void (*)(partid_t, int, void *)) 93 xpc_interface.received = (void (*)(partid_t, int, void *))
96 xpc_notloaded; 94 xpc_notloaded;
97 xpc_interface.partid_to_nasids = (enum xpc_retval (*)(partid_t, void *)) 95 xpc_interface.partid_to_nasids = (enum xpc_retval(*)(partid_t, void *))
98 xpc_notloaded; 96 xpc_notloaded;
99} 97}
100 98
101
102/* 99/*
103 * Register for automatic establishment of a channel connection whenever 100 * Register for automatic establishment of a channel connection whenever
104 * a partition comes up. 101 * a partition comes up.
@@ -125,11 +122,10 @@ xpc_clear_interface(void)
125 */ 122 */
126enum xpc_retval 123enum xpc_retval
127xpc_connect(int ch_number, xpc_channel_func func, void *key, u16 payload_size, 124xpc_connect(int ch_number, xpc_channel_func func, void *key, u16 payload_size,
128 u16 nentries, u32 assigned_limit, u32 idle_limit) 125 u16 nentries, u32 assigned_limit, u32 idle_limit)
129{ 126{
130 struct xpc_registration *registration; 127 struct xpc_registration *registration;
131 128
132
133 DBUG_ON(ch_number < 0 || ch_number >= XPC_NCHANNELS); 129 DBUG_ON(ch_number < 0 || ch_number >= XPC_NCHANNELS);
134 DBUG_ON(payload_size == 0 || nentries == 0); 130 DBUG_ON(payload_size == 0 || nentries == 0);
135 DBUG_ON(func == NULL); 131 DBUG_ON(func == NULL);
@@ -162,7 +158,6 @@ xpc_connect(int ch_number, xpc_channel_func func, void *key, u16 payload_size,
162 return xpcSuccess; 158 return xpcSuccess;
163} 159}
164 160
165
166/* 161/*
167 * Remove the registration for automatic connection of the specified channel 162 * Remove the registration for automatic connection of the specified channel
168 * when a partition comes up. 163 * when a partition comes up.
@@ -181,7 +176,6 @@ xpc_disconnect(int ch_number)
181{ 176{
182 struct xpc_registration *registration; 177 struct xpc_registration *registration;
183 178
184
185 DBUG_ON(ch_number < 0 || ch_number >= XPC_NCHANNELS); 179 DBUG_ON(ch_number < 0 || ch_number >= XPC_NCHANNELS);
186 180
187 registration = &xpc_registrations[ch_number]; 181 registration = &xpc_registrations[ch_number];
@@ -214,14 +208,12 @@ xpc_disconnect(int ch_number)
214 return; 208 return;
215} 209}
216 210
217
218int __init 211int __init
219xp_init(void) 212xp_init(void)
220{ 213{
221 int ret, ch_number; 214 int ret, ch_number;
222 u64 func_addr = *(u64 *) xp_nofault_PIOR; 215 u64 func_addr = *(u64 *)xp_nofault_PIOR;
223 u64 err_func_addr = *(u64 *) xp_error_PIOR; 216 u64 err_func_addr = *(u64 *)xp_error_PIOR;
224
225 217
226 if (!ia64_platform_is("sn2")) { 218 if (!ia64_platform_is("sn2")) {
227 return -ENODEV; 219 return -ENODEV;
@@ -237,9 +229,9 @@ xp_init(void)
237 * work around). 229 * work around).
238 */ 230 */
239 if ((ret = sn_register_nofault_code(func_addr, err_func_addr, 231 if ((ret = sn_register_nofault_code(func_addr, err_func_addr,
240 err_func_addr, 1, 1)) != 0) { 232 err_func_addr, 1, 1)) != 0) {
241 printk(KERN_ERR "XP: can't register nofault code, error=%d\n", 233 printk(KERN_ERR "XP: can't register nofault code, error=%d\n",
242 ret); 234 ret);
243 } 235 }
244 /* 236 /*
245 * Setup the nofault PIO read target. (There is no special reason why 237 * Setup the nofault PIO read target. (There is no special reason why
@@ -258,22 +250,21 @@ xp_init(void)
258 250
259 return 0; 251 return 0;
260} 252}
261module_init(xp_init);
262 253
254module_init(xp_init);
263 255
264void __exit 256void __exit
265xp_exit(void) 257xp_exit(void)
266{ 258{
267 u64 func_addr = *(u64 *) xp_nofault_PIOR; 259 u64 func_addr = *(u64 *)xp_nofault_PIOR;
268 u64 err_func_addr = *(u64 *) xp_error_PIOR; 260 u64 err_func_addr = *(u64 *)xp_error_PIOR;
269
270 261
271 /* unregister the PIO read nofault code region */ 262 /* unregister the PIO read nofault code region */
272 (void) sn_register_nofault_code(func_addr, err_func_addr, 263 (void)sn_register_nofault_code(func_addr, err_func_addr,
273 err_func_addr, 1, 0); 264 err_func_addr, 1, 0);
274} 265}
275module_exit(xp_exit);
276 266
267module_exit(xp_exit);
277 268
278MODULE_AUTHOR("Silicon Graphics, Inc."); 269MODULE_AUTHOR("Silicon Graphics, Inc.");
279MODULE_DESCRIPTION("Cross Partition (XP) base"); 270MODULE_DESCRIPTION("Cross Partition (XP) base");
@@ -287,4 +278,3 @@ EXPORT_SYMBOL(xpc_clear_interface);
287EXPORT_SYMBOL(xpc_set_interface); 278EXPORT_SYMBOL(xpc_set_interface);
288EXPORT_SYMBOL(xpc_connect); 279EXPORT_SYMBOL(xpc_connect);
289EXPORT_SYMBOL(xpc_disconnect); 280EXPORT_SYMBOL(xpc_disconnect);
290