2 * drivers/s390/char/sclp_config.c
4 * Copyright IBM Corp. 2007
5 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
8 #include <linux/init.h>
9 #include <linux/errno.h>
10 #include <linux/cpu.h>
11 #include <linux/sysdev.h>
12 #include <linux/workqueue.h>
15 #define TAG "sclp_config: "
17 struct conf_mgm_data {
20 } __attribute__((packed));
22 #define EV_QUAL_CAP_CHANGE 3
24 static struct work_struct sclp_cpu_capability_work;
26 static void sclp_cpu_capability_notify(struct work_struct *work)
29 struct sys_device *sysdev;
31 printk(KERN_WARNING TAG "cpu capability changed.\n");
33 for_each_online_cpu(cpu) {
34 sysdev = get_cpu_sysdev(cpu);
35 kobject_uevent(&sysdev->kobj, KOBJ_CHANGE);
40 static void sclp_conf_receiver_fn(struct evbuf_header *evbuf)
42 struct conf_mgm_data *cdata;
44 cdata = (struct conf_mgm_data *)(evbuf + 1);
45 if (cdata->ev_qualifier == EV_QUAL_CAP_CHANGE)
46 schedule_work(&sclp_cpu_capability_work);
49 static struct sclp_register sclp_conf_register =
51 .receive_mask = EVTYP_CONFMGMDATA_MASK,
52 .receiver_fn = sclp_conf_receiver_fn,
55 static int __init sclp_conf_init(void)
59 INIT_WORK(&sclp_cpu_capability_work, sclp_cpu_capability_notify);
61 rc = sclp_register(&sclp_conf_register);
63 printk(KERN_ERR TAG "failed to register (%d).\n", rc);
67 if (!(sclp_conf_register.sclp_receive_mask & EVTYP_CONFMGMDATA_MASK)) {
68 printk(KERN_WARNING TAG "no configuration management.\n");
69 sclp_unregister(&sclp_conf_register);
75 __initcall(sclp_conf_init);