Searched refs:ssif_info (Results 1 - 1 of 1) sorted by relevance

/linux-4.1.27/drivers/char/ipmi/
H A Dipmi_ssif.c105 * Indexes into stats[] in ssif_info below.
190 struct ssif_info;
192 typedef void (*ssif_i2c_done)(struct ssif_info *ssif_info, int result,
195 struct ssif_info { struct
298 static void return_hosed_msg(struct ssif_info *ssif_info,
300 static void start_next_msg(struct ssif_info *ssif_info, unsigned long *flags);
301 static int start_send(struct ssif_info *ssif_info,
305 static unsigned long *ipmi_ssif_lock_cond(struct ssif_info *ssif_info, ipmi_ssif_lock_cond() argument
308 spin_lock_irqsave(&ssif_info->lock, *flags); ipmi_ssif_lock_cond()
312 static void ipmi_ssif_unlock_cond(struct ssif_info *ssif_info, ipmi_ssif_unlock_cond() argument
315 spin_unlock_irqrestore(&ssif_info->lock, *flags); ipmi_ssif_unlock_cond()
318 static void deliver_recv_msg(struct ssif_info *ssif_info, deliver_recv_msg() argument
321 ipmi_smi_t intf = ssif_info->intf; deliver_recv_msg()
326 return_hosed_msg(ssif_info, msg); deliver_recv_msg()
335 static void return_hosed_msg(struct ssif_info *ssif_info, return_hosed_msg() argument
338 ssif_inc_stat(ssif_info, hosed); return_hosed_msg()
346 deliver_recv_msg(ssif_info, msg); return_hosed_msg()
355 static void start_clear_flags(struct ssif_info *ssif_info, unsigned long *flags) start_clear_flags() argument
359 ssif_info->msg_flags &= ~WDT_PRE_TIMEOUT_INT; start_clear_flags()
360 ssif_info->ssif_state = SSIF_CLEARING_FLAGS; start_clear_flags()
361 ipmi_ssif_unlock_cond(ssif_info, flags); start_clear_flags()
368 if (start_send(ssif_info, msg, 3) != 0) { start_clear_flags()
370 ssif_info->ssif_state = SSIF_NORMAL; start_clear_flags()
374 static void start_flag_fetch(struct ssif_info *ssif_info, unsigned long *flags) start_flag_fetch() argument
378 ssif_info->req_flags = false; start_flag_fetch()
379 ssif_info->ssif_state = SSIF_GETTING_FLAGS; start_flag_fetch()
380 ipmi_ssif_unlock_cond(ssif_info, flags); start_flag_fetch()
384 if (start_send(ssif_info, mb, 2) != 0) start_flag_fetch()
385 ssif_info->ssif_state = SSIF_NORMAL; start_flag_fetch()
388 static void check_start_send(struct ssif_info *ssif_info, unsigned long *flags, check_start_send() argument
391 if (start_send(ssif_info, msg->data, msg->data_size) != 0) { check_start_send()
394 flags = ipmi_ssif_lock_cond(ssif_info, &oflags); check_start_send()
395 ssif_info->curr_msg = NULL; check_start_send()
396 ssif_info->ssif_state = SSIF_NORMAL; check_start_send()
397 ipmi_ssif_unlock_cond(ssif_info, flags); check_start_send()
402 static void start_event_fetch(struct ssif_info *ssif_info, unsigned long *flags) start_event_fetch() argument
406 ssif_info->req_events = false; start_event_fetch()
410 ssif_info->ssif_state = SSIF_NORMAL; start_event_fetch()
414 ssif_info->curr_msg = msg; start_event_fetch()
415 ssif_info->ssif_state = SSIF_GETTING_EVENTS; start_event_fetch()
416 ipmi_ssif_unlock_cond(ssif_info, flags); start_event_fetch()
422 check_start_send(ssif_info, flags, msg); start_event_fetch()
425 static void start_recv_msg_fetch(struct ssif_info *ssif_info, start_recv_msg_fetch() argument
432 ssif_info->ssif_state = SSIF_NORMAL; start_recv_msg_fetch()
436 ssif_info->curr_msg = msg; start_recv_msg_fetch()
437 ssif_info->ssif_state = SSIF_GETTING_MESSAGES; start_recv_msg_fetch()
438 ipmi_ssif_unlock_cond(ssif_info, flags); start_recv_msg_fetch()
444 check_start_send(ssif_info, flags, msg); start_recv_msg_fetch()
453 static void handle_flags(struct ssif_info *ssif_info, unsigned long *flags) handle_flags() argument
455 if (ssif_info->msg_flags & WDT_PRE_TIMEOUT_INT) { handle_flags()
456 ipmi_smi_t intf = ssif_info->intf; handle_flags()
458 ssif_inc_stat(ssif_info, watchdog_pretimeouts); handle_flags()
459 start_clear_flags(ssif_info, flags); handle_flags()
462 } else if (ssif_info->msg_flags & RECEIVE_MSG_AVAIL) handle_flags()
464 start_recv_msg_fetch(ssif_info, flags); handle_flags()
465 else if (ssif_info->msg_flags & EVENT_MSG_BUFFER_FULL) handle_flags()
467 start_event_fetch(ssif_info, flags); handle_flags()
469 ssif_info->ssif_state = SSIF_NORMAL; handle_flags()
470 ipmi_ssif_unlock_cond(ssif_info, flags); handle_flags()
476 struct ssif_info *ssif_info = data; ipmi_ssif_thread() local
483 &ssif_info->wake_thread); ipmi_ssif_thread()
484 if (ssif_info->stopping) ipmi_ssif_thread()
488 init_completion(&ssif_info->wake_thread); ipmi_ssif_thread()
490 if (ssif_info->i2c_read_write == I2C_SMBUS_WRITE) { ipmi_ssif_thread()
492 ssif_info->client, ssif_info->i2c_command, ipmi_ssif_thread()
493 ssif_info->i2c_data[0], ipmi_ssif_thread()
494 ssif_info->i2c_data + 1); ipmi_ssif_thread()
495 ssif_info->done_handler(ssif_info, result, NULL, 0); ipmi_ssif_thread()
498 ssif_info->client, ssif_info->i2c_command, ipmi_ssif_thread()
499 ssif_info->i2c_data); ipmi_ssif_thread()
501 ssif_info->done_handler(ssif_info, result, ipmi_ssif_thread()
504 ssif_info->done_handler(ssif_info, 0, ipmi_ssif_thread()
505 ssif_info->i2c_data, ipmi_ssif_thread()
513 static int ssif_i2c_send(struct ssif_info *ssif_info, ssif_i2c_send() argument
518 ssif_info->done_handler = handler; ssif_i2c_send()
520 ssif_info->i2c_read_write = read_write; ssif_i2c_send()
521 ssif_info->i2c_command = command; ssif_i2c_send()
522 ssif_info->i2c_data = data; ssif_i2c_send()
523 ssif_info->i2c_size = size; ssif_i2c_send()
524 complete(&ssif_info->wake_thread); ssif_i2c_send()
529 static void msg_done_handler(struct ssif_info *ssif_info, int result,
532 static void start_get(struct ssif_info *ssif_info) start_get() argument
536 ssif_info->rtc_us_timer = 0; start_get()
537 ssif_info->multi_pos = 0; start_get()
539 rv = ssif_i2c_send(ssif_info, msg_done_handler, I2C_SMBUS_READ, start_get()
541 ssif_info->recv, I2C_SMBUS_BLOCK_DATA); start_get()
544 if (ssif_info->ssif_debug & SSIF_DEBUG_MSG) start_get()
547 msg_done_handler(ssif_info, -EIO, NULL, 0); start_get()
553 struct ssif_info *ssif_info = (void *) data; retry_timeout() local
557 if (ssif_info->stopping) retry_timeout()
560 flags = ipmi_ssif_lock_cond(ssif_info, &oflags); retry_timeout()
561 waiting = ssif_info->waiting_alert; retry_timeout()
562 ssif_info->waiting_alert = false; retry_timeout()
563 ipmi_ssif_unlock_cond(ssif_info, flags); retry_timeout()
566 start_get(ssif_info); retry_timeout()
572 struct ssif_info *ssif_info = i2c_get_clientdata(client); ssif_alert() local
576 ssif_inc_stat(ssif_info, alerts); ssif_alert()
578 flags = ipmi_ssif_lock_cond(ssif_info, &oflags); ssif_alert()
579 if (ssif_info->waiting_alert) { ssif_alert()
580 ssif_info->waiting_alert = false; ssif_alert()
581 del_timer(&ssif_info->retry_timer); ssif_alert()
583 } else if (ssif_info->curr_msg) { ssif_alert()
584 ssif_info->got_alert = true; ssif_alert()
586 ipmi_ssif_unlock_cond(ssif_info, flags); ssif_alert()
588 start_get(ssif_info); ssif_alert()
591 static int start_resend(struct ssif_info *ssif_info);
593 static void msg_done_handler(struct ssif_info *ssif_info, int result, msg_done_handler() argument
606 ssif_info->retries_left--; msg_done_handler()
607 if (ssif_info->retries_left > 0) { msg_done_handler()
608 ssif_inc_stat(ssif_info, receive_retries); msg_done_handler()
610 flags = ipmi_ssif_lock_cond(ssif_info, &oflags); msg_done_handler()
611 ssif_info->waiting_alert = true; msg_done_handler()
612 ssif_info->rtc_us_timer = SSIF_MSG_USEC; msg_done_handler()
613 mod_timer(&ssif_info->retry_timer, msg_done_handler()
615 ipmi_ssif_unlock_cond(ssif_info, flags); msg_done_handler()
619 ssif_inc_stat(ssif_info, receive_errors); msg_done_handler()
621 if (ssif_info->ssif_debug & SSIF_DEBUG_MSG) msg_done_handler()
627 if ((len > 1) && (ssif_info->multi_pos == 0) msg_done_handler()
632 ssif_inc_stat(ssif_info, received_message_parts); msg_done_handler()
637 ssif_info->data[i] = data[i+2]; msg_done_handler()
638 ssif_info->multi_len = len; msg_done_handler()
639 ssif_info->multi_pos = 1; msg_done_handler()
641 rv = ssif_i2c_send(ssif_info, msg_done_handler, I2C_SMBUS_READ, msg_done_handler()
643 ssif_info->recv, I2C_SMBUS_BLOCK_DATA); msg_done_handler()
645 if (ssif_info->ssif_debug & SSIF_DEBUG_MSG) msg_done_handler()
651 } else if (ssif_info->multi_pos) { msg_done_handler()
658 if (ssif_info->ssif_debug & SSIF_DEBUG_MSG) msg_done_handler()
666 if (ssif_info->multi_len + len - 1 > IPMI_MAX_MSG_LENGTH) { msg_done_handler()
669 if (ssif_info->ssif_debug & SSIF_DEBUG_MSG) msg_done_handler()
678 ssif_info->data[i + ssif_info->multi_len] = data[i + 1]; msg_done_handler()
679 ssif_info->multi_len += len; msg_done_handler()
682 len = ssif_info->multi_len; msg_done_handler()
683 data = ssif_info->data; msg_done_handler()
684 } else if (blocknum + 1 != ssif_info->multi_pos) { msg_done_handler()
692 ssif_inc_stat(ssif_info, received_message_parts); msg_done_handler()
694 ssif_info->multi_pos++; msg_done_handler()
696 rv = ssif_i2c_send(ssif_info, msg_done_handler, msg_done_handler()
699 ssif_info->recv, msg_done_handler()
702 if (ssif_info->ssif_debug & SSIF_DEBUG_MSG) msg_done_handler()
713 ssif_inc_stat(ssif_info, receive_errors); msg_done_handler()
715 ssif_inc_stat(ssif_info, received_messages); msg_done_handler()
716 ssif_inc_stat(ssif_info, received_message_parts); msg_done_handler()
721 if (ssif_info->ssif_debug & SSIF_DEBUG_STATE) msg_done_handler()
723 ssif_info->ssif_state, result); msg_done_handler()
725 flags = ipmi_ssif_lock_cond(ssif_info, &oflags); msg_done_handler()
726 msg = ssif_info->curr_msg; msg_done_handler()
732 ssif_info->curr_msg = NULL; msg_done_handler()
735 switch (ssif_info->ssif_state) { msg_done_handler()
737 ipmi_ssif_unlock_cond(ssif_info, flags); msg_done_handler()
742 return_hosed_msg(ssif_info, msg); msg_done_handler()
744 deliver_recv_msg(ssif_info, msg); msg_done_handler()
754 ssif_info->ssif_state = SSIF_NORMAL; msg_done_handler()
755 ipmi_ssif_unlock_cond(ssif_info, flags); msg_done_handler()
763 ssif_inc_stat(ssif_info, flag_fetches); msg_done_handler()
764 ssif_info->msg_flags = data[3]; msg_done_handler()
765 handle_flags(ssif_info, flags); msg_done_handler()
780 ssif_info->ssif_state = SSIF_NORMAL; msg_done_handler()
781 ipmi_ssif_unlock_cond(ssif_info, flags); msg_done_handler()
790 ssif_info->msg_flags &= ~EVENT_MSG_BUFFER_FULL; msg_done_handler()
791 handle_flags(ssif_info, flags); msg_done_handler()
798 ssif_info->msg_flags &= ~EVENT_MSG_BUFFER_FULL; msg_done_handler()
799 handle_flags(ssif_info, flags); msg_done_handler()
801 handle_flags(ssif_info, flags); msg_done_handler()
802 ssif_inc_stat(ssif_info, events); msg_done_handler()
803 deliver_recv_msg(ssif_info, msg); msg_done_handler()
813 ssif_info->msg_flags &= ~RECEIVE_MSG_AVAIL; msg_done_handler()
814 handle_flags(ssif_info, flags); msg_done_handler()
822 ssif_info->msg_flags &= ~RECEIVE_MSG_AVAIL; msg_done_handler()
823 handle_flags(ssif_info, flags); msg_done_handler()
825 ssif_inc_stat(ssif_info, incoming_messages); msg_done_handler()
826 handle_flags(ssif_info, flags); msg_done_handler()
827 deliver_recv_msg(ssif_info, msg); msg_done_handler()
832 flags = ipmi_ssif_lock_cond(ssif_info, &oflags); msg_done_handler()
833 if (SSIF_IDLE(ssif_info) && !ssif_info->stopping) { msg_done_handler()
834 if (ssif_info->req_events) msg_done_handler()
835 start_event_fetch(ssif_info, flags); msg_done_handler()
836 else if (ssif_info->req_flags) msg_done_handler()
837 start_flag_fetch(ssif_info, flags); msg_done_handler()
839 start_next_msg(ssif_info, flags); msg_done_handler()
841 ipmi_ssif_unlock_cond(ssif_info, flags); msg_done_handler()
843 if (ssif_info->ssif_debug & SSIF_DEBUG_STATE) msg_done_handler()
844 pr_info(PFX "DONE 2: state = %d.\n", ssif_info->ssif_state); msg_done_handler()
847 static void msg_written_handler(struct ssif_info *ssif_info, int result, msg_written_handler() argument
854 ssif_info->retries_left--; msg_written_handler()
855 if (ssif_info->retries_left > 0) { msg_written_handler()
856 if (!start_resend(ssif_info)) { msg_written_handler()
857 ssif_inc_stat(ssif_info, send_retries); msg_written_handler()
861 ssif_inc_stat(ssif_info, send_errors); msg_written_handler()
863 if (ssif_info->ssif_debug & SSIF_DEBUG_MSG) msg_written_handler()
866 msg_done_handler(ssif_info, -EIO, NULL, 0); msg_written_handler()
870 ssif_inc_stat(ssif_info, send_errors); msg_written_handler()
876 if (ssif_info->ssif_debug & SSIF_DEBUG_MSG) msg_written_handler()
879 msg_done_handler(ssif_info, result, NULL, 0); msg_written_handler()
883 if (ssif_info->multi_data) { msg_written_handler()
891 ssif_inc_stat(ssif_info, sent_messages_parts); msg_written_handler()
893 left = ssif_info->multi_len - ssif_info->multi_pos; msg_written_handler()
897 ssif_info->multi_data[ssif_info->multi_pos] = left; msg_written_handler()
898 ssif_info->multi_pos += left; msg_written_handler()
906 ssif_info->multi_data = NULL; msg_written_handler()
908 rv = ssif_i2c_send(ssif_info, msg_written_handler, msg_written_handler()
911 ssif_info->multi_data + ssif_info->multi_pos, msg_written_handler()
915 ssif_inc_stat(ssif_info, send_errors); msg_written_handler()
917 if (ssif_info->ssif_debug & SSIF_DEBUG_MSG) msg_written_handler()
919 msg_done_handler(ssif_info, -EIO, NULL, 0); msg_written_handler()
925 ssif_inc_stat(ssif_info, sent_messages); msg_written_handler()
926 ssif_inc_stat(ssif_info, sent_messages_parts); msg_written_handler()
928 flags = ipmi_ssif_lock_cond(ssif_info, &oflags); msg_written_handler()
929 got_alert = ssif_info->got_alert; msg_written_handler()
931 ssif_info->got_alert = false; msg_written_handler()
932 ssif_info->waiting_alert = false; msg_written_handler()
936 ipmi_ssif_unlock_cond(ssif_info, flags); msg_written_handler()
938 retry_timeout((unsigned long) ssif_info); msg_written_handler()
941 ssif_info->waiting_alert = true; msg_written_handler()
942 ssif_info->retries_left = SSIF_RECV_RETRIES; msg_written_handler()
943 ssif_info->rtc_us_timer = SSIF_MSG_PART_USEC; msg_written_handler()
944 mod_timer(&ssif_info->retry_timer, msg_written_handler()
946 ipmi_ssif_unlock_cond(ssif_info, flags); msg_written_handler()
951 static int start_resend(struct ssif_info *ssif_info) start_resend() argument
956 ssif_info->got_alert = false; start_resend()
958 if (ssif_info->data_len > 32) { start_resend()
960 ssif_info->multi_data = ssif_info->data; start_resend()
961 ssif_info->multi_len = ssif_info->data_len; start_resend()
967 ssif_info->multi_pos = 32; start_resend()
968 ssif_info->data[0] = 32; start_resend()
970 ssif_info->multi_data = NULL; start_resend()
972 ssif_info->data[0] = ssif_info->data_len; start_resend()
975 rv = ssif_i2c_send(ssif_info, msg_written_handler, I2C_SMBUS_WRITE, start_resend()
976 command, ssif_info->data, I2C_SMBUS_BLOCK_DATA); start_resend()
977 if (rv && (ssif_info->ssif_debug & SSIF_DEBUG_MSG)) start_resend()
982 static int start_send(struct ssif_info *ssif_info, start_send() argument
988 if (len > ssif_info->max_xmit_msg_size) start_send()
991 ssif_info->retries_left = SSIF_SEND_RETRIES; start_send()
992 memcpy(ssif_info->data + 1, data, len); start_send()
993 ssif_info->data_len = len; start_send()
994 return start_resend(ssif_info); start_send()
998 static void start_next_msg(struct ssif_info *ssif_info, unsigned long *flags) start_next_msg() argument
1004 if (!SSIF_IDLE(ssif_info)) { start_next_msg()
1005 ipmi_ssif_unlock_cond(ssif_info, flags); start_next_msg()
1009 if (!ssif_info->waiting_msg) { start_next_msg()
1010 ssif_info->curr_msg = NULL; start_next_msg()
1011 ipmi_ssif_unlock_cond(ssif_info, flags); start_next_msg()
1015 ssif_info->curr_msg = ssif_info->waiting_msg; start_next_msg()
1016 ssif_info->waiting_msg = NULL; start_next_msg()
1017 ipmi_ssif_unlock_cond(ssif_info, flags); start_next_msg()
1018 rv = start_send(ssif_info, start_next_msg()
1019 ssif_info->curr_msg->data, start_next_msg()
1020 ssif_info->curr_msg->data_size); start_next_msg()
1022 msg = ssif_info->curr_msg; start_next_msg()
1023 ssif_info->curr_msg = NULL; start_next_msg()
1024 return_hosed_msg(ssif_info, msg); start_next_msg()
1025 flags = ipmi_ssif_lock_cond(ssif_info, &oflags); start_next_msg()
1034 struct ssif_info *ssif_info = (struct ssif_info *) send_info; sender() local
1037 BUG_ON(ssif_info->waiting_msg); sender()
1038 ssif_info->waiting_msg = msg; sender()
1040 flags = ipmi_ssif_lock_cond(ssif_info, &oflags); sender()
1041 start_next_msg(ssif_info, flags); sender()
1043 if (ssif_info->ssif_debug & SSIF_DEBUG_TIMING) { sender()
1055 struct ssif_info *ssif_info = send_info; get_smi_info() local
1057 data->addr_src = ssif_info->addr_source; get_smi_info()
1058 data->dev = &ssif_info->client->dev; get_smi_info()
1059 data->addr_info = ssif_info->addr_info; get_smi_info()
1071 struct ssif_info *ssif_info = (struct ssif_info *) send_info; request_events() local
1074 if (!ssif_info->has_event_buffer) request_events()
1077 flags = ipmi_ssif_lock_cond(ssif_info, &oflags); request_events()
1083 ssif_info->req_events = true; request_events()
1084 if (SSIF_IDLE(ssif_info)) request_events()
1085 start_flag_fetch(ssif_info, flags); request_events()
1087 ssif_info->req_flags = true; request_events()
1088 ipmi_ssif_unlock_cond(ssif_info, flags); request_events()
1094 struct ssif_info *ssif_info = send_info; inc_usecount() local
1096 if (!i2c_get_adapter(ssif_info->client->adapter->nr)) inc_usecount()
1099 i2c_use_client(ssif_info->client); inc_usecount()
1105 struct ssif_info *ssif_info = send_info; dec_usecount() local
1107 i2c_release_client(ssif_info->client); dec_usecount()
1108 i2c_put_adapter(ssif_info->client->adapter); dec_usecount()
1114 struct ssif_info *ssif_info = send_info; ssif_start_processing() local
1116 ssif_info->intf = intf; ssif_start_processing()
1170 struct ssif_info *ssif_info = i2c_get_clientdata(client); ssif_remove() local
1173 if (!ssif_info) ssif_remove()
1180 rv = ipmi_unregister_smi(ssif_info->intf); ssif_remove()
1185 ssif_info->intf = NULL; ssif_remove()
1188 while (ssif_info->ssif_state != SSIF_NORMAL) ssif_remove()
1191 ssif_info->stopping = true; ssif_remove()
1192 del_timer_sync(&ssif_info->retry_timer); ssif_remove()
1193 if (ssif_info->thread) { ssif_remove()
1194 complete(&ssif_info->wake_thread); ssif_remove()
1195 kthread_stop(ssif_info->thread); ssif_remove()
1202 kfree(ssif_info); ssif_remove()
1294 struct ssif_info *ssif_info = m->private; smi_stats_proc_show() local
1297 ssif_get_stat(ssif_info, sent_messages)); smi_stats_proc_show()
1299 ssif_get_stat(ssif_info, sent_messages_parts)); smi_stats_proc_show()
1301 ssif_get_stat(ssif_info, send_retries)); smi_stats_proc_show()
1303 ssif_get_stat(ssif_info, send_errors)); smi_stats_proc_show()
1305 ssif_get_stat(ssif_info, received_messages)); smi_stats_proc_show()
1307 ssif_get_stat(ssif_info, received_message_parts)); smi_stats_proc_show()
1309 ssif_get_stat(ssif_info, receive_retries)); smi_stats_proc_show()
1311 ssif_get_stat(ssif_info, receive_errors)); smi_stats_proc_show()
1313 ssif_get_stat(ssif_info, flag_fetches)); smi_stats_proc_show()
1315 ssif_get_stat(ssif_info, hosed)); smi_stats_proc_show()
1317 ssif_get_stat(ssif_info, events)); smi_stats_proc_show()
1319 ssif_get_stat(ssif_info, watchdog_pretimeouts)); smi_stats_proc_show()
1321 ssif_get_stat(ssif_info, alerts)); smi_stats_proc_show()
1389 static bool check_acpi(struct ssif_info *ssif_info, struct device *dev) check_acpi() argument
1396 ssif_info->addr_source = SI_ACPI; check_acpi()
1397 ssif_info->addr_info.acpi_info.acpi_handle = acpi_handle; check_acpi()
1414 struct ssif_info *ssif_info; ssif_probe() local
1426 ssif_info = kzalloc(sizeof(*ssif_info), GFP_KERNEL); ssif_probe()
1427 if (!ssif_info) { ssif_probe()
1432 if (!check_acpi(ssif_info, &client->dev)) { ssif_probe()
1437 ssif_info->addr_source = SI_HOTMOD; ssif_probe()
1439 ssif_info->addr_source = addr_info->addr_src; ssif_probe()
1440 ssif_info->ssif_debug = addr_info->debug; ssif_probe()
1441 ssif_info->addr_info = addr_info->addr_info; ssif_probe()
1447 ipmi_addr_src_to_str(ssif_info->addr_source), ssif_probe()
1460 rv = ipmi_demangle_device_id(resp, len, &ssif_info->device_id); ssif_probe()
1464 ssif_info->client = client; ssif_probe()
1465 i2c_set_clientdata(client, ssif_info); ssif_probe()
1480 ssif_info->max_xmit_msg_size = resp[5]; ssif_probe()
1481 ssif_info->max_recv_msg_size = resp[6]; ssif_probe()
1482 ssif_info->multi_support = (resp[4] >> 6) & 0x3; ssif_probe()
1483 ssif_info->supports_pec = (resp[4] >> 3) & 0x1; ssif_probe()
1486 switch (ssif_info->multi_support) { ssif_probe()
1488 if (ssif_info->max_xmit_msg_size > 32) ssif_probe()
1489 ssif_info->max_xmit_msg_size = 32; ssif_probe()
1490 if (ssif_info->max_recv_msg_size > 32) ssif_probe()
1491 ssif_info->max_recv_msg_size = 32; ssif_probe()
1495 if (ssif_info->max_xmit_msg_size > 63) ssif_probe()
1496 ssif_info->max_xmit_msg_size = 63; ssif_probe()
1497 if (ssif_info->max_recv_msg_size > 62) ssif_probe()
1498 ssif_info->max_recv_msg_size = 62; ssif_probe()
1520 if (ssif_info->max_xmit_msg_size > 63) ssif_probe()
1521 ssif_info->max_xmit_msg_size = 63; ssif_probe()
1534 ssif_info->max_xmit_msg_size = 32; ssif_probe()
1535 ssif_info->max_recv_msg_size = 32; ssif_probe()
1536 ssif_info->multi_support = SSIF_NO_MULTI; ssif_probe()
1537 ssif_info->supports_pec = 0; ssif_probe()
1560 ssif_info->global_enables = resp[3]; ssif_probe()
1563 ssif_info->has_event_buffer = true; ssif_probe()
1570 msg[2] = ssif_info->global_enables | IPMI_BMC_EVT_MSG_BUFF; ssif_probe()
1581 ssif_info->has_event_buffer = true; ssif_probe()
1582 ssif_info->global_enables |= IPMI_BMC_EVT_MSG_BUFF; ssif_probe()
1587 msg[2] = ssif_info->global_enables | IPMI_BMC_RCV_MSG_INTR; ssif_probe()
1598 ssif_info->supports_alert = true; ssif_probe()
1599 ssif_info->global_enables |= IPMI_BMC_RCV_MSG_INTR; ssif_probe()
1603 ssif_info->intf_num = atomic_inc_return(&next_intf); ssif_probe()
1610 spin_lock_init(&ssif_info->lock); ssif_probe()
1611 ssif_info->ssif_state = SSIF_NORMAL; ssif_probe()
1612 init_timer(&ssif_info->retry_timer); ssif_probe()
1613 ssif_info->retry_timer.data = (unsigned long) ssif_info; ssif_probe()
1614 ssif_info->retry_timer.function = retry_timeout; ssif_probe()
1617 atomic_set(&ssif_info->stats[i], 0); ssif_probe()
1619 if (ssif_info->supports_pec) ssif_probe()
1620 ssif_info->client->flags |= I2C_CLIENT_PEC; ssif_probe()
1622 ssif_info->handlers.owner = THIS_MODULE; ssif_probe()
1623 ssif_info->handlers.start_processing = ssif_start_processing; ssif_probe()
1624 ssif_info->handlers.get_smi_info = get_smi_info; ssif_probe()
1625 ssif_info->handlers.sender = sender; ssif_probe()
1626 ssif_info->handlers.request_events = request_events; ssif_probe()
1627 ssif_info->handlers.inc_usecount = inc_usecount; ssif_probe()
1628 ssif_info->handlers.dec_usecount = dec_usecount; ssif_probe()
1633 thread_num = ((ssif_info->client->adapter->nr << 8) | ssif_probe()
1634 ssif_info->client->addr); ssif_probe()
1635 init_completion(&ssif_info->wake_thread); ssif_probe()
1636 ssif_info->thread = kthread_run(ipmi_ssif_thread, ssif_info, ssif_probe()
1638 if (IS_ERR(ssif_info->thread)) { ssif_probe()
1639 rv = PTR_ERR(ssif_info->thread); ssif_probe()
1640 dev_notice(&ssif_info->client->dev, ssif_probe()
1647 rv = ipmi_register_smi(&ssif_info->handlers, ssif_probe()
1648 ssif_info, ssif_probe()
1649 &ssif_info->device_id, ssif_probe()
1650 &ssif_info->client->dev, ssif_probe()
1657 rv = ipmi_smi_add_proc_entry(ssif_info->intf, "type", ssif_probe()
1659 ssif_info); ssif_probe()
1665 rv = ipmi_smi_add_proc_entry(ssif_info->intf, "ssif_stats", ssif_probe()
1667 ssif_info); ssif_probe()
1675 kfree(ssif_info); ssif_probe()
1680 ipmi_unregister_smi(ssif_info->intf); ssif_probe()

Completed in 61 milliseconds