patch-2.4.13 linux/include/linux/i2o.h
Next file: linux/include/linux/locks.h
Previous file: linux/include/linux/i2o-dev.h
Back to the patch index
Back to the overall index
- Lines: 307
- Date:
Fri Oct 19 08:32:28 2001
- Orig file:
v2.4.12/linux/include/linux/i2o.h
- Orig date:
Mon Aug 27 12:41:48 2001
diff -u --recursive --new-file v2.4.12/linux/include/linux/i2o.h linux/include/linux/i2o.h
@@ -17,24 +17,25 @@
#ifndef _I2O_H
#define _I2O_H
-#ifdef __KERNEL__ /* This file to be included by kernel only */
+
+#ifdef __KERNEL__ /* This file to be included by kernel only */
#include <linux/i2o-dev.h>
-/* How many different OSM's are we allowing */
+/* How many different OSM's are we allowing */
#define MAX_I2O_MODULES 64
/* How many OSMs can register themselves for device status updates? */
#define I2O_MAX_MANAGERS 4
-#include <asm/semaphore.h> /* Needed for MUTEX init macros */
+#include <asm/semaphore.h> /* Needed for MUTEX init macros */
#include <linux/config.h>
#include <linux/notifier.h>
-#include <linux/ioport.h>
+#include <linux/ioport.h> /* Needed for struct resource */
#include <asm/atomic.h>
/*
- * message structures
+ * Message structures
*/
struct i2o_message
{
@@ -43,7 +44,7 @@
u16 size;
u32 target_tid:12;
u32 init_tid:12;
- u32 function:8;
+ u32 function:8;
u32 initiator_context;
/* List follows */
};
@@ -54,18 +55,19 @@
*/
struct i2o_device
{
- i2o_lct_entry lct_data; /* Device LCT information */
- u32 flags;
- int i2oversion; /* I2O version supported. Actually there
- * should be high and low version */
+ i2o_lct_entry lct_data; /* Device LCT information */
+ u32 flags;
+ int i2oversion; /* I2O version supported. Actually
+ * there should be high and low
+ * version */
- struct proc_dir_entry* proc_entry; /* /proc dir */
+ struct proc_dir_entry *proc_entry; /* /proc dir */
/* Primary user */
struct i2o_handler *owner;
/* Management users */
- struct i2o_handler *managers[I2O_MAX_MANAGERS];
+ struct i2o_handler *managers[I2O_MAX_MANAGERS];
int num_managers;
struct i2o_controller *controller; /* Controlling IOP */
@@ -76,24 +78,23 @@
/*
* Resource data for each PCI I2O controller
- */
+ */
struct i2o_pci
{
- struct pci_dev *pdev; /* PCI device */
- int irq;
- int queue_buggy:1; /* Don't send a lot of messages */
- int short_req:1; /* Use small block sizes */
- int dpt:1; /* Don't quiesce */
+ int irq;
+ int queue_buggy:1; /* Don't send a lot of messages */
+ int short_req:1; /* Use small block sizes */
+ int dpt:1; /* Don't quiesce */
#ifdef CONFIG_MTRR
- int mtrr_reg0;
- int mtrr_reg1;
+ int mtrr_reg0;
+ int mtrr_reg1;
#endif
};
/*
* Transport types supported by I2O stack
*/
-#define I2O_TYPE_PCI 0x01 /* PCI I2O controller */
+#define I2O_TYPE_PCI 0x01 /* PCI I2O controller */
/*
@@ -101,6 +102,8 @@
*/
struct i2o_controller
{
+ struct pci_dev *pdev; /* PCI device */
+
char name[16];
int unit;
int type;
@@ -126,35 +129,35 @@
u32 mem_offset; /* MFA offset */
u32 mem_phys; /* MFA physical */
-
+
int battery:1; /* Has a battery backup */
int io_alloc:1; /* An I/O resource was allocated */
int mem_alloc:1; /* A memory resource was allocated */
-
+
struct resource io_resource; /* I/O resource allocated to the IOP */
struct resource mem_resource; /* Mem resource allocated to the IOP */
- struct proc_dir_entry* proc_entry; /* /proc dir */
+ struct proc_dir_entry *proc_entry; /* /proc dir */
- union
- { /* Bus information */
+ union { /* Bus information */
struct i2o_pci pci;
} bus;
/* Bus specific destructor */
- void (*destructor)(struct i2o_controller *);
+ void (*destructor)(struct i2o_controller *);
/* Bus specific attach/detach */
- int (*bind)(struct i2o_controller *, struct i2o_device *);
+ int (*bind)(struct i2o_controller *, struct i2o_device *);
/* Bus specific initiator */
int (*unbind)(struct i2o_controller *, struct i2o_device *);
/* Bus specific enable/disable */
- void (*bus_enable)(struct i2o_controller *c);
- void (*bus_disable)(struct i2o_controller *c);
+ void (*bus_enable)(struct i2o_controller *);
+ void (*bus_disable)(struct i2o_controller *);
- void *page_frame; /* Message buffers */
+ void *page_frame; /* Message buffers */
+ dma_addr_t page_frame_map; /* Cache map */
};
/*
@@ -169,7 +172,8 @@
struct i2o_handler
{
/* Message reply handler */
- void (*reply)(struct i2o_handler *, struct i2o_controller *, struct i2o_message *);
+ void (*reply)(struct i2o_handler *, struct i2o_controller *,
+ struct i2o_message *);
/* New device notification handler */
void (*new_dev_notify)(struct i2o_controller *, struct i2o_device *);
@@ -181,7 +185,7 @@
void (*reboot_notify)(void);
char *name; /* OSM name */
- int context; /* Low 8 bits of the transaction info */
+ int context; /* Low 8 bits of the transaction info */
u32 class; /* I2O classes that this driver handles */
/* User data follows */
};
@@ -201,12 +205,12 @@
{
int (*install)(struct i2o_controller *);
int (*activate)(struct i2o_controller *);
- struct i2o_controller* (*find)(int);
+ struct i2o_controller *(*find)(int);
void (*unlock)(struct i2o_controller *);
- void (*run_queue)(struct i2o_controller *c);
+ void (*run_queue)(struct i2o_controller * c);
int (*delete)(struct i2o_controller *);
};
-#endif // MODULE
+#endif /* MODULE */
/*
* I2O System table entry
@@ -222,9 +226,9 @@
u32 iop_id:12;
u32 reserved2:20;
u16 seg_num:12;
- u16 i2o_version:4;
- u8 iop_state;
- u8 msg_type;
+ u16 i2o_version:4;
+ u8 iop_state;
+ u8 msg_type;
u16 frame_size;
u16 reserved3;
u32 last_changed;
@@ -235,14 +239,14 @@
struct i2o_sys_tbl
{
- u8 num_entries;
- u8 version;
- u16 reserved1;
+ u8 num_entries;
+ u8 version;
+ u16 reserved1;
u32 change_ind;
u32 reserved2;
u32 reserved3;
struct i2o_sys_tbl_entry iops[0];
-};
+};
/*
* Messenger inlines
@@ -265,9 +269,9 @@
static inline void I2O_REPLY_WRITE32(struct i2o_controller *c, u32 Val)
{
- *c->reply_port= Val;
+ *c->reply_port = Val;
}
-
+
static inline u32 I2O_IRQ_READ32(struct i2o_controller *c)
{
@@ -283,13 +287,13 @@
static inline void i2o_post_message(struct i2o_controller *c, u32 m)
{
/* The second line isnt spurious - thats forcing PCI posting */
- I2O_POST_WRITE32(c,m);
+ I2O_POST_WRITE32(c, m);
(void) I2O_IRQ_READ32(c);
}
static inline void i2o_flush_reply(struct i2o_controller *c, u32 m)
{
- I2O_REPLY_WRITE32(c,m);
+ I2O_REPLY_WRITE32(c, m);
}
extern struct i2o_controller *i2o_find_controller(int);
@@ -304,23 +308,27 @@
extern int i2o_claim_device(struct i2o_device *, struct i2o_handler *);
extern int i2o_release_device(struct i2o_device *, struct i2o_handler *);
extern int i2o_device_notify_on(struct i2o_device *, struct i2o_handler *);
-extern int i2o_device_notify_off(struct i2o_device *, struct i2o_handler *);
+extern int i2o_device_notify_off(struct i2o_device *,
+ struct i2o_handler *);
extern int i2o_post_this(struct i2o_controller *, u32 *, int);
extern int i2o_post_wait(struct i2o_controller *, u32 *, int, int);
-extern int i2o_post_wait_mem(struct i2o_controller *, u32 *, int, int, void *, void *);
+extern int i2o_post_wait_mem(struct i2o_controller *, u32 *, int, int,
+ void *, void *);
-extern int i2o_query_scalar(struct i2o_controller *, int, int, int, void *, int);
-extern int i2o_set_scalar(struct i2o_controller *, int, int, int, void *, int);
-extern int i2o_query_table(int, struct i2o_controller *, int, int, int, void *,
- int, void *, int);
-extern int i2o_clear_table(struct i2o_controller *, int, int);
-extern int i2o_row_add_table(struct i2o_controller *, int, int, int, void *,
- int);
-extern int i2o_issue_params(int, struct i2o_controller *, int, void *,
- int, void *, int);
+extern int i2o_query_scalar(struct i2o_controller *, int, int, int, void *,
+ int);
+extern int i2o_set_scalar(struct i2o_controller *, int, int, int, void *,
+ int);
+extern int i2o_query_table(int, struct i2o_controller *, int, int, int,
+ void *, int, void *, int);
+extern int i2o_clear_table(struct i2o_controller *, int, int);
+extern int i2o_row_add_table(struct i2o_controller *, int, int, int,
+ void *, int);
+extern int i2o_issue_params(int, struct i2o_controller *, int, void *, int,
+ void *, int);
-extern int i2o_event_register(struct i2o_controller *, u32, u32, u32, u32);
+extern int i2o_event_register(struct i2o_controller *, u32, u32, u32, u32);
extern int i2o_event_ack(struct i2o_controller *, u32 *);
extern void i2o_report_status(const char *, const char *, u32 *);
@@ -339,7 +347,7 @@
/*
* Executive Class
- */
+ */
#define I2O_CMD_ADAPTER_ASSIGN 0xB3
#define I2O_CMD_ADAPTER_READ 0xB2
#define I2O_CMD_ADAPTER_RELEASE 0xB5
@@ -524,7 +532,7 @@
#define I2O_CLAIM_MANAGEMENT 0x02000000
#define I2O_CLAIM_AUTHORIZED 0x03000000
#define I2O_CLAIM_SECONDARY 0x04000000
-
+
/* Message header defines for VersionOffset */
#define I2OVER15 0x0001
#define I2OVER20 0x0002
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)