diff options
author | Corey Minyard <cminyard@mvista.com> | 2019-07-31 19:18:25 -0500 |
---|---|---|
committer | Corey Minyard <cminyard@mvista.com> | 2019-08-02 07:25:03 -0500 |
commit | 104fb25f60077e4696145bcea51ca56f0959d7e3 (patch) | |
tree | 5ce57ae72112aa1f598ec98b8a59940403c72cec /drivers/char/ipmi/ipmi_si.h | |
parent | cbb19cb1eef050b193c823502bf920097c0f0459 (diff) | |
download | linux-104fb25f60077e4696145bcea51ca56f0959d7e3.tar.bz2 |
ipmi_si: Rework some include files
ipmi_si_sm.h was getting included in lots of places it didn't
belong. Rework things a bit to remove all the dependencies,
mostly just moving things between include files that were in
the wrong place and removing bogus includes.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char/ipmi/ipmi_si.h')
-rw-r--r-- | drivers/char/ipmi/ipmi_si.h | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/drivers/char/ipmi/ipmi_si.h b/drivers/char/ipmi/ipmi_si.h index 357a229c9012..bac0ff86e48e 100644 --- a/drivers/char/ipmi/ipmi_si.h +++ b/drivers/char/ipmi/ipmi_si.h @@ -6,14 +6,65 @@ * etc) to the base ipmi system interface code. */ +#ifndef __IPMI_SI_H__ +#define __IPMI_SI_H__ + +#include <linux/ipmi.h> #include <linux/interrupt.h> #include <linux/platform_device.h> -#include "ipmi_si_sm.h" + +#define SI_DEVICE_NAME "ipmi_si" #define DEFAULT_REGSPACING 1 #define DEFAULT_REGSIZE 1 -#define DEVICE_NAME "ipmi_si" +enum si_type { + SI_TYPE_INVALID, SI_KCS, SI_SMIC, SI_BT +}; + +enum ipmi_addr_space { + IPMI_IO_ADDR_SPACE, IPMI_MEM_ADDR_SPACE +}; + +/* + * The structure for doing I/O in the state machine. The state + * machine doesn't have the actual I/O routines, they are done through + * this interface. + */ +struct si_sm_io { + unsigned char (*inputb)(const struct si_sm_io *io, unsigned int offset); + void (*outputb)(const struct si_sm_io *io, + unsigned int offset, + unsigned char b); + + /* + * Generic info used by the actual handling routines, the + * state machine shouldn't touch these. + */ + void __iomem *addr; + unsigned int regspacing; + unsigned int regsize; + unsigned int regshift; + enum ipmi_addr_space addr_space; + unsigned long addr_data; + enum ipmi_addr_src addr_source; /* ACPI, PCI, SMBIOS, hardcode, etc. */ + void (*addr_source_cleanup)(struct si_sm_io *io); + void *addr_source_data; + union ipmi_smi_info_union addr_info; + + int (*io_setup)(struct si_sm_io *info); + void (*io_cleanup)(struct si_sm_io *info); + unsigned int io_size; + + int irq; + int (*irq_setup)(struct si_sm_io *io); + void *irq_handler_data; + void (*irq_cleanup)(struct si_sm_io *io); + + u8 slave_addr; + enum si_type si_type; + struct device *dev; +}; int ipmi_si_add_smi(struct si_sm_io *io); irqreturn_t ipmi_si_irq_handler(int irq, void *data); @@ -50,3 +101,5 @@ static inline void ipmi_si_parisc_shutdown(void) { } int ipmi_si_port_setup(struct si_sm_io *io); int ipmi_si_mem_setup(struct si_sm_io *io); + +#endif /* __IPMI_SI_H__ */ |