diff options
Diffstat (limited to 'drivers/char/ipmi/ipmi_msghandler.c')
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index d0ed25278cbb..792f4c282291 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -117,7 +117,7 @@ struct seq_table | |||
117 | do { \ | 117 | do { \ |
118 | seq = ((msgid >> 26) & 0x3f); \ | 118 | seq = ((msgid >> 26) & 0x3f); \ |
119 | seqid = (msgid & 0x3fffff); \ | 119 | seqid = (msgid & 0x3fffff); \ |
120 | } while(0) | 120 | } while (0) |
121 | 121 | ||
122 | #define NEXT_SEQID(seqid) (((seqid) + 1) & 0x3fffff) | 122 | #define NEXT_SEQID(seqid) (((seqid) + 1) & 0x3fffff) |
123 | 123 | ||
@@ -326,7 +326,7 @@ int ipmi_smi_watcher_register(struct ipmi_smi_watcher *watcher) | |||
326 | down_read(&interfaces_sem); | 326 | down_read(&interfaces_sem); |
327 | down_write(&smi_watchers_sem); | 327 | down_write(&smi_watchers_sem); |
328 | list_add(&(watcher->link), &smi_watchers); | 328 | list_add(&(watcher->link), &smi_watchers); |
329 | for (i=0; i<MAX_IPMI_INTERFACES; i++) { | 329 | for (i = 0; i < MAX_IPMI_INTERFACES; i++) { |
330 | if (ipmi_interfaces[i] != NULL) { | 330 | if (ipmi_interfaces[i] != NULL) { |
331 | watcher->new_smi(i); | 331 | watcher->new_smi(i); |
332 | } | 332 | } |
@@ -496,9 +496,9 @@ static int intf_next_seq(ipmi_smi_t intf, | |||
496 | int rv = 0; | 496 | int rv = 0; |
497 | unsigned int i; | 497 | unsigned int i; |
498 | 498 | ||
499 | for (i=intf->curr_seq; | 499 | for (i = intf->curr_seq; |
500 | (i+1)%IPMI_IPMB_NUM_SEQ != intf->curr_seq; | 500 | (i+1)%IPMI_IPMB_NUM_SEQ != intf->curr_seq; |
501 | i=(i+1)%IPMI_IPMB_NUM_SEQ) | 501 | i = (i+1)%IPMI_IPMB_NUM_SEQ) |
502 | { | 502 | { |
503 | if (! intf->seq_table[i].inuse) | 503 | if (! intf->seq_table[i].inuse) |
504 | break; | 504 | break; |
@@ -733,7 +733,7 @@ static int ipmi_destroy_user_nolock(ipmi_user_t user) | |||
733 | 733 | ||
734 | /* Remove the user from the interfaces sequence table. */ | 734 | /* Remove the user from the interfaces sequence table. */ |
735 | spin_lock_irqsave(&(user->intf->seq_lock), flags); | 735 | spin_lock_irqsave(&(user->intf->seq_lock), flags); |
736 | for (i=0; i<IPMI_IPMB_NUM_SEQ; i++) { | 736 | for (i = 0; i < IPMI_IPMB_NUM_SEQ; i++) { |
737 | if (user->intf->seq_table[i].inuse | 737 | if (user->intf->seq_table[i].inuse |
738 | && (user->intf->seq_table[i].recv_msg->user == user)) | 738 | && (user->intf->seq_table[i].recv_msg->user == user)) |
739 | { | 739 | { |
@@ -1370,7 +1370,7 @@ static inline int i_ipmi_request(ipmi_user_t user, | |||
1370 | #ifdef DEBUG_MSGING | 1370 | #ifdef DEBUG_MSGING |
1371 | { | 1371 | { |
1372 | int m; | 1372 | int m; |
1373 | for (m=0; m<smi_msg->data_size; m++) | 1373 | for (m = 0; m < smi_msg->data_size; m++) |
1374 | printk(" %2.2x", smi_msg->data[m]); | 1374 | printk(" %2.2x", smi_msg->data[m]); |
1375 | printk("\n"); | 1375 | printk("\n"); |
1376 | } | 1376 | } |
@@ -1467,7 +1467,7 @@ static int ipmb_file_read_proc(char *page, char **start, off_t off, | |||
1467 | int i; | 1467 | int i; |
1468 | int rv= 0; | 1468 | int rv= 0; |
1469 | 1469 | ||
1470 | for (i=0; i<IPMI_MAX_CHANNELS; i++) | 1470 | for (i = 0; i < IPMI_MAX_CHANNELS; i++) |
1471 | rv += sprintf(out+rv, "%x ", intf->channels[i].address); | 1471 | rv += sprintf(out+rv, "%x ", intf->channels[i].address); |
1472 | out[rv-1] = '\n'; /* Replace the final space with a newline */ | 1472 | out[rv-1] = '\n'; /* Replace the final space with a newline */ |
1473 | out[rv] = '\0'; | 1473 | out[rv] = '\0'; |
@@ -1766,12 +1766,12 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers, | |||
1766 | rv = -ENOMEM; | 1766 | rv = -ENOMEM; |
1767 | 1767 | ||
1768 | down_write(&interfaces_sem); | 1768 | down_write(&interfaces_sem); |
1769 | for (i=0; i<MAX_IPMI_INTERFACES; i++) { | 1769 | for (i = 0; i < MAX_IPMI_INTERFACES; i++) { |
1770 | if (ipmi_interfaces[i] == NULL) { | 1770 | if (ipmi_interfaces[i] == NULL) { |
1771 | new_intf->intf_num = i; | 1771 | new_intf->intf_num = i; |
1772 | new_intf->version_major = version_major; | 1772 | new_intf->version_major = version_major; |
1773 | new_intf->version_minor = version_minor; | 1773 | new_intf->version_minor = version_minor; |
1774 | for (j=0; j<IPMI_MAX_CHANNELS; j++) { | 1774 | for (j = 0; j < IPMI_MAX_CHANNELS; j++) { |
1775 | new_intf->channels[j].address | 1775 | new_intf->channels[j].address |
1776 | = IPMI_BMC_SLAVE_ADDR; | 1776 | = IPMI_BMC_SLAVE_ADDR; |
1777 | new_intf->channels[j].lun = 2; | 1777 | new_intf->channels[j].lun = 2; |
@@ -1783,7 +1783,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers, | |||
1783 | new_intf->handlers = handlers; | 1783 | new_intf->handlers = handlers; |
1784 | new_intf->send_info = send_info; | 1784 | new_intf->send_info = send_info; |
1785 | spin_lock_init(&(new_intf->seq_lock)); | 1785 | spin_lock_init(&(new_intf->seq_lock)); |
1786 | for (j=0; j<IPMI_IPMB_NUM_SEQ; j++) { | 1786 | for (j = 0; j < IPMI_IPMB_NUM_SEQ; j++) { |
1787 | new_intf->seq_table[j].inuse = 0; | 1787 | new_intf->seq_table[j].inuse = 0; |
1788 | new_intf->seq_table[j].seqid = 0; | 1788 | new_intf->seq_table[j].seqid = 0; |
1789 | } | 1789 | } |
@@ -1891,7 +1891,7 @@ static void clean_up_interface_data(ipmi_smi_t intf) | |||
1891 | free_recv_msg_list(&(intf->waiting_events)); | 1891 | free_recv_msg_list(&(intf->waiting_events)); |
1892 | free_cmd_rcvr_list(&(intf->cmd_rcvrs)); | 1892 | free_cmd_rcvr_list(&(intf->cmd_rcvrs)); |
1893 | 1893 | ||
1894 | for (i=0; i<IPMI_IPMB_NUM_SEQ; i++) { | 1894 | for (i = 0; i < IPMI_IPMB_NUM_SEQ; i++) { |
1895 | if ((intf->seq_table[i].inuse) | 1895 | if ((intf->seq_table[i].inuse) |
1896 | && (intf->seq_table[i].recv_msg)) | 1896 | && (intf->seq_table[i].recv_msg)) |
1897 | { | 1897 | { |
@@ -1910,7 +1910,7 @@ int ipmi_unregister_smi(ipmi_smi_t intf) | |||
1910 | down_write(&interfaces_sem); | 1910 | down_write(&interfaces_sem); |
1911 | if (list_empty(&(intf->users))) | 1911 | if (list_empty(&(intf->users))) |
1912 | { | 1912 | { |
1913 | for (i=0; i<MAX_IPMI_INTERFACES; i++) { | 1913 | for (i = 0; i < MAX_IPMI_INTERFACES; i++) { |
1914 | if (ipmi_interfaces[i] == intf) { | 1914 | if (ipmi_interfaces[i] == intf) { |
1915 | remove_proc_entries(intf); | 1915 | remove_proc_entries(intf); |
1916 | spin_lock_irqsave(&interfaces_lock, flags); | 1916 | spin_lock_irqsave(&interfaces_lock, flags); |
@@ -2074,7 +2074,7 @@ static int handle_ipmb_get_msg_cmd(ipmi_smi_t intf, | |||
2074 | { | 2074 | { |
2075 | int m; | 2075 | int m; |
2076 | printk("Invalid command:"); | 2076 | printk("Invalid command:"); |
2077 | for (m=0; m<msg->data_size; m++) | 2077 | for (m = 0; m < msg->data_size; m++) |
2078 | printk(" %2.2x", msg->data[m]); | 2078 | printk(" %2.2x", msg->data[m]); |
2079 | printk("\n"); | 2079 | printk("\n"); |
2080 | } | 2080 | } |
@@ -2469,7 +2469,7 @@ static int handle_new_recv_msg(ipmi_smi_t intf, | |||
2469 | #ifdef DEBUG_MSGING | 2469 | #ifdef DEBUG_MSGING |
2470 | int m; | 2470 | int m; |
2471 | printk("Recv:"); | 2471 | printk("Recv:"); |
2472 | for (m=0; m<msg->rsp_size; m++) | 2472 | for (m = 0; m < msg->rsp_size; m++) |
2473 | printk(" %2.2x", msg->rsp[m]); | 2473 | printk(" %2.2x", msg->rsp[m]); |
2474 | printk("\n"); | 2474 | printk("\n"); |
2475 | #endif | 2475 | #endif |
@@ -2703,7 +2703,7 @@ smi_from_recv_msg(ipmi_smi_t intf, struct ipmi_recv_msg *recv_msg, | |||
2703 | { | 2703 | { |
2704 | int m; | 2704 | int m; |
2705 | printk("Resend: "); | 2705 | printk("Resend: "); |
2706 | for (m=0; m<smi_msg->data_size; m++) | 2706 | for (m = 0; m < smi_msg->data_size; m++) |
2707 | printk(" %2.2x", smi_msg->data[m]); | 2707 | printk(" %2.2x", smi_msg->data[m]); |
2708 | printk("\n"); | 2708 | printk("\n"); |
2709 | } | 2709 | } |
@@ -2724,7 +2724,7 @@ ipmi_timeout_handler(long timeout_period) | |||
2724 | INIT_LIST_HEAD(&timeouts); | 2724 | INIT_LIST_HEAD(&timeouts); |
2725 | 2725 | ||
2726 | spin_lock(&interfaces_lock); | 2726 | spin_lock(&interfaces_lock); |
2727 | for (i=0; i<MAX_IPMI_INTERFACES; i++) { | 2727 | for (i = 0; i < MAX_IPMI_INTERFACES; i++) { |
2728 | intf = ipmi_interfaces[i]; | 2728 | intf = ipmi_interfaces[i]; |
2729 | if (intf == NULL) | 2729 | if (intf == NULL) |
2730 | continue; | 2730 | continue; |
@@ -2749,7 +2749,7 @@ ipmi_timeout_handler(long timeout_period) | |||
2749 | have timed out, putting them in the timeouts | 2749 | have timed out, putting them in the timeouts |
2750 | list. */ | 2750 | list. */ |
2751 | spin_lock_irqsave(&(intf->seq_lock), flags); | 2751 | spin_lock_irqsave(&(intf->seq_lock), flags); |
2752 | for (j=0; j<IPMI_IPMB_NUM_SEQ; j++) { | 2752 | for (j = 0; j < IPMI_IPMB_NUM_SEQ; j++) { |
2753 | struct seq_table *ent = &(intf->seq_table[j]); | 2753 | struct seq_table *ent = &(intf->seq_table[j]); |
2754 | if (!ent->inuse) | 2754 | if (!ent->inuse) |
2755 | continue; | 2755 | continue; |
@@ -2789,7 +2789,7 @@ ipmi_timeout_handler(long timeout_period) | |||
2789 | spin_unlock(&intf->counter_lock); | 2789 | spin_unlock(&intf->counter_lock); |
2790 | smi_msg = smi_from_recv_msg(intf, | 2790 | smi_msg = smi_from_recv_msg(intf, |
2791 | ent->recv_msg, j, ent->seqid); | 2791 | ent->recv_msg, j, ent->seqid); |
2792 | if(!smi_msg) | 2792 | if (! smi_msg) |
2793 | continue; | 2793 | continue; |
2794 | 2794 | ||
2795 | spin_unlock_irqrestore(&(intf->seq_lock),flags); | 2795 | spin_unlock_irqrestore(&(intf->seq_lock),flags); |
@@ -2820,7 +2820,7 @@ static void ipmi_request_event(void) | |||
2820 | int i; | 2820 | int i; |
2821 | 2821 | ||
2822 | spin_lock(&interfaces_lock); | 2822 | spin_lock(&interfaces_lock); |
2823 | for (i=0; i<MAX_IPMI_INTERFACES; i++) { | 2823 | for (i = 0; i < MAX_IPMI_INTERFACES; i++) { |
2824 | intf = ipmi_interfaces[i]; | 2824 | intf = ipmi_interfaces[i]; |
2825 | if (intf == NULL) | 2825 | if (intf == NULL) |
2826 | continue; | 2826 | continue; |
@@ -2982,7 +2982,7 @@ static void send_panic_events(char *str) | |||
2982 | recv_msg.done = dummy_recv_done_handler; | 2982 | recv_msg.done = dummy_recv_done_handler; |
2983 | 2983 | ||
2984 | /* For every registered interface, send the event. */ | 2984 | /* For every registered interface, send the event. */ |
2985 | for (i=0; i<MAX_IPMI_INTERFACES; i++) { | 2985 | for (i = 0; i < MAX_IPMI_INTERFACES; i++) { |
2986 | intf = ipmi_interfaces[i]; | 2986 | intf = ipmi_interfaces[i]; |
2987 | if (intf == NULL) | 2987 | if (intf == NULL) |
2988 | continue; | 2988 | continue; |
@@ -3009,7 +3009,7 @@ static void send_panic_events(char *str) | |||
3009 | if (!str) | 3009 | if (!str) |
3010 | return; | 3010 | return; |
3011 | 3011 | ||
3012 | for (i=0; i<MAX_IPMI_INTERFACES; i++) { | 3012 | for (i = 0; i < MAX_IPMI_INTERFACES; i++) { |
3013 | char *p = str; | 3013 | char *p = str; |
3014 | struct ipmi_ipmb_addr *ipmb; | 3014 | struct ipmi_ipmb_addr *ipmb; |
3015 | int j; | 3015 | int j; |
@@ -3149,7 +3149,7 @@ static int panic_event(struct notifier_block *this, | |||
3149 | has_paniced = 1; | 3149 | has_paniced = 1; |
3150 | 3150 | ||
3151 | /* For every registered interface, set it to run to completion. */ | 3151 | /* For every registered interface, set it to run to completion. */ |
3152 | for (i=0; i<MAX_IPMI_INTERFACES; i++) { | 3152 | for (i = 0; i < MAX_IPMI_INTERFACES; i++) { |
3153 | intf = ipmi_interfaces[i]; | 3153 | intf = ipmi_interfaces[i]; |
3154 | if (intf == NULL) | 3154 | if (intf == NULL) |
3155 | continue; | 3155 | continue; |
@@ -3180,7 +3180,7 @@ static int ipmi_init_msghandler(void) | |||
3180 | printk(KERN_INFO "ipmi message handler version " | 3180 | printk(KERN_INFO "ipmi message handler version " |
3181 | IPMI_DRIVER_VERSION "\n"); | 3181 | IPMI_DRIVER_VERSION "\n"); |
3182 | 3182 | ||
3183 | for (i=0; i<MAX_IPMI_INTERFACES; i++) { | 3183 | for (i = 0; i < MAX_IPMI_INTERFACES; i++) { |
3184 | ipmi_interfaces[i] = NULL; | 3184 | ipmi_interfaces[i] = NULL; |
3185 | } | 3185 | } |
3186 | 3186 | ||