diff options
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 138 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 88 | ||||
-rw-r--r-- | include/linux/ipmi_smi.h | 2 |
3 files changed, 142 insertions, 86 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 38223e93aa98..58c0e6387cf7 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <asm/system.h> | 36 | #include <asm/system.h> |
37 | #include <linux/poll.h> | 37 | #include <linux/poll.h> |
38 | #include <linux/sched.h> | 38 | #include <linux/sched.h> |
39 | #include <linux/seq_file.h> | ||
39 | #include <linux/spinlock.h> | 40 | #include <linux/spinlock.h> |
40 | #include <linux/mutex.h> | 41 | #include <linux/mutex.h> |
41 | #include <linux/slab.h> | 42 | #include <linux/slab.h> |
@@ -1896,102 +1897,128 @@ int ipmi_request_supply_msgs(ipmi_user_t user, | |||
1896 | EXPORT_SYMBOL(ipmi_request_supply_msgs); | 1897 | EXPORT_SYMBOL(ipmi_request_supply_msgs); |
1897 | 1898 | ||
1898 | #ifdef CONFIG_PROC_FS | 1899 | #ifdef CONFIG_PROC_FS |
1899 | static int ipmb_file_read_proc(char *page, char **start, off_t off, | 1900 | static int smi_ipmb_proc_show(struct seq_file *m, void *v) |
1900 | int count, int *eof, void *data) | ||
1901 | { | 1901 | { |
1902 | char *out = (char *) page; | 1902 | ipmi_smi_t intf = m->private; |
1903 | ipmi_smi_t intf = data; | ||
1904 | int i; | 1903 | int i; |
1905 | int rv = 0; | ||
1906 | 1904 | ||
1907 | for (i = 0; i < IPMI_MAX_CHANNELS; i++) | 1905 | seq_printf(m, "%x", intf->channels[0].address); |
1908 | rv += sprintf(out+rv, "%x ", intf->channels[i].address); | 1906 | for (i = 1; i < IPMI_MAX_CHANNELS; i++) |
1909 | out[rv-1] = '\n'; /* Replace the final space with a newline */ | 1907 | seq_printf(m, " %x", intf->channels[i].address); |
1910 | out[rv] = '\0'; | 1908 | return seq_putc(m, '\n'); |
1911 | rv++; | ||
1912 | return rv; | ||
1913 | } | 1909 | } |
1914 | 1910 | ||
1915 | static int version_file_read_proc(char *page, char **start, off_t off, | 1911 | static int smi_ipmb_proc_open(struct inode *inode, struct file *file) |
1916 | int count, int *eof, void *data) | ||
1917 | { | 1912 | { |
1918 | char *out = (char *) page; | 1913 | return single_open(file, smi_ipmb_proc_show, PDE(inode)->data); |
1919 | ipmi_smi_t intf = data; | 1914 | } |
1920 | 1915 | ||
1921 | return sprintf(out, "%u.%u\n", | 1916 | static const struct file_operations smi_ipmb_proc_ops = { |
1917 | .open = smi_ipmb_proc_open, | ||
1918 | .read = seq_read, | ||
1919 | .llseek = seq_lseek, | ||
1920 | .release = single_release, | ||
1921 | }; | ||
1922 | |||
1923 | static int smi_version_proc_show(struct seq_file *m, void *v) | ||
1924 | { | ||
1925 | ipmi_smi_t intf = m->private; | ||
1926 | |||
1927 | return seq_printf(m, "%u.%u\n", | ||
1922 | ipmi_version_major(&intf->bmc->id), | 1928 | ipmi_version_major(&intf->bmc->id), |
1923 | ipmi_version_minor(&intf->bmc->id)); | 1929 | ipmi_version_minor(&intf->bmc->id)); |
1924 | } | 1930 | } |
1925 | 1931 | ||
1926 | static int stat_file_read_proc(char *page, char **start, off_t off, | 1932 | static int smi_version_proc_open(struct inode *inode, struct file *file) |
1927 | int count, int *eof, void *data) | ||
1928 | { | 1933 | { |
1929 | char *out = (char *) page; | 1934 | return single_open(file, smi_version_proc_show, PDE(inode)->data); |
1930 | ipmi_smi_t intf = data; | 1935 | } |
1936 | |||
1937 | static const struct file_operations smi_version_proc_ops = { | ||
1938 | .open = smi_version_proc_open, | ||
1939 | .read = seq_read, | ||
1940 | .llseek = seq_lseek, | ||
1941 | .release = single_release, | ||
1942 | }; | ||
1931 | 1943 | ||
1932 | out += sprintf(out, "sent_invalid_commands: %u\n", | 1944 | static int smi_stats_proc_show(struct seq_file *m, void *v) |
1945 | { | ||
1946 | ipmi_smi_t intf = m->private; | ||
1947 | |||
1948 | seq_printf(m, "sent_invalid_commands: %u\n", | ||
1933 | ipmi_get_stat(intf, sent_invalid_commands)); | 1949 | ipmi_get_stat(intf, sent_invalid_commands)); |
1934 | out += sprintf(out, "sent_local_commands: %u\n", | 1950 | seq_printf(m, "sent_local_commands: %u\n", |
1935 | ipmi_get_stat(intf, sent_local_commands)); | 1951 | ipmi_get_stat(intf, sent_local_commands)); |
1936 | out += sprintf(out, "handled_local_responses: %u\n", | 1952 | seq_printf(m, "handled_local_responses: %u\n", |
1937 | ipmi_get_stat(intf, handled_local_responses)); | 1953 | ipmi_get_stat(intf, handled_local_responses)); |
1938 | out += sprintf(out, "unhandled_local_responses: %u\n", | 1954 | seq_printf(m, "unhandled_local_responses: %u\n", |
1939 | ipmi_get_stat(intf, unhandled_local_responses)); | 1955 | ipmi_get_stat(intf, unhandled_local_responses)); |
1940 | out += sprintf(out, "sent_ipmb_commands: %u\n", | 1956 | seq_printf(m, "sent_ipmb_commands: %u\n", |
1941 | ipmi_get_stat(intf, sent_ipmb_commands)); | 1957 | ipmi_get_stat(intf, sent_ipmb_commands)); |
1942 | out += sprintf(out, "sent_ipmb_command_errs: %u\n", | 1958 | seq_printf(m, "sent_ipmb_command_errs: %u\n", |
1943 | ipmi_get_stat(intf, sent_ipmb_command_errs)); | 1959 | ipmi_get_stat(intf, sent_ipmb_command_errs)); |
1944 | out += sprintf(out, "retransmitted_ipmb_commands: %u\n", | 1960 | seq_printf(m, "retransmitted_ipmb_commands: %u\n", |
1945 | ipmi_get_stat(intf, retransmitted_ipmb_commands)); | 1961 | ipmi_get_stat(intf, retransmitted_ipmb_commands)); |
1946 | out += sprintf(out, "timed_out_ipmb_commands: %u\n", | 1962 | seq_printf(m, "timed_out_ipmb_commands: %u\n", |
1947 | ipmi_get_stat(intf, timed_out_ipmb_commands)); | 1963 | ipmi_get_stat(intf, timed_out_ipmb_commands)); |
1948 | out += sprintf(out, "timed_out_ipmb_broadcasts: %u\n", | 1964 | seq_printf(m, "timed_out_ipmb_broadcasts: %u\n", |
1949 | ipmi_get_stat(intf, timed_out_ipmb_broadcasts)); | 1965 | ipmi_get_stat(intf, timed_out_ipmb_broadcasts)); |
1950 | out += sprintf(out, "sent_ipmb_responses: %u\n", | 1966 | seq_printf(m, "sent_ipmb_responses: %u\n", |
1951 | ipmi_get_stat(intf, sent_ipmb_responses)); | 1967 | ipmi_get_stat(intf, sent_ipmb_responses)); |
1952 | out += sprintf(out, "handled_ipmb_responses: %u\n", | 1968 | seq_printf(m, "handled_ipmb_responses: %u\n", |
1953 | ipmi_get_stat(intf, handled_ipmb_responses)); | 1969 | ipmi_get_stat(intf, handled_ipmb_responses)); |
1954 | out += sprintf(out, "invalid_ipmb_responses: %u\n", | 1970 | seq_printf(m, "invalid_ipmb_responses: %u\n", |
1955 | ipmi_get_stat(intf, invalid_ipmb_responses)); | 1971 | ipmi_get_stat(intf, invalid_ipmb_responses)); |
1956 | out += sprintf(out, "unhandled_ipmb_responses: %u\n", | 1972 | seq_printf(m, "unhandled_ipmb_responses: %u\n", |
1957 | ipmi_get_stat(intf, unhandled_ipmb_responses)); | 1973 | ipmi_get_stat(intf, unhandled_ipmb_responses)); |
1958 | out += sprintf(out, "sent_lan_commands: %u\n", | 1974 | seq_printf(m, "sent_lan_commands: %u\n", |
1959 | ipmi_get_stat(intf, sent_lan_commands)); | 1975 | ipmi_get_stat(intf, sent_lan_commands)); |
1960 | out += sprintf(out, "sent_lan_command_errs: %u\n", | 1976 | seq_printf(m, "sent_lan_command_errs: %u\n", |
1961 | ipmi_get_stat(intf, sent_lan_command_errs)); | 1977 | ipmi_get_stat(intf, sent_lan_command_errs)); |
1962 | out += sprintf(out, "retransmitted_lan_commands: %u\n", | 1978 | seq_printf(m, "retransmitted_lan_commands: %u\n", |
1963 | ipmi_get_stat(intf, retransmitted_lan_commands)); | 1979 | ipmi_get_stat(intf, retransmitted_lan_commands)); |
1964 | out += sprintf(out, "timed_out_lan_commands: %u\n", | 1980 | seq_printf(m, "timed_out_lan_commands: %u\n", |
1965 | ipmi_get_stat(intf, timed_out_lan_commands)); | 1981 | ipmi_get_stat(intf, timed_out_lan_commands)); |
1966 | out += sprintf(out, "sent_lan_responses: %u\n", | 1982 | seq_printf(m, "sent_lan_responses: %u\n", |
1967 | ipmi_get_stat(intf, sent_lan_responses)); | 1983 | ipmi_get_stat(intf, sent_lan_responses)); |
1968 | out += sprintf(out, "handled_lan_responses: %u\n", | 1984 | seq_printf(m, "handled_lan_responses: %u\n", |
1969 | ipmi_get_stat(intf, handled_lan_responses)); | 1985 | ipmi_get_stat(intf, handled_lan_responses)); |
1970 | out += sprintf(out, "invalid_lan_responses: %u\n", | 1986 | seq_printf(m, "invalid_lan_responses: %u\n", |
1971 | ipmi_get_stat(intf, invalid_lan_responses)); | 1987 | ipmi_get_stat(intf, invalid_lan_responses)); |
1972 | out += sprintf(out, "unhandled_lan_responses: %u\n", | 1988 | seq_printf(m, "unhandled_lan_responses: %u\n", |
1973 | ipmi_get_stat(intf, unhandled_lan_responses)); | 1989 | ipmi_get_stat(intf, unhandled_lan_responses)); |
1974 | out += sprintf(out, "handled_commands: %u\n", | 1990 | seq_printf(m, "handled_commands: %u\n", |
1975 | ipmi_get_stat(intf, handled_commands)); | 1991 | ipmi_get_stat(intf, handled_commands)); |
1976 | out += sprintf(out, "invalid_commands: %u\n", | 1992 | seq_printf(m, "invalid_commands: %u\n", |
1977 | ipmi_get_stat(intf, invalid_commands)); | 1993 | ipmi_get_stat(intf, invalid_commands)); |
1978 | out += sprintf(out, "unhandled_commands: %u\n", | 1994 | seq_printf(m, "unhandled_commands: %u\n", |
1979 | ipmi_get_stat(intf, unhandled_commands)); | 1995 | ipmi_get_stat(intf, unhandled_commands)); |
1980 | out += sprintf(out, "invalid_events: %u\n", | 1996 | seq_printf(m, "invalid_events: %u\n", |
1981 | ipmi_get_stat(intf, invalid_events)); | 1997 | ipmi_get_stat(intf, invalid_events)); |
1982 | out += sprintf(out, "events: %u\n", | 1998 | seq_printf(m, "events: %u\n", |
1983 | ipmi_get_stat(intf, events)); | 1999 | ipmi_get_stat(intf, events)); |
1984 | out += sprintf(out, "failed rexmit LAN msgs: %u\n", | 2000 | seq_printf(m, "failed rexmit LAN msgs: %u\n", |
1985 | ipmi_get_stat(intf, dropped_rexmit_lan_commands)); | 2001 | ipmi_get_stat(intf, dropped_rexmit_lan_commands)); |
1986 | out += sprintf(out, "failed rexmit IPMB msgs: %u\n", | 2002 | seq_printf(m, "failed rexmit IPMB msgs: %u\n", |
1987 | ipmi_get_stat(intf, dropped_rexmit_ipmb_commands)); | 2003 | ipmi_get_stat(intf, dropped_rexmit_ipmb_commands)); |
2004 | return 0; | ||
2005 | } | ||
1988 | 2006 | ||
1989 | return (out - ((char *) page)); | 2007 | static int smi_stats_proc_open(struct inode *inode, struct file *file) |
2008 | { | ||
2009 | return single_open(file, smi_stats_proc_show, PDE(inode)->data); | ||
1990 | } | 2010 | } |
2011 | |||
2012 | static const struct file_operations smi_stats_proc_ops = { | ||
2013 | .open = smi_stats_proc_open, | ||
2014 | .read = seq_read, | ||
2015 | .llseek = seq_lseek, | ||
2016 | .release = single_release, | ||
2017 | }; | ||
1991 | #endif /* CONFIG_PROC_FS */ | 2018 | #endif /* CONFIG_PROC_FS */ |
1992 | 2019 | ||
1993 | int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name, | 2020 | int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name, |
1994 | read_proc_t *read_proc, | 2021 | const struct file_operations *proc_ops, |
1995 | void *data) | 2022 | void *data) |
1996 | { | 2023 | { |
1997 | int rv = 0; | 2024 | int rv = 0; |
@@ -2010,15 +2037,12 @@ int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name, | |||
2010 | } | 2037 | } |
2011 | strcpy(entry->name, name); | 2038 | strcpy(entry->name, name); |
2012 | 2039 | ||
2013 | file = create_proc_entry(name, 0, smi->proc_dir); | 2040 | file = proc_create_data(name, 0, smi->proc_dir, proc_ops, data); |
2014 | if (!file) { | 2041 | if (!file) { |
2015 | kfree(entry->name); | 2042 | kfree(entry->name); |
2016 | kfree(entry); | 2043 | kfree(entry); |
2017 | rv = -ENOMEM; | 2044 | rv = -ENOMEM; |
2018 | } else { | 2045 | } else { |
2019 | file->data = data; | ||
2020 | file->read_proc = read_proc; | ||
2021 | |||
2022 | mutex_lock(&smi->proc_entry_lock); | 2046 | mutex_lock(&smi->proc_entry_lock); |
2023 | /* Stick it on the list. */ | 2047 | /* Stick it on the list. */ |
2024 | entry->next = smi->proc_entries; | 2048 | entry->next = smi->proc_entries; |
@@ -2043,17 +2067,17 @@ static int add_proc_entries(ipmi_smi_t smi, int num) | |||
2043 | 2067 | ||
2044 | if (rv == 0) | 2068 | if (rv == 0) |
2045 | rv = ipmi_smi_add_proc_entry(smi, "stats", | 2069 | rv = ipmi_smi_add_proc_entry(smi, "stats", |
2046 | stat_file_read_proc, | 2070 | &smi_stats_proc_ops, |
2047 | smi); | 2071 | smi); |
2048 | 2072 | ||
2049 | if (rv == 0) | 2073 | if (rv == 0) |
2050 | rv = ipmi_smi_add_proc_entry(smi, "ipmb", | 2074 | rv = ipmi_smi_add_proc_entry(smi, "ipmb", |
2051 | ipmb_file_read_proc, | 2075 | &smi_ipmb_proc_ops, |
2052 | smi); | 2076 | smi); |
2053 | 2077 | ||
2054 | if (rv == 0) | 2078 | if (rv == 0) |
2055 | rv = ipmi_smi_add_proc_entry(smi, "version", | 2079 | rv = ipmi_smi_add_proc_entry(smi, "version", |
2056 | version_file_read_proc, | 2080 | &smi_version_proc_ops, |
2057 | smi); | 2081 | smi); |
2058 | #endif /* CONFIG_PROC_FS */ | 2082 | #endif /* CONFIG_PROC_FS */ |
2059 | 2083 | ||
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 64c6b8530615..9397ab49b72e 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <linux/moduleparam.h> | 43 | #include <linux/moduleparam.h> |
44 | #include <asm/system.h> | 44 | #include <asm/system.h> |
45 | #include <linux/sched.h> | 45 | #include <linux/sched.h> |
46 | #include <linux/seq_file.h> | ||
46 | #include <linux/timer.h> | 47 | #include <linux/timer.h> |
47 | #include <linux/errno.h> | 48 | #include <linux/errno.h> |
48 | #include <linux/spinlock.h> | 49 | #include <linux/spinlock.h> |
@@ -2805,54 +2806,73 @@ static int try_enable_event_buffer(struct smi_info *smi_info) | |||
2805 | return rv; | 2806 | return rv; |
2806 | } | 2807 | } |
2807 | 2808 | ||
2808 | static int type_file_read_proc(char *page, char **start, off_t off, | 2809 | static int smi_type_proc_show(struct seq_file *m, void *v) |
2809 | int count, int *eof, void *data) | ||
2810 | { | 2810 | { |
2811 | struct smi_info *smi = data; | 2811 | struct smi_info *smi = m->private; |
2812 | 2812 | ||
2813 | return sprintf(page, "%s\n", si_to_str[smi->si_type]); | 2813 | return seq_printf(m, "%s\n", si_to_str[smi->si_type]); |
2814 | } | 2814 | } |
2815 | 2815 | ||
2816 | static int stat_file_read_proc(char *page, char **start, off_t off, | 2816 | static int smi_type_proc_open(struct inode *inode, struct file *file) |
2817 | int count, int *eof, void *data) | ||
2818 | { | 2817 | { |
2819 | char *out = (char *) page; | 2818 | return single_open(file, smi_type_proc_show, PDE(inode)->data); |
2820 | struct smi_info *smi = data; | 2819 | } |
2820 | |||
2821 | static const struct file_operations smi_type_proc_ops = { | ||
2822 | .open = smi_type_proc_open, | ||
2823 | .read = seq_read, | ||
2824 | .llseek = seq_lseek, | ||
2825 | .release = single_release, | ||
2826 | }; | ||
2827 | |||
2828 | static int smi_si_stats_proc_show(struct seq_file *m, void *v) | ||
2829 | { | ||
2830 | struct smi_info *smi = m->private; | ||
2821 | 2831 | ||
2822 | out += sprintf(out, "interrupts_enabled: %d\n", | 2832 | seq_printf(m, "interrupts_enabled: %d\n", |
2823 | smi->irq && !smi->interrupt_disabled); | 2833 | smi->irq && !smi->interrupt_disabled); |
2824 | out += sprintf(out, "short_timeouts: %u\n", | 2834 | seq_printf(m, "short_timeouts: %u\n", |
2825 | smi_get_stat(smi, short_timeouts)); | 2835 | smi_get_stat(smi, short_timeouts)); |
2826 | out += sprintf(out, "long_timeouts: %u\n", | 2836 | seq_printf(m, "long_timeouts: %u\n", |
2827 | smi_get_stat(smi, long_timeouts)); | 2837 | smi_get_stat(smi, long_timeouts)); |
2828 | out += sprintf(out, "idles: %u\n", | 2838 | seq_printf(m, "idles: %u\n", |
2829 | smi_get_stat(smi, idles)); | 2839 | smi_get_stat(smi, idles)); |
2830 | out += sprintf(out, "interrupts: %u\n", | 2840 | seq_printf(m, "interrupts: %u\n", |
2831 | smi_get_stat(smi, interrupts)); | 2841 | smi_get_stat(smi, interrupts)); |
2832 | out += sprintf(out, "attentions: %u\n", | 2842 | seq_printf(m, "attentions: %u\n", |
2833 | smi_get_stat(smi, attentions)); | 2843 | smi_get_stat(smi, attentions)); |
2834 | out += sprintf(out, "flag_fetches: %u\n", | 2844 | seq_printf(m, "flag_fetches: %u\n", |
2835 | smi_get_stat(smi, flag_fetches)); | 2845 | smi_get_stat(smi, flag_fetches)); |
2836 | out += sprintf(out, "hosed_count: %u\n", | 2846 | seq_printf(m, "hosed_count: %u\n", |
2837 | smi_get_stat(smi, hosed_count)); | 2847 | smi_get_stat(smi, hosed_count)); |
2838 | out += sprintf(out, "complete_transactions: %u\n", | 2848 | seq_printf(m, "complete_transactions: %u\n", |
2839 | smi_get_stat(smi, complete_transactions)); | 2849 | smi_get_stat(smi, complete_transactions)); |
2840 | out += sprintf(out, "events: %u\n", | 2850 | seq_printf(m, "events: %u\n", |
2841 | smi_get_stat(smi, events)); | 2851 | smi_get_stat(smi, events)); |
2842 | out += sprintf(out, "watchdog_pretimeouts: %u\n", | 2852 | seq_printf(m, "watchdog_pretimeouts: %u\n", |
2843 | smi_get_stat(smi, watchdog_pretimeouts)); | 2853 | smi_get_stat(smi, watchdog_pretimeouts)); |
2844 | out += sprintf(out, "incoming_messages: %u\n", | 2854 | seq_printf(m, "incoming_messages: %u\n", |
2845 | smi_get_stat(smi, incoming_messages)); | 2855 | smi_get_stat(smi, incoming_messages)); |
2856 | return 0; | ||
2857 | } | ||
2846 | 2858 | ||
2847 | return out - page; | 2859 | static int smi_si_stats_proc_open(struct inode *inode, struct file *file) |
2860 | { | ||
2861 | return single_open(file, smi_si_stats_proc_show, PDE(inode)->data); | ||
2848 | } | 2862 | } |
2849 | 2863 | ||
2850 | static int param_read_proc(char *page, char **start, off_t off, | 2864 | static const struct file_operations smi_si_stats_proc_ops = { |
2851 | int count, int *eof, void *data) | 2865 | .open = smi_si_stats_proc_open, |
2866 | .read = seq_read, | ||
2867 | .llseek = seq_lseek, | ||
2868 | .release = single_release, | ||
2869 | }; | ||
2870 | |||
2871 | static int smi_params_proc_show(struct seq_file *m, void *v) | ||
2852 | { | 2872 | { |
2853 | struct smi_info *smi = data; | 2873 | struct smi_info *smi = m->private; |
2854 | 2874 | ||
2855 | return sprintf(page, | 2875 | return seq_printf(m, |
2856 | "%s,%s,0x%lx,rsp=%d,rsi=%d,rsh=%d,irq=%d,ipmb=%d\n", | 2876 | "%s,%s,0x%lx,rsp=%d,rsi=%d,rsh=%d,irq=%d,ipmb=%d\n", |
2857 | si_to_str[smi->si_type], | 2877 | si_to_str[smi->si_type], |
2858 | addr_space_to_str[smi->io.addr_type], | 2878 | addr_space_to_str[smi->io.addr_type], |
@@ -2864,6 +2884,18 @@ static int param_read_proc(char *page, char **start, off_t off, | |||
2864 | smi->slave_addr); | 2884 | smi->slave_addr); |
2865 | } | 2885 | } |
2866 | 2886 | ||
2887 | static int smi_params_proc_open(struct inode *inode, struct file *file) | ||
2888 | { | ||
2889 | return single_open(file, smi_params_proc_show, PDE(inode)->data); | ||
2890 | } | ||
2891 | |||
2892 | static const struct file_operations smi_params_proc_ops = { | ||
2893 | .open = smi_params_proc_open, | ||
2894 | .read = seq_read, | ||
2895 | .llseek = seq_lseek, | ||
2896 | .release = single_release, | ||
2897 | }; | ||
2898 | |||
2867 | /* | 2899 | /* |
2868 | * oem_data_avail_to_receive_msg_avail | 2900 | * oem_data_avail_to_receive_msg_avail |
2869 | * @info - smi_info structure with msg_flags set | 2901 | * @info - smi_info structure with msg_flags set |
@@ -3257,7 +3289,7 @@ static int try_smi_init(struct smi_info *new_smi) | |||
3257 | } | 3289 | } |
3258 | 3290 | ||
3259 | rv = ipmi_smi_add_proc_entry(new_smi->intf, "type", | 3291 | rv = ipmi_smi_add_proc_entry(new_smi->intf, "type", |
3260 | type_file_read_proc, | 3292 | &smi_type_proc_ops, |
3261 | new_smi); | 3293 | new_smi); |
3262 | if (rv) { | 3294 | if (rv) { |
3263 | dev_err(new_smi->dev, "Unable to create proc entry: %d\n", rv); | 3295 | dev_err(new_smi->dev, "Unable to create proc entry: %d\n", rv); |
@@ -3265,7 +3297,7 @@ static int try_smi_init(struct smi_info *new_smi) | |||
3265 | } | 3297 | } |
3266 | 3298 | ||
3267 | rv = ipmi_smi_add_proc_entry(new_smi->intf, "si_stats", | 3299 | rv = ipmi_smi_add_proc_entry(new_smi->intf, "si_stats", |
3268 | stat_file_read_proc, | 3300 | &smi_si_stats_proc_ops, |
3269 | new_smi); | 3301 | new_smi); |
3270 | if (rv) { | 3302 | if (rv) { |
3271 | dev_err(new_smi->dev, "Unable to create proc entry: %d\n", rv); | 3303 | dev_err(new_smi->dev, "Unable to create proc entry: %d\n", rv); |
@@ -3273,7 +3305,7 @@ static int try_smi_init(struct smi_info *new_smi) | |||
3273 | } | 3305 | } |
3274 | 3306 | ||
3275 | rv = ipmi_smi_add_proc_entry(new_smi->intf, "params", | 3307 | rv = ipmi_smi_add_proc_entry(new_smi->intf, "params", |
3276 | param_read_proc, | 3308 | &smi_params_proc_ops, |
3277 | new_smi); | 3309 | new_smi); |
3278 | if (rv) { | 3310 | if (rv) { |
3279 | dev_err(new_smi->dev, "Unable to create proc entry: %d\n", rv); | 3311 | dev_err(new_smi->dev, "Unable to create proc entry: %d\n", rv); |
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h index 906590aa6907..204f9cd26c16 100644 --- a/include/linux/ipmi_smi.h +++ b/include/linux/ipmi_smi.h | |||
@@ -236,7 +236,7 @@ static inline void ipmi_free_smi_msg(struct ipmi_smi_msg *msg) | |||
236 | directory for this interface. Note that the entry will | 236 | directory for this interface. Note that the entry will |
237 | automatically be dstroyed when the interface is destroyed. */ | 237 | automatically be dstroyed when the interface is destroyed. */ |
238 | int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name, | 238 | int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name, |
239 | read_proc_t *read_proc, | 239 | const struct file_operations *proc_ops, |
240 | void *data); | 240 | void *data); |
241 | 241 | ||
242 | #endif /* __LINUX_IPMI_SMI_H */ | 242 | #endif /* __LINUX_IPMI_SMI_H */ |