Skip to content

Commit 163475e

Browse files
committed
ipmi: Remove the proc interface
It has been deprecated long enough, get rid of it. Signed-off-by: Corey Minyard <[email protected]>
1 parent 1211229 commit 163475e

File tree

5 files changed

+0
-497
lines changed

5 files changed

+0
-497
lines changed

drivers/char/ipmi/Kconfig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ config IPMI_DMI_DECODE
2222

2323
if IPMI_HANDLER
2424

25-
config IPMI_PROC_INTERFACE
26-
bool 'Provide an interface for IPMI stats in /proc (deprecated)'
27-
depends on PROC_FS
28-
default y
29-
help
30-
Do not use this any more, use sysfs for this info. It will be
31-
removed in future kernel versions.
32-
3325
config IPMI_PANIC_EVENT
3426
bool 'Generate a panic event to all BMCs on a panic'
3527
help

drivers/char/ipmi/ipmi_msghandler.c

Lines changed: 0 additions & 264 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,6 @@ module_param_cb(panic_op, &panic_op_ops, NULL, 0600);
131131
MODULE_PARM_DESC(panic_op, "Sets if the IPMI driver will attempt to store panic information in the event log in the event of a panic. Set to 'none' for no, 'event' for a single event, or 'string' for a generic event and the panic string in IPMI OEM events.");
132132

133133

134-
#ifdef CONFIG_IPMI_PROC_INTERFACE
135-
static struct proc_dir_entry *proc_ipmi_root;
136-
#endif /* CONFIG_IPMI_PROC_INTERFACE */
137-
138134
#define MAX_EVENTS_IN_QUEUE 25
139135

140136
/* Remain in auto-maintenance mode for this amount of time (in ms). */
@@ -315,13 +311,6 @@ struct ipmi_my_addrinfo {
315311
unsigned char lun;
316312
};
317313

318-
#ifdef CONFIG_IPMI_PROC_INTERFACE
319-
struct ipmi_proc_entry {
320-
char *name;
321-
struct ipmi_proc_entry *next;
322-
};
323-
#endif
324-
325314
/*
326315
* Note that the product id, manufacturer id, guid, and device id are
327316
* immutable in this structure, so dyn_mutex is not required for
@@ -492,15 +481,6 @@ struct ipmi_smi {
492481
const struct ipmi_smi_handlers *handlers;
493482
void *send_info;
494483

495-
#ifdef CONFIG_IPMI_PROC_INTERFACE
496-
/* A list of proc entries for this interface. */
497-
struct mutex proc_entry_lock;
498-
struct ipmi_proc_entry *proc_entries;
499-
500-
struct proc_dir_entry *proc_dir;
501-
char proc_dir_name[10];
502-
#endif
503-
504484
/* Driver-model device for the system interface. */
505485
struct device *si_dev;
506486

@@ -2515,216 +2495,6 @@ static int bmc_get_device_id(struct ipmi_smi *intf, struct bmc_device *bmc,
25152495
return __bmc_get_device_id(intf, bmc, id, guid_set, guid, -1);
25162496
}
25172497

