#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;
return 0;
}
-int sja1000_disable_configuration(struct chip_t *chip)
+int sja1000_disable_configuration(struct canchip_t *chip)
{
int i=0;
unsigned flags;
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;
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;
* 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;
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;
#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;
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);
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;
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))
return 0;
}
-int sja1000_start_chip(struct chip_t *chip)
+int sja1000_start_chip(struct canchip_t *chip)
{
unsigned short flags = 0;
return 0;
}
-int sja1000_stop_chip(struct chip_t *chip)
+int sja1000_stop_chip(struct canchip_t *chip)
{
unsigned short flags = 0;
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;
}
-can_irqreturn_t sja1000_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
+int sja1000_irq_handler(int irq, struct canchip_t *chip)
{
unsigned irq_register;
- struct chip_t *chip=(struct chip_t *)dev_id;
struct msgobj_t *obj=chip->msgobj[0];
irq_register=can_read_reg(chip, SJAIR);
// can_read_reg(chip, SJASR));
if ((irq_register & (sjaIR_WUI|sjaIR_DOI|sjaIR_EI|sjaIR_TI|sjaIR_RI)) == 0)
- return CAN_IRQ_NONE;
+ return CANCHIP_IRQ_NONE;
if ((irq_register & sjaIR_RI) != 0)
sja1000_irq_read_handler(chip, obj);
}
}
- return CAN_IRQ_HANDLED;
+ 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;
} 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;
* 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();
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;