diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-15 19:53:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-15 19:53:15 -0500 |
commit | 3feeba1e53f54f726a39da254a5c41e02530255e (patch) | |
tree | 11be6e023579adb6727884f4cc105c3106a06fb4 /net/can/bcm.c | |
parent | 7e92214b539ea17ccaf0886d140cbba9801a4d40 (diff) | |
parent | a58c891a53aca81c78f9cbe0572a301042470e96 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (95 commits)
b44: GFP_DMA skb should not escape from driver
korina: do not use IRQF_SHARED with IRQF_DISABLED
korina: do not stop queue here
korina: fix handling tx_chain_tail
korina: do tx at the right position
korina: do schedule napi after testing for it
korina: rework korina_rx() for use with napi
korina: disable napi on close and restart
korina: reset resource buffer size to 1536
korina: fix usage of driver_data
bnx2x: First slow path interrupt race
bnx2x: MTU Filter
bnx2x: Indirection table initialization index
bnx2x: Missing brackets
bnx2x: Fixing the doorbell size
bnx2x: Endianness issues
bnx2x: VLAN tagged packets without VLAN offload
bnx2x: Protecting the link change indication
bnx2x: Flow control updated before reporting the link
bnx2x: Missing mask when calculating flow control
...
Diffstat (limited to 'net/can/bcm.c')
-rw-r--r-- | net/can/bcm.c | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/net/can/bcm.c b/net/can/bcm.c index 1649c8ab2c2f..b7c7d4651136 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c | |||
@@ -347,51 +347,54 @@ static void bcm_tx_timeout_tsklet(unsigned long data) | |||
347 | struct bcm_op *op = (struct bcm_op *)data; | 347 | struct bcm_op *op = (struct bcm_op *)data; |
348 | struct bcm_msg_head msg_head; | 348 | struct bcm_msg_head msg_head; |
349 | 349 | ||
350 | /* create notification to user */ | ||
351 | msg_head.opcode = TX_EXPIRED; | ||
352 | msg_head.flags = op->flags; | ||
353 | msg_head.count = op->count; | ||
354 | msg_head.ival1 = op->ival1; | ||
355 | msg_head.ival2 = op->ival2; | ||
356 | msg_head.can_id = op->can_id; | ||
357 | msg_head.nframes = 0; | ||
358 | |||
359 | bcm_send_to_user(op, &msg_head, NULL, 0); | ||
360 | } | ||
361 | |||
362 | /* | ||
363 | * bcm_tx_timeout_handler - performes cyclic CAN frame transmissions | ||
364 | */ | ||
365 | static enum hrtimer_restart bcm_tx_timeout_handler(struct hrtimer *hrtimer) | ||
366 | { | ||
367 | struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer); | ||
368 | enum hrtimer_restart ret = HRTIMER_NORESTART; | ||
369 | |||
370 | if (op->kt_ival1.tv64 && (op->count > 0)) { | 350 | if (op->kt_ival1.tv64 && (op->count > 0)) { |
371 | 351 | ||
372 | op->count--; | 352 | op->count--; |
373 | if (!op->count && (op->flags & TX_COUNTEVT)) | 353 | if (!op->count && (op->flags & TX_COUNTEVT)) { |
374 | tasklet_schedule(&op->tsklet); | 354 | |
355 | /* create notification to user */ | ||
356 | msg_head.opcode = TX_EXPIRED; | ||
357 | msg_head.flags = op->flags; | ||
358 | msg_head.count = op->count; | ||
359 | msg_head.ival1 = op->ival1; | ||
360 | msg_head.ival2 = op->ival2; | ||
361 | msg_head.can_id = op->can_id; | ||
362 | msg_head.nframes = 0; | ||
363 | |||
364 | bcm_send_to_user(op, &msg_head, NULL, 0); | ||
365 | } | ||
375 | } | 366 | } |
376 | 367 | ||
377 | if (op->kt_ival1.tv64 && (op->count > 0)) { | 368 | if (op->kt_ival1.tv64 && (op->count > 0)) { |
378 | 369 | ||
379 | /* send (next) frame */ | 370 | /* send (next) frame */ |
380 | bcm_can_tx(op); | 371 | bcm_can_tx(op); |
381 | hrtimer_forward(hrtimer, ktime_get(), op->kt_ival1); | 372 | hrtimer_start(&op->timer, |
382 | ret = HRTIMER_RESTART; | 373 | ktime_add(ktime_get(), op->kt_ival1), |
374 | HRTIMER_MODE_ABS); | ||
383 | 375 | ||
384 | } else { | 376 | } else { |
385 | if (op->kt_ival2.tv64) { | 377 | if (op->kt_ival2.tv64) { |
386 | 378 | ||
387 | /* send (next) frame */ | 379 | /* send (next) frame */ |
388 | bcm_can_tx(op); | 380 | bcm_can_tx(op); |
389 | hrtimer_forward(hrtimer, ktime_get(), op->kt_ival2); | 381 | hrtimer_start(&op->timer, |
390 | ret = HRTIMER_RESTART; | 382 | ktime_add(ktime_get(), op->kt_ival2), |
383 | HRTIMER_MODE_ABS); | ||
391 | } | 384 | } |
392 | } | 385 | } |
386 | } | ||
393 | 387 | ||
394 | return ret; | 388 | /* |
389 | * bcm_tx_timeout_handler - performes cyclic CAN frame transmissions | ||
390 | */ | ||
391 | static enum hrtimer_restart bcm_tx_timeout_handler(struct hrtimer *hrtimer) | ||
392 | { | ||
393 | struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer); | ||
394 | |||
395 | tasklet_schedule(&op->tsklet); | ||
396 | |||
397 | return HRTIMER_NORESTART; | ||
395 | } | 398 | } |
396 | 399 | ||
397 | /* | 400 | /* |