From: ppisa Date: Thu, 16 Sep 2004 00:01:34 +0000 (+0000) Subject: To prevent future name collisions "chip_t" changed to "canchip_t" X-Git-Tag: CLT_COMM_CAN-lincan-0_3~5 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/commitdiff_plain/95c031e101c74ae6472a7e538f3128f67a490082 To prevent future name collisions "chip_t" changed to "canchip_t" --- diff --git a/lincan/include/aim104.h b/lincan/include/aim104.h index 4dd71aa..0426441 100644 --- a/lincan/include/aim104.h +++ b/lincan/include/aim104.h @@ -12,7 +12,7 @@ int aim104_release_io(struct candevice_t *candev); int aim104_reset(struct candevice_t *candev); int aim104_init_hw_data(struct candevice_t *candev); int aim104_init_chip_data(struct candevice_t *candev, int chipnr); -int aim104_init_obj_data(struct chip_t *chip, int objnr); +int aim104_init_obj_data(struct canchip_t *chip, int objnr); void aim104_write_register(unsigned data, unsigned long address); unsigned aim104_read_register(unsigned long address); int aim104_program_irq(struct candevice_t *candev); diff --git a/lincan/include/c_can.h b/lincan/include/c_can.h index 99a4c29..1c3bb8f 100644 --- a/lincan/include/c_can.h +++ b/lincan/include/c_can.h @@ -12,7 +12,7 @@ /* * optimized inline version, may it be, that it can be too fast for the chip */ -extern inline void c_can_write_reg_w(const struct chip_t *pchip, u16 data, unsigned reg) +extern inline void c_can_write_reg_w(const struct canchip_t *pchip, u16 data, unsigned reg) { u32 address = pchip->chip_base_addr + reg; #ifndef CONFIG_OC_LINCAN_DYNAMICIO @@ -22,7 +22,7 @@ extern inline void c_can_write_reg_w(const struct chip_t *pchip, u16 data, unsig #endif /*CONFIG_OC_LINCAN_DYNAMICIO*/ } -extern inline u16 c_can_read_reg_w(const struct chip_t *pchip, unsigned reg) +extern inline u16 c_can_read_reg_w(const struct canchip_t *pchip, unsigned reg) { u32 address = pchip->chip_base_addr + reg; #ifndef CONFIG_OC_LINCAN_DYNAMICIO @@ -37,42 +37,42 @@ extern can_spinlock_t c_can_sprlock; // Spin lock for read operations extern can_spinlock_t c_can_if1lock; // spin lock for the if1 register extern can_spinlock_t c_can_if2lock; // spin lcok for the if2 register -int c_can_if1_busycheck(struct chip_t *pchip); -int c_can_if2_busycheck(struct chip_t *pchip); +int c_can_if1_busycheck(struct canchip_t *pchip); +int c_can_if2_busycheck(struct canchip_t *pchip); -int c_can_enable_configuration(struct chip_t *pchip); -int c_can_disable_configuration(struct chip_t *pchip); -int c_can_chip_config(struct chip_t *pchip); -int c_can_baud_rate(struct chip_t *chip, int rate, int clock, +int c_can_enable_configuration(struct canchip_t *pchip); +int c_can_disable_configuration(struct canchip_t *pchip); +int c_can_chip_config(struct canchip_t *pchip); +int c_can_baud_rate(struct canchip_t *chip, int rate, int clock, int sjw, int sampl_pt, int flags); int c_can_mask(struct msgobj_t *pmsgobj, u32 mask, u16 usedirbit); int c_can_use_mask(struct msgobj_t *pmsgobj, u16 useflag); -int c_can_clear_objects(struct chip_t *pchip); -int c_can_config_irqs(struct chip_t *pchip, +int c_can_clear_objects(struct canchip_t *pchip); +int c_can_config_irqs(struct canchip_t *pchip, u16 irqs); -int c_can_pre_read_config(struct chip_t *chip, struct msgobj_t *obj); -int c_can_send_msg(struct chip_t *pchip, struct msgobj_t *pmsgobj, +int c_can_pre_read_config(struct canchip_t *chip, struct msgobj_t *obj); +int c_can_send_msg(struct canchip_t *pchip, struct msgobj_t *pmsgobj, struct canmsg_t *pmsg); -int c_can_remote_request(struct chip_t *pchip, struct msgobj_t *pmsgobj ); -int c_can_set_btregs(struct chip_t *chip, +int c_can_remote_request(struct canchip_t *pchip, struct msgobj_t *pmsgobj ); +int c_can_set_btregs(struct canchip_t *chip, u16 btr0, u16 btr1); -int c_can_start_chip(struct chip_t *pchip); -int c_can_stop_chip(struct chip_t *pchip); -int c_can_check_tx_stat(struct chip_t *pchip); +int c_can_start_chip(struct canchip_t *pchip); +int c_can_stop_chip(struct canchip_t *pchip); +int c_can_check_tx_stat(struct canchip_t *pchip); int c_can_register(struct chipspecops_t *chipspecops); -void c_can_registerdump(struct chip_t *pchip); +void c_can_registerdump(struct canchip_t *pchip); -void c_can_irq_sync_activities(struct chip_t *chip, struct msgobj_t *obj); +void c_can_irq_sync_activities(struct canchip_t *chip, struct msgobj_t *obj); -int c_can_irq_handler(int irq, struct chip_t *chip); +int c_can_irq_handler(int irq, struct canchip_t *chip); -int c_can_fill_chipspecops(struct chip_t *chip); +int c_can_fill_chipspecops(struct canchip_t *chip); /* BasicCAN mode address map */ #define CCCR 0x0000 /* Control Register */ diff --git a/lincan/include/can_queue.h b/lincan/include/can_queue.h index 5ed1fe4..8593346 100644 --- a/lincan/include/can_queue.h +++ b/lincan/include/can_queue.h @@ -273,7 +273,7 @@ int canque_fifo_init_slots(struct canque_fifo_t *fifo); /* Forward declarations for external types */ struct msgobj_t; -struct chip_t; +struct canchip_t; /** * struct canque_edge_t - CAN message delivery subsystem graph edge @@ -382,7 +382,7 @@ struct canque_ends_t { #endif /*CAN_WITH_RTL*/ struct { struct msgobj_t *msgobj; - struct chip_t *chip; + struct canchip_t *chip; #ifndef CAN_WITH_RTL wait_queue_head_t daemonq; #else /*CAN_WITH_RTL*/ diff --git a/lincan/include/cc_can104.h b/lincan/include/cc_can104.h index 3f2b063..722746a 100644 --- a/lincan/include/cc_can104.h +++ b/lincan/include/cc_can104.h @@ -12,7 +12,7 @@ int cc104_release_io(struct candevice_t *candev); int cc104_reset(struct candevice_t *candev); int cc104_init_hw_data(struct candevice_t *candev); int cc104_init_chip_data(struct candevice_t *candev, int chipnr); -int cc104_init_obj_data(struct chip_t *chip, int objnr); +int cc104_init_obj_data(struct canchip_t *chip, int objnr); void cc104_write_register(unsigned data, unsigned long address); unsigned cc104_read_register(unsigned long address); int cc104_program_irq(struct candevice_t *candev); diff --git a/lincan/include/constants.h b/lincan/include/constants.h index aef197d..ce3d742 100644 --- a/lincan/include/constants.h +++ b/lincan/include/constants.h @@ -72,7 +72,7 @@ test_and_clear_bit(MSGOBJ_##obj_fl##_b,&(obj)->obj_flags) -/* These flags can be used for the chip_t structure flags data entry */ +/* These flags can be used for the canchip_t structure flags data entry */ #define CHIP_CONFIGURED (1<<0) #define CHIP_SEGMENTED (1<<1) #define CHIP_IRQ_SETUP (1<<2) diff --git a/lincan/include/devcommon.h b/lincan/include/devcommon.h index b4acba7..837ffb6 100644 --- a/lincan/include/devcommon.h +++ b/lincan/include/devcommon.h @@ -11,5 +11,5 @@ #include "./constants.h" #include "./can_queue.h" -int canqueue_ends_init_chip(struct canque_ends_t *qends, struct chip_t *chip, struct msgobj_t *obj); +int canqueue_ends_init_chip(struct canque_ends_t *qends, struct canchip_t *chip, struct msgobj_t *obj); int canqueue_ends_done_chip(struct canque_ends_t *qends); diff --git a/lincan/include/finish.h b/lincan/include/finish.h index 18007a0..87df046 100644 --- a/lincan/include/finish.h +++ b/lincan/include/finish.h @@ -8,6 +8,6 @@ */ void msgobj_done(struct msgobj_t *obj); -void canchip_done(struct chip_t *chip); +void canchip_done(struct canchip_t *chip); void candevice_done(struct candevice_t *candev); void canhardware_done(struct canhardware_t *candev); diff --git a/lincan/include/hms30c7202_can.h b/lincan/include/hms30c7202_can.h index c1aaf43..9b4704e 100644 --- a/lincan/include/hms30c7202_can.h +++ b/lincan/include/hms30c7202_can.h @@ -22,7 +22,7 @@ unsigned hms30c7202_read_register(unsigned long address); -int hms30c7202_init_obj_data(struct chip_t *chip, int objnr); +int hms30c7202_init_obj_data(struct canchip_t *chip, int objnr); int hms30c7202_program_irq(struct candevice_t *candev); #endif /* __HMS30C7202_CAN__ */ diff --git a/lincan/include/i82527.h b/lincan/include/i82527.h index cc1f314..1747396 100644 --- a/lincan/include/i82527.h +++ b/lincan/include/i82527.h @@ -7,32 +7,32 @@ * Version lincan-0.3 17 Jun 2004 */ -int i82527_enable_configuration(struct chip_t *chip); -int i82527_disable_configuration(struct chip_t *chip); -int i82527_chip_config(struct chip_t *chip); -int i82527_baud_rate(struct chip_t *chip, int rate, int clock, int sjw, +int i82527_enable_configuration(struct canchip_t *chip); +int i82527_disable_configuration(struct canchip_t *chip); +int i82527_chip_config(struct canchip_t *chip); +int i82527_baud_rate(struct canchip_t *chip, int rate, int clock, int sjw, int sampl_pt, int flags); -int i82527_standard_mask(struct chip_t *chip, unsigned short code, +int i82527_standard_mask(struct canchip_t *chip, unsigned short code, unsigned short mask); -int i82527_extended_mask(struct chip_t *chip, unsigned long code, +int i82527_extended_mask(struct canchip_t *chip, unsigned long code, unsigned long mask); -int i82527_message15_mask(struct chip_t *chip, unsigned long code, +int i82527_message15_mask(struct canchip_t *chip, unsigned long code, unsigned long mask); -int i82527_clear_objects(struct chip_t *chip); -int i82527_config_irqs(struct chip_t *chip, short irqs); -int i82527_pre_read_config(struct chip_t *chip, struct msgobj_t *obj); -int i82527_pre_write_config(struct chip_t *chip, struct msgobj_t *obj, +int i82527_clear_objects(struct canchip_t *chip); +int i82527_config_irqs(struct canchip_t *chip, short irqs); +int i82527_pre_read_config(struct canchip_t *chip, struct msgobj_t *obj); +int i82527_pre_write_config(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg); -int i82527_send_msg(struct chip_t *chip, struct msgobj_t *obj, +int i82527_send_msg(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg); -int i82527_remote_request(struct chip_t *chip, struct msgobj_t *obj); -int i82527_set_btregs(struct chip_t *chip, unsigned short btr0, +int i82527_remote_request(struct canchip_t *chip, struct msgobj_t *obj); +int i82527_set_btregs(struct canchip_t *chip, unsigned short btr0, unsigned short btr1); -int i82527_start_chip(struct chip_t *chip); -int i82527_stop_chip(struct chip_t *chip); -int i82527_check_tx_stat(struct chip_t *chip); -int i82527_irq_handler(int irq, struct chip_t *chip); -int i82527_fill_chipspecops(struct chip_t *chip); +int i82527_start_chip(struct canchip_t *chip); +int i82527_stop_chip(struct canchip_t *chip); +int i82527_check_tx_stat(struct canchip_t *chip); +int i82527_irq_handler(int irq, struct canchip_t *chip); +int i82527_fill_chipspecops(struct canchip_t *chip); #define MSG_OFFSET(object) ((object)*0x10) @@ -173,5 +173,5 @@ enum i82527_iMSGCFG { MCFG_DIR = 1<<3 // Direction is Transmit }; -void i82527_seg_write_reg(const struct chip_t *chip, unsigned char data, unsigned address); -unsigned i82527_seg_read_reg(const struct chip_t *chip, unsigned address); +void i82527_seg_write_reg(const struct canchip_t *chip, unsigned char data, unsigned address); +unsigned i82527_seg_read_reg(const struct canchip_t *chip, unsigned address); diff --git a/lincan/include/irq.h b/lincan/include/irq.h index 315336a..e2601d7 100644 --- a/lincan/include/irq.h +++ b/lincan/include/irq.h @@ -7,7 +7,7 @@ * Version lincan-0.3 17 Jun 2004 */ -int i82527_irq_handler(int irq, struct chip_t *chip); -int sja1000_irq_handler(int irq, struct chip_t *chip); -int sja1000p_irq_handler(int irq, struct chip_t *chip); -int dummy_irq_handler(int irq, struct chip_t *chip); +int i82527_irq_handler(int irq, struct canchip_t *chip); +int sja1000_irq_handler(int irq, struct canchip_t *chip); +int sja1000p_irq_handler(int irq, struct canchip_t *chip); +int dummy_irq_handler(int irq, struct canchip_t *chip); diff --git a/lincan/include/m437.h b/lincan/include/m437.h index ad54ccf..351e3a3 100644 --- a/lincan/include/m437.h +++ b/lincan/include/m437.h @@ -14,7 +14,7 @@ int m437_release_io(struct candevice_t *candev); int m437_reset(struct candevice_t *candev); int m437_init_hw_data(struct candevice_t *candev); int m437_init_chip_data(struct candevice_t *candev, int chipnr); -int m437_init_obj_data(struct chip_t *chip, int objnr); +int m437_init_obj_data(struct canchip_t *chip, int objnr); void m437_write_register(unsigned data, unsigned long address); unsigned m437_read_register(unsigned long address); int m437_program_irq(struct candevice_t *candev); diff --git a/lincan/include/main.h b/lincan/include/main.h index 3af24c6..0a12ffe 100644 --- a/lincan/include/main.h +++ b/lincan/include/main.h @@ -80,7 +80,7 @@ struct candevice_t { int nr_all_chips; int nr_82527_chips; int nr_sja1000_chips; - struct chip_t *chip[MAX_HW_CHIPS]; + struct canchip_t *chip[MAX_HW_CHIPS]; struct hwspecops_t *hwspecops; @@ -96,7 +96,7 @@ struct candevice_t { }; /** - * struct chip_t - CAN chip state and type information + * struct canchip_t - CAN chip state and type information * @chip_type: text string describing chip type * @chip_idx: index of the chip in candevice_t.chip[] array * @chip_irq: chip interrupt number if any @@ -149,7 +149,7 @@ struct candevice_t { * chip->hostdevice->hwspecops->read_register) * to speedup can_write_reg() and can_read_reg() functions. */ -struct chip_t { +struct canchip_t { char *chip_type; int chip_idx; /* chip index in candevice_t.chip[] */ int chip_irq; @@ -189,7 +189,7 @@ struct chip_t { * struct msgobj_t - structure holding communication object state * @obj_base_addr: * @minor: associated device minor number - * @object: object number in chip_t structure +1 + * @object: object number in canchip_t structure +1 * @flags: message object flags * @ret: field holding status of the last Tx operation * @qends: pointer to message object corresponding ends structure @@ -201,7 +201,7 @@ struct chip_t { * @tx_timeout: can be used by chip driver to check for the transmission timeout * @rx_msg: temporary storage to hold received messages before * calling to canque_filter_msg2edges() - * @hostchip: pointer to the &chip_t structure this object belongs to + * @hostchip: pointer to the &canchip_t structure this object belongs to * @obj_used: counter of users (associated file structures for Linux * userspace clients) of this object * @obj_users: list of user structures of type &canuser_t. @@ -215,7 +215,7 @@ struct chip_t { struct msgobj_t { unsigned long obj_base_addr; unsigned int minor; /* associated device minor number */ - unsigned int object; /* object number in chip_t +1 for debug printk */ + unsigned int object; /* object number in canchip_t +1 for debug printk */ unsigned long obj_flags; int ret; @@ -228,7 +228,7 @@ struct msgobj_t { struct canmsg_t rx_msg; - struct chip_t *hostchip; + struct canchip_t *hostchip; unsigned long rx_preconfig_id; @@ -278,9 +278,9 @@ struct canuser_t { * @init_hw_data: called to initialize &candevice_t structure, mainly * @res_add, @nr_all_chips, @nr_82527_chips, @nr_sja1000_chips * and @flags fields - * @init_chip_data: called initialize each &chip_t structure, mainly + * @init_chip_data: called initialize each &canchip_t structure, mainly * @chip_type, @chip_base_addr, @clock and chip specific registers. - * It is responsible to setup &chip_t->@chipspecops functions + * It is responsible to setup &canchip_t->@chipspecops functions * for non-standard chip types (type other than "i82527", "sja1000" or "sja1000p") * @init_obj_data: called initialize each &msgobj_t structure, * mainly @obj_base_addr field. @@ -295,7 +295,7 @@ struct hwspecops_t { int (*reset)(struct candevice_t *candev); int (*init_hw_data)(struct candevice_t *candev); int (*init_chip_data)(struct candevice_t *candev, int chipnr); - int (*init_obj_data)(struct chip_t *chip, int objnr); + int (*init_obj_data)(struct canchip_t *chip, int objnr); int (*program_irq)(struct candevice_t *candev); void (*write_register)(unsigned data,unsigned long address); unsigned (*read_register)(unsigned long address); @@ -325,33 +325,33 @@ struct hwspecops_t { * @irq_handler: interrupt service routine */ struct chipspecops_t { - int (*chip_config)(struct chip_t *chip); - int (*baud_rate)(struct chip_t *chip, int rate, int clock, int sjw, + int (*chip_config)(struct canchip_t *chip); + int (*baud_rate)(struct canchip_t *chip, int rate, int clock, int sjw, int sampl_pt, int flags); - int (*standard_mask)(struct chip_t *chip, unsigned short code, + int (*standard_mask)(struct canchip_t *chip, unsigned short code, unsigned short mask); - int (*extended_mask)(struct chip_t *chip, unsigned long code, + int (*extended_mask)(struct canchip_t *chip, unsigned long code, unsigned long mask); - int (*message15_mask)(struct chip_t *chip, unsigned long code, + int (*message15_mask)(struct canchip_t *chip, unsigned long code, unsigned long mask); - int (*clear_objects)(struct chip_t *chip); - int (*config_irqs)(struct chip_t *chip, short irqs); - int (*pre_read_config)(struct chip_t *chip, struct msgobj_t *obj); - int (*pre_write_config)(struct chip_t *chip, struct msgobj_t *obj, + int (*clear_objects)(struct canchip_t *chip); + int (*config_irqs)(struct canchip_t *chip, short irqs); + int (*pre_read_config)(struct canchip_t *chip, struct msgobj_t *obj); + int (*pre_write_config)(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg); - int (*send_msg)(struct chip_t *chip, struct msgobj_t *obj, + int (*send_msg)(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg); - int (*remote_request)(struct chip_t *chip, struct msgobj_t *obj); - int (*check_tx_stat)(struct chip_t *chip); - int (*wakeup_tx)(struct chip_t *chip, struct msgobj_t *obj); - int (*filtch_rq)(struct chip_t *chip, struct msgobj_t *obj); - int (*enable_configuration)(struct chip_t *chip); - int (*disable_configuration)(struct chip_t *chip); - int (*set_btregs)(struct chip_t *chip, unsigned short btr0, + int (*remote_request)(struct canchip_t *chip, struct msgobj_t *obj); + int (*check_tx_stat)(struct canchip_t *chip); + int (*wakeup_tx)(struct canchip_t *chip, struct msgobj_t *obj); + int (*filtch_rq)(struct canchip_t *chip, struct msgobj_t *obj); + int (*enable_configuration)(struct canchip_t *chip); + int (*disable_configuration)(struct canchip_t *chip); + int (*set_btregs)(struct canchip_t *chip, unsigned short btr0, unsigned short btr1); - int (*start_chip)(struct chip_t *chip); - int (*stop_chip)(struct chip_t *chip); - int (*irq_handler)(int irq, struct chip_t *chip); + int (*start_chip)(struct canchip_t *chip); + int (*stop_chip)(struct canchip_t *chip); + int (*irq_handler)(int irq, struct canchip_t *chip); }; struct mem_addr { @@ -378,47 +378,47 @@ extern unsigned long io[MAX_HW_CARDS]; extern int processlocal; extern struct canhardware_t *hardware_p; -extern struct chip_t *chips_p[MAX_TOT_CHIPS]; +extern struct canchip_t *chips_p[MAX_TOT_CHIPS]; extern struct msgobj_t *objects_p[MAX_TOT_MSGOBJS]; extern struct mem_addr *mem_head; #if defined(CONFIG_OC_LINCAN_PORTIO_ONLY) -extern inline void can_write_reg(const struct chip_t *chip, unsigned char data, unsigned address) +extern inline void can_write_reg(const struct canchip_t *chip, unsigned char data, unsigned address) { outb(data, chip->chip_base_addr+address); } -extern inline unsigned can_read_reg(const struct chip_t *chip, unsigned address) +extern inline unsigned can_read_reg(const struct canchip_t *chip, unsigned address) { return inb(chip->chip_base_addr+address); } -extern inline void canobj_write_reg(const struct chip_t *chip, const struct msgobj_t *obj, +extern inline void canobj_write_reg(const struct canchip_t *chip, const struct msgobj_t *obj, unsigned char data, unsigned address) { outb(data, obj->obj_base_addr+address); } -extern inline unsigned canobj_read_reg(const struct chip_t *chip, const struct msgobj_t *obj, +extern inline unsigned canobj_read_reg(const struct canchip_t *chip, const struct msgobj_t *obj, unsigned address) { return inb(obj->obj_base_addr+address); } #elif defined(CONFIG_OC_LINCAN_MEMIO_ONLY) -extern inline void can_write_reg(const struct chip_t *chip, unsigned char data, unsigned address) +extern inline void can_write_reg(const struct canchip_t *chip, unsigned char data, unsigned address) { writeb(data, chip->chip_base_addr+address); } -extern inline unsigned can_read_reg(const struct chip_t *chip, unsigned address) +extern inline unsigned can_read_reg(const struct canchip_t *chip, unsigned address) { return readb(chip->chip_base_addr+address); } -extern inline void canobj_write_reg(const struct chip_t *chip, const struct msgobj_t *obj, +extern inline void canobj_write_reg(const struct canchip_t *chip, const struct msgobj_t *obj, unsigned char data, unsigned address) { writeb(data, obj->obj_base_addr+address); } -extern inline unsigned canobj_read_reg(const struct chip_t *chip, const struct msgobj_t *obj, +extern inline unsigned canobj_read_reg(const struct canchip_t *chip, const struct msgobj_t *obj, unsigned address) { return readb(obj->obj_base_addr+address); @@ -432,21 +432,21 @@ extern inline unsigned canobj_read_reg(const struct chip_t *chip, const struct m /* Inline function to write to the hardware registers. The argument address is * relative to the memory map of the chip and not the absolute memory address. */ -extern inline void can_write_reg(const struct chip_t *chip, unsigned char data, unsigned address) +extern inline void can_write_reg(const struct canchip_t *chip, unsigned char data, unsigned address) { unsigned long address_to_write; address_to_write = chip->chip_base_addr+address; chip->write_register(data, address_to_write); } -extern inline unsigned can_read_reg(const struct chip_t *chip, unsigned address) +extern inline unsigned can_read_reg(const struct canchip_t *chip, unsigned address) { unsigned long address_to_read; address_to_read = chip->chip_base_addr+address; return chip->read_register(address_to_read); } -extern inline void canobj_write_reg(const struct chip_t *chip, const struct msgobj_t *obj, +extern inline void canobj_write_reg(const struct canchip_t *chip, const struct msgobj_t *obj, unsigned char data, unsigned address) { unsigned long address_to_write; @@ -454,7 +454,7 @@ extern inline void canobj_write_reg(const struct chip_t *chip, const struct msgo chip->write_register(data, address_to_write); } -extern inline unsigned canobj_read_reg(const struct chip_t *chip, const struct msgobj_t *obj, +extern inline unsigned canobj_read_reg(const struct canchip_t *chip, const struct msgobj_t *obj, unsigned address) { unsigned long address_to_read; diff --git a/lincan/include/msmcan.h b/lincan/include/msmcan.h index f2d2a00..9f5b387 100644 --- a/lincan/include/msmcan.h +++ b/lincan/include/msmcan.h @@ -12,7 +12,7 @@ int msmcan_release_io(struct candevice_t *candev); int msmcan_reset(struct candevice_t *candev); int msmcan_init_hw_data(struct candevice_t *candev); int msmcan_init_chip_data(struct candevice_t *candev, int chipnr); -int msmcan_init_obj_data(struct chip_t *chip, int objnr); +int msmcan_init_obj_data(struct canchip_t *chip, int objnr); void msmcan_write_register(unsigned data, unsigned long address); unsigned msmcan_read_register(unsigned long address); int msmcan_program_irq(struct candevice_t *candev); diff --git a/lincan/include/nsi.h b/lincan/include/nsi.h index 8ccc1b1..c48e4ef 100644 --- a/lincan/include/nsi.h +++ b/lincan/include/nsi.h @@ -12,7 +12,7 @@ int nsi_release_io(struct candevice_t *candev); int nsi_reset(struct candevice_t *candev); int nsi_init_hw_data(struct candevice_t *candev); int nsi_init_chip_data(struct candevice_t *candev, int chipnr); -int nsi_init_obj_data(struct chip_t *chip, int objnr); +int nsi_init_obj_data(struct canchip_t *chip, int objnr); void nsi_write_register(unsigned data, unsigned long address); unsigned nsi_read_register(unsigned long address); int nsi_program_irq(struct candevice_t *candev); diff --git a/lincan/include/pc-i03.h b/lincan/include/pc-i03.h index 6d7b6e7..0e8ec4f 100644 --- a/lincan/include/pc-i03.h +++ b/lincan/include/pc-i03.h @@ -12,7 +12,7 @@ int pci03_release_io(struct candevice_t *candev); int pci03_reset(struct candevice_t *candev); int pci03_init_hw_data(struct candevice_t *candev); int pci03_init_chip_data(struct candevice_t *candev, int chipnr); -int pci03_init_obj_data(struct chip_t *chip, int objnr); +int pci03_init_obj_data(struct canchip_t *chip, int objnr); void pci03_write_register(unsigned data, unsigned long address); unsigned pci03_read_register(unsigned long address); int pci03_program_irq(struct candevice_t *candev); diff --git a/lincan/include/pcan_dongle.h b/lincan/include/pcan_dongle.h index 307071a..ca5a14d 100644 --- a/lincan/include/pcan_dongle.h +++ b/lincan/include/pcan_dongle.h @@ -83,7 +83,7 @@ struct DONGLE_PORT int nMinor; // the associated minor char *type; // the literal type of the device, info only - struct chip_t *chip; + struct canchip_t *chip; }; @@ -95,7 +95,7 @@ int pcan_dongle_release_io(struct candevice_t *candev); int pcan_dongle_reset(struct candevice_t *candev); int pcan_dongle_init_hw_data(struct candevice_t *candev); int pcan_dongle_init_chip_data(struct candevice_t *candev, int chipnr); -int pcan_dongle_init_obj_data(struct chip_t *chip, int objnr); +int pcan_dongle_init_obj_data(struct canchip_t *chip, int objnr); void pcan_dongle_write_register(unsigned data, unsigned long address); unsigned pcan_dongle_read_register(unsigned long address); int pcan_dongle_program_irq(struct candevice_t *candev); diff --git a/lincan/include/pccan.h b/lincan/include/pccan.h index 62561df..918e7cd 100644 --- a/lincan/include/pccan.h +++ b/lincan/include/pccan.h @@ -18,7 +18,7 @@ int pccand_reset(struct candevice_t *candev); int pccanq_reset(struct candevice_t *candev); int pccan_init_hw_data(struct candevice_t *candev); int pccan_init_chip_data(struct candevice_t *candev, int chipnr); -int pccan_init_obj_data(struct chip_t *chip, int objnr); +int pccan_init_obj_data(struct canchip_t *chip, int objnr); void pccan_write_register(unsigned data, unsigned long address); unsigned pccan_read_register(unsigned long address); int pccan_program_irq(struct candevice_t *candev); diff --git a/lincan/include/pcccan.h b/lincan/include/pcccan.h index 4efb380..50039c1 100644 --- a/lincan/include/pcccan.h +++ b/lincan/include/pcccan.h @@ -12,7 +12,7 @@ int pcccan_release_io(struct candevice_t *candev); int pcccan_reset(struct candevice_t *candev); int pcccan_init_hw_data(struct candevice_t *candev); int pcccan_init_chip_data(struct candevice_t *candev, int chipnr); -int pcccan_init_obj_data(struct chip_t *chip, int objnr); +int pcccan_init_obj_data(struct canchip_t *chip, int objnr); void pcccan_write_register(unsigned data, unsigned long address); unsigned pcccan_read_register(unsigned long address); int pcccan_program_irq(struct candevice_t *candev); diff --git a/lincan/include/pcm3680.h b/lincan/include/pcm3680.h index 18a13e1..d97cbd2 100644 --- a/lincan/include/pcm3680.h +++ b/lincan/include/pcm3680.h @@ -12,7 +12,7 @@ int pcm3680_release_io(struct candevice_t *candev); int pcm3680_reset(struct candevice_t *candev); int pcm3680_init_hw_data(struct candevice_t *candev); int pcm3680_init_chip_data(struct candevice_t *candev, int chipnr); -int pcm3680_init_obj_data(struct chip_t *chip, int objnr); +int pcm3680_init_obj_data(struct canchip_t *chip, int objnr); void pcm3680_write_register(unsigned data, unsigned long address); unsigned pcm3680_read_register(unsigned long address); int pcm3680_program_irq(struct candevice_t *candev); diff --git a/lincan/include/pikronisa.h b/lincan/include/pikronisa.h index 4d2ae68..a6ba399 100644 --- a/lincan/include/pikronisa.h +++ b/lincan/include/pikronisa.h @@ -15,7 +15,7 @@ int pikronisa_release_io(struct candevice_t *candev); int pikronisa_reset(struct candevice_t *candev); int pikronisa_init_hw_data(struct candevice_t *candev); int pikronisa_init_chip_data(struct candevice_t *candev, int chipnr); -int pikronisa_init_obj_data(struct chip_t *chip, int objnr); +int pikronisa_init_obj_data(struct canchip_t *chip, int objnr); int pikronisa_program_irq(struct candevice_t *candev); void pikronisa_write_register(unsigned data, unsigned long address); unsigned pikronisa_read_register(unsigned long address); diff --git a/lincan/include/pip.h b/lincan/include/pip.h index cc77559..bcec26b 100644 --- a/lincan/include/pip.h +++ b/lincan/include/pip.h @@ -12,7 +12,7 @@ int pip5_release_io(struct candevice_t *candev); int pip5_reset(struct candevice_t *candev); int pip5_init_hw_data(struct candevice_t *candev); int pip5_init_chip_data(struct candevice_t *candev, int chipnr); -int pip5_init_obj_data(struct chip_t *chip, int objnr); +int pip5_init_obj_data(struct canchip_t *chip, int objnr); void pip5_write_register(unsigned data, unsigned long address); unsigned pip5_read_register(unsigned long address); int pip5_program_irq(struct candevice_t *candev); diff --git a/lincan/include/setup.h b/lincan/include/setup.h index 4229f20..d35a8b1 100644 --- a/lincan/include/setup.h +++ b/lincan/include/setup.h @@ -12,5 +12,5 @@ int list_hw(void); void *can_checked_malloc(size_t size); int can_checked_free(void *address_p); int can_del_mem_list(void); -int can_chip_setup_irq(struct chip_t *chip); -void can_chip_free_irq(struct chip_t *chip); +int can_chip_setup_irq(struct canchip_t *chip); +void can_chip_free_irq(struct canchip_t *chip); diff --git a/lincan/include/sja1000.h b/lincan/include/sja1000.h index abc5169..fa04cce 100644 --- a/lincan/include/sja1000.h +++ b/lincan/include/sja1000.h @@ -7,24 +7,24 @@ * Version lincan-0.3 17 Jun 2004 */ -int sja1000_enable_configuration(struct chip_t *chip); -int sja1000_disable_configuration(struct chip_t *chip); -int sja1000_chip_config(struct chip_t *chip); -int sja1000_standard_mask(struct chip_t *chip, unsigned short code, unsigned short mask); -int sja1000_baud_rate(struct chip_t *chip, int rate, int clock, int sjw, +int sja1000_enable_configuration(struct canchip_t *chip); +int sja1000_disable_configuration(struct canchip_t *chip); +int sja1000_chip_config(struct canchip_t *chip); +int sja1000_standard_mask(struct canchip_t *chip, unsigned short code, unsigned short mask); +int sja1000_baud_rate(struct canchip_t *chip, int rate, int clock, int sjw, int sampl_pt, int flags); -int sja1000_pre_read_config(struct chip_t *chip, struct msgobj_t *obj); -int sja1000_pre_write_config(struct chip_t *chip, struct msgobj_t *obj, +int sja1000_pre_read_config(struct canchip_t *chip, struct msgobj_t *obj); +int sja1000_pre_write_config(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg); -int sja1000_send_msg(struct chip_t *chip, struct msgobj_t *obj, +int sja1000_send_msg(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg); -int sja1000_check_tx_stat(struct chip_t *chip); -int sja1000_set_btregs(struct chip_t *chip, unsigned short btr0, +int sja1000_check_tx_stat(struct canchip_t *chip); +int sja1000_set_btregs(struct canchip_t *chip, unsigned short btr0, unsigned short btr1); -int sja1000_start_chip(struct chip_t *chip); -int sja1000_stop_chip(struct chip_t *chip); -int sja1000_irq_handler(int irq, struct chip_t *chip); -int sja1000_fill_chipspecops(struct chip_t *chip); +int sja1000_start_chip(struct canchip_t *chip); +int sja1000_stop_chip(struct canchip_t *chip); +int sja1000_irq_handler(int irq, struct canchip_t *chip); +int sja1000_fill_chipspecops(struct canchip_t *chip); /* BasicCAN mode address map */ #define SJACR 0x00 /* Control register */ diff --git a/lincan/include/sja1000p.h b/lincan/include/sja1000p.h index cd21c22..9ca166b 100644 --- a/lincan/include/sja1000p.h +++ b/lincan/include/sja1000p.h @@ -9,17 +9,17 @@ * Version lincan-0.3 17 Jun 2004 */ -int sja1000p_chip_config(struct chip_t *chip); -int sja1000p_extended_mask(struct chip_t *chip, unsigned long code, unsigned long mask); -int sja1000p_baud_rate(struct chip_t *chip, int rate, int clock, int sjw, +int sja1000p_chip_config(struct canchip_t *chip); +int sja1000p_extended_mask(struct canchip_t *chip, unsigned long code, unsigned long mask); +int sja1000p_baud_rate(struct canchip_t *chip, int rate, int clock, int sjw, int sampl_pt, int flags); -int sja1000p_pre_read_config(struct chip_t *chip, struct msgobj_t *obj); -int sja1000p_pre_write_config(struct chip_t *chip, struct msgobj_t *obj, +int sja1000p_pre_read_config(struct canchip_t *chip, struct msgobj_t *obj); +int sja1000p_pre_write_config(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg); -int sja1000p_send_msg(struct chip_t *chip, struct msgobj_t *obj, +int sja1000p_send_msg(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg); -int sja1000p_fill_chipspecops(struct chip_t *chip); -int sja1000p_irq_handler(int irq, struct chip_t *chip); +int sja1000p_fill_chipspecops(struct canchip_t *chip); +int sja1000p_irq_handler(int irq, struct canchip_t *chip); /* PeliCAN mode */ diff --git a/lincan/include/smartcan.h b/lincan/include/smartcan.h index e5916c2..58c0d42 100644 --- a/lincan/include/smartcan.h +++ b/lincan/include/smartcan.h @@ -12,7 +12,7 @@ int smartcan_release_io(struct candevice_t *candev); int smartcan_reset(struct candevice_t *candev); int smartcan_init_hw_data(struct candevice_t *candev); int smartcan_init_chip_data(struct candevice_t *candev, int chipnr); -int smartcan_init_obj_data(struct chip_t *chip, int objnr); +int smartcan_init_obj_data(struct canchip_t *chip, int objnr); void smartcan_write_register(unsigned data, unsigned long address); unsigned smartcan_read_register(unsigned long address); diff --git a/lincan/include/ssv.h b/lincan/include/ssv.h index ca074fa..6395782 100644 --- a/lincan/include/ssv.h +++ b/lincan/include/ssv.h @@ -10,7 +10,7 @@ int ssv_release_io(struct candevice_t *candev); int ssv_reset(struct candevice_t *candev); int ssv_init_hw_data(struct candevice_t *candev); int ssv_init_chip_data(struct candevice_t *candev, int chipnr); -int ssv_init_obj_data(struct chip_t *chip, int objnr); +int ssv_init_obj_data(struct canchip_t *chip, int objnr); void ssv_write_register(unsigned data, unsigned long address); unsigned ssv_read_register(unsigned long address); int ssv_program_irq(struct candevice_t *candev); diff --git a/lincan/include/template.h b/lincan/include/template.h index bccf422..88f162c 100644 --- a/lincan/include/template.h +++ b/lincan/include/template.h @@ -12,7 +12,7 @@ int template_release_io(struct candevice_t *candev); int template_reset(struct candevice_t *candev); int template_init_hw_data(struct candevice_t *candev); int template_init_chip_data(struct candevice_t *candev, int chipnr); -int template_init_obj_data(struct chip_t *chip, int objnr); +int template_init_obj_data(struct canchip_t *chip, int objnr); void template_write_register(unsigned data, unsigned long address); unsigned template_read_register(unsigned long address); int template_program_irq(struct candevice_t *candev); diff --git a/lincan/src/Makefile.std b/lincan/src/Makefile.std index 296e659..52069e2 100644 --- a/lincan/src/Makefile.std +++ b/lincan/src/Makefile.std @@ -63,8 +63,7 @@ endif SUPPORTED_CARDS = pip pccan smartcan nsi cc_can104 \ pc_i03 pcm3680 aim104 m437 pcccan ssv \ bfadcan pikronisa kv_pcican msmcan virtual template \ - unican unican_cl2 -# ems_cpcpci # compiles only for 2.6 kernels now + unican unican_cl2 ems_cpcpci # hms30c7202_can c_can c_can_irq # pcan_dongle diff --git a/lincan/src/aim104.c b/lincan/src/aim104.c index d406f76..485186b 100644 --- a/lincan/src/aim104.c +++ b/lincan/src/aim104.c @@ -187,7 +187,7 @@ int aim104_init_chip_data(struct candevice_t *candev, int chipnr) * Return Value: The function always returns zero * File: src/template.c */ -int aim104_init_obj_data(struct chip_t *chip, int objnr) +int aim104_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr=chip->chip_base_addr; chip->msgobj[objnr]->obj_flags=0; diff --git a/lincan/src/bfadcan.c b/lincan/src/bfadcan.c index d91603c..39d52e7 100644 --- a/lincan/src/bfadcan.c +++ b/lincan/src/bfadcan.c @@ -105,7 +105,7 @@ int bfadcan_reset(struct candevice_t *candev) { int i; - struct chip_t *chip=candev->chip[0]; + struct canchip_t *chip=candev->chip[0]; unsigned cdr; bfadcan_write_register(sjaMOD_RM, chip->chip_base_addr+SJAMOD); @@ -234,7 +234,7 @@ int bfadcan_init_chip_data(struct candevice_t *candev, int chipnr) * Return Value: The function always returns zero * File: src/bfadcan.c */ -int bfadcan_init_obj_data(struct chip_t *chip, int objnr) +int bfadcan_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr=chip->chip_base_addr+(objnr+1)*0x10; diff --git a/lincan/src/c_can.c b/lincan/src/c_can.c index bb1ee0b..94456bb 100644 --- a/lincan/src/c_can.c +++ b/lincan/src/c_can.c @@ -28,7 +28,7 @@ can_spinlock_t c_can_if2lock=SPIN_LOCK_UNLOCKED; // spin lcok for the if2 regist * c_can_enable_configuration - enable chip configuration mode * @pchip: pointer to chip state structure */ -int c_can_enable_configuration(struct chip_t *pchip) +int c_can_enable_configuration(struct canchip_t *pchip) { int i=0; u16 flags; @@ -60,7 +60,7 @@ int c_can_enable_configuration(struct chip_t *pchip) } /////////////////////////////////////////////////////////////////////// -int c_can_disable_configuration(struct chip_t *pchip) +int c_can_disable_configuration(struct canchip_t *pchip) { int i=0; u16 flags; @@ -90,7 +90,7 @@ int c_can_disable_configuration(struct chip_t *pchip) } /////////////////////////////////////////////////////////////////////// -int c_can_chip_config(struct chip_t *pchip) +int c_can_chip_config(struct canchip_t *pchip) { DEBUGMSG("(c%d)calling c_can_chip_config(...)\n", pchip->chip_idx); @@ -140,7 +140,7 @@ int c_can_chip_config(struct chip_t *pchip) /* * Checks if the Busy-Bit in the IF1-Command-Request Register is set */ -int c_can_if1_busycheck(struct chip_t *pchip) +int c_can_if1_busycheck(struct canchip_t *pchip) { int i=0; @@ -166,7 +166,7 @@ int c_can_if1_busycheck(struct chip_t *pchip) /* * Checks if the Busy-Bit in the IF2-Command-Request Register is set */ -int c_can_if2_busycheck(struct chip_t *pchip) +int c_can_if2_busycheck(struct canchip_t *pchip) { int i=0; @@ -201,7 +201,7 @@ int c_can_if2_busycheck(struct chip_t *pchip) * param sampl_pt sample point in % (0-100) sets (TSEG1+2)/(TSEG1+TSEG2+3) ratio * param flags fields BTR1_SAM, OCMODE, OCPOL, OCTP, OCTN, CLK_OFF, CBP */ -int c_can_baud_rate(struct chip_t *pchip, int rate, int clock, +int c_can_baud_rate(struct canchip_t *pchip, int rate, int clock, int sjw, int sampl_pt, int flags) { int best_error = 1000000000, error; @@ -406,7 +406,7 @@ int c_can_use_mask(struct msgobj_t *pmsgobj, } /////////////////////////////////////////////////////////////////////// -int c_can_clear_objects(struct chip_t *pchip) +int c_can_clear_objects(struct canchip_t *pchip) { unsigned short i = 0; unsigned short tempreg = 0; @@ -460,7 +460,7 @@ int c_can_clear_objects(struct chip_t *pchip) } /////////////////////////////////////////////////////////////////////// -int c_can_config_irqs(struct chip_t *pchip, +int c_can_config_irqs(struct canchip_t *pchip, u16 irqs) { u16 tempreg; @@ -480,7 +480,7 @@ int c_can_config_irqs(struct chip_t *pchip, } /////////////////////////////////////////////////////////////////////// -int c_can_pre_read_config(struct chip_t *pchip, struct msgobj_t *pmsgobj) +int c_can_pre_read_config(struct canchip_t *pchip, struct msgobj_t *pmsgobj) { unsigned short readMaskCM = IFXCM_CNTRL | IFXCM_ARB; unsigned short writeMaskCM = IFXCM_CNTRL | IFXCM_ARB | IFXCM_WRRD; @@ -534,7 +534,7 @@ int c_can_pre_read_config(struct chip_t *pchip, struct msgobj_t *pmsgobj) } /////////////////////////////////////////////////////////////////////// -int c_can_pre_write_config(struct chip_t *chip, struct msgobj_t *obj, +int c_can_pre_write_config(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg) { return 0; @@ -546,7 +546,7 @@ int c_can_pre_write_config(struct chip_t *chip, struct msgobj_t *obj, *In this version the method also sends the message. */ -int c_can_send_msg(struct chip_t *pchip, struct msgobj_t *pmsgobj, +int c_can_send_msg(struct canchip_t *pchip, struct msgobj_t *pmsgobj, struct canmsg_t *pmsg) { unsigned short readMaskCM = IFXCM_CNTRL | IFXCM_ARB | IFXCM_DA | IFXCM_DB; @@ -622,7 +622,7 @@ int c_can_send_msg(struct chip_t *pchip, struct msgobj_t *pmsgobj, } ////////////////////////////////////////////////////////////////////// -int c_can_remote_request(struct chip_t *pchip, struct msgobj_t *pmsgobj ) +int c_can_remote_request(struct canchip_t *pchip, struct msgobj_t *pmsgobj ) { unsigned short readMaskCM = IFXCM_CNTRL;// | IFXCM_ARB; //unsigned short writeMaskCM = IFXCM_CNTRL | IFXCM_ARB | IFXCM_WRRD; @@ -660,7 +660,7 @@ int c_can_remote_request(struct chip_t *pchip, struct msgobj_t *pmsgobj ) } /////////////////////////////////////////////////////////////////////// -int c_can_set_btregs(struct chip_t *pchip, +int c_can_set_btregs(struct canchip_t *pchip, u16 btr0, u16 btr1) { @@ -691,7 +691,7 @@ int c_can_set_btregs(struct chip_t *pchip, /* * Starts the Chip, by setting the CAN Enable Bit */ -int c_can_start_chip(struct chip_t *pchip) +int c_can_start_chip(struct canchip_t *pchip) { u16 flags = 0; @@ -722,7 +722,7 @@ int c_can_start_chip(struct chip_t *pchip) /* * Stops the Chip, by deleting the CAN Enable Bit */ -int c_can_stop_chip(struct chip_t *pchip) +int c_can_stop_chip(struct canchip_t *pchip) { u16 flags = 0; @@ -746,7 +746,7 @@ int c_can_stop_chip(struct chip_t *pchip) /* *Check the TxOK bit of the Status Register and resets it afterwards. */ -int c_can_check_tx_stat(struct chip_t *pchip) +int c_can_check_tx_stat(struct canchip_t *pchip) { unsigned long tempstat = 0; @@ -770,7 +770,7 @@ int c_can_check_tx_stat(struct chip_t *pchip) /////////////////////////////////////////////////////////////////////// -int c_can_wakeup_tx(struct chip_t *chip, struct msgobj_t *obj) +int c_can_wakeup_tx(struct canchip_t *chip, struct msgobj_t *obj) { can_preempt_disable(); @@ -785,7 +785,7 @@ int c_can_wakeup_tx(struct chip_t *chip, struct msgobj_t *obj) } /////////////////////////////////////////////////////////////////////// -int c_can_filtch_rq(struct chip_t *chip, struct msgobj_t *obj) +int c_can_filtch_rq(struct canchip_t *chip, struct msgobj_t *obj) { can_preempt_disable(); @@ -800,7 +800,7 @@ int c_can_filtch_rq(struct chip_t *chip, struct msgobj_t *obj) /////////////////////////////////////////////////////////////////////// -void c_can_registerdump(struct chip_t *pchip) +void c_can_registerdump(struct canchip_t *pchip) { CANMSG("------------------------------------\n"); CANMSG("---------C-CAN Register Dump--------\n"); @@ -912,7 +912,7 @@ int c_can_register(struct chipspecops_t *chipspecops) return 0; } -int c_can_fill_chipspecops(struct chip_t *chip) +int c_can_fill_chipspecops(struct canchip_t *chip) { chip->chip_type="c_can"; chip->max_objects = 32; diff --git a/lincan/src/c_can_irq.c b/lincan/src/c_can_irq.c index 71e84fc..eb03ac8 100644 --- a/lincan/src/c_can_irq.c +++ b/lincan/src/c_can_irq.c @@ -23,11 +23,11 @@ union c_can_data // prototypes -inline void c_can_irq_read_handler( struct chip_t *pchip, int idxobj, u32 msgid ); +inline void c_can_irq_read_handler( struct canchip_t *pchip, int idxobj, u32 msgid ); -inline void c_can_irq_write_handler( struct chip_t *pchip, int idxobj); +inline void c_can_irq_write_handler( struct canchip_t *pchip, int idxobj); -void c_can_irq_rtr_handler( struct chip_t *pchip, int idxobj, u32 msgid ); +void c_can_irq_rtr_handler( struct canchip_t *pchip, int idxobj, u32 msgid ); u16 readMaskCM = IFXCM_ARB | IFXCM_CNTRL | IFXCM_CLRINTPND | IFXCM_TRND | IFXCM_DA | IFXCM_DB; @@ -41,7 +41,7 @@ u16 msgLstWriteMaskCM = IFXCM_CNTRL | IFXCM_WRRD; // Send a message from the output fifo ( if any ). // -inline void c_can_irq_write_handler( struct chip_t *pchip, int idxobj) +inline void c_can_irq_write_handler( struct canchip_t *pchip, int idxobj) { int cmd; struct msgobj_t *pmsgobj = pchip->msgobj[idxobj]; @@ -103,7 +103,7 @@ inline void c_can_irq_write_handler( struct chip_t *pchip, int idxobj) // Message received form the line. Write it in the input fifo-> // -inline void c_can_irq_read_handler( struct chip_t *pchip, +inline void c_can_irq_read_handler( struct canchip_t *pchip, int idxobj, u32 msgid ) { int i=0; @@ -184,7 +184,7 @@ inline void c_can_irq_read_handler( struct chip_t *pchip, // while } -void c_can_irq_sync_activities(struct chip_t *chip, struct msgobj_t *obj) +void c_can_irq_sync_activities(struct canchip_t *chip, struct msgobj_t *obj) { while(!can_msgobj_test_and_set_fl(obj,TX_LOCK)) { @@ -214,7 +214,7 @@ void c_can_irq_sync_activities(struct chip_t *chip, struct msgobj_t *obj) // c_can_irq_handler // -int c_can_irq_handler(int irq, struct chip_t *chip) +int c_can_irq_handler(int irq, struct canchip_t *chip) { struct rtr_id *rtr_search = hardware_p->rtr_queue; u16 chip_status; @@ -482,7 +482,7 @@ int c_can_irq_handler(int irq, struct chip_t *chip) // c_can_irq_rtr_handler // -void c_can_irq_rtr_handler( struct chip_t *pchip, int idxobj, u32 msgid ) +void c_can_irq_rtr_handler( struct canchip_t *pchip, int idxobj, u32 msgid ) { short int i=0; struct rtr_id *prtr_search = hardware_p->rtr_queue; diff --git a/lincan/src/can_devrtl.c b/lincan/src/can_devrtl.c index 301c52c..4557531 100644 --- a/lincan/src/can_devrtl.c +++ b/lincan/src/can_devrtl.c @@ -26,7 +26,7 @@ can_spinlock_t can_irq_manipulation_lock; unsigned int can_rtl_isr( unsigned int irq_num, struct pt_regs *r ) { - struct chip_t *chip; + struct canchip_t *chip; struct candevice_t *candev; int board_nr; int chip_nr; @@ -80,7 +80,7 @@ rtl_free_global_irq( irq ) void * can_chip_worker_thread(void *arg) { - struct chip_t *chip = (struct chip_t *) arg; + struct canchip_t *chip = (struct canchip_t *) arg; struct msgobj_t *obj; int ret, i; int loop_cnt; @@ -154,7 +154,7 @@ void * can_chip_worker_thread(void *arg) } -int can_chip_setup_irq(struct chip_t *chip) +int can_chip_setup_irq(struct canchip_t *chip) { int ret; struct sched_param sched_param; @@ -195,7 +195,7 @@ int can_chip_setup_irq(struct chip_t *chip) } -void can_chip_free_irq(struct chip_t *chip) +void can_chip_free_irq(struct canchip_t *chip) { if(chip->worker_thread) pthread_delete_np(chip->worker_thread); diff --git a/lincan/src/cc_can104.c b/lincan/src/cc_can104.c index 92a6994..6d0da98 100644 --- a/lincan/src/cc_can104.c +++ b/lincan/src/cc_can104.c @@ -168,7 +168,7 @@ int cc104_init_chip_data(struct candevice_t *candev, int chipnr) * Return Value: The function always returns zero * File: src/template.c */ -int cc104_init_obj_data(struct chip_t *chip, int objnr) +int cc104_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr=chip->chip_base_addr; diff --git a/lincan/src/devcommon.c b/lincan/src/devcommon.c index 8cd6424..2af0f86 100644 --- a/lincan/src/devcommon.c +++ b/lincan/src/devcommon.c @@ -14,7 +14,7 @@ #ifdef CAN_WITH_RTL static inline -void canqueue_wake_chip_worker(struct canque_ends_t *qends, struct chip_t *chip, struct msgobj_t *obj) +void canqueue_wake_chip_worker(struct canque_ends_t *qends, struct canchip_t *chip, struct msgobj_t *obj) { if(qends->endinfo.chipinfo.worker_thread){ can_msgobj_set_fl(obj,WORKER_WAKE); @@ -46,7 +46,7 @@ void canqueue_wake_chip_worker(struct canque_ends_t *qends, struct chip_t *chip, */ void canqueue_notify_chip(struct canque_ends_t *qends, struct canque_edge_t *qedge, int what) { - struct chip_t *chip=qends->endinfo.chipinfo.chip; + struct canchip_t *chip=qends->endinfo.chipinfo.chip; struct msgobj_t *obj=qends->endinfo.chipinfo.msgobj; DEBUGMSG("canqueue_notify_chip for edge %d and event %d\n",qedge->edge_num,what); @@ -93,7 +93,7 @@ void canqueue_notify_chip(struct canque_ends_t *qends, struct canque_edge_t *qed * @chip: pointer to the corresponding CAN chip structure * @obj: pointer to the corresponding message object structure */ -int canqueue_ends_init_chip(struct canque_ends_t *qends, struct chip_t *chip, struct msgobj_t *obj) +int canqueue_ends_init_chip(struct canque_ends_t *qends, struct canchip_t *chip, struct msgobj_t *obj) { int ret; ret=canqueue_ends_init_gen(qends); diff --git a/lincan/src/ems_cpcpci.c b/lincan/src/ems_cpcpci.c index 8938909..d20e281 100644 --- a/lincan/src/ems_cpcpci.c +++ b/lincan/src/ems_cpcpci.c @@ -123,7 +123,7 @@ int ems_cpcpci_request_io(struct candevice_t *candev) * can change when resources are temporarily released */ for(i=0;inr_all_chips;i++) { - struct chip_t *chip=candev->chip[i]; + struct canchip_t *chip=candev->chip[i]; if(!chip) continue; chip->chip_base_addr = candev->io_addr+ 0x400 + i*EMS_CPCPCI_BYTES_PER_CIRCUIT; @@ -183,9 +183,9 @@ unsigned ems_cpcpci_read_register(unsigned long address) return readb(address); } -int ems_cpcpci_irq_handler(int irq, struct chip_t *chip) +int ems_cpcpci_irq_handler(int irq, struct canchip_t *chip) { - //struct chip_t *chip=(struct chip_t *)dev_id; + //struct canchip_t *chip=(struct canchip_t *)dev_id; struct candevice_t *candev=chip->hostdevice; int i; unsigned long icr; @@ -213,7 +213,7 @@ int ems_cpcpci_irq_handler(int irq, struct chip_t *chip) int ems_cpcpci_reset(struct candevice_t *candev) { int i=0,chip_nr; - struct chip_t *chip; + struct canchip_t *chip; unsigned cdr; DEBUGMSG("Resetting EMS_CPCPCI hardware ...\n"); @@ -343,7 +343,7 @@ int ems_cpcpci_init_chip_data(struct candevice_t *candev, int chipnr) return 0; } -int ems_cpcpci_init_obj_data(struct chip_t *chip, int objnr) +int ems_cpcpci_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr=chip->chip_base_addr; return 0; diff --git a/lincan/src/finish.c b/lincan/src/finish.c index 752b177..0641048 100644 --- a/lincan/src/finish.c +++ b/lincan/src/finish.c @@ -32,7 +32,7 @@ void msgobj_done(struct msgobj_t *obj) if(obj->hostchip->msgobj[obj->object-1] == obj) obj->hostchip->msgobj[obj->object-1]=NULL; else - CANMSG("msgobj_done: not registered in the chip_t\n"); + CANMSG("msgobj_done: not registered in the canchip_t\n"); obj->hostchip=NULL; } @@ -60,7 +60,7 @@ void msgobj_done(struct msgobj_t *obj) * canchip_done - destroys one CAN chip representation * @chip: pointer to CAN chip structure */ -void canchip_done(struct chip_t *chip) +void canchip_done(struct canchip_t *chip) { int i; @@ -96,7 +96,7 @@ void canchip_done(struct chip_t *chip) void candevice_done(struct candevice_t *candev) { int i; - struct chip_t *chip; + struct canchip_t *chip; for(i=0; inr_all_chips; i++){ if((chip=candev->chip[i])==NULL) diff --git a/lincan/src/hms30c7202_can.c b/lincan/src/hms30c7202_can.c index 4661c3a..df21d2d 100644 --- a/lincan/src/hms30c7202_can.c +++ b/lincan/src/hms30c7202_can.c @@ -143,7 +143,7 @@ int hms30c7202_reset( struct candevice_t *candev) { int i=0; int enableTest=0, disableTest=0; - struct chip_t *pchip = candev->chip[0]; + struct canchip_t *pchip = candev->chip[0]; enableTest = pchip->chipspecops->enable_configuration(pchip); disableTest = pchip->chipspecops->disable_configuration(pchip); @@ -190,7 +190,7 @@ int hms30c7202_reset( struct candevice_t *candev) * File: src/template.c */ int hms30c7202_init_hw_data(struct candevice_t *candev) -/*( struct chip_t *pchip, u16 chip_nr, u16 startminor, u32 baseaddr, u8 irq )*/ +/*( struct canchip_t *pchip, u16 chip_nr, u16 startminor, u32 baseaddr, u8 irq )*/ { // u32 intCntrVAddr = 0; u32 gpioVAddr = 0; @@ -327,7 +327,7 @@ int hms30c7202_init_chip_data(struct candevice_t *candev, int chipnr) * Return Value: The function always returns zero * File: src/template.c */ -int hms30c7202_init_obj_data(struct chip_t *chip, int objnr) +int hms30c7202_init_obj_data(struct canchip_t *chip, int objnr) { DEBUGMSG("(c%d)calling hms30c7202_init_obj_data( ...)\n", chip->chip_idx); diff --git a/lincan/src/i82527.c b/lincan/src/i82527.c index 3aed30b..d11a79b 100644 --- a/lincan/src/i82527.c +++ b/lincan/src/i82527.c @@ -12,7 +12,7 @@ #include "../include/main.h" #include "../include/i82527.h" -void i82527_irq_rtr_handler(struct chip_t *chip, struct msgobj_t *obj, +void i82527_irq_rtr_handler(struct canchip_t *chip, struct msgobj_t *obj, struct rtr_id *rtr_search, unsigned long message_id); @@ -23,7 +23,7 @@ extern int mo15mask; /* helper functions for segmented cards read and write configuration and status registers above 0xf offset */ -void i82527_seg_write_reg(const struct chip_t *chip, unsigned char data, unsigned address) +void i82527_seg_write_reg(const struct canchip_t *chip, unsigned char data, unsigned address) { if((address > 0xf) && (chip->flags & CHIP_SEGMENTED)) canobj_write_reg(chip, chip->msgobj[(address>>4)-1],data, address & 0xf); @@ -31,7 +31,7 @@ void i82527_seg_write_reg(const struct chip_t *chip, unsigned char data, unsigne can_write_reg(chip, data, address); } -unsigned i82527_seg_read_reg(const struct chip_t *chip, unsigned address) +unsigned i82527_seg_read_reg(const struct canchip_t *chip, unsigned address) { if((address > 0xf) && (chip->flags & CHIP_SEGMENTED)) return canobj_read_reg(chip, chip->msgobj[(address>>4)-1], address & 0xf); @@ -39,7 +39,7 @@ unsigned i82527_seg_read_reg(const struct chip_t *chip, unsigned address) return can_read_reg(chip, address); } -int i82527_enable_configuration(struct chip_t *chip) +int i82527_enable_configuration(struct canchip_t *chip) { unsigned short flags=0; @@ -49,7 +49,7 @@ int i82527_enable_configuration(struct chip_t *chip) return 0; } -int i82527_disable_configuration(struct chip_t *chip) +int i82527_disable_configuration(struct canchip_t *chip) { unsigned short flags=0; @@ -59,7 +59,7 @@ int i82527_disable_configuration(struct chip_t *chip) return 0; } -int i82527_chip_config(struct chip_t *chip) +int i82527_chip_config(struct canchip_t *chip) { can_write_reg(chip,chip->int_cpu_reg,iCPU); // Configure cpu interface can_write_reg(chip,(iCTL_CCE|iCTL_INI),iCTL); // Enable configuration @@ -121,7 +121,7 @@ int i82527_chip_config(struct chip_t *chip) * param sampl_pt sample point in % (0-100) sets (TSEG1+2)/(TSEG1+TSEG2+3) ratio * param flags fields BTR1_SAM, OCMODE, OCPOL, OCTP, OCTN, CLK_OFF, CBP */ -int i82527_baud_rate(struct chip_t *chip, int rate, int clock, int sjw, +int i82527_baud_rate(struct canchip_t *chip, int rate, int clock, int sjw, int sampl_pt, int flags) { int best_error = 1000000000, error; @@ -185,7 +185,7 @@ int i82527_baud_rate(struct chip_t *chip, int rate, int clock, int sjw, return 0; } -int i82527_standard_mask(struct chip_t *chip, unsigned short code, unsigned short mask) +int i82527_standard_mask(struct canchip_t *chip, unsigned short code, unsigned short mask) { unsigned char mask0, mask1; @@ -200,7 +200,7 @@ int i82527_standard_mask(struct chip_t *chip, unsigned short code, unsigned shor return 0; } -int i82527_extended_mask(struct chip_t *chip, unsigned long code, unsigned long mask) +int i82527_extended_mask(struct canchip_t *chip, unsigned long code, unsigned long mask) { unsigned char mask0, mask1, mask2, mask3; @@ -219,7 +219,7 @@ int i82527_extended_mask(struct chip_t *chip, unsigned long code, unsigned long return 0; } -int i82527_message15_mask(struct chip_t *chip, unsigned long code, unsigned long mask) +int i82527_message15_mask(struct canchip_t *chip, unsigned long code, unsigned long mask) { unsigned char mask0, mask1, mask2, mask3; @@ -240,7 +240,7 @@ int i82527_message15_mask(struct chip_t *chip, unsigned long code, unsigned long } -int i82527_clear_objects(struct chip_t *chip) +int i82527_clear_objects(struct canchip_t *chip) { int i=0,id=0,data=0; struct msgobj_t *obj; @@ -271,14 +271,14 @@ int i82527_clear_objects(struct chip_t *chip) return 0; } -int i82527_config_irqs(struct chip_t *chip, short irqs) +int i82527_config_irqs(struct canchip_t *chip, short irqs) { can_write_reg(chip,irqs,iCTL); DEBUGMSG("Configured hardware interrupt delivery\n"); return 0; } -int i82527_pre_read_config(struct chip_t *chip, struct msgobj_t *obj) +int i82527_pre_read_config(struct canchip_t *chip, struct msgobj_t *obj) { unsigned long id=obj->rx_preconfig_id; @@ -306,7 +306,7 @@ int i82527_pre_read_config(struct chip_t *chip, struct msgobj_t *obj) return 0; } -int i82527_pre_write_config(struct chip_t *chip, struct msgobj_t *obj, +int i82527_pre_write_config(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg) { int i=0,id0=0,id1=0,id2=0,id3=0; @@ -346,7 +346,7 @@ int i82527_pre_write_config(struct chip_t *chip, struct msgobj_t *obj, return 0; } -int i82527_send_msg(struct chip_t *chip, struct msgobj_t *obj, +int i82527_send_msg(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg) { canobj_write_reg(chip,obj,(MVAL_SET|TXIE_SET|RXIE_RES|INTPD_RES),iMSGCTL0); @@ -361,7 +361,7 @@ int i82527_send_msg(struct chip_t *chip, struct msgobj_t *obj, return 0; } -int i82527_check_tx_stat(struct chip_t *chip) +int i82527_check_tx_stat(struct canchip_t *chip) { if (can_read_reg(chip,iSTAT) & iSTAT_TXOK) { can_write_reg(chip,0x0,iSTAT); @@ -373,7 +373,7 @@ int i82527_check_tx_stat(struct chip_t *chip) } } -int i82527_remote_request(struct chip_t *chip, struct msgobj_t *obj) +int i82527_remote_request(struct canchip_t *chip, struct msgobj_t *obj) { canobj_write_reg(chip,obj,(MVAL_SET|TXIE_RES|RXIE_SET|INTPD_RES),iMSGCTL0); canobj_write_reg(chip,obj,(RMPD_RES|TXRQ_SET|MLST_RES|NEWD_RES),iMSGCTL1); @@ -381,7 +381,7 @@ int i82527_remote_request(struct chip_t *chip, struct msgobj_t *obj) return 0; } -int i82527_set_btregs(struct chip_t *chip, unsigned short btr0, +int i82527_set_btregs(struct canchip_t *chip, unsigned short btr0, unsigned short btr1) { if (i82527_enable_configuration(chip)) @@ -395,7 +395,7 @@ int i82527_set_btregs(struct chip_t *chip, unsigned short btr0, return 0; } -int i82527_start_chip(struct chip_t *chip) +int i82527_start_chip(struct canchip_t *chip) { unsigned short flags = 0; @@ -405,7 +405,7 @@ int i82527_start_chip(struct chip_t *chip) return 0; } -int i82527_stop_chip(struct chip_t *chip) +int i82527_stop_chip(struct canchip_t *chip) { unsigned short flags = 0; @@ -416,7 +416,7 @@ int i82527_stop_chip(struct chip_t *chip) } static inline -void i82527_irq_write_handler(struct chip_t *chip, struct msgobj_t *obj) +void i82527_irq_write_handler(struct canchip_t *chip, struct msgobj_t *obj) { int cmd; @@ -458,7 +458,7 @@ void i82527_irq_write_handler(struct chip_t *chip, struct msgobj_t *obj) } static inline -void i82527_irq_read_handler(struct chip_t *chip, struct msgobj_t *obj, int objnum) +void i82527_irq_read_handler(struct canchip_t *chip, struct msgobj_t *obj, int objnum) { int i; unsigned long message_id; @@ -565,7 +565,7 @@ void i82527_irq_read_handler(struct chip_t *chip, struct msgobj_t *obj, int objn static inline -void i82527_irq_update_filter(struct chip_t *chip, struct msgobj_t *obj) +void i82527_irq_update_filter(struct canchip_t *chip, struct msgobj_t *obj) { struct canfilt_t filt; @@ -587,7 +587,7 @@ void i82527_irq_update_filter(struct chip_t *chip, struct msgobj_t *obj) } -void i82527_irq_sync_activities(struct chip_t *chip, struct msgobj_t *obj) +void i82527_irq_sync_activities(struct canchip_t *chip, struct msgobj_t *obj) { while(!can_msgobj_test_and_set_fl(obj,TX_LOCK)) { @@ -611,7 +611,7 @@ void i82527_irq_sync_activities(struct chip_t *chip, struct msgobj_t *obj) } } -int i82527_irq_handler(int irq, struct chip_t *chip) +int i82527_irq_handler(int irq, struct canchip_t *chip) { unsigned char msgcfg; @@ -666,7 +666,7 @@ int i82527_irq_handler(int irq, struct chip_t *chip) return CANCHIP_IRQ_HANDLED; } -void i82527_irq_rtr_handler(struct chip_t *chip, struct msgobj_t *obj, +void i82527_irq_rtr_handler(struct canchip_t *chip, struct msgobj_t *obj, struct rtr_id *rtr_search, unsigned long message_id) { short int i=0; @@ -698,7 +698,7 @@ void i82527_irq_rtr_handler(struct chip_t *chip, struct msgobj_t *obj, * Return Value: negative value reports error. * File: src/i82527.c */ -int i82527_wakeup_tx(struct chip_t *chip, struct msgobj_t *obj) +int i82527_wakeup_tx(struct canchip_t *chip, struct msgobj_t *obj) { can_preempt_disable(); @@ -712,7 +712,7 @@ int i82527_wakeup_tx(struct chip_t *chip, struct msgobj_t *obj) return 0; } -int i82527_filtch_rq(struct chip_t *chip, struct msgobj_t *obj) +int i82527_filtch_rq(struct canchip_t *chip, struct msgobj_t *obj) { can_preempt_disable(); @@ -750,7 +750,7 @@ int i82527_register(struct chipspecops_t *chipspecops) return 0; } -int i82527_fill_chipspecops(struct chip_t *chip) +int i82527_fill_chipspecops(struct canchip_t *chip) { chip->chip_type="i82527"; chip->max_objects=15; diff --git a/lincan/src/ioctl.c b/lincan/src/ioctl.c index caa3517..6edca99 100644 --- a/lincan/src/ioctl.c +++ b/lincan/src/ioctl.c @@ -20,7 +20,7 @@ int can_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned unsigned btr0=0, btr1=0; struct canuser_t *canuser = (struct canuser_t*)(file->private_data); struct msgobj_t *obj; - struct chip_t *chip; + struct canchip_t *chip; struct canque_ends_t *qends; if(!canuser || (canuser->magic != CAN_USER_MAGIC)){ diff --git a/lincan/src/ioctl_rtl.c b/lincan/src/ioctl_rtl.c index 39b5823..88c2641 100644 --- a/lincan/src/ioctl_rtl.c +++ b/lincan/src/ioctl_rtl.c @@ -26,7 +26,7 @@ int can_ioctl_rtl_posix(struct rtl_file *fptr, unsigned int cmd, unsigned long a unsigned short channel=0; unsigned btr0=0, btr1=0; struct msgobj_t *obj; - struct chip_t *chip; + struct canchip_t *chip; struct canque_ends_t *qends; if(!canuser || (canuser->magic != CAN_USER_MAGIC)){ diff --git a/lincan/src/irq.c b/lincan/src/irq.c index 7793f01..a31e67d 100644 --- a/lincan/src/irq.c +++ b/lincan/src/irq.c @@ -13,7 +13,7 @@ #include "../include/irq.h" -int dummy_irq_handler(int irq, struct chip_t *chip) { +int dummy_irq_handler(int irq, struct canchip_t *chip) { CANMSG("dummy_irq_handler called irq %d \n", irq); return CANCHIP_IRQ_NONE; } diff --git a/lincan/src/kv_pcican.c b/lincan/src/kv_pcican.c index eb344b4..a3d2000 100644 --- a/lincan/src/kv_pcican.c +++ b/lincan/src/kv_pcican.c @@ -134,7 +134,7 @@ unsigned kv_pcican_read_register(unsigned long address) int kv_pcican_reset(struct candevice_t *candev) { int i=0,chip_nr; - struct chip_t *chip; + struct canchip_t *chip; unsigned cdr; DEBUGMSG("Resetting kv_pcican hardware ...\n"); @@ -248,7 +248,7 @@ int kv_pcican_init_chip_data(struct candevice_t *candev, int chipnr) return 0; } -int kv_pcican_init_obj_data(struct chip_t *chip, int objnr) +int kv_pcican_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr=chip->chip_base_addr; return 0; diff --git a/lincan/src/m437.c b/lincan/src/m437.c index 82c03eb..c67b3dd 100644 --- a/lincan/src/m437.c +++ b/lincan/src/m437.c @@ -225,7 +225,7 @@ int m437_init_chip_data(struct candevice_t *candev, int chipnr) * Return Value: The function always returns zero * File: src/m437.c */ -int m437_init_obj_data(struct chip_t *chip, int objnr) +int m437_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr=chip->chip_base_addr+(objnr+1)*0x10; diff --git a/lincan/src/main.c b/lincan/src/main.c index d8a0cb2..9928c15 100644 --- a/lincan/src/main.c +++ b/lincan/src/main.c @@ -128,7 +128,7 @@ MODULE_AUTHOR("Pavel Pisa , Arnaud Westenberg"); /* Global structures, used to describe the installed hardware. */ struct canhardware_t canhardware; struct canhardware_t *hardware_p=&canhardware; -struct chip_t *chips_p[MAX_TOT_CHIPS]; +struct canchip_t *chips_p[MAX_TOT_CHIPS]; struct msgobj_t *objects_p[MAX_TOT_MSGOBJS]; #ifdef CONFIG_DEVFS_FS #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,60)) @@ -177,7 +177,7 @@ int init_module(void) { int res=0,i=0, j; struct candevice_t *candev; - struct chip_t *chip; + struct canchip_t *chip; if (parse_mod_parms()) return -EINVAL; diff --git a/lincan/src/msmcan.c b/lincan/src/msmcan.c index 42513ad..230e786 100644 --- a/lincan/src/msmcan.c +++ b/lincan/src/msmcan.c @@ -56,7 +56,7 @@ int msmcan_release_io(struct candevice_t *candev) */ int msmcan_reset(struct candevice_t *candev) { - struct chip_t *chip=candev->chip[0]; + struct canchip_t *chip=candev->chip[0]; DEBUGMSG("Resetting msmcan hardware ...\n"); /* we don't use template_write_register because we don't use the two first @@ -148,7 +148,7 @@ int msmcan_init_chip_data(struct candevice_t *candev, int chipnr) * base address. * Unless the hardware uses a segmented memory map, flags can be set zero. */ -int msmcan_init_obj_data(struct chip_t *chip, int objnr) +int msmcan_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr= diff --git a/lincan/src/nsi.c b/lincan/src/nsi.c index 455a3dc..777850b 100644 --- a/lincan/src/nsi.c +++ b/lincan/src/nsi.c @@ -145,7 +145,7 @@ int nsi_init_chip_data(struct candevice_t *candev, int chipnr) * base address. * Unless the hardware uses a segmented memory map, flags can be set zero. */ -int nsi_init_obj_data(struct chip_t *chip, int objnr) +int nsi_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr= diff --git a/lincan/src/open.c b/lincan/src/open.c index 0301ed3..127fdea 100644 --- a/lincan/src/open.c +++ b/lincan/src/open.c @@ -20,7 +20,7 @@ int can_open(struct inode *inode, struct file *file) { struct msgobj_t *obj; - struct chip_t *chip; + struct canchip_t *chip; struct canuser_t *canuser; struct canque_ends_t *qends; struct canque_edge_t *edge; diff --git a/lincan/src/open_rtl.c b/lincan/src/open_rtl.c index 155cdb0..66a5bac 100644 --- a/lincan/src/open_rtl.c +++ b/lincan/src/open_rtl.c @@ -25,7 +25,7 @@ static inline int can_open_rtl_common(struct canuser_t *canuser, int open_flags) { struct msgobj_t *obj=canuser->msgobj; - struct chip_t *chip; + struct canchip_t *chip; struct canque_ends_t *qends; struct canque_edge_t *edge; can_spin_irqflags_t iflags; @@ -93,7 +93,7 @@ int can_open_rtl_posix(struct rtl_file *fptr) { int ret; struct msgobj_t *obj; - struct chip_t *chip; + struct canchip_t *chip; struct canuser_t *canuser; int minor_nr = RTL_MINOR_FROM_FILEPTR(fptr); diff --git a/lincan/src/pc_i03.c b/lincan/src/pc_i03.c index 18c9df8..c724068 100644 --- a/lincan/src/pc_i03.c +++ b/lincan/src/pc_i03.c @@ -195,7 +195,7 @@ int pci03_init_chip_data(struct candevice_t *candev, int chipnr) * Return Value: The function always returns zero * File: src/pc-i03.c */ -int pci03_init_obj_data(struct chip_t *chip, int objnr) +int pci03_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr=chip->chip_base_addr; diff --git a/lincan/src/pcan_dongle.c b/lincan/src/pcan_dongle.c index 10b6efa..5e6f927 100644 --- a/lincan/src/pcan_dongle.c +++ b/lincan/src/pcan_dongle.c @@ -527,7 +527,7 @@ int pcan_dongle_release_io(struct candevice_t *candev) int pcan_dongle_reset(struct candevice_t *candev) { int i=0; - struct chip_t *chip; + struct canchip_t *chip; int chipnr; unsigned cdr; @@ -664,7 +664,7 @@ int pcan_dongle_init_chip_data(struct candevice_t *candev, int chipnr) * Return Value: The function always returns zero * File: src/template.c */ -int pcan_dongle_init_obj_data(struct chip_t *chip, int objnr) +int pcan_dongle_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr=chip->chip_base_addr; chip->msgobj[objnr]->obj_flags=0; diff --git a/lincan/src/pccan.c b/lincan/src/pccan.c index 4b23f9b..4d877c6 100644 --- a/lincan/src/pccan.c +++ b/lincan/src/pccan.c @@ -286,7 +286,7 @@ int pccan_init_chip_data(struct candevice_t *candev, int chipnr) return 0; } -int pccan_init_obj_data(struct chip_t *chip, int objnr) +int pccan_init_obj_data(struct canchip_t *chip, int objnr) { if (!strcmp(chip->chip_type,"sja1000")) { chip->msgobj[objnr]->obj_base_addr=chip->chip_base_addr; diff --git a/lincan/src/pcccan.c b/lincan/src/pcccan.c index f83b1c5..a6b3ad0 100644 --- a/lincan/src/pcccan.c +++ b/lincan/src/pcccan.c @@ -217,7 +217,7 @@ int pcccan_init_chip_data(struct candevice_t *candev, int chipnr) * Return Value: The function always returns zero * File: src/pcccan.c */ -int pcccan_init_obj_data(struct chip_t *chip, int objnr) +int pcccan_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr=(objnr+1)*0x10; diff --git a/lincan/src/pcm3680.c b/lincan/src/pcm3680.c index 63e8556..5cefafa 100644 --- a/lincan/src/pcm3680.c +++ b/lincan/src/pcm3680.c @@ -85,7 +85,7 @@ int pcm3680_release_io(struct candevice_t *candev) int pcm3680_reset(struct candevice_t *candev) { int i=0; - struct chip_t *chip; + struct canchip_t *chip; int chipnr; DEBUGMSG("Resetting pcm3680 hardware ...\n"); @@ -201,7 +201,7 @@ int pcm3680_init_chip_data(struct candevice_t *candev, int chipnr) * Return Value: The function always returns zero * File: src/template.c */ -int pcm3680_init_obj_data(struct chip_t *chip, int objnr) +int pcm3680_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr=chip->chip_base_addr; diff --git a/lincan/src/pikronisa.c b/lincan/src/pikronisa.c index 67f383f..de7d4cb 100644 --- a/lincan/src/pikronisa.c +++ b/lincan/src/pikronisa.c @@ -88,7 +88,7 @@ int pikronisa_release_io(struct candevice_t *candev) int pikronisa_reset(struct candevice_t *candev) { int i; - struct chip_t *chip=candev->chip[0]; + struct canchip_t *chip=candev->chip[0]; unsigned cdr; pikronisa_write_register(sjaMOD_RM, chip->chip_base_addr+SJAMOD); @@ -208,7 +208,7 @@ int pikronisa_init_chip_data(struct candevice_t *candev, int chipnr) * Return Value: The function always returns zero * File: src/pikronisa.c */ -int pikronisa_init_obj_data(struct chip_t *chip, int objnr) +int pikronisa_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr=chip->chip_base_addr; return 0; diff --git a/lincan/src/pip.c b/lincan/src/pip.c index 5ca28f8..1f3418e 100644 --- a/lincan/src/pip.c +++ b/lincan/src/pip.c @@ -141,7 +141,7 @@ int pip_init_chip_data(struct candevice_t *candev, int chipnr) return 0; } -int pip_init_obj_data(struct chip_t *chip, int objnr) +int pip_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr=chip->chip_base_addr+(objnr+1)*0x10; diff --git a/lincan/src/read.c b/lincan/src/read.c index efc3641..384bf1b 100644 --- a/lincan/src/read.c +++ b/lincan/src/read.c @@ -60,7 +60,7 @@ inline ssize_t can_std_read(struct file *file, struct canque_ends_t *qends, } /* This is the 'RTR' read handler for remote transmission request messages */ -inline ssize_t can_rtr_read(struct chip_t *chip, struct msgobj_t *obj, +inline ssize_t can_rtr_read(struct canchip_t *chip, struct msgobj_t *obj, char *buffer) { can_spin_irqflags_t flags; @@ -128,7 +128,7 @@ ssize_t can_read(struct file *file, char *buffer, size_t length, loff_t *offset) { struct canuser_t *canuser = (struct canuser_t*)(file->private_data); struct msgobj_t *obj; - struct chip_t *chip; + struct canchip_t *chip; struct canmsg_t read_msg; struct canque_ends_t *qends; int ret=0; diff --git a/lincan/src/setup.c b/lincan/src/setup.c index 670bfc4..c77d03c 100644 --- a/lincan/src/setup.c +++ b/lincan/src/setup.c @@ -23,7 +23,7 @@ int init_hwspecops(struct candevice_t *candev, int *irqnum_p); int init_device_struct(int card, int *chan_param_idx_p, int *irq_param_idx_p); int init_chip_struct(struct candevice_t *candev, int chipnr, int irq, long baudrate); -int init_obj_struct(struct candevice_t *candev, struct chip_t *hostchip, int objnr); +int init_obj_struct(struct candevice_t *candev, struct canchip_t *hostchip, int objnr); /** * can_checked_malloc - memory allocation with registering of requested blocks @@ -278,7 +278,7 @@ int register_obj_struct(struct msgobj_t *obj, int minorbase) * * Return Value: returns negative number in the case of fail */ -int register_chip_struct(struct chip_t *chip, int minorbase) +int register_chip_struct(struct canchip_t *chip, int minorbase) { static int next_chip_slot=0; int i; @@ -403,7 +403,7 @@ int init_device_struct(int card, int *chan_param_idx_p, int *irq_param_idx_p) for (chipnr=0; chipnr < candev->nr_all_chips; chipnr++) { int m=minor[*chan_param_idx_p+chipnr]; - struct chip_t *chip=candev->chip[chipnr]; + struct canchip_t *chip=candev->chip[chipnr]; int objnr; register_chip_struct(chip, m); @@ -451,15 +451,15 @@ int init_device_struct(int card, int *chan_param_idx_p, int *irq_param_idx_p) */ int init_chip_struct(struct candevice_t *candev, int chipnr, int irq, long baudrate) { - struct chip_t *chip; + struct canchip_t *chip; int objnr; int ret; - candev->chip[chipnr]=(struct chip_t *)can_checked_malloc(sizeof(struct chip_t)); + candev->chip[chipnr]=(struct canchip_t *)can_checked_malloc(sizeof(struct canchip_t)); if ((chip=candev->chip[chipnr])==NULL) return -ENOMEM; - memset(chip, 0, sizeof(struct chip_t)); + memset(chip, 0, sizeof(struct canchip_t)); chip->write_register=candev->hwspecops->write_register; chip->read_register=candev->hwspecops->read_register; @@ -498,7 +498,7 @@ int init_chip_struct(struct candevice_t *candev, int chipnr, int irq, long baudr * * Return Value: returns negative number in the case of fail */ -int init_obj_struct(struct candevice_t *candev, struct chip_t *hostchip, int objnr) +int init_obj_struct(struct candevice_t *candev, struct canchip_t *hostchip, int objnr) { struct canque_ends_t *qends; struct msgobj_t *obj; @@ -571,7 +571,7 @@ int init_hwspecops(struct candevice_t *candev, int *irqnum_p) can_irqreturn_t can_default_irq_dispatch(int irq, void *dev_id, struct pt_regs *regs) { int retval; - struct chip_t *chip=(struct chip_t *)dev_id; + struct canchip_t *chip=(struct canchip_t *)dev_id; retval=chip->chipspecops->irq_handler(irq, chip); return CAN_IRQ_RETVAL(retval); @@ -583,7 +583,7 @@ can_irqreturn_t can_default_irq_dispatch(int irq, void *dev_id, struct pt_regs * * * Return Value: returns negative number in the case of fail */ -int can_chip_setup_irq(struct chip_t *chip) +int can_chip_setup_irq(struct canchip_t *chip) { if(chip==NULL) return -1; @@ -617,7 +617,7 @@ int can_chip_setup_irq(struct chip_t *chip) * can_chip_free_irq - unregisters chip interrupt handler from the system * @chip: pointer to CAN chip structure */ -void can_chip_free_irq(struct chip_t *chip) +void can_chip_free_irq(struct canchip_t *chip) { if((chip->flags & CHIP_IRQ_SETUP) && (chip->chip_irq>=0)) { if ((chip->flags & CHIP_IRQ_VME) == 0) diff --git a/lincan/src/sja1000.c b/lincan/src/sja1000.c index dfc47a2..27eebca 100644 --- a/lincan/src/sja1000.c +++ b/lincan/src/sja1000.c @@ -12,10 +12,10 @@ #include "../include/main.h" #include "../include/sja1000.h" -void sja1000_irq_read_handler(struct chip_t *chip, struct msgobj_t *obj); -void sja1000_irq_write_handler(struct chip_t *chip, struct msgobj_t *obj); +void sja1000_irq_read_handler(struct canchip_t *chip, struct msgobj_t *obj); +void sja1000_irq_write_handler(struct canchip_t *chip, struct msgobj_t *obj); -int sja1000_enable_configuration(struct chip_t *chip) +int sja1000_enable_configuration(struct canchip_t *chip) { int i=0; unsigned flags; @@ -39,7 +39,7 @@ int sja1000_enable_configuration(struct chip_t *chip) return 0; } -int sja1000_disable_configuration(struct chip_t *chip) +int sja1000_disable_configuration(struct canchip_t *chip) { int i=0; unsigned flags; @@ -62,7 +62,7 @@ int sja1000_disable_configuration(struct chip_t *chip) return 0; } -int sja1000_chip_config(struct chip_t *chip) +int sja1000_chip_config(struct canchip_t *chip) { if (sja1000_enable_configuration(chip)) return -ENODEV; @@ -88,7 +88,7 @@ int sja1000_chip_config(struct chip_t *chip) return 0; } -int sja1000_standard_mask(struct chip_t *chip, unsigned short code, unsigned short mask) +int sja1000_standard_mask(struct canchip_t *chip, unsigned short code, unsigned short mask) { unsigned char write_code, write_mask; @@ -123,7 +123,7 @@ int sja1000_standard_mask(struct chip_t *chip, unsigned short code, unsigned sho * param sampl_pt sample point in % (0-100) sets (TSEG1+2)/(TSEG1+TSEG2+3) ratio * param flags fields BTR1_SAM, OCMODE, OCPOL, OCTP, OCTN, CLK_OFF, CBP */ -int sja1000_baud_rate(struct chip_t *chip, int rate, int clock, int sjw, +int sja1000_baud_rate(struct canchip_t *chip, int rate, int clock, int sjw, int sampl_pt, int flags) { int best_error = 1000000000, error; @@ -186,7 +186,7 @@ int sja1000_baud_rate(struct chip_t *chip, int rate, int clock, int sjw, return 0; } -int sja1000_pre_read_config(struct chip_t *chip, struct msgobj_t *obj) +int sja1000_pre_read_config(struct canchip_t *chip, struct msgobj_t *obj) { int i; @@ -214,7 +214,7 @@ int sja1000_pre_read_config(struct chip_t *chip, struct msgobj_t *obj) #define MAX_TRANSMIT_WAIT_LOOPS 10 -int sja1000_pre_write_config(struct chip_t *chip, struct msgobj_t *obj, +int sja1000_pre_write_config(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg) { int i=0, id=0; @@ -255,7 +255,7 @@ int sja1000_pre_write_config(struct chip_t *chip, struct msgobj_t *obj, return 0; } -int sja1000_send_msg(struct chip_t *chip, struct msgobj_t *obj, +int sja1000_send_msg(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg) { can_write_reg(chip, sjaCMR_TR, SJACMR); @@ -263,7 +263,7 @@ int sja1000_send_msg(struct chip_t *chip, struct msgobj_t *obj, return 0; } -int sja1000_check_tx_stat(struct chip_t *chip) +int sja1000_check_tx_stat(struct canchip_t *chip) { if (can_read_reg(chip,SJASR) & sjaSR_TCS) return 0; @@ -271,7 +271,7 @@ int sja1000_check_tx_stat(struct chip_t *chip) return 1; } -int sja1000_set_btregs(struct chip_t *chip, unsigned short btr0, +int sja1000_set_btregs(struct canchip_t *chip, unsigned short btr0, unsigned short btr1) { if (sja1000_enable_configuration(chip)) @@ -285,7 +285,7 @@ int sja1000_set_btregs(struct chip_t *chip, unsigned short btr0, return 0; } -int sja1000_start_chip(struct chip_t *chip) +int sja1000_start_chip(struct canchip_t *chip) { unsigned short flags = 0; @@ -295,7 +295,7 @@ int sja1000_start_chip(struct chip_t *chip) return 0; } -int sja1000_stop_chip(struct chip_t *chip) +int sja1000_stop_chip(struct canchip_t *chip) { unsigned short flags = 0; @@ -305,33 +305,33 @@ int sja1000_stop_chip(struct chip_t *chip) return 0; } -int sja1000_remote_request(struct chip_t *chip, struct msgobj_t *obj) +int sja1000_remote_request(struct canchip_t *chip, struct msgobj_t *obj) { CANMSG("sja1000_remote_request not implemented\n"); return -ENOSYS; } -int sja1000_extended_mask(struct chip_t *chip, unsigned long code, +int sja1000_extended_mask(struct canchip_t *chip, unsigned long code, unsigned long mask) { CANMSG("sja1000_extended_mask not implemented\n"); return -ENOSYS; } -int sja1000_clear_objects(struct chip_t *chip) +int sja1000_clear_objects(struct canchip_t *chip) { CANMSG("sja1000_clear_objects not implemented\n"); return -ENOSYS; } -int sja1000_config_irqs(struct chip_t *chip, short irqs) +int sja1000_config_irqs(struct canchip_t *chip, short irqs) { CANMSG("sja1000_config_irqs not implemented\n"); return -ENOSYS; } -int sja1000_irq_handler(int irq, struct chip_t *chip) +int sja1000_irq_handler(int irq, struct canchip_t *chip) { unsigned irq_register; struct msgobj_t *obj=chip->msgobj[0]; @@ -378,7 +378,7 @@ int sja1000_irq_handler(int irq, struct chip_t *chip) return CANCHIP_IRQ_HANDLED; } -void sja1000_irq_read_handler(struct chip_t *chip, struct msgobj_t *obj) +void sja1000_irq_read_handler(struct canchip_t *chip, struct msgobj_t *obj) { int i=0, id=0, len; @@ -402,7 +402,7 @@ void sja1000_irq_read_handler(struct chip_t *chip, struct msgobj_t *obj) } while(can_read_reg(chip, SJASR) & sjaSR_RBS); } -void sja1000_irq_write_handler(struct chip_t *chip, struct msgobj_t *obj) +void sja1000_irq_write_handler(struct canchip_t *chip, struct msgobj_t *obj) { int cmd; @@ -448,7 +448,7 @@ void sja1000_irq_write_handler(struct chip_t *chip, struct msgobj_t *obj) * Return Value: negative value reports error. * File: src/sja1000.c */ -int sja1000_wakeup_tx(struct chip_t *chip, struct msgobj_t *obj) +int sja1000_wakeup_tx(struct canchip_t *chip, struct msgobj_t *obj) { can_preempt_disable(); @@ -491,7 +491,7 @@ int sja1000_register(struct chipspecops_t *chipspecops) return 0; } -int sja1000_fill_chipspecops(struct chip_t *chip) +int sja1000_fill_chipspecops(struct canchip_t *chip) { chip->chip_type="sja1000"; chip->max_objects=1; diff --git a/lincan/src/sja1000p.c b/lincan/src/sja1000p.c index 39dff69..dd9d696 100644 --- a/lincan/src/sja1000p.c +++ b/lincan/src/sja1000p.c @@ -18,7 +18,7 @@ * sja1000p_enable_configuration - enable chip configuration mode * @chip: pointer to chip state structure */ -int sja1000p_enable_configuration(struct chip_t *chip) +int sja1000p_enable_configuration(struct canchip_t *chip) { int i=0; enum sja1000_PeliCAN_MOD flags; @@ -48,7 +48,7 @@ int sja1000p_enable_configuration(struct chip_t *chip) * sja1000p_disable_configuration - disable chip configuration mode * @chip: pointer to chip state structure */ -int sja1000p_disable_configuration(struct chip_t *chip) +int sja1000p_disable_configuration(struct canchip_t *chip) { int i=0; enum sja1000_PeliCAN_MOD flags; @@ -86,7 +86,7 @@ int sja1000p_disable_configuration(struct chip_t *chip) * Return Value: negative value reports error. * File: src/sja1000p.c */ -int sja1000p_chip_config(struct chip_t *chip) +int sja1000p_chip_config(struct canchip_t *chip) { int i; unsigned char n, r; @@ -138,7 +138,7 @@ int sja1000p_chip_config(struct chip_t *chip) * Return Value: negative value reports error. * File: src/sja1000p.c */ -int sja1000p_extended_mask(struct chip_t *chip, unsigned long code, unsigned long mask) +int sja1000p_extended_mask(struct canchip_t *chip, unsigned long code, unsigned long mask) { int i; @@ -173,7 +173,7 @@ int sja1000p_extended_mask(struct chip_t *chip, unsigned long code, unsigned lo * Return Value: negative value reports error. * File: src/sja1000p.c */ -int sja1000p_baud_rate(struct chip_t *chip, int rate, int clock, int sjw, +int sja1000p_baud_rate(struct canchip_t *chip, int rate, int clock, int sjw, int sampl_pt, int flags) { int best_error = 1000000000, error; @@ -240,7 +240,7 @@ int sja1000p_baud_rate(struct chip_t *chip, int rate, int clock, int sjw, * * File: src/sja1000p.c */ -void sja1000p_read(struct chip_t *chip, struct msgobj_t *obj) { +void sja1000p_read(struct canchip_t *chip, struct msgobj_t *obj) { int i, flags, len, datastart; do { flags = can_read_reg(chip,SJAFRM); @@ -286,7 +286,7 @@ void sja1000p_read(struct chip_t *chip, struct msgobj_t *obj) { * Positive value indicates immediate reception of message. * File: src/sja1000p.c */ -int sja1000p_pre_read_config(struct chip_t *chip, struct msgobj_t *obj) +int sja1000p_pre_read_config(struct canchip_t *chip, struct msgobj_t *obj) { int status; status=can_read_reg(chip,SJASR); @@ -325,7 +325,7 @@ int sja1000p_pre_read_config(struct chip_t *chip, struct msgobj_t *obj) * Return Value: negative value reports error. * File: src/sja1000p.c */ -int sja1000p_pre_write_config(struct chip_t *chip, struct msgobj_t *obj, +int sja1000p_pre_write_config(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg) { int i=0; @@ -404,7 +404,7 @@ int sja1000p_pre_write_config(struct chip_t *chip, struct msgobj_t *obj, * Return Value: negative value reports error. * File: src/sja1000p.c */ -int sja1000p_send_msg(struct chip_t *chip, struct msgobj_t *obj, +int sja1000p_send_msg(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg) { can_write_reg(chip, sjaCMR_TR, SJACMR); @@ -421,7 +421,7 @@ int sja1000p_send_msg(struct chip_t *chip, struct msgobj_t *obj, * Zero value indicates finishing of all issued transmission requests. * File: src/sja1000p.c */ -int sja1000p_check_tx_stat(struct chip_t *chip) +int sja1000p_check_tx_stat(struct canchip_t *chip) { if (can_read_reg(chip,SJASR) & sjaSR_TCS) return 0; @@ -438,7 +438,7 @@ int sja1000p_check_tx_stat(struct chip_t *chip) * Return Value: negative value reports error. * File: src/sja1000p.c */ -int sja1000p_set_btregs(struct chip_t *chip, unsigned short btr0, +int sja1000p_set_btregs(struct canchip_t *chip, unsigned short btr0, unsigned short btr1) { if (sja1000p_enable_configuration(chip)) @@ -459,7 +459,7 @@ int sja1000p_set_btregs(struct chip_t *chip, unsigned short btr0, * Return Value: negative value reports error. * File: src/sja1000p.c */ -int sja1000p_start_chip(struct chip_t *chip) +int sja1000p_start_chip(struct canchip_t *chip) { enum sja1000_PeliCAN_MOD flags; @@ -476,7 +476,7 @@ int sja1000p_start_chip(struct chip_t *chip) * Return Value: negative value reports error. * File: src/sja1000p.c */ -int sja1000p_stop_chip(struct chip_t *chip) +int sja1000p_stop_chip(struct canchip_t *chip) { enum sja1000_PeliCAN_MOD flags; @@ -495,7 +495,7 @@ int sja1000p_stop_chip(struct chip_t *chip) * Return Value: negative value reports error. * File: src/sja1000p.c */ -int sja1000p_remote_request(struct chip_t *chip, struct msgobj_t *obj) +int sja1000p_remote_request(struct canchip_t *chip, struct msgobj_t *obj) { CANMSG("sja1000p_remote_request not implemented\n"); return -ENOSYS; @@ -510,7 +510,7 @@ int sja1000p_remote_request(struct chip_t *chip, struct msgobj_t *obj) * Return Value: negative value reports error. * File: src/sja1000p.c */ -int sja1000p_standard_mask(struct chip_t *chip, unsigned short code, +int sja1000p_standard_mask(struct canchip_t *chip, unsigned short code, unsigned short mask) { CANMSG("sja1000p_standard_mask not implemented\n"); @@ -524,7 +524,7 @@ int sja1000p_standard_mask(struct chip_t *chip, unsigned short code, * Return Value: negative value reports error. * File: src/sja1000p.c */ -int sja1000p_clear_objects(struct chip_t *chip) +int sja1000p_clear_objects(struct canchip_t *chip) { CANMSG("sja1000p_clear_objects not implemented\n"); return -ENOSYS; @@ -538,7 +538,7 @@ int sja1000p_clear_objects(struct chip_t *chip) * Return Value: negative value reports error. * File: src/sja1000p.c */ -int sja1000p_config_irqs(struct chip_t *chip, short irqs) +int sja1000p_config_irqs(struct canchip_t *chip, short irqs) { CANMSG("sja1000p_config_irqs not implemented\n"); return -ENOSYS; @@ -555,7 +555,7 @@ int sja1000p_config_irqs(struct chip_t *chip, short irqs) * sja1000p_irq_write_handler() for transmit events. * File: src/sja1000p.c */ -void sja1000p_irq_write_handler(struct chip_t *chip, struct msgobj_t *obj) +void sja1000p_irq_write_handler(struct canchip_t *chip, struct msgobj_t *obj) { int cmd; @@ -601,7 +601,7 @@ void sja1000p_irq_write_handler(struct chip_t *chip, struct msgobj_t *obj) * @irq: interrupt vector number, this value is system specific * @dev_id: driver private pointer registered at time of request_irq() call. * The CAN driver uses this pointer to store relationship of interrupt - * to chip state structure - @struct chip_t + * to chip state structure - @struct canchip_t * @regs: system dependent value pointing to registers stored in exception frame * * Interrupt handler is activated when state of CAN controller chip changes, @@ -611,7 +611,7 @@ void sja1000p_irq_write_handler(struct chip_t *chip, struct msgobj_t *obj) * message queues. * File: src/sja1000p.c */ -int sja1000p_irq_handler(int irq, struct chip_t *chip) +int sja1000p_irq_handler(int irq, struct canchip_t *chip) { int irq_register, status, error_code; struct msgobj_t *obj=chip->msgobj[0]; @@ -696,7 +696,7 @@ int sja1000p_irq_handler(int irq, struct chip_t *chip) * Return Value: negative value reports error. * File: src/sja1000p.c */ -int sja1000p_wakeup_tx(struct chip_t *chip, struct msgobj_t *obj) +int sja1000p_wakeup_tx(struct canchip_t *chip, struct msgobj_t *obj) { can_preempt_disable(); @@ -752,7 +752,7 @@ int sja1000p_register(struct chipspecops_t *chipspecops) * * Return Value: returns negative number in the case of fail */ -int sja1000p_fill_chipspecops(struct chip_t *chip) +int sja1000p_fill_chipspecops(struct canchip_t *chip) { chip->chip_type="sja1000p"; chip->max_objects=1; diff --git a/lincan/src/smartcan.c b/lincan/src/smartcan.c index f9123fe..eddd13d 100644 --- a/lincan/src/smartcan.c +++ b/lincan/src/smartcan.c @@ -92,7 +92,7 @@ int smartcan_init_chip_data(struct candevice_t *candev, int chipnr) return 0; } -int smartcan_init_obj_data(struct chip_t *chip, int objnr) +int smartcan_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr=(objnr+1)*0x10; diff --git a/lincan/src/ssv.c b/lincan/src/ssv.c index 7f147e1..3cd003d 100644 --- a/lincan/src/ssv.c +++ b/lincan/src/ssv.c @@ -159,7 +159,7 @@ int ssv_init_chip_data(struct candevice_t *candev, int chipnr) * base address. * Unless the hardware uses a segmented memory map, flags can be set zero. */ -int ssv_init_obj_data(struct chip_t *chip, int objnr) +int ssv_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr= diff --git a/lincan/src/template.c b/lincan/src/template.c index 5999366..d990332 100644 --- a/lincan/src/template.c +++ b/lincan/src/template.c @@ -181,7 +181,7 @@ int template_init_chip_data(struct candevice_t *candev, int chipnr) * Return Value: The function always returns zero * File: src/template.c */ -int template_init_obj_data(struct chip_t *chip, int objnr) +int template_init_obj_data(struct canchip_t *chip, int objnr) { chip->msgobj[objnr]->obj_base_addr=chip->chip_base_addr+(objnr+1)*0x10; diff --git a/lincan/src/unican.c b/lincan/src/unican.c index 957d5af..d93063a 100644 --- a/lincan/src/unican.c +++ b/lincan/src/unican.c @@ -43,12 +43,12 @@ long unican_bus_latency(struct msgobj_t *obj) /* * * unican Chip Functionality * * */ -int unican_enable_configuration(struct chip_t *chip) +int unican_enable_configuration(struct canchip_t *chip) { return 0; } -int unican_disable_configuration(struct chip_t *chip) +int unican_disable_configuration(struct canchip_t *chip) { return 0; } @@ -60,7 +60,7 @@ int unican_disable_configuration(struct chip_t *chip) * Return Value: negative value reports error. * File: src/unican.c */ -int unican_chip_config(struct chip_t *chip) +int unican_chip_config(struct canchip_t *chip) { int ret; sCAN_CARD *chipext = (sCAN_CARD *)chip->chip_data; @@ -125,7 +125,7 @@ int unican_chip_config(struct chip_t *chip) * Return Value: negative value reports error. * File: src/unican.c */ -int unican_extended_mask(struct chip_t *chip, unsigned long code, unsigned long mask) +int unican_extended_mask(struct canchip_t *chip, unsigned long code, unsigned long mask) { return 0; } @@ -142,7 +142,7 @@ int unican_extended_mask(struct chip_t *chip, unsigned long code, unsigned long * Return Value: negative value reports error. * File: src/unican.c */ -int unican_baud_rate(struct chip_t *chip, int rate, int clock, int sjw, +int unican_baud_rate(struct canchip_t *chip, int rate, int clock, int sjw, int sampl_pt, int flags) { int ret; @@ -184,7 +184,7 @@ int unican_baud_rate(struct chip_t *chip, int rate, int clock, int sjw, * * File: src/unican.c */ -void unican_read(struct chip_t *chip, struct msgobj_t *obj) { +void unican_read(struct canchip_t *chip, struct msgobj_t *obj) { sCAN_CARD *chipext = (sCAN_CARD *)chip->chip_data; __u16 *ptr16; __u16 u; @@ -259,7 +259,7 @@ void unican_read(struct chip_t *chip, struct msgobj_t *obj) { * Positive value indicates immediate reception of message. * File: src/unican.c */ -int unican_pre_read_config(struct chip_t *chip, struct msgobj_t *obj) +int unican_pre_read_config(struct canchip_t *chip, struct msgobj_t *obj) { return 0; } @@ -274,7 +274,7 @@ int unican_pre_read_config(struct chip_t *chip, struct msgobj_t *obj) * Return Value: negative value reports error. * File: src/unican.c */ -int unican_pre_write_config(struct chip_t *chip, struct msgobj_t *obj, +int unican_pre_write_config(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg) { return 0; @@ -291,7 +291,7 @@ int unican_pre_write_config(struct chip_t *chip, struct msgobj_t *obj, * Return Value: negative value reports error. * File: src/unican.c */ -int unican_send_msg(struct chip_t *chip, struct msgobj_t *obj, +int unican_send_msg(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg) { return 0; @@ -306,7 +306,7 @@ int unican_send_msg(struct chip_t *chip, struct msgobj_t *obj, * Zero value indicates finishing of all issued transmission requests. * File: src/unican.c */ -int unican_check_tx_stat(struct chip_t *chip) +int unican_check_tx_stat(struct canchip_t *chip) { return 0; } @@ -320,7 +320,7 @@ int unican_check_tx_stat(struct chip_t *chip) * Return Value: negative value reports error. * File: src/unican.c */ -int unican_set_btregs(struct chip_t *chip, unsigned short btr0, +int unican_set_btregs(struct canchip_t *chip, unsigned short btr0, unsigned short btr1) { int ret; @@ -342,7 +342,7 @@ int unican_set_btregs(struct chip_t *chip, unsigned short btr0, * Return Value: negative value reports error. * File: src/unican.c */ -int unican_start_chip(struct chip_t *chip) +int unican_start_chip(struct canchip_t *chip) { return 0; } @@ -354,7 +354,7 @@ int unican_start_chip(struct chip_t *chip) * Return Value: negative value reports error. * File: src/unican.c */ -int unican_stop_chip(struct chip_t *chip) +int unican_stop_chip(struct canchip_t *chip) { return 0; } @@ -368,7 +368,7 @@ int unican_stop_chip(struct chip_t *chip) * Return Value: negative value reports error. * File: src/unican.c */ -int unican_remote_request(struct chip_t *chip, struct msgobj_t *obj) +int unican_remote_request(struct canchip_t *chip, struct msgobj_t *obj) { CANMSG("unican_remote_request not implemented\n"); return -ENOSYS; @@ -383,7 +383,7 @@ int unican_remote_request(struct chip_t *chip, struct msgobj_t *obj) * Return Value: negative value reports error. * File: src/unican.c */ -int unican_standard_mask(struct chip_t *chip, unsigned short code, +int unican_standard_mask(struct canchip_t *chip, unsigned short code, unsigned short mask) { CANMSG("unican_standard_mask not implemented\n"); @@ -397,7 +397,7 @@ int unican_standard_mask(struct chip_t *chip, unsigned short code, * Return Value: negative value reports error. * File: src/unican.c */ -int unican_clear_objects(struct chip_t *chip) +int unican_clear_objects(struct canchip_t *chip) { CANMSG("unican_clear_objects not implemented\n"); return -ENOSYS; @@ -411,7 +411,7 @@ int unican_clear_objects(struct chip_t *chip) * Return Value: negative value reports error. * File: src/unican.c */ -int unican_config_irqs(struct chip_t *chip, short irqs) +int unican_config_irqs(struct canchip_t *chip, short irqs) { CANMSG("unican_config_irqs not implemented\n"); @@ -429,7 +429,7 @@ int unican_config_irqs(struct chip_t *chip, short irqs) * unican_irq_write_handler() for transmit events. * File: src/unican.c */ -void unican_irq_write_handler(struct chip_t *chip, struct msgobj_t *obj) +void unican_irq_write_handler(struct canchip_t *chip, struct msgobj_t *obj) { int cmd; sCAN_CARD *chipext = (sCAN_CARD *)chip->chip_data; @@ -531,7 +531,7 @@ void unican_irq_write_handler(struct chip_t *chip, struct msgobj_t *obj) } -void unican_irq_sync_activities(struct chip_t *chip, struct msgobj_t *obj) +void unican_irq_sync_activities(struct canchip_t *chip, struct msgobj_t *obj) { while(!can_msgobj_test_and_set_fl(obj,TX_LOCK)) { @@ -560,7 +560,7 @@ void unican_irq_sync_activities(struct chip_t *chip, struct msgobj_t *obj) * @irq: interrupt vector number, this value is system specific * @dev_id: driver private pointer registered at time of request_irq() call. * The CAN driver uses this pointer to store relationship of interrupt - * to chip state structure - @struct chip_t + * to chip state structure - @struct canchip_t * @regs: system dependent value pointing to registers stored in exception frame * * Interrupt handler is activated when state of CAN controller chip changes, @@ -570,7 +570,7 @@ void unican_irq_sync_activities(struct chip_t *chip, struct msgobj_t *obj) * message queues. * File: src/unican.c */ -int unican_irq_handler(int irq, struct chip_t *chip) +int unican_irq_handler(int irq, struct canchip_t *chip) { sCAN_CARD *chipext = (sCAN_CARD *)chip->chip_data; struct msgobj_t *obj=chip->msgobj[0]; @@ -626,7 +626,7 @@ int unican_irq_handler(int irq, struct chip_t *chip) * Return Value: negative value reports error. * File: src/unican.c */ -int unican_wakeup_tx(struct chip_t *chip, struct msgobj_t *obj) +int unican_wakeup_tx(struct canchip_t *chip, struct msgobj_t *obj) { can_preempt_disable(); @@ -697,7 +697,7 @@ int unican_reset(struct candevice_t *candev) { int ret; int i; - struct chip_t *chip = candev->chip[0]; + struct canchip_t *chip = candev->chip[0]; sCAN_CARD *chipext; @@ -768,7 +768,7 @@ int unican_init_hw_data(struct candevice_t *candev) */ int unican_init_chip_data(struct candevice_t *candev, int chipnr) { - struct chip_t *chip = candev->chip[chipnr]; + struct canchip_t *chip = candev->chip[chipnr]; chip->chip_type = "unican"; chip->chip_base_addr = 0; chip->clock = 10000000; @@ -809,7 +809,7 @@ int unican_init_chip_data(struct candevice_t *candev, int chipnr) * Return Value: The function always returns zero * File: src/unican.c */ -int unican_init_obj_data(struct chip_t *chip, int objnr) +int unican_init_obj_data(struct canchip_t *chip, int objnr) { struct msgobj_t *obj=chip->msgobj[objnr]; obj->obj_base_addr=chip->chip_base_addr; diff --git a/lincan/src/unican_vme.c b/lincan/src/unican_vme.c index 94f122b..a4f9c05 100644 --- a/lincan/src/unican_vme.c +++ b/lincan/src/unican_vme.c @@ -20,7 +20,7 @@ int unican_vme_reset(struct candevice_t *candev) { int ret; - struct chip_t *chip = candev->chip[0]; + struct canchip_t *chip = candev->chip[0]; ret = unican_reset(candev); @@ -41,7 +41,7 @@ int unican_vme_reset(struct candevice_t *candev) */ int unican_vme_init_chip_data(struct candevice_t *candev, int chipnr) { - struct chip_t *chip = candev->chip[chipnr]; + struct canchip_t *chip = candev->chip[chipnr]; unican_init_chip_data(candev, chipnr); diff --git a/lincan/src/virtual.c b/lincan/src/virtual.c index 67fc276..1281885 100644 --- a/lincan/src/virtual.c +++ b/lincan/src/virtual.c @@ -24,12 +24,12 @@ long virtual_bus_latency(struct msgobj_t *obj) /* * * Virtual Chip Functionality * * */ -int virtual_enable_configuration(struct chip_t *chip) +int virtual_enable_configuration(struct canchip_t *chip) { return 0; } -int virtual_disable_configuration(struct chip_t *chip) +int virtual_disable_configuration(struct canchip_t *chip) { return 0; } @@ -41,7 +41,7 @@ int virtual_disable_configuration(struct chip_t *chip) * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_chip_config(struct chip_t *chip) +int virtual_chip_config(struct canchip_t *chip) { return 0; } @@ -55,7 +55,7 @@ int virtual_chip_config(struct chip_t *chip) * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_extended_mask(struct chip_t *chip, unsigned long code, unsigned long mask) +int virtual_extended_mask(struct canchip_t *chip, unsigned long code, unsigned long mask) { return 0; } @@ -72,7 +72,7 @@ int virtual_extended_mask(struct chip_t *chip, unsigned long code, unsigned lon * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_baud_rate(struct chip_t *chip, int rate, int clock, int sjw, +int virtual_baud_rate(struct canchip_t *chip, int rate, int clock, int sjw, int sampl_pt, int flags) { return 0; @@ -85,7 +85,7 @@ int virtual_baud_rate(struct chip_t *chip, int rate, int clock, int sjw, * * File: src/virtual.c */ -void virtual_read(struct chip_t *chip, struct msgobj_t *obj) { +void virtual_read(struct canchip_t *chip, struct msgobj_t *obj) { } @@ -98,7 +98,7 @@ void virtual_read(struct chip_t *chip, struct msgobj_t *obj) { * Positive value indicates immediate reception of message. * File: src/virtual.c */ -int virtual_pre_read_config(struct chip_t *chip, struct msgobj_t *obj) +int virtual_pre_read_config(struct canchip_t *chip, struct msgobj_t *obj) { return 0; } @@ -113,7 +113,7 @@ int virtual_pre_read_config(struct chip_t *chip, struct msgobj_t *obj) * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_pre_write_config(struct chip_t *chip, struct msgobj_t *obj, +int virtual_pre_write_config(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg) { return 0; @@ -130,7 +130,7 @@ int virtual_pre_write_config(struct chip_t *chip, struct msgobj_t *obj, * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_send_msg(struct chip_t *chip, struct msgobj_t *obj, +int virtual_send_msg(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg) { return 0; @@ -145,7 +145,7 @@ int virtual_send_msg(struct chip_t *chip, struct msgobj_t *obj, * Zero value indicates finishing of all issued transmission requests. * File: src/virtual.c */ -int virtual_check_tx_stat(struct chip_t *chip) +int virtual_check_tx_stat(struct canchip_t *chip) { return 0; } @@ -159,7 +159,7 @@ int virtual_check_tx_stat(struct chip_t *chip) * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_set_btregs(struct chip_t *chip, unsigned short btr0, +int virtual_set_btregs(struct canchip_t *chip, unsigned short btr0, unsigned short btr1) { return 0; @@ -172,7 +172,7 @@ int virtual_set_btregs(struct chip_t *chip, unsigned short btr0, * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_start_chip(struct chip_t *chip) +int virtual_start_chip(struct canchip_t *chip) { return 0; } @@ -184,7 +184,7 @@ int virtual_start_chip(struct chip_t *chip) * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_stop_chip(struct chip_t *chip) +int virtual_stop_chip(struct canchip_t *chip) { return 0; } @@ -198,7 +198,7 @@ int virtual_stop_chip(struct chip_t *chip) * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_remote_request(struct chip_t *chip, struct msgobj_t *obj) +int virtual_remote_request(struct canchip_t *chip, struct msgobj_t *obj) { CANMSG("virtual_remote_request not implemented\n"); return -ENOSYS; @@ -213,7 +213,7 @@ int virtual_remote_request(struct chip_t *chip, struct msgobj_t *obj) * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_standard_mask(struct chip_t *chip, unsigned short code, +int virtual_standard_mask(struct canchip_t *chip, unsigned short code, unsigned short mask) { CANMSG("virtual_standard_mask not implemented\n"); @@ -227,7 +227,7 @@ int virtual_standard_mask(struct chip_t *chip, unsigned short code, * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_clear_objects(struct chip_t *chip) +int virtual_clear_objects(struct canchip_t *chip) { CANMSG("virtual_clear_objects not implemented\n"); return -ENOSYS; @@ -241,7 +241,7 @@ int virtual_clear_objects(struct chip_t *chip) * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_config_irqs(struct chip_t *chip, short irqs) +int virtual_config_irqs(struct canchip_t *chip, short irqs) { CANMSG("virtual_config_irqs not implemented\n"); return -ENOSYS; @@ -258,7 +258,7 @@ int virtual_config_irqs(struct chip_t *chip, short irqs) * virtual_irq_write_handler() for transmit events. * File: src/virtual.c */ -void virtual_irq_write_handler(struct chip_t *chip, struct msgobj_t *obj) +void virtual_irq_write_handler(struct canchip_t *chip, struct msgobj_t *obj) { } @@ -270,7 +270,7 @@ void virtual_irq_write_handler(struct chip_t *chip, struct msgobj_t *obj) * @irq: interrupt vector number, this value is system specific * @dev_id: driver private pointer registered at time of request_irq() call. * The CAN driver uses this pointer to store relationship of interrupt - * to chip state structure - @struct chip_t + * to chip state structure - @struct canchip_t * @regs: system dependent value pointing to registers stored in exception frame * * Interrupt handler is activated when state of CAN controller chip changes, @@ -280,7 +280,7 @@ void virtual_irq_write_handler(struct chip_t *chip, struct msgobj_t *obj) * message queues. * File: src/virtual.c */ -int virtual_irq_handler(int irq, struct chip_t *chip) +int virtual_irq_handler(int irq, struct canchip_t *chip) { return CANCHIP_IRQ_HANDLED; } @@ -346,7 +346,7 @@ void virtual_do_tx_timeout(unsigned long data) * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_wakeup_tx(struct chip_t *chip, struct msgobj_t *obj) +int virtual_wakeup_tx(struct canchip_t *chip, struct msgobj_t *obj) { /* can_msgobj_set_fl(obj,TX_REQUEST); */ @@ -449,7 +449,7 @@ int virtual_init_hw_data(struct candevice_t *candev) */ int virtual_init_chip_data(struct candevice_t *candev, int chipnr) { - struct chip_t *chip = candev->chip[chipnr]; + struct canchip_t *chip = candev->chip[chipnr]; chip->chip_type = CHIP_TYPE; chip->chip_base_addr = 0; chip->clock = 10000000; @@ -489,7 +489,7 @@ int virtual_init_chip_data(struct candevice_t *candev, int chipnr) * Return Value: The function always returns zero * File: src/virtual.c */ -int virtual_init_obj_data(struct chip_t *chip, int objnr) +int virtual_init_obj_data(struct canchip_t *chip, int objnr) { struct msgobj_t *obj=chip->msgobj[objnr]; obj->obj_base_addr=chip->chip_base_addr;