2518-
#ifdef CONFIG_IPMI_PROC_INTERFACE
2519-
static int smi_ipmb_proc_show(struct seq_file *m, void *v)
2520-
{
2521-
struct ipmi_smi *intf = m->private;
2522-
int i;
2523-
2524-
seq_printf(m, "%x", intf->addrinfo[0].address);
2525-
for (i = 1; i < IPMI_MAX_CHANNELS; i++)
2526-
seq_printf(m, " %x", intf->addrinfo[i].address);
2527-
seq_putc(m, '\n');
2528-
2529-
return 0;
2530-
}
2531-
2532-
static int smi_ipmb_proc_open(struct inode *inode, struct file *file)
2533-
{
2534-
return single_open(file, smi_ipmb_proc_show, PDE_DATA(inode));
2535-
}
2536-
2537-
static const struct file_operations smi_ipmb_proc_ops = {
2538-
.open = smi_ipmb_proc_open,
2539-
.read = seq_read,
2540-
.llseek = seq_lseek,
2541-
.release = single_release,
2542-
};
2543-
2544-
static int smi_version_proc_show(struct seq_file *m, void *v)
2545-
{
2546-
struct ipmi_smi *intf = m->private;
2547-
struct ipmi_device_id id;
2548-
int rv;
2549-
2550-
rv = bmc_get_device_id(intf, NULL, &id, NULL, NULL);
2551-
if (rv)
2552-
return rv;
2553-
2554-
seq_printf(m, "%u.%u\n",
2555-
ipmi_version_major(&id),
2556-
ipmi_version_minor(&id));
2557-
2558-
return 0;
2559-
}
2560-
2561-
static int smi_version_proc_open(struct inode *inode, struct file *file)
2562-
{
2563-
return single_open(file, smi_version_proc_show, PDE_DATA(inode));
2564-
}
2565-
2566-
static const struct file_operations smi_version_proc_ops = {
2567-
.open = smi_version_proc_open,
2568-
.read = seq_read,
2569-
.llseek = seq_lseek,
2570-
.release = single_release,
2571-
};
2572-
2573-
static int smi_stats_proc_show(struct seq_file *m, void *v)
2574-
{
2575-
struct ipmi_smi *intf = m->private;
2576-
2577-
seq_printf(m, "sent_invalid_commands: %u\n",
2578-
ipmi_get_stat(intf, sent_invalid_commands));
2579-
seq_printf(m, "sent_local_commands: %u\n",
2580-
ipmi_get_stat(intf, sent_local_commands));
2581-
seq_printf(m, "handled_local_responses: %u\n",
2582-
ipmi_get_stat(intf, handled_local_responses));
2583-
seq_printf(m, "unhandled_local_responses: %u\n",
2584-
ipmi_get_stat(intf, unhandled_local_responses));
2585-
seq_printf(m, "sent_ipmb_commands: %u\n",
2586-
ipmi_get_stat(intf, sent_ipmb_commands));
2587-
seq_printf(m, "sent_ipmb_command_errs: %u\n",
2588-
ipmi_get_stat(intf, sent_ipmb_command_errs));
2589-
seq_printf(m, "retransmitted_ipmb_commands: %u\n",
2590-
ipmi_get_stat(intf, retransmitted_ipmb_commands));
2591-
seq_printf(m, "timed_out_ipmb_commands: %u\n",
2592-
ipmi_get_stat(intf, timed_out_ipmb_commands));
2593-
seq_printf(m, "timed_out_ipmb_broadcasts: %u\n",
2594-
ipmi_get_stat(intf, timed_out_ipmb_broadcasts));
2595-
seq_printf(m, "sent_ipmb_responses: %u\n",
2596-
ipmi_get_stat(intf, sent_ipmb_responses));
2597-
seq_printf(m, "handled_ipmb_responses: %u\n",
2598-
ipmi_get_stat(intf, handled_ipmb_responses));
2599-
seq_printf(m, "invalid_ipmb_responses: %u\n",
2600-
ipmi_get_stat(intf, invalid_ipmb_responses));
2601-
seq_printf(m, "unhandled_ipmb_responses: %u\n",
2602-
ipmi_get_stat(intf, unhandled_ipmb_responses));
2603-
seq_printf(m, "sent_lan_commands: %u\n",
2604-
ipmi_get_stat(intf, sent_lan_commands));
2605-
seq_printf(m, "sent_lan_command_errs: %u\n",
2606-
ipmi_get_stat(intf, sent_lan_command_errs));
2607-
seq_printf(m, "retransmitted_lan_commands: %u\n",
2608-
ipmi_get_stat(intf, retransmitted_lan_commands));
2609-
seq_printf(m, "timed_out_lan_commands: %u\n",
2610-
ipmi_get_stat(intf, timed_out_lan_commands));
2611-
seq_printf(m, "sent_lan_responses: %u\n",
2612-
ipmi_get_stat(intf, sent_lan_responses));
2613-
seq_printf(m, "handled_lan_responses: %u\n",
2614-
ipmi_get_stat(intf, handled_lan_responses));
2615-
seq_printf(m, "invalid_lan_responses: %u\n",
2616-
ipmi_get_stat(intf, invalid_lan_responses));
2617-
seq_printf(m, "unhandled_lan_responses: %u\n",
2618-
ipmi_get_stat(intf, unhandled_lan_responses));
2619-
seq_printf(m, "handled_commands: %u\n",
2620-
ipmi_get_stat(intf, handled_commands));
2621-
seq_printf(m, "invalid_commands: %u\n",
2622-
ipmi_get_stat(intf, invalid_commands));
2623-
seq_printf(m, "unhandled_commands: %u\n",
2624-
ipmi_get_stat(intf, unhandled_commands));
2625-
seq_printf(m, "invalid_events: %u\n",
2626-
ipmi_get_stat(intf, invalid_events));
2627-
seq_printf(m, "events: %u\n",
2628-
ipmi_get_stat(intf, events));
2629-
seq_printf(m, "failed rexmit LAN msgs: %u\n",
2630-
ipmi_get_stat(intf, dropped_rexmit_lan_commands));
2631-
seq_printf(m, "failed rexmit IPMB msgs: %u\n",
2632-
ipmi_get_stat(intf, dropped_rexmit_ipmb_commands));
2633-
return 0;
2634-
}
2635-
2636-
static int smi_stats_proc_open(struct inode *inode, struct file *file)
2637-
{
2638-
return single_open(file, smi_stats_proc_show, PDE_DATA(inode));
2639-
}
2640-
2641-
static const struct file_operations smi_stats_proc_ops = {
2642-
.open = smi_stats_proc_open,
2643-
.read = seq_read,
2644-
.llseek = seq_lseek,
2645-
.release = single_release,
2646-
};
2647-
2648-
int ipmi_smi_add_proc_entry(struct ipmi_smi *smi, char *name,
2649-
const struct file_operations *proc_ops,
2650-
void *data)
2651-
{
2652-
int rv = 0;
2653-
struct proc_dir_entry *file;
2654-
struct ipmi_proc_entry *entry;
2655-
2656-
/* Create a list element. */
2657-
entry = kmalloc(sizeof(*entry), GFP_KERNEL);
2658-
if (!entry)
2659-
return -ENOMEM;
2660-
entry->name = kstrdup(name, GFP_KERNEL);
2661-
if (!entry->name) {
2662-
kfree(entry);
2663-
return -ENOMEM;
2664-
}
2665-
2666-
file = proc_create_data(name, 0, smi->proc_dir, proc_ops, data);
2667-
if (!file) {
2668-
kfree(entry->name);
2669-
kfree(entry);
2670-
rv = -ENOMEM;
2671-
} else {
2672-
mutex_lock(&smi->proc_entry_lock);
2673-
/* Stick it on the list. */
2674-
entry->next = smi->proc_entries;
2675-
smi->proc_entries = entry;
2676-
mutex_unlock(&smi->proc_entry_lock);
2677-
}
2678-
2679-
return rv;
2680-
}
2681-
EXPORT_SYMBOL(ipmi_smi_add_proc_entry);
2682-
2683-
static int add_proc_entries(struct ipmi_smi *smi, int num)
2684-
{
2685-
int rv = 0;
2686-
2687-
sprintf(smi->proc_dir_name, "%d", num);
2688-
smi->proc_dir = proc_mkdir(smi->proc_dir_name, proc_ipmi_root);
2689-
if (!smi->proc_dir)
2690-
rv = -ENOMEM;
2691-
2692-
if (rv == 0)
2693-
rv = ipmi_smi_add_proc_entry(smi, "stats",
2694-
&smi_stats_proc_ops,
2695-
smi);
2696-
2697-
if (rv == 0)
2698-
rv = ipmi_smi_add_proc_entry(smi, "ipmb",
2699-
&smi_ipmb_proc_ops,
2700-
smi);
2701-
2702-
if (rv == 0)
2703-
rv = ipmi_smi_add_proc_entry(smi, "version",
2704-
&smi_version_proc_ops,
2705-
smi);
2706-
2707-
return rv;
2708-
}
2709-
2710-
static void remove_proc_entries(struct ipmi_smi *smi)
2711-
{
2712-
struct ipmi_proc_entry *entry;
2713-
2714-
mutex_lock(&smi->proc_entry_lock);
2715-
while (smi->proc_entries) {
2716-
entry = smi->proc_entries;
2717-
smi->proc_entries = entry->next;
2718-
2719-
remove_proc_entry(entry->name, smi->proc_dir);
2720-
kfree(entry->name);
2721-
kfree(entry);
2722-
}
2723-
mutex_unlock(&smi->proc_entry_lock);
2724-
remove_proc_entry(smi->proc_dir_name, proc_ipmi_root);
2725-
}
2726-
#endif /* CONFIG_IPMI_PROC_INTERFACE */
2727-
27282498
static ssize_t device_id_show(struct device *dev,
27292499
struct device_attribute *attr,
27302500
char *buf)
@@ -3564,9 +3334,6 @@ int ipmi_register_smi(const struct ipmi_smi_handlers *handlers,
35643334
intf->seq_table[j].seqid = 0;
35653335
}
35663336
intf->curr_seq = 0;
3567-
#ifdef CONFIG_IPMI_PROC_INTERFACE
3568-
mutex_init(&intf->proc_entry_lock);
3569-
#endif
35703337
spin_lock_init(&intf->waiting_rcv_msgs_lock);
35713338
INIT_LIST_HEAD(&intf->waiting_rcv_msgs);
35723339
tasklet_init(&intf->recv_tasklet,
@@ -3588,10 +3355,6 @@ int ipmi_register_smi(const struct ipmi_smi_handlers *handlers,
35883355
for (i = 0; i < IPMI_NUM_STATS; i++)
35893356
atomic_set(&intf->stats[i], 0);
35903357

3591-
#ifdef CONFIG_IPMI_PROC_INTERFACE
3592-
intf->proc_dir = NULL;
3593-
#endif
3594-
35953358
mutex_lock(&ipmi_interfaces_mutex);
35963359
/* Look for a hole in the numbers. */
35973360
i = 0;
@@ -3622,20 +3385,10 @@ int ipmi_register_smi(const struct ipmi_smi_handlers *handlers,
36223385
mutex_lock(&intf->bmc_reg_mutex);
36233386
rv = __scan_channels(intf, &id);
36243387
mutex_unlock(&intf->bmc_reg_mutex);
3625-
if (rv)
3626-
goto out;
3627-
3628-
#ifdef CONFIG_IPMI_PROC_INTERFACE
3629-
rv = add_proc_entries(intf, i);
3630-
#endif
36313388

36323389
out:
36333390
if (rv) {
36343391
ipmi_bmc_unregister(intf);
3635-
#ifdef CONFIG_IPMI_PROC_INTERFACE
3636-
if (intf->proc_dir)
3637-
remove_proc_entries(intf);
3638-
#endif
36393392
list_del_rcu(&intf->link);
36403393
mutex_unlock(&ipmi_interfaces_mutex);
36413394
synchronize_srcu(&ipmi_interfaces_srcu);
@@ -3748,9 +3501,6 @@ void ipmi_unregister_smi(struct ipmi_smi *intf)
37483501

37493502
cleanup_smi_msgs(intf);
37503503

3751-
#ifdef CONFIG_IPMI_PROC_INTERFACE
3752-
remove_proc_entries(intf);
3753-
#endif
37543504
ipmi_bmc_unregister(intf);
37553505

37563506
cleanup_srcu_struct(&intf->users_srcu);
@@ -5277,16 +5027,6 @@ static int ipmi_init_msghandler(void)
52775027

52785028
pr_info("ipmi message handler version " IPMI_DRIVER_VERSION "\n");
52795029

5280-
#ifdef CONFIG_IPMI_PROC_INTERFACE
5281-
proc_ipmi_root = proc_mkdir("ipmi", NULL);
5282-
if (!proc_ipmi_root) {
5283-
pr_err(PFX "Unable to create IPMI proc dir");
5284-
driver_unregister(&ipmidriver.driver);
5285-
return -ENOMEM;
5286-
}
5287-
5288-
#endif /* CONFIG_IPMI_PROC_INTERFACE */
5289-
52905030
timer_setup(&ipmi_timer, ipmi_timeout, 0);
52915031
mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES);
52925032

@@ -5325,10 +5065,6 @@ static void __exit cleanup_ipmi(void)
53255065
atomic_inc(&stop_operation);
53265066
del_timer_sync(&ipmi_timer);
53275067

5328-
#ifdef CONFIG_IPMI_PROC_INTERFACE
5329-
proc_remove(proc_ipmi_root);
5330-
#endif /* CONFIG_IPMI_PROC_INTERFACE */
5331-
53325068
driver_unregister(&ipmidriver.driver);
53335069

53345070
initialized = 0;

0 commit comments

Comments
 (0)