Commit 9019be28 authored by Andrew Morton's avatar Andrew Morton Committed by James Bottomley

[PATCH] I2O: run linux/i2o.h and linux/i2o-dev.h through

From: Markus Lidel <Markus.Lidel@shadowconnect.com>

- i2o.h and i2o-dev.h are now formated using Lindent.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent b590b47b
......@@ -44,27 +44,23 @@
#define I2OPASSTHRU _IOR(I2O_MAGIC_NUMBER,12,struct i2o_cmd_passthru)
#define I2OPASSTHRU32 _IOR(I2O_MAGIC_NUMBER,12,struct i2o_cmd_passthru32)
struct i2o_cmd_passthru32
{
struct i2o_cmd_passthru32 {
unsigned int iop; /* IOP unit number */
u32 msg; /* message */
};
struct i2o_cmd_passthru
{
struct i2o_cmd_passthru {
unsigned int iop; /* IOP unit number */
void __user *msg; /* message */
};
struct i2o_cmd_hrtlct
{
struct i2o_cmd_hrtlct {
unsigned int iop; /* IOP unit number */
void __user *resbuf; /* Buffer for result */
unsigned int __user *reslen; /* Buffer length in bytes */
};
struct i2o_cmd_psetget
{
struct i2o_cmd_psetget {
unsigned int iop; /* IOP unit number */
unsigned int tid; /* Target device TID */
void __user *opbuf; /* Operation List buffer */
......@@ -73,8 +69,7 @@ struct i2o_cmd_psetget
unsigned int __user *reslen; /* Result List buffer length in bytes */
};
struct i2o_sw_xfer
{
struct i2o_sw_xfer {
unsigned int iop; /* IOP unit number */
unsigned char flags; /* Flags field */
unsigned char sw_type; /* Software type */
......@@ -85,8 +80,7 @@ struct i2o_sw_xfer
unsigned int __user *curfrag; /* Current fragment count */
};
struct i2o_html
{
struct i2o_html {
unsigned int iop; /* IOP unit number */
unsigned int tid; /* Target device ID */
unsigned int page; /* HTML page */
......@@ -98,8 +92,7 @@ struct i2o_html
#define I2O_EVT_Q_LEN 32
struct i2o_evt_id
{
struct i2o_evt_id {
unsigned int iop;
unsigned int tid;
unsigned int evt_mask;
......@@ -108,21 +101,18 @@ struct i2o_evt_id
/* Event data size = frame size - message header + evt indicator */
#define I2O_EVT_DATA_SIZE 88
struct i2o_evt_info
{
struct i2o_evt_info {
struct i2o_evt_id id;
unsigned char evt_data[I2O_EVT_DATA_SIZE];
unsigned int data_size;
};
struct i2o_evt_get
{
struct i2o_evt_get {
struct i2o_evt_info info;
int pending;
int lost;
};
/**************************************************************************
* HRT related constants and structures
**************************************************************************/
......@@ -144,8 +134,7 @@ typedef unsigned int u32;
#endif /* __KERNEL__ */
typedef struct _i2o_pci_bus
{
typedef struct _i2o_pci_bus {
u8 PciFunctionNumber;
u8 PciDeviceNumber;
u8 PciBusNumber;
......@@ -154,53 +143,46 @@ typedef struct _i2o_pci_bus
u16 PciDeviceID;
} i2o_pci_bus;
typedef struct _i2o_local_bus
{
typedef struct _i2o_local_bus {
u16 LbBaseIOPort;
u16 reserved;
u32 LbBaseMemoryAddress;
} i2o_local_bus;
typedef struct _i2o_isa_bus
{
typedef struct _i2o_isa_bus {
u16 IsaBaseIOPort;
u8 CSN;
u8 reserved;
u32 IsaBaseMemoryAddress;
} i2o_isa_bus;
typedef struct _i2o_eisa_bus_info
{
typedef struct _i2o_eisa_bus_info {
u16 EisaBaseIOPort;
u8 reserved;
u8 EisaSlotNumber;
u32 EisaBaseMemoryAddress;
} i2o_eisa_bus;
typedef struct _i2o_mca_bus
{
typedef struct _i2o_mca_bus {
u16 McaBaseIOPort;
u8 reserved;
u8 McaSlotNumber;
u32 McaBaseMemoryAddress;
} i2o_mca_bus;
typedef struct _i2o_other_bus
{
typedef struct _i2o_other_bus {
u16 BaseIOPort;
u16 reserved;
u32 BaseMemoryAddress;
} i2o_other_bus;
typedef struct _i2o_hrt_entry
{
typedef struct _i2o_hrt_entry {
u32 adapter_id;
u32 parent_tid:12;
u32 state:4;
u32 bus_num:8;
u32 bus_type:8;
union
{
union {
i2o_pci_bus pci_bus;
i2o_local_bus local_bus;
i2o_isa_bus isa_bus;
......@@ -210,8 +192,7 @@ typedef struct _i2o_hrt_entry
} bus;
} i2o_hrt_entry;
typedef struct _i2o_hrt
{
typedef struct _i2o_hrt {
u16 num_entries;
u8 entry_len;
u8 hrt_version;
......@@ -219,8 +200,7 @@ typedef struct _i2o_hrt
i2o_hrt_entry hrt_entry[1];
} i2o_hrt;
typedef struct _i2o_lct_entry
{
typedef struct _i2o_lct_entry {
u32 entry_size:16;
u32 tid:12;
u32 reserved:4;
......@@ -237,8 +217,7 @@ typedef struct _i2o_lct_entry
u32 event_capabilities;
} i2o_lct_entry;
typedef struct _i2o_lct
{
typedef struct _i2o_lct {
u32 table_size:16;
u32 boot_tid:12;
u32 lct_ver:4;
......@@ -247,8 +226,7 @@ typedef struct _i2o_lct
i2o_lct_entry lct_entry[1];
} i2o_lct;
typedef struct _i2o_status_block
{
typedef struct _i2o_status_block {
u16 org_id;
u16 reserved;
u16 iop_id:12;
......
......@@ -30,7 +30,6 @@
#include <linux/pci.h>
#include <asm/dma-mapping.h>
/* message queue empty */
#define I2O_QUEUE_EMPTY 0xffffffff
......@@ -42,8 +41,7 @@ enum i2o_driver_notify {
/*
* Message structures
*/
struct i2o_message
{
struct i2o_message {
union {
struct {
u8 version_offset;
......@@ -64,8 +62,7 @@ struct i2o_message
/*
* Each I2O device entity has one of these. There is one per device.
*/
struct i2o_device
{
struct i2o_device {
i2o_lct_entry lct_data; /* Device LCT information */
struct i2o_controller *iop; /* Controlling IOP */
......@@ -108,17 +105,17 @@ struct i2o_driver {
struct i2o_class_id *classes; /* I2O classes that this OSM handles */
/* Message reply handler */
int (*reply)(struct i2o_controller *, u32, struct i2o_message *);
int (*reply) (struct i2o_controller *, u32, struct i2o_message *);
/* Event handler */
void (*event)(struct i2o_event *);
void (*event) (struct i2o_event *);
struct workqueue_struct *event_queue; /* Event queue */
struct device_driver driver;
/* notification of changes */
void (*notify)(enum i2o_driver_notify, void *);
void (*notify) (enum i2o_driver_notify, void *);
struct semaphore lock;
};
......@@ -145,8 +142,7 @@ struct i2o_context_list_element {
/*
* Each I2O controller has one of these objects
*/
struct i2o_controller
{
struct i2o_controller {
char name[16];
int unit;
int type;
......@@ -182,7 +178,6 @@ struct i2o_controller
struct semaphore lct_lock; /* Lock for LCT updates */
struct i2o_dma status_block; /* IOP status block */
struct i2o_dma base; /* controller messaging unit */
struct i2o_dma in_queue; /* inbound message queue Host->IOP */
struct i2o_dma out_queue; /* outbound message queue IOP->Host */
......@@ -196,7 +191,6 @@ struct i2o_controller
struct proc_dir_entry *proc_entry; /* /proc dir */
struct list_head bus_list; /* list of busses on IOP */
struct device device;
struct i2o_device *exec; /* Executive */
......@@ -219,8 +213,7 @@ struct i2o_controller
* system. It is sent to all IOPs so that they can create peer2peer
* connections between them.
*/
struct i2o_sys_tbl_entry
{
struct i2o_sys_tbl_entry {
u16 org_id;
u16 reserved1;
u32 iop_id:12;
......@@ -237,8 +230,7 @@ struct i2o_sys_tbl_entry
u32 inbound_high;
};
struct i2o_sys_tbl
{
struct i2o_sys_tbl {
u8 num_entries;
u8 version;
u16 reserved1;
......@@ -250,18 +242,18 @@ struct i2o_sys_tbl
extern struct list_head i2o_controllers;
/* Message functions */
static inline u32 i2o_msg_get(struct i2o_controller *, struct i2o_message **);
extern u32 i2o_msg_get_wait(struct i2o_controller *, struct i2o_message **,int);
extern u32 i2o_msg_get_wait(struct i2o_controller *, struct i2o_message **,
int);
static inline void i2o_msg_post(struct i2o_controller *, u32);
static inline int i2o_msg_post_wait(struct i2o_controller *,u32,unsigned long);
static inline int i2o_msg_post_wait(struct i2o_controller *, u32,
unsigned long);
extern int i2o_msg_post_wait_mem(struct i2o_controller *, u32, unsigned long,
struct i2o_dma *);
extern void i2o_msg_nop(struct i2o_controller *, u32);
static inline void i2o_flush_reply(struct i2o_controller *, u32);
/* DMA handling functions */
static inline int i2o_dma_alloc(struct device *, struct i2o_dma *, size_t,
unsigned int);
......@@ -275,7 +267,8 @@ static inline void i2o_dma_unmap(struct device *, struct i2o_dma *);
extern int i2o_status_get(struct i2o_controller *);
extern int i2o_hrt_get(struct i2o_controller *);
extern int i2o_event_register(struct i2o_device *, struct i2o_driver *,int,u32);
extern int i2o_event_register(struct i2o_device *, struct i2o_driver *, int,
u32);
extern struct i2o_device *i2o_iop_find_device(struct i2o_controller *, u16);
extern struct i2o_controller *i2o_find_iop(int);
......@@ -288,17 +281,17 @@ extern u32 i2o_cntxt_list_get_ptr(struct i2o_controller *, void *);
static inline u32 i2o_ptr_low(void *ptr)
{
return (u32)(u64)ptr;
return (u32) (u64) ptr;
};
static inline u32 i2o_ptr_high(void *ptr)
{
return (u32)((u64)ptr>>32);
return (u32) ((u64) ptr >> 32);
};
#else
static inline u32 i2o_cntxt_list_add(struct i2o_controller *c, void *ptr)
{
return (u32)ptr;
return (u32) ptr;
};
static inline void *i2o_cntxt_list_get(struct i2o_controller *c, u32 context)
......@@ -308,17 +301,17 @@ static inline void *i2o_cntxt_list_get(struct i2o_controller *c, u32 context)
static inline u32 i2o_cntxt_list_remove(struct i2o_controller *c, void *ptr)
{
return (u32)ptr;
return (u32) ptr;
};
static inline u32 i2o_cntxt_list_get_ptr(struct i2o_controller *c, void *ptr)
{
return (u32)ptr;
return (u32) ptr;
};
static inline u32 i2o_ptr_low(void *ptr)
{
return (u32)ptr;
return (u32) ptr;
};
static inline u32 i2o_ptr_high(void *ptr)
......@@ -337,8 +330,9 @@ extern void i2o_driver_unregister(struct i2o_driver *);
* Send notifications to a single registered driver.
*/
static inline void i2o_driver_notify(struct i2o_driver *drv,
enum i2o_driver_notify notify, void *data) {
if(drv->notify)
enum i2o_driver_notify notify, void *data)
{
if (drv->notify)
drv->notify(notify, data);
}
......@@ -356,7 +350,6 @@ extern int i2o_exec_lct_notify(struct i2o_controller *, u32);
#define to_i2o_driver(drv) container_of(drv,struct i2o_driver, driver)
#define to_i2o_device(dev) container_of(dev, struct i2o_device, device)
/*
* Messenger inlines
*/
......@@ -372,7 +365,6 @@ static inline void I2O_POST_WRITE32(struct i2o_controller *c, u32 val)
writel(val, c->post_port);
};
static inline u32 I2O_REPLY_READ32(struct i2o_controller *c)
{
rmb();
......@@ -385,7 +377,6 @@ static inline void I2O_REPLY_WRITE32(struct i2o_controller *c, u32 val)
writel(val, c->reply_port);
};
static inline u32 I2O_IRQ_READ32(struct i2o_controller *c)
{
rmb();
......@@ -412,11 +403,12 @@ static inline void I2O_IRQ_WRITE32(struct i2o_controller *c, u32 val)
* address from the read port (see the i2o spec). If no message is
* available returns I2O_QUEUE_EMPTY and msg is leaved untouched.
*/
static inline u32 i2o_msg_get(struct i2o_controller *c,struct i2o_message **msg)
static inline u32 i2o_msg_get(struct i2o_controller *c,
struct i2o_message **msg)
{
u32 m;
if((m=I2O_POST_READ32(c))!=I2O_QUEUE_EMPTY)
if ((m = I2O_POST_READ32(c)) != I2O_QUEUE_EMPTY)
*msg = c->in_queue.virt + m;
return m;
......@@ -483,7 +475,7 @@ static inline int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr,
size_t len, unsigned int gfp_mask)
{
addr->virt = dma_alloc_coherent(dev, len, &addr->phys, gfp_mask);
if(!addr->virt)
if (!addr->virt)
return -ENOMEM;
memset(addr->virt, 0, len);
......@@ -501,9 +493,10 @@ static inline int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr,
*/
static inline void i2o_dma_free(struct device *dev, struct i2o_dma *addr)
{
if(addr->virt) {
if(addr->phys)
dma_free_coherent(dev, addr->len,addr->virt,addr->phys);
if (addr->virt) {
if (addr->phys)
dma_free_coherent(dev, addr->len, addr->virt,
addr->phys);
else
kfree(addr->virt);
addr->virt = NULL;
......@@ -522,13 +515,13 @@ static inline void i2o_dma_free(struct device *dev, struct i2o_dma *addr)
*/
static inline int i2o_dma_map(struct device *dev, struct i2o_dma *addr)
{
if(!addr->virt)
if (!addr->virt)
return -EFAULT;
if(!addr->phys)
if (!addr->phys)
addr->phys = dma_map_single(dev, addr->virt, addr->len,
DMA_BIDIRECTIONAL);
if(!addr->phys)
if (!addr->phys)
return -ENOMEM;
return 0;
......@@ -543,16 +536,15 @@ static inline int i2o_dma_map(struct device *dev, struct i2o_dma *addr)
*/
static inline void i2o_dma_unmap(struct device *dev, struct i2o_dma *addr)
{
if(!addr->virt)
if (!addr->virt)
return;
if(addr->phys) {
if (addr->phys) {
dma_unmap_single(dev, addr->phys, addr->len, DMA_BIDIRECTIONAL);
addr->phys = 0;
}
};
/*
* Endian handling wrapped into the macro - keeps the core code
* cleaner.
......@@ -560,7 +552,6 @@ static inline void i2o_dma_unmap(struct device *dev, struct i2o_dma *addr)
#define i2o_raw_writel(val, mem) __raw_writel(cpu_to_le32(val), mem)
extern int i2o_parm_field_get(struct i2o_device *, int, int, void *, int);
extern int i2o_parm_field_set(struct i2o_device *, int, int, void *, int);
extern int i2o_parm_table_get(struct i2o_device *, int, int, int, void *, int,
......@@ -575,19 +566,16 @@ extern int i2o_issue_params(int, struct i2o_controller *, int, void *, int,
void *, int);
*/
/* debugging functions */
extern void i2o_report_status(const char *, const char *, struct i2o_message *);
extern void i2o_dump_message(struct i2o_message *);
extern void i2o_dump_hrt(struct i2o_controller *c);
extern void i2o_debug_state(struct i2o_controller *c);
/*
* Cache strategies
*/
/* The NULL strategy leaves everything up to the controller. This tends to be a
* pessimal but functional choice.
*/
......@@ -628,13 +616,11 @@ extern void i2o_debug_state(struct i2o_controller *c);
* Ioctl structures
*/
#define BLKI2OGRSTRAT _IOR('2', 1, int)
#define BLKI2OGWSTRAT _IOR('2', 2, int)
#define BLKI2OSRSTRAT _IOW('2', 3, int)
#define BLKI2OSWSTRAT _IOW('2', 4, int)
/*
* I2O Function codes
*/
......@@ -871,7 +857,6 @@ extern void i2o_debug_state(struct i2o_controller *c);
#define TRL_SINGLE_VARIABLE_LENGTH 0x40
#define TRL_MULTIPLE_FIXED_LENGTH 0x80
/* msg header defines for MsgFlags */
#define MSG_STATIC 0x0100
#define MSG_64BIT_CNTXT 0x0200
......@@ -892,7 +877,6 @@ extern void i2o_debug_state(struct i2o_controller *c);
#define ELEVEN_WORD_MSG_SIZE 0x000B0000
#define I2O_MESSAGE_SIZE(x) ((x)<<16)
/* Special TID Assignments */
#define ADAPTER_TID 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment