diff options
author | Robin Holt <holt@sgi.com> | 2009-04-13 17:40:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-13 18:04:33 -0400 |
commit | a7665b0a380585fbd70a2275f3120c6086e0c92d (patch) | |
tree | 01465e3d7a8bc917084e9a47789f3508c38307cf /drivers/misc/sgi-xp/xpc_sn2.c | |
parent | efdd06ed181a88a11e612238c1ac04668e665395 (diff) |
sgi-xpc: clean up numerous globals
Introduce xpc_arch_ops and eliminate numerous individual global definitions.
Signed-off-by: Robin Holt <holt@sgi.com>
Cc: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-xp/xpc_sn2.c')
-rw-r--r-- | drivers/misc/sgi-xp/xpc_sn2.c | 122 |
1 files changed, 63 insertions, 59 deletions
diff --git a/drivers/misc/sgi-xp/xpc_sn2.c b/drivers/misc/sgi-xp/xpc_sn2.c index 09bc1989f216..915a3b495da5 100644 --- a/drivers/misc/sgi-xp/xpc_sn2.c +++ b/drivers/misc/sgi-xp/xpc_sn2.c | |||
@@ -60,14 +60,14 @@ static struct xpc_vars_sn2 *xpc_vars_sn2; | |||
60 | static struct xpc_vars_part_sn2 *xpc_vars_part_sn2; | 60 | static struct xpc_vars_part_sn2 *xpc_vars_part_sn2; |
61 | 61 | ||
62 | static int | 62 | static int |
63 | xpc_setup_partitions_sn_sn2(void) | 63 | xpc_setup_partitions_sn2(void) |
64 | { | 64 | { |
65 | /* nothing needs to be done */ | 65 | /* nothing needs to be done */ |
66 | return 0; | 66 | return 0; |
67 | } | 67 | } |
68 | 68 | ||
69 | static void | 69 | static void |
70 | xpc_teardown_partitions_sn_sn2(void) | 70 | xpc_teardown_partitions_sn2(void) |
71 | { | 71 | { |
72 | /* nothing needs to be done */ | 72 | /* nothing needs to be done */ |
73 | } | 73 | } |
@@ -628,7 +628,7 @@ xpc_get_partition_rsvd_page_pa_sn2(void *buf, u64 *cookie, unsigned long *rp_pa, | |||
628 | 628 | ||
629 | 629 | ||
630 | static int | 630 | static int |
631 | xpc_setup_rsvd_page_sn_sn2(struct xpc_rsvd_page *rp) | 631 | xpc_setup_rsvd_page_sn2(struct xpc_rsvd_page *rp) |
632 | { | 632 | { |
633 | struct amo *amos_page; | 633 | struct amo *amos_page; |
634 | int i; | 634 | int i; |
@@ -1162,7 +1162,7 @@ xpc_process_activate_IRQ_rcvd_sn2(void) | |||
1162 | * Setup the channel structures that are sn2 specific. | 1162 | * Setup the channel structures that are sn2 specific. |
1163 | */ | 1163 | */ |
1164 | static enum xp_retval | 1164 | static enum xp_retval |
1165 | xpc_setup_ch_structures_sn_sn2(struct xpc_partition *part) | 1165 | xpc_setup_ch_structures_sn2(struct xpc_partition *part) |
1166 | { | 1166 | { |
1167 | struct xpc_partition_sn2 *part_sn2 = &part->sn.sn2; | 1167 | struct xpc_partition_sn2 *part_sn2 = &part->sn.sn2; |
1168 | struct xpc_channel_sn2 *ch_sn2; | 1168 | struct xpc_channel_sn2 *ch_sn2; |
@@ -1284,7 +1284,7 @@ out_1: | |||
1284 | * Teardown the channel structures that are sn2 specific. | 1284 | * Teardown the channel structures that are sn2 specific. |
1285 | */ | 1285 | */ |
1286 | static void | 1286 | static void |
1287 | xpc_teardown_ch_structures_sn_sn2(struct xpc_partition *part) | 1287 | xpc_teardown_ch_structures_sn2(struct xpc_partition *part) |
1288 | { | 1288 | { |
1289 | struct xpc_partition_sn2 *part_sn2 = &part->sn.sn2; | 1289 | struct xpc_partition_sn2 *part_sn2 = &part->sn.sn2; |
1290 | short partid = XPC_PARTID(part); | 1290 | short partid = XPC_PARTID(part); |
@@ -2348,66 +2348,70 @@ xpc_received_payload_sn2(struct xpc_channel *ch, void *payload) | |||
2348 | xpc_acknowledge_msgs_sn2(ch, get, msg->flags); | 2348 | xpc_acknowledge_msgs_sn2(ch, get, msg->flags); |
2349 | } | 2349 | } |
2350 | 2350 | ||
2351 | static struct xpc_arch_operations xpc_arch_ops_sn2 = { | ||
2352 | .setup_partitions = xpc_setup_partitions_sn2, | ||
2353 | .teardown_partitions = xpc_teardown_partitions_sn2, | ||
2354 | .process_activate_IRQ_rcvd = xpc_process_activate_IRQ_rcvd_sn2, | ||
2355 | .get_partition_rsvd_page_pa = xpc_get_partition_rsvd_page_pa_sn2, | ||
2356 | .setup_rsvd_page = xpc_setup_rsvd_page_sn2, | ||
2357 | |||
2358 | .allow_hb = xpc_allow_hb_sn2, | ||
2359 | .disallow_hb = xpc_disallow_hb_sn2, | ||
2360 | .disallow_all_hbs = xpc_disallow_all_hbs_sn2, | ||
2361 | .increment_heartbeat = xpc_increment_heartbeat_sn2, | ||
2362 | .offline_heartbeat = xpc_offline_heartbeat_sn2, | ||
2363 | .online_heartbeat = xpc_online_heartbeat_sn2, | ||
2364 | .heartbeat_init = xpc_heartbeat_init_sn2, | ||
2365 | .heartbeat_exit = xpc_heartbeat_exit_sn2, | ||
2366 | .get_remote_heartbeat = xpc_get_remote_heartbeat_sn2, | ||
2367 | |||
2368 | .request_partition_activation = | ||
2369 | xpc_request_partition_activation_sn2, | ||
2370 | .request_partition_reactivation = | ||
2371 | xpc_request_partition_reactivation_sn2, | ||
2372 | .request_partition_deactivation = | ||
2373 | xpc_request_partition_deactivation_sn2, | ||
2374 | .cancel_partition_deactivation_request = | ||
2375 | xpc_cancel_partition_deactivation_request_sn2, | ||
2376 | |||
2377 | .setup_ch_structures = xpc_setup_ch_structures_sn2, | ||
2378 | .teardown_ch_structures = xpc_teardown_ch_structures_sn2, | ||
2379 | |||
2380 | .make_first_contact = xpc_make_first_contact_sn2, | ||
2381 | |||
2382 | .get_chctl_all_flags = xpc_get_chctl_all_flags_sn2, | ||
2383 | .send_chctl_closerequest = xpc_send_chctl_closerequest_sn2, | ||
2384 | .send_chctl_closereply = xpc_send_chctl_closereply_sn2, | ||
2385 | .send_chctl_openrequest = xpc_send_chctl_openrequest_sn2, | ||
2386 | .send_chctl_openreply = xpc_send_chctl_openreply_sn2, | ||
2387 | .send_chctl_opencomplete = xpc_send_chctl_opencomplete_sn2, | ||
2388 | .process_msg_chctl_flags = xpc_process_msg_chctl_flags_sn2, | ||
2389 | |||
2390 | .save_remote_msgqueue_pa = xpc_save_remote_msgqueue_pa_sn2, | ||
2391 | |||
2392 | .setup_msg_structures = xpc_setup_msg_structures_sn2, | ||
2393 | .teardown_msg_structures = xpc_teardown_msg_structures_sn2, | ||
2394 | |||
2395 | .indicate_partition_engaged = xpc_indicate_partition_engaged_sn2, | ||
2396 | .indicate_partition_disengaged = xpc_indicate_partition_disengaged_sn2, | ||
2397 | .partition_engaged = xpc_partition_engaged_sn2, | ||
2398 | .any_partition_engaged = xpc_any_partition_engaged_sn2, | ||
2399 | .assume_partition_disengaged = xpc_assume_partition_disengaged_sn2, | ||
2400 | |||
2401 | .n_of_deliverable_payloads = xpc_n_of_deliverable_payloads_sn2, | ||
2402 | .send_payload = xpc_send_payload_sn2, | ||
2403 | .get_deliverable_payload = xpc_get_deliverable_payload_sn2, | ||
2404 | .received_payload = xpc_received_payload_sn2, | ||
2405 | .notify_senders_of_disconnect = xpc_notify_senders_of_disconnect_sn2, | ||
2406 | }; | ||
2407 | |||
2351 | int | 2408 | int |
2352 | xpc_init_sn2(void) | 2409 | xpc_init_sn2(void) |
2353 | { | 2410 | { |
2354 | int ret; | 2411 | int ret; |
2355 | size_t buf_size; | 2412 | size_t buf_size; |
2356 | 2413 | ||
2357 | xpc_setup_partitions_sn = xpc_setup_partitions_sn_sn2; | 2414 | xpc_arch_ops = xpc_arch_ops_sn2; |
2358 | xpc_teardown_partitions_sn = xpc_teardown_partitions_sn_sn2; | ||
2359 | xpc_get_partition_rsvd_page_pa = xpc_get_partition_rsvd_page_pa_sn2; | ||
2360 | xpc_setup_rsvd_page_sn = xpc_setup_rsvd_page_sn_sn2; | ||
2361 | |||
2362 | xpc_allow_hb = xpc_allow_hb_sn2; | ||
2363 | xpc_disallow_hb = xpc_disallow_hb_sn2; | ||
2364 | xpc_disallow_all_hbs = xpc_disallow_all_hbs_sn2; | ||
2365 | xpc_increment_heartbeat = xpc_increment_heartbeat_sn2; | ||
2366 | xpc_offline_heartbeat = xpc_offline_heartbeat_sn2; | ||
2367 | xpc_online_heartbeat = xpc_online_heartbeat_sn2; | ||
2368 | xpc_heartbeat_init = xpc_heartbeat_init_sn2; | ||
2369 | xpc_heartbeat_exit = xpc_heartbeat_exit_sn2; | ||
2370 | xpc_get_remote_heartbeat = xpc_get_remote_heartbeat_sn2; | ||
2371 | |||
2372 | xpc_request_partition_activation = xpc_request_partition_activation_sn2; | ||
2373 | xpc_request_partition_reactivation = | ||
2374 | xpc_request_partition_reactivation_sn2; | ||
2375 | xpc_request_partition_deactivation = | ||
2376 | xpc_request_partition_deactivation_sn2; | ||
2377 | xpc_cancel_partition_deactivation_request = | ||
2378 | xpc_cancel_partition_deactivation_request_sn2; | ||
2379 | |||
2380 | xpc_process_activate_IRQ_rcvd = xpc_process_activate_IRQ_rcvd_sn2; | ||
2381 | xpc_setup_ch_structures_sn = xpc_setup_ch_structures_sn_sn2; | ||
2382 | xpc_teardown_ch_structures_sn = xpc_teardown_ch_structures_sn_sn2; | ||
2383 | xpc_make_first_contact = xpc_make_first_contact_sn2; | ||
2384 | |||
2385 | xpc_get_chctl_all_flags = xpc_get_chctl_all_flags_sn2; | ||
2386 | xpc_send_chctl_closerequest = xpc_send_chctl_closerequest_sn2; | ||
2387 | xpc_send_chctl_closereply = xpc_send_chctl_closereply_sn2; | ||
2388 | xpc_send_chctl_openrequest = xpc_send_chctl_openrequest_sn2; | ||
2389 | xpc_send_chctl_openreply = xpc_send_chctl_openreply_sn2; | ||
2390 | xpc_send_chctl_opencomplete = xpc_send_chctl_opencomplete_sn2; | ||
2391 | |||
2392 | xpc_save_remote_msgqueue_pa = xpc_save_remote_msgqueue_pa_sn2; | ||
2393 | |||
2394 | xpc_setup_msg_structures = xpc_setup_msg_structures_sn2; | ||
2395 | xpc_teardown_msg_structures = xpc_teardown_msg_structures_sn2; | ||
2396 | |||
2397 | xpc_notify_senders_of_disconnect = xpc_notify_senders_of_disconnect_sn2; | ||
2398 | xpc_process_msg_chctl_flags = xpc_process_msg_chctl_flags_sn2; | ||
2399 | xpc_n_of_deliverable_payloads = xpc_n_of_deliverable_payloads_sn2; | ||
2400 | xpc_get_deliverable_payload = xpc_get_deliverable_payload_sn2; | ||
2401 | |||
2402 | xpc_indicate_partition_engaged = xpc_indicate_partition_engaged_sn2; | ||
2403 | xpc_indicate_partition_disengaged = | ||
2404 | xpc_indicate_partition_disengaged_sn2; | ||
2405 | xpc_partition_engaged = xpc_partition_engaged_sn2; | ||
2406 | xpc_any_partition_engaged = xpc_any_partition_engaged_sn2; | ||
2407 | xpc_assume_partition_disengaged = xpc_assume_partition_disengaged_sn2; | ||
2408 | |||
2409 | xpc_send_payload = xpc_send_payload_sn2; | ||
2410 | xpc_received_payload = xpc_received_payload_sn2; | ||
2411 | 2415 | ||
2412 | if (offsetof(struct xpc_msg_sn2, payload) > XPC_MSG_HDR_MAX_SIZE) { | 2416 | if (offsetof(struct xpc_msg_sn2, payload) > XPC_MSG_HDR_MAX_SIZE) { |
2413 | dev_err(xpc_part, "header portion of struct xpc_msg_sn2 is " | 2417 | dev_err(xpc_part, "header portion of struct xpc_msg_sn2 is " |