aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ipmi
diff options
context:
space:
mode:
authorCorey Minyard <cminyard@mvista.com>2014-11-06 21:52:24 -0500
committerCorey Minyard <cminyard@mvista.com>2014-12-11 16:04:09 -0500
commit7f4a1c84c3506f492b208fdaae21879f55a51229 (patch)
treeded7316cff937838990d2af1270e1e271675bf52 /drivers/char/ipmi
parent65be754453a3625487670b086b1f9a662f28c610 (diff)
ipmi: Move message sending into its own function
Getting ready for a transmit queue. Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char/ipmi')
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index 31de905b0a0e..1a8e7b2131e9 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -1485,6 +1485,12 @@ static inline void format_lan_msg(struct ipmi_smi_msg *smi_msg,
1485 smi_msg->msgid = msgid; 1485 smi_msg->msgid = msgid;
1486} 1486}
1487 1487
1488static void smi_send(ipmi_smi_t intf, struct ipmi_smi_handlers *handlers,
1489 struct ipmi_smi_msg *smi_msg, int priority)
1490{
1491 handlers->sender(intf->send_info, smi_msg, 0);
1492}
1493
1488/* 1494/*
1489 * Separate from ipmi_request so that the user does not have to be 1495 * Separate from ipmi_request so that the user does not have to be
1490 * supplied in certain circumstances (mainly at panic time). If 1496 * supplied in certain circumstances (mainly at panic time). If
@@ -1868,7 +1874,7 @@ static int i_ipmi_request(ipmi_user_t user,
1868 } 1874 }
1869#endif 1875#endif
1870 1876
1871 handlers->sender(intf->send_info, smi_msg, priority); 1877 smi_send(intf, handlers, smi_msg, priority);
1872 rcu_read_unlock(); 1878 rcu_read_unlock();
1873 1879
1874 return 0; 1880 return 0;
@@ -3079,7 +3085,7 @@ static int handle_ipmb_get_msg_cmd(ipmi_smi_t intf,
3079 rcu_read_lock(); 3085 rcu_read_lock();
3080 handlers = intf->handlers; 3086 handlers = intf->handlers;
3081 if (handlers) { 3087 if (handlers) {
3082 handlers->sender(intf->send_info, msg, 0); 3088 smi_send(intf, handlers, msg, 0);
3083 /* 3089 /*
3084 * We used the message, so return the value 3090 * We used the message, so return the value
3085 * that causes it to not be freed or 3091 * that causes it to not be freed or
@@ -3972,8 +3978,7 @@ static void check_msg_timeout(ipmi_smi_t intf, struct seq_table *ent,
3972 ipmi_inc_stat(intf, 3978 ipmi_inc_stat(intf,
3973 retransmitted_ipmb_commands); 3979 retransmitted_ipmb_commands);
3974 3980
3975 intf->handlers->sender(intf->send_info, 3981 smi_send(intf, intf->handlers, smi_msg, 0);
3976 smi_msg, 0);
3977 } else 3982 } else
3978 ipmi_free_smi_msg(smi_msg); 3983 ipmi_free_smi_msg(smi_msg);
3979 3984