diff options
| author | Dean Nelson <dcn@sgi.com> | 2008-05-12 17:02:02 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-13 11:02:23 -0400 |
| commit | 65c17b801e03e40acdca0cd34e8eb1b8a347b539 (patch) | |
| tree | fe5c5ccb73604d6cbd88525f930b50b8435a71a7 /drivers/misc/sgi-xp/xpc.h | |
| parent | 0cf942d75a6acfa11a41f63330d8780901eda4af (diff) | |
drivers/misc/sgi-xp: clean up return values
Make XP return values more generic to XP and not so tied to XPC by changing
enum xpc_retval to xp_retval, along with changing return value prefixes from
xpc to xp. Also, cleanup a comment block that referenced some of these return
values as well as the handling of BTE related return values.
Signed-off-by: Dean Nelson <dcn@sgi.com>
Acked-by: Robin Holt <holt@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.h')
| -rw-r--r-- | drivers/misc/sgi-xp/xpc.h | 71 |
1 files changed, 20 insertions, 51 deletions
diff --git a/drivers/misc/sgi-xp/xpc.h b/drivers/misc/sgi-xp/xpc.h index 9eb6d4a3269..67b179abf4a 100644 --- a/drivers/misc/sgi-xp/xpc.h +++ b/drivers/misc/sgi-xp/xpc.h | |||
| @@ -412,7 +412,7 @@ struct xpc_channel { | |||
| 412 | spinlock_t lock; /* lock for updating this structure */ | 412 | spinlock_t lock; /* lock for updating this structure */ |
| 413 | u32 flags; /* general flags */ | 413 | u32 flags; /* general flags */ |
| 414 | 414 | ||
| 415 | enum xpc_retval reason; /* reason why channel is disconnect'g */ | 415 | enum xp_retval reason; /* reason why channel is disconnect'g */ |
| 416 | int reason_line; /* line# disconnect initiated from */ | 416 | int reason_line; /* line# disconnect initiated from */ |
| 417 | 417 | ||
| 418 | u16 number; /* channel # */ | 418 | u16 number; /* channel # */ |
| @@ -522,7 +522,7 @@ struct xpc_partition { | |||
| 522 | spinlock_t act_lock; /* protect updating of act_state */ | 522 | spinlock_t act_lock; /* protect updating of act_state */ |
| 523 | u8 act_state; /* from XPC HB viewpoint */ | 523 | u8 act_state; /* from XPC HB viewpoint */ |
| 524 | u8 remote_vars_version; /* version# of partition's vars */ | 524 | u8 remote_vars_version; /* version# of partition's vars */ |
| 525 | enum xpc_retval reason; /* reason partition is deactivating */ | 525 | enum xp_retval reason; /* reason partition is deactivating */ |
| 526 | int reason_line; /* line# deactivation initiated from */ | 526 | int reason_line; /* line# deactivation initiated from */ |
| 527 | int reactivate_nasid; /* nasid in partition to reactivate */ | 527 | int reactivate_nasid; /* nasid in partition to reactivate */ |
| 528 | 528 | ||
| @@ -646,31 +646,31 @@ extern void xpc_allow_IPI_ops(void); | |||
| 646 | extern void xpc_restrict_IPI_ops(void); | 646 | extern void xpc_restrict_IPI_ops(void); |
| 647 | extern int xpc_identify_act_IRQ_sender(void); | 647 | extern int xpc_identify_act_IRQ_sender(void); |
| 648 | extern int xpc_partition_disengaged(struct xpc_partition *); | 648 | extern int xpc_partition_disengaged(struct xpc_partition *); |
| 649 | extern enum xpc_retval xpc_mark_partition_active(struct xpc_partition *); | 649 | extern enum xp_retval xpc_mark_partition_active(struct xpc_partition *); |
| 650 | extern void xpc_mark_partition_inactive(struct xpc_partition *); | 650 | extern void xpc_mark_partition_inactive(struct xpc_partition *); |
| 651 | extern void xpc_discovery(void); | 651 | extern void xpc_discovery(void); |
| 652 | extern void xpc_check_remote_hb(void); | 652 | extern void xpc_check_remote_hb(void); |
| 653 | extern void xpc_deactivate_partition(const int, struct xpc_partition *, | 653 | extern void xpc_deactivate_partition(const int, struct xpc_partition *, |
| 654 | enum xpc_retval); | 654 | enum xp_retval); |
| 655 | extern enum xpc_retval xpc_initiate_partid_to_nasids(partid_t, void *); | 655 | extern enum xp_retval xpc_initiate_partid_to_nasids(partid_t, void *); |
| 656 | 656 | ||
| 657 | /* found in xpc_channel.c */ | 657 | /* found in xpc_channel.c */ |
| 658 | extern void xpc_initiate_connect(int); | 658 | extern void xpc_initiate_connect(int); |
| 659 | extern void xpc_initiate_disconnect(int); | 659 | extern void xpc_initiate_disconnect(int); |
| 660 | extern enum xpc_retval xpc_initiate_allocate(partid_t, int, u32, void **); | 660 | extern enum xp_retval xpc_initiate_allocate(partid_t, int, u32, void **); |
| 661 | extern enum xpc_retval xpc_initiate_send(partid_t, int, void *); | 661 | extern enum xp_retval xpc_initiate_send(partid_t, int, void *); |
| 662 | extern enum xpc_retval xpc_initiate_send_notify(partid_t, int, void *, | 662 | extern enum xp_retval xpc_initiate_send_notify(partid_t, int, void *, |
| 663 | xpc_notify_func, void *); | 663 | xpc_notify_func, void *); |
| 664 | extern void xpc_initiate_received(partid_t, int, void *); | 664 | extern void xpc_initiate_received(partid_t, int, void *); |
| 665 | extern enum xpc_retval xpc_setup_infrastructure(struct xpc_partition *); | 665 | extern enum xp_retval xpc_setup_infrastructure(struct xpc_partition *); |
| 666 | extern enum xpc_retval xpc_pull_remote_vars_part(struct xpc_partition *); | 666 | extern enum xp_retval xpc_pull_remote_vars_part(struct xpc_partition *); |
| 667 | extern void xpc_process_channel_activity(struct xpc_partition *); | 667 | extern void xpc_process_channel_activity(struct xpc_partition *); |
| 668 | extern void xpc_connected_callout(struct xpc_channel *); | 668 | extern void xpc_connected_callout(struct xpc_channel *); |
| 669 | extern void xpc_deliver_msg(struct xpc_channel *); | 669 | extern void xpc_deliver_msg(struct xpc_channel *); |
| 670 | extern void xpc_disconnect_channel(const int, struct xpc_channel *, | 670 | extern void xpc_disconnect_channel(const int, struct xpc_channel *, |
| 671 | enum xpc_retval, unsigned long *); | 671 | enum xp_retval, unsigned long *); |
| 672 | extern void xpc_disconnect_callout(struct xpc_channel *, enum xpc_retval); | 672 | extern void xpc_disconnect_callout(struct xpc_channel *, enum xp_retval); |
| 673 | extern void xpc_partition_going_down(struct xpc_partition *, enum xpc_retval); | 673 | extern void xpc_partition_going_down(struct xpc_partition *, enum xp_retval); |
| 674 | extern void xpc_teardown_infrastructure(struct xpc_partition *); | 674 | extern void xpc_teardown_infrastructure(struct xpc_partition *); |
| 675 | 675 | ||
| 676 | static inline void | 676 | static inline void |
| @@ -901,7 +901,7 @@ xpc_IPI_receive(AMO_t *amo) | |||
| 901 | return FETCHOP_LOAD_OP(TO_AMO((u64)&amo->variable), FETCHOP_CLEAR); | 901 | return FETCHOP_LOAD_OP(TO_AMO((u64)&amo->variable), FETCHOP_CLEAR); |
| 902 | } | 902 | } |
| 903 | 903 | ||
| 904 | static inline enum xpc_retval | 904 | static inline enum xp_retval |
| 905 | xpc_IPI_send(AMO_t *amo, u64 flag, int nasid, int phys_cpuid, int vector) | 905 | xpc_IPI_send(AMO_t *amo, u64 flag, int nasid, int phys_cpuid, int vector) |
| 906 | { | 906 | { |
| 907 | int ret = 0; | 907 | int ret = 0; |
| @@ -923,7 +923,7 @@ xpc_IPI_send(AMO_t *amo, u64 flag, int nasid, int phys_cpuid, int vector) | |||
| 923 | 923 | ||
| 924 | local_irq_restore(irq_flags); | 924 | local_irq_restore(irq_flags); |
| 925 | 925 | ||
| 926 | return ((ret == 0) ? xpcSuccess : xpcPioReadError); | 926 | return ((ret == 0) ? xpSuccess : xpPioReadError); |
| 927 | } | 927 | } |
| 928 | 928 | ||
| 929 | /* | 929 | /* |
| @@ -992,7 +992,7 @@ xpc_notify_IRQ_send(struct xpc_channel *ch, u8 ipi_flag, char *ipi_flag_string, | |||
| 992 | unsigned long *irq_flags) | 992 | unsigned long *irq_flags) |
| 993 | { | 993 | { |
| 994 | struct xpc_partition *part = &xpc_partitions[ch->partid]; | 994 | struct xpc_partition *part = &xpc_partitions[ch->partid]; |
| 995 | enum xpc_retval ret; | 995 | enum xp_retval ret; |
| 996 | 996 | ||
| 997 | if (likely(part->act_state != XPC_P_DEACTIVATING)) { | 997 | if (likely(part->act_state != XPC_P_DEACTIVATING)) { |
| 998 | ret = xpc_IPI_send(part->remote_IPI_amo_va, | 998 | ret = xpc_IPI_send(part->remote_IPI_amo_va, |
| @@ -1001,7 +1001,7 @@ xpc_notify_IRQ_send(struct xpc_channel *ch, u8 ipi_flag, char *ipi_flag_string, | |||
| 1001 | part->remote_IPI_phys_cpuid, SGI_XPC_NOTIFY); | 1001 | part->remote_IPI_phys_cpuid, SGI_XPC_NOTIFY); |
| 1002 | dev_dbg(xpc_chan, "%s sent to partid=%d, channel=%d, ret=%d\n", | 1002 | dev_dbg(xpc_chan, "%s sent to partid=%d, channel=%d, ret=%d\n", |
| 1003 | ipi_flag_string, ch->partid, ch->number, ret); | 1003 | ipi_flag_string, ch->partid, ch->number, ret); |
| 1004 | if (unlikely(ret != xpcSuccess)) { | 1004 | if (unlikely(ret != xpSuccess)) { |
| 1005 | if (irq_flags != NULL) | 1005 | if (irq_flags != NULL) |
| 1006 | spin_unlock_irqrestore(&ch->lock, *irq_flags); | 1006 | spin_unlock_irqrestore(&ch->lock, *irq_flags); |
| 1007 | XPC_DEACTIVATE_PARTITION(part, ret); | 1007 | XPC_DEACTIVATE_PARTITION(part, ret); |
| @@ -1123,41 +1123,10 @@ xpc_IPI_init(int index) | |||
| 1123 | return amo; | 1123 | return amo; |
| 1124 | } | 1124 | } |
| 1125 | 1125 | ||
| 1126 | static inline enum xpc_retval | 1126 | static inline enum xp_retval |
| 1127 | xpc_map_bte_errors(bte_result_t error) | 1127 | xpc_map_bte_errors(bte_result_t error) |
| 1128 | { | 1128 | { |
| 1129 | if (error == BTE_SUCCESS) | 1129 | return ((error == BTE_SUCCESS) ? xpSuccess : xpBteCopyError); |
| 1130 | return xpcSuccess; | ||
| 1131 | |||
| 1132 | if (is_shub2()) { | ||
| 1133 | if (BTE_VALID_SH2_ERROR(error)) | ||
| 1134 | return xpcBteSh2Start + error; | ||
| 1135 | return xpcBteUnmappedError; | ||
| 1136 | } | ||
| 1137 | switch (error) { | ||
| 1138 | case BTE_SUCCESS: | ||
| 1139 | return xpcSuccess; | ||
| 1140 | case BTEFAIL_DIR: | ||
| 1141 | return xpcBteDirectoryError; | ||
| 1142 | case BTEFAIL_POISON: | ||
| 1143 | return xpcBtePoisonError; | ||
| 1144 | case BTEFAIL_WERR: | ||
| 1145 | return xpcBteWriteError; | ||
| 1146 | case BTEFAIL_ACCESS: | ||
| 1147 | return xpcBteAccessError; | ||
| 1148 | case BTEFAIL_PWERR: | ||
| 1149 | return xpcBtePWriteError; | ||
| 1150 | case BTEFAIL_PRERR: | ||
| 1151 | return xpcBtePReadError; | ||
| 1152 | case BTEFAIL_TOUT: | ||
| 1153 | return xpcBteTimeOutError; | ||
| 1154 | case BTEFAIL_XTERR: | ||
| 1155 | return xpcBteXtalkError; | ||
| 1156 | case BTEFAIL_NOTAVAIL: | ||
| 1157 | return xpcBteNotAvailable; | ||
| 1158 | default: | ||
| 1159 | return xpcBteUnmappedError; | ||
| 1160 | } | ||
| 1161 | } | 1130 | } |
| 1162 | 1131 | ||
| 1163 | /* | 1132 | /* |
