SUNRPC: Deal with the lack of a SYN_SENT sk->sk_state_change callback...
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / s390 / char / sclp_config.c
blob16e232a99fb7f09150f9e6ecac15c171bc9575f1
1 /*
2 * drivers/s390/char/sclp_config.c
4 * Copyright IBM Corp. 2007
5 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
6 */
8 #define KMSG_COMPONENT "sclp_config"
9 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
11 #include <linux/init.h>
12 #include <linux/errno.h>
13 #include <linux/cpu.h>
14 #include <linux/sysdev.h>
15 #include <linux/workqueue.h>
16 #include <asm/smp.h>
18 #include "sclp.h"
20 struct conf_mgm_data {
21 u8 reserved;
22 u8 ev_qualifier;
23 } __attribute__((packed));
25 #define EV_QUAL_CPU_CHANGE 1
26 #define EV_QUAL_CAP_CHANGE 3
28 static struct work_struct sclp_cpu_capability_work;
29 static struct work_struct sclp_cpu_change_work;
31 static void sclp_cpu_capability_notify(struct work_struct *work)
33 int cpu;
34 struct sys_device *sysdev;
36 s390_adjust_jiffies();
37 pr_warning("cpu capability changed.\n");
38 get_online_cpus();
39 for_each_online_cpu(cpu) {
40 sysdev = get_cpu_sysdev(cpu);
41 kobject_uevent(&sysdev->kobj, KOBJ_CHANGE);
43 put_online_cpus();
46 static void __ref sclp_cpu_change_notify(struct work_struct *work)
48 smp_rescan_cpus();
51 static void sclp_conf_receiver_fn(struct evbuf_header *evbuf)
53 struct conf_mgm_data *cdata;
55 cdata = (struct conf_mgm_data *)(evbuf + 1);
56 switch (cdata->ev_qualifier) {
57 case EV_QUAL_CPU_CHANGE:
58 schedule_work(&sclp_cpu_change_work);
59 break;
60 case EV_QUAL_CAP_CHANGE:
61 schedule_work(&sclp_cpu_capability_work);
62 break;
66 static struct sclp_register sclp_conf_register =
68 .receive_mask = EVTYP_CONFMGMDATA_MASK,
69 .receiver_fn = sclp_conf_receiver_fn,
72 static int __init sclp_conf_init(void)
74 int rc;
76 INIT_WORK(&sclp_cpu_capability_work, sclp_cpu_capability_notify);
77 INIT_WORK(&sclp_cpu_change_work, sclp_cpu_change_notify);
79 rc = sclp_register(&sclp_conf_register);
80 if (rc)
81 return rc;
83 if (!(sclp_conf_register.sclp_send_mask & EVTYP_CONFMGMDATA_MASK)) {
84 pr_warning("no configuration management.\n");
85 sclp_unregister(&sclp_conf_register);
86 rc = -ENOSYS;
88 return rc;
91 __initcall(sclp_conf_init);