X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=include%2Flinux%2Frio.h;h=dc0c75556c63c763da2f29e1173606b0502ae78b;hb=c36c804559d3a891a2e655ba8185b4fa7eaee156;hp=d93857056cb99b1a45de079ab9e8101231d3f003;hpb=077e98945db7e54a9865b5f29a1f02f531eca414;p=cascardo%2Flinux.git diff --git a/include/linux/rio.h b/include/linux/rio.h index d93857056cb9..dc0c75556c63 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h @@ -14,8 +14,6 @@ #ifndef LINUX_RIO_H #define LINUX_RIO_H -#ifdef __KERNEL__ - #include #include #include @@ -23,8 +21,8 @@ #include #include -#define RIO_ANY_DESTID 0xff #define RIO_NO_HOPCOUNT -1 +#define RIO_INVALID_DESTID 0xffff #define RIO_MAX_MPORT_RESOURCES 16 #define RIO_MAX_DEV_RESOURCES 16 @@ -38,11 +36,8 @@ entry is invalid (no route exists for the device ID) */ -#ifdef CONFIG_RAPIDIO_8_BIT_TRANSPORT -#define RIO_MAX_ROUTE_ENTRIES (1 << 8) -#else -#define RIO_MAX_ROUTE_ENTRIES (1 << 16) -#endif +#define RIO_MAX_ROUTE_ENTRIES(size) (size ? (1 << 16) : (1 << 8)) +#define RIO_ANY_DESTID(size) (size ? 0xffff : 0xff) #define RIO_MAX_MBOX 4 #define RIO_MAX_MSG_SIZE 0x1000 @@ -148,6 +143,11 @@ struct rio_dbell { void *dev_id; }; +enum rio_phy_type { + RIO_PHY_PARALLEL, + RIO_PHY_SERIAL, +}; + /** * struct rio_mport - RIO master port info * @dbells: List of doorbell events @@ -161,7 +161,10 @@ struct rio_dbell { * @ops: configuration space functions * @id: Port ID, unique among all ports * @index: Port index, unique among all port interfaces of the same type + * @sys_size: RapidIO common transport system size + * @phy_type: RapidIO phy type * @name: Port name string + * @priv: Master port private data */ struct rio_mport { struct list_head dbells; /* list of doorbell events */ @@ -176,7 +179,13 @@ struct rio_mport { unsigned char id; /* port ID, unique among all ports */ unsigned char index; /* port index, unique among all port interfaces of the same type */ + unsigned int sys_size; /* RapidIO common transport system size. + * 0 - Small size. 256 devices. + * 1 - Large size, 65536 devices. + */ + enum rio_phy_type phy_type; /* RapidIO phy type */ unsigned char name[40]; + void *priv; /* Master port private data */ }; /** @@ -210,7 +219,7 @@ struct rio_switch { u16 switchid; u16 hopcount; u16 destid; - u8 route_table[RIO_MAX_ROUTE_ENTRIES]; + u8 *route_table; int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, u16 table, u16 route_destid, u8 route_port); int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, @@ -228,13 +237,15 @@ struct rio_switch { * @dsend: Callback to send a doorbell message. */ struct rio_ops { - int (*lcread) (int index, u32 offset, int len, u32 * data); - int (*lcwrite) (int index, u32 offset, int len, u32 data); - int (*cread) (int index, u16 destid, u8 hopcount, u32 offset, int len, - u32 * data); - int (*cwrite) (int index, u16 destid, u8 hopcount, u32 offset, int len, - u32 data); - int (*dsend) (int index, u16 destid, u16 data); + int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len, + u32 *data); + int (*lcwrite) (struct rio_mport *mport, int index, u32 offset, int len, + u32 data); + int (*cread) (struct rio_mport *mport, int index, u16 destid, + u8 hopcount, u32 offset, int len, u32 *data); + int (*cwrite) (struct rio_mport *mport, int index, u16 destid, + u8 hopcount, u32 offset, int len, u32 data); + int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data); }; #define RIO_RESOURCE_MEM 0x00000100 @@ -320,5 +331,4 @@ extern void rio_close_inb_mbox(struct rio_mport *, int); extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int); extern void rio_close_outb_mbox(struct rio_mport *, int); -#endif /* __KERNEL__ */ #endif /* LINUX_RIO_H */