Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129784
b: refs/heads/master
c: c53a6ee
h: refs/heads/master
v: v3
  • Loading branch information
Oliver Hartkopp authored and David S. Miller committed Jan 15, 2009
1 parent a604fcd commit f2fd82f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d57bc36e7aba9e3a00d154f5eff80ff596146fc4
refs/heads/master: c53a6ee88b0a91bd012ef1b7988c0b93dae6f24d
57 changes: 30 additions & 27 deletions trunk/net/can/bcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,51 +347,54 @@ static void bcm_tx_timeout_tsklet(unsigned long data)
struct bcm_op *op = (struct bcm_op *)data;
struct bcm_msg_head msg_head;

/* create notification to user */
msg_head.opcode = TX_EXPIRED;
msg_head.flags = op->flags;
msg_head.count = op->count;
msg_head.ival1 = op->ival1;
msg_head.ival2 = op->ival2;
msg_head.can_id = op->can_id;
msg_head.nframes = 0;

bcm_send_to_user(op, &msg_head, NULL, 0);
}

/*
* bcm_tx_timeout_handler - performes cyclic CAN frame transmissions
*/
static enum hrtimer_restart bcm_tx_timeout_handler(struct hrtimer *hrtimer)
{
struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer);
enum hrtimer_restart ret = HRTIMER_NORESTART;

if (op->kt_ival1.tv64 && (op->count > 0)) {

op->count--;
if (!op->count && (op->flags & TX_COUNTEVT))
tasklet_schedule(&op->tsklet);
if (!op->count && (op->flags & TX_COUNTEVT)) {

/* create notification to user */
msg_head.opcode = TX_EXPIRED;
msg_head.flags = op->flags;
msg_head.count = op->count;
msg_head.ival1 = op->ival1;
msg_head.ival2 = op->ival2;
msg_head.can_id = op->can_id;
msg_head.nframes = 0;

bcm_send_to_user(op, &msg_head, NULL, 0);
}
}

if (op->kt_ival1.tv64 && (op->count > 0)) {

/* send (next) frame */
bcm_can_tx(op);
hrtimer_forward(hrtimer, ktime_get(), op->kt_ival1);
ret = HRTIMER_RESTART;
hrtimer_start(&op->timer,
ktime_add(ktime_get(), op->kt_ival1),
HRTIMER_MODE_ABS);

} else {
if (op->kt_ival2.tv64) {

/* send (next) frame */
bcm_can_tx(op);
hrtimer_forward(hrtimer, ktime_get(), op->kt_ival2);
ret = HRTIMER_RESTART;
hrtimer_start(&op->timer,
ktime_add(ktime_get(), op->kt_ival2),
HRTIMER_MODE_ABS);
}
}
}

return ret;
/*
* bcm_tx_timeout_handler - performes cyclic CAN frame transmissions
*/
static enum hrtimer_restart bcm_tx_timeout_handler(struct hrtimer *hrtimer)
{
struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer);

tasklet_schedule(&op->tsklet);

return HRTIMER_NORESTART;
}

/*
Expand Down

0 comments on commit f2fd82f

Please sign in to comment.