diff options
Diffstat (limited to 'drivers/firewire/core-card.c')
-rw-r--r-- | drivers/firewire/core-card.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c index 85661b060ed7..cc595eba7ba9 100644 --- a/drivers/firewire/core-card.c +++ b/drivers/firewire/core-card.c | |||
@@ -37,6 +37,22 @@ | |||
37 | 37 | ||
38 | #include "core.h" | 38 | #include "core.h" |
39 | 39 | ||
40 | #define define_fw_printk_level(func, kern_level) \ | ||
41 | void func(const struct fw_card *card, const char *fmt, ...) \ | ||
42 | { \ | ||
43 | struct va_format vaf; \ | ||
44 | va_list args; \ | ||
45 | \ | ||
46 | va_start(args, fmt); \ | ||
47 | vaf.fmt = fmt; \ | ||
48 | vaf.va = &args; \ | ||
49 | printk(kern_level KBUILD_MODNAME " %s: %pV", \ | ||
50 | dev_name(card->device), &vaf); \ | ||
51 | va_end(args); \ | ||
52 | } | ||
53 | define_fw_printk_level(fw_err, KERN_ERR); | ||
54 | define_fw_printk_level(fw_notice, KERN_NOTICE); | ||
55 | |||
40 | int fw_compute_block_crc(__be32 *block) | 56 | int fw_compute_block_crc(__be32 *block) |
41 | { | 57 | { |
42 | int length; | 58 | int length; |
@@ -260,7 +276,7 @@ static void allocate_broadcast_channel(struct fw_card *card, int generation) | |||
260 | fw_iso_resource_manage(card, generation, 1ULL << 31, | 276 | fw_iso_resource_manage(card, generation, 1ULL << 31, |
261 | &channel, &bandwidth, true); | 277 | &channel, &bandwidth, true); |
262 | if (channel != 31) { | 278 | if (channel != 31) { |
263 | fw_notify("failed to allocate broadcast channel\n"); | 279 | fw_notice(card, "failed to allocate broadcast channel\n"); |
264 | return; | 280 | return; |
265 | } | 281 | } |
266 | card->broadcast_channel_allocated = true; | 282 | card->broadcast_channel_allocated = true; |
@@ -343,14 +359,14 @@ static void bm_work(struct work_struct *work) | |||
343 | 359 | ||
344 | if (!card->irm_node->link_on) { | 360 | if (!card->irm_node->link_on) { |
345 | new_root_id = local_id; | 361 | new_root_id = local_id; |
346 | fw_notify("%s, making local node (%02x) root.\n", | 362 | fw_notice(card, "%s, making local node (%02x) root\n", |
347 | "IRM has link off", new_root_id); | 363 | "IRM has link off", new_root_id); |
348 | goto pick_me; | 364 | goto pick_me; |
349 | } | 365 | } |
350 | 366 | ||
351 | if (irm_is_1394_1995_only && !keep_this_irm) { | 367 | if (irm_is_1394_1995_only && !keep_this_irm) { |
352 | new_root_id = local_id; | 368 | new_root_id = local_id; |
353 | fw_notify("%s, making local node (%02x) root.\n", | 369 | fw_notice(card, "%s, making local node (%02x) root\n", |
354 | "IRM is not 1394a compliant", new_root_id); | 370 | "IRM is not 1394a compliant", new_root_id); |
355 | goto pick_me; | 371 | goto pick_me; |
356 | } | 372 | } |
@@ -405,7 +421,7 @@ static void bm_work(struct work_struct *work) | |||
405 | * root, and thus, IRM. | 421 | * root, and thus, IRM. |
406 | */ | 422 | */ |
407 | new_root_id = local_id; | 423 | new_root_id = local_id; |
408 | fw_notify("%s, making local node (%02x) root.\n", | 424 | fw_notice(card, "%s, making local node (%02x) root\n", |
409 | "BM lock failed", new_root_id); | 425 | "BM lock failed", new_root_id); |
410 | goto pick_me; | 426 | goto pick_me; |
411 | } | 427 | } |
@@ -478,8 +494,8 @@ static void bm_work(struct work_struct *work) | |||
478 | spin_unlock_irq(&card->lock); | 494 | spin_unlock_irq(&card->lock); |
479 | 495 | ||
480 | if (do_reset) { | 496 | if (do_reset) { |
481 | fw_notify("phy config: card %d, new root=%x, gap_count=%d\n", | 497 | fw_notice(card, "phy config: new root=%x, gap_count=%d\n", |
482 | card->index, new_root_id, gap_count); | 498 | new_root_id, gap_count); |
483 | fw_send_phy_config(card, new_root_id, generation, gap_count); | 499 | fw_send_phy_config(card, new_root_id, generation, gap_count); |
484 | reset_bus(card, true); | 500 | reset_bus(card, true); |
485 | /* Will allocate broadcast channel after the reset. */ | 501 | /* Will allocate broadcast channel after the reset. */ |
@@ -634,6 +650,11 @@ static void dummy_flush_queue_iso(struct fw_iso_context *ctx) | |||
634 | { | 650 | { |
635 | } | 651 | } |
636 | 652 | ||
653 | static int dummy_flush_iso_completions(struct fw_iso_context *ctx) | ||
654 | { | ||
655 | return -ENODEV; | ||
656 | } | ||
657 | |||
637 | static const struct fw_card_driver dummy_driver_template = { | 658 | static const struct fw_card_driver dummy_driver_template = { |
638 | .read_phy_reg = dummy_read_phy_reg, | 659 | .read_phy_reg = dummy_read_phy_reg, |
639 | .update_phy_reg = dummy_update_phy_reg, | 660 | .update_phy_reg = dummy_update_phy_reg, |
@@ -646,6 +667,7 @@ static const struct fw_card_driver dummy_driver_template = { | |||
646 | .set_iso_channels = dummy_set_iso_channels, | 667 | .set_iso_channels = dummy_set_iso_channels, |
647 | .queue_iso = dummy_queue_iso, | 668 | .queue_iso = dummy_queue_iso, |
648 | .flush_queue_iso = dummy_flush_queue_iso, | 669 | .flush_queue_iso = dummy_flush_queue_iso, |
670 | .flush_iso_completions = dummy_flush_iso_completions, | ||
649 | }; | 671 | }; |
650 | 672 | ||
651 | void fw_card_release(struct kref *kref) | 673 | void fw_card_release(struct kref *kref) |