X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/2827b727d2910a3b48f9de7d67b3a67f59e256c7..c61a955168179d9b11a8f420979eed5cc24869c0:/lincan/include/main.h diff --git a/lincan/include/main.h b/lincan/include/main.h index 52c7c6c..30ae627 100644 --- a/lincan/include/main.h +++ b/lincan/include/main.h @@ -11,7 +11,6 @@ #include "./constants.h" #include "./can_sysdep.h" #include "./can_queue.h" -#include "lincan_config.h" #ifdef CAN_DEBUG #define DEBUGMSG(fmt,args...) can_printk(KERN_ERR "can.o (debug): " fmt,\ @@ -88,6 +87,7 @@ struct candevice_t { struct canhardware_t *hosthardware_p; union { + void *anydev; #ifdef CAN_ENABLE_PCI_SUPPORT struct pci_dev *pcidev; #endif /*CAN_ENABLE_PCI_SUPPORT*/ @@ -105,8 +105,9 @@ struct candevice_t { * %CHIP_SEGMENTED .. access to the chip is segmented (mainly for i82527 chips) * @clock: chip base clock frequency in Hz * @baudrate: selected chip baudrate in Hz - * @write_register: write chip register function copy - + * @write_register: write chip register function copy * @read_register: read chip register function copy + * @chip_data: pointer for optional chip specific data extension * @sja_cdr_reg: SJA specific register - * holds hardware specific options for the Clock Divider * register. Options defined in the sja1000.h file: @@ -157,9 +158,11 @@ struct chip_t { long clock; /* Chip clock in Hz */ long baudrate; - void (*write_register)(unsigned char data,unsigned long address); + void (*write_register)(unsigned data,unsigned long address); unsigned (*read_register)(unsigned long address); - + + void *chip_data; + unsigned short sja_cdr_reg; /* sja1000 only! */ unsigned short sja_ocr_reg; /* sja1000 only! */ unsigned short int_cpu_reg; /* intel 82527 only! */ @@ -206,6 +209,8 @@ struct chip_t { * %MSGOBJ_TX_REQUEST .. the message object requests TX activation * %MSGOBJ_TX_LOCK .. some IRQ routine or callback on some CPU * is running inside TX activation processing code + * @rx_preconfig_id: place to store RX message identifier for some chip types + * that reuse same object for TX */ struct msgobj_t { unsigned long obj_base_addr; @@ -224,6 +229,8 @@ struct msgobj_t { struct canmsg_t rx_msg; struct chip_t *hostchip; + + unsigned long rx_preconfig_id; atomic_t obj_used; struct list_head obj_users; @@ -290,7 +297,7 @@ struct hwspecops_t { int (*init_chip_data)(struct candevice_t *candev, int chipnr); int (*init_obj_data)(struct chip_t *chip, int objnr); int (*program_irq)(struct candevice_t *candev); - void (*write_register)(unsigned char data,unsigned long address); + void (*write_register)(unsigned data,unsigned long address); unsigned (*read_register)(unsigned long address); }; @@ -471,6 +478,8 @@ struct boardtype_t { const struct boardtype_t* boardtype_find(const char *str); +int can_check_dev_taken(void *anydev); + #ifdef CAN_WITH_RTL extern int can_rtl_priority; #endif /*CAN_WITH_RTL*/