]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/c_can.c
Added prefix sja to all sjaXX_YY register bit-fields definitions.
[lincan.git] / lincan / src / c_can.c
index 6bef001f84c0d502508cc885ab355ac8ed685a11..6c6b0eb9131492734bbd27d237f22d14c28bb4be 100644 (file)
@@ -32,7 +32,7 @@ int c_can_enable_configuration(struct chip_t *pchip)
 {
    int i=0;
    u16 flags;
-   DEBUGMSG("(c%d)calling c_can_enable_configuration(...)\n", pchip->chip_nr);
+   DEBUGMSG("(c%d)calling c_can_enable_configuration(...)\n", pchip->chip_idx);
 /*
    DEBUGMSG("Trying disable_irq(...) : ");
    //disable IRQ
@@ -65,7 +65,7 @@ int c_can_disable_configuration(struct chip_t *pchip)
    int i=0;
    u16 flags;
 
-   DEBUGMSG("(c%d)calling c_can_disable_configuration(...)\n", pchip->chip_nr);
+   DEBUGMSG("(c%d)calling c_can_disable_configuration(...)\n", pchip->chip_idx);
    //read Control Register
    flags=c_can_read_reg_w(pchip, CCCR);
 
@@ -93,7 +93,7 @@ int c_can_disable_configuration(struct chip_t *pchip)
 int c_can_chip_config(struct chip_t *pchip)
 {
 
-   DEBUGMSG("(c%d)calling c_can_chip_config(...)\n", pchip->chip_nr);
+   DEBUGMSG("(c%d)calling c_can_chip_config(...)\n", pchip->chip_idx);
    // Validate pointer
    if ( NULL == pchip ) return -1;
 
@@ -210,7 +210,7 @@ int c_can_baud_rate(struct chip_t *pchip, int rate, int clock,
 
    unsigned short tempCR = 0;
 
-   DEBUGMSG("(c%d)calling c_can_baud_rate(...)\n", pchip->chip_nr);
+   DEBUGMSG("(c%d)calling c_can_baud_rate(...)\n", pchip->chip_idx);
 
    if (c_can_enable_configuration(pchip))
      return -ENODEV;
@@ -282,7 +282,7 @@ int c_can_mask(struct msgobj_t *pmsgobj,
    unsigned short readMaskCM;
    unsigned short writeMaskCM;
 
-   DEBUGMSG("(c%dm%d)calling c_can_mask(...)\n", pmsgobj->hostchip->chip_nr, pmsgobj->object);
+   DEBUGMSG("(c%dm%d)calling c_can_mask(...)\n", pmsgobj->hostchip->chip_idx, pmsgobj->object);
 
    readMaskCM = IFXCM_CNTRL | IFXCM_ARB | IFXCM_MASK;
    writeMaskCM = IFXCM_CNTRL | IFXCM_ARB | IFXCM_MASK | IFXCM_WRRD;
@@ -355,7 +355,7 @@ int c_can_use_mask(struct msgobj_t *pmsgobj,
    char *boolstring = "false";
    if (useflag) boolstring = "true";
 #endif
-   DEBUGMSG("(c%dm%d)calling c_can_use_mask(...)\n", pmsgobj->hostchip->chip_nr, pmsgobj->object);
+   DEBUGMSG("(c%dm%d)calling c_can_use_mask(...)\n", pmsgobj->hostchip->chip_idx, pmsgobj->object);
 
    readMaskCM = IFXCM_CNTRL | IFXCM_ARB;
    writeMaskCM = IFXCM_CNTRL | IFXCM_ARB | IFXCM_WRRD;;
@@ -413,7 +413,7 @@ int c_can_clear_objects(struct chip_t *pchip)
 
    unsigned short maskCM = IFXCM_ARB;
 
-   DEBUGMSG("(c%d)calling c_can_clear_objects(...)\n", pchip->chip_nr);
+   DEBUGMSG("(c%d)calling c_can_clear_objects(...)\n", pchip->chip_idx);
 
    spin_lock( &c_can_if1lock );
    spin_lock( &c_can_if2lock );
@@ -465,7 +465,7 @@ int c_can_config_irqs(struct chip_t *pchip,
 {
    u16 tempreg;
 
-   DEBUGMSG("(c%d)calling c_can_config_irqs(...)\n", pchip->chip_nr);
+   DEBUGMSG("(c%d)calling c_can_config_irqs(...)\n", pchip->chip_idx);
 
    /*
     CANMSG("c_can_config_irqs not implemented\n");
@@ -487,7 +487,7 @@ int c_can_pre_read_config(struct chip_t *pchip, struct msgobj_t *pmsgobj)
    unsigned short mcreg = 0;
    u32 id=pmsgobj->rx_preconfig_id;
 
-   DEBUGMSG("(c%dm%d)calling c_can_pre_read_config(...)\n", pmsgobj->hostchip->chip_nr, pmsgobj->object);
+   DEBUGMSG("(c%dm%d)calling c_can_pre_read_config(...)\n", pmsgobj->hostchip->chip_idx, pmsgobj->object);
 
    spin_lock( &c_can_if1lock );
 
@@ -559,7 +559,7 @@ int c_can_send_msg(struct chip_t *pchip, struct msgobj_t *pmsgobj,
    unsigned short dataB1 = 0;
    unsigned short dataB2 = 0;
 
-   DEBUGMSG("(c%dm%d)calling c_can_send_msg(...)\n", pmsgobj->hostchip->chip_nr, pmsgobj->object);
+   DEBUGMSG("(c%dm%d)calling c_can_send_msg(...)\n", pmsgobj->hostchip->chip_idx, pmsgobj->object);
 
    spin_lock( &c_can_if2lock );
 
@@ -628,7 +628,7 @@ int c_can_remote_request(struct chip_t *pchip, struct msgobj_t *pmsgobj )
    //unsigned short writeMaskCM = IFXCM_CNTRL | IFXCM_ARB | IFXCM_WRRD;
    unsigned short mcreg = 0;
 
-   DEBUGMSG("(c%dm%d)calling c_can_remote_request(...)\n", pmsgobj->hostchip->chip_nr, pmsgobj->object);
+   DEBUGMSG("(c%dm%d)calling c_can_remote_request(...)\n", pmsgobj->hostchip->chip_idx, pmsgobj->object);
 
    //Remote request is only available when the message object is in receiving mode
    if (!can_msgobj_test_fl(pmsgobj,RX_MODE))
@@ -666,7 +666,7 @@ int c_can_set_btregs(struct chip_t *pchip,
 {
    unsigned short tempCR = 0;
 
-   DEBUGMSG("(c%d)calling c_can_set_btregs(...)\n", pchip->chip_nr);
+   DEBUGMSG("(c%d)calling c_can_set_btregs(...)\n", pchip->chip_idx);
 
    // Validate pointer
    if ( NULL == pchip ) return -1;
@@ -695,7 +695,7 @@ int c_can_start_chip(struct chip_t *pchip)
 {
    u16 flags = 0;
 
-   DEBUGMSG("(c%d)calling c_can_start_chip(...)\n", pchip->chip_nr);
+   DEBUGMSG("(c%d)calling c_can_start_chip(...)\n", pchip->chip_idx);
 
    // Validate pointer
    if ( NULL == pchip )
@@ -726,7 +726,7 @@ int c_can_stop_chip(struct chip_t *pchip)
 {
    u16 flags = 0;
 
-   DEBUGMSG("(c%d)calling c_can_stop_chip(...)\n", pchip->chip_nr);
+   DEBUGMSG("(c%d)calling c_can_stop_chip(...)\n", pchip->chip_idx);
 
    // Validate pointer
    if ( NULL == pchip )
@@ -750,7 +750,7 @@ int c_can_check_tx_stat(struct chip_t *pchip)
 {
    unsigned long tempstat = 0;
 
-   DEBUGMSG("(c%d)calling c_can_check_tx_stat(...)\n", pchip->chip_nr);
+   DEBUGMSG("(c%d)calling c_can_check_tx_stat(...)\n", pchip->chip_idx);
 
    // Validate pointer
    if ( NULL == pchip ) return -1;
@@ -914,7 +914,7 @@ int c_can_register(struct chipspecops_t *chipspecops)
 
 /*int c_can_register(struct chip_t *pchip)
 {
-   DEBUGMSG("(c%d)call c_can_register\n", pchip->chip_nr);
+   DEBUGMSG("(c%d)call c_can_register\n", pchip->chip_idx);
 
    // Validate pointer
    if ( NULL == pchip ) return -1;