X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/3d6c5be34ccd4bf1633c6b7f98e9beedfebc262f..95c031e101c74ae6472a7e538f3128f67a490082:/lincan/src/c_can.c 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;