* Return Value: negative value reports error.
* File: src/virtual.c
*/
-int virtual_pre_write_config(struct canchip_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;
* Return Value: negative value reports error.
* File: src/virtual.c
*/
-int virtual_send_msg(struct canchip_t *chip, struct msgobj_t *obj,
+int virtual_send_msg(struct canchip_t *chip, struct msgobj_t *obj,
struct canmsg_t *msg)
{
return 0;
* Return Value: negative value reports error.
* File: src/virtual.c
*/
-int virtual_set_btregs(struct canchip_t *chip, unsigned short btr0,
+int virtual_set_btregs(struct canchip_t *chip, unsigned short btr0,
unsigned short btr1)
{
return 0;
* The CAN driver uses this pointer to store relationship of interrupt
* 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,
* there is message to be read or there is more space for new messages or
* error occurs. The receive events results in reading of the message from
can_preempt_disable();
can_msgobj_set_fl(obj,TX_REQUEST);
-
+
while(!can_msgobj_test_and_set_fl(obj,TX_LOCK)){
can_msgobj_clear_fl(obj,TX_REQUEST);
-
+
cmd=canque_test_outslot(obj->qends, &obj->tx_qedge, &obj->tx_slot);
if(cmd>=0) {
mod_timer(&obj->tx_timeout,
jiffies+virtual_bus_latency(obj));
DEBUGMSG("virtual: scheduled delivery\n");
- } else
+ } else
can_msgobj_clear_fl(obj,TX_LOCK);
-
+
if(!can_msgobj_test_fl(obj,TX_REQUEST)) break;
DEBUGMSG("TX looping in virtual_schedule_next\n");
}
void virtual_do_tx_timeout(unsigned long data)
{
struct msgobj_t *obj=(struct msgobj_t *)data;
-
+
if(obj->tx_slot) {
/* fill CAN message timestamp */
can_filltimestamp(&obj->tx_slot->msg.timestamp);
int virtual_wakeup_tx(struct canchip_t *chip, struct msgobj_t *obj)
{
/* can_msgobj_set_fl(obj,TX_REQUEST); */
-
+
struct canque_edge_t *qedge;
struct canque_slot_t *slot;
int cmd;
if(cmd==0) {
/* fill CAN message timestamp */
can_filltimestamp(&slot->msg.timestamp);
-
+
canque_filter_msg2edges(obj->qends, &slot->msg);
DEBUGMSG("virtual: direct delivery\n");
}
* Return Value: The function always returns zero
* File: src/virtual.c
*/
-int virtual_init_hw_data(struct candevice_t *candev)
+int virtual_init_hw_data(struct candevice_t *candev)
{
candev->res_addr=0;
candev->nr_82527_chips=0;