1#ifndef __GENERIC_BUS_H__ 2#define __GENERIC_BUS_H__ 3 4/* this is meant to be used for proprietary buses where abstraction is needed 5 but they don't occur often enough to warrant a separate helper library */ 6 7#include <stdint.h> 8 9#define GB_IOCTL_GET_NAME 1 10 /* third argument is size of the buffer, fourth argument is pointer 11 to the buffer. Returns the name of the bus */ 12#define GB_IOCTL_GET_TYPE 2 13 /* third argument is size of the buffer, fourth argument is pointer 14 to the buffer. Returns the type of the bus, driver should check 15 this at initialization time to find out whether they are compatible 16 */ 17 18 19typedef struct _GENERIC_BUS_Rec *GENERIC_BUS_Ptr; 20 21typedef struct _GENERIC_BUS_Rec{ 22 ScrnInfoPtr pScrn; 23 DevUnion DriverPrivate; 24 Bool (*ioctl)(GENERIC_BUS_Ptr, long, long, char *); 25 Bool (*read)(GENERIC_BUS_Ptr, uint32_t, uint32_t, uint8_t *); 26 Bool (*write)(GENERIC_BUS_Ptr, uint32_t, uint32_t, uint8_t *); 27 Bool (*fifo_read)(GENERIC_BUS_Ptr, uint32_t, uint32_t, uint8_t *); 28 Bool (*fifo_write)(GENERIC_BUS_Ptr, uint32_t, uint32_t, uint8_t *); 29 30 } GENERIC_BUS_Rec; 31 32 33 34 35 36#endif 37