diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-08-01 06:23:14 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-08-02 02:59:52 -0400 |
commit | 20802224298ce9dfd99a7e26b675fc0c8ae26cac (patch) | |
tree | a00ead28ffc6b5032f1d83a22f7503fdc2c1f0ec | |
parent | 872e330e38806d835bd6c311c93ab998e2fb9058 (diff) |
firewire: core: add forgotten dummy driver methods, remove unused ones
There is an at least theoretic race condition in which .start_iso etc.
could still be called between when the dummy driver is bound to the card
and when the children devices are being shut down. Add dummy_start_iso
and friends.
On the other hand, .enable, .set_config_rom, .read_csr, write_csr do not
need to be implemented by the dummy driver, as commented.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r-- | drivers/firewire/core-card.c | 64 |
1 files changed, 38 insertions, 26 deletions
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c index 6d1cfae6aad4..417b8a4b1af1 100644 --- a/drivers/firewire/core-card.c +++ b/drivers/firewire/core-card.c | |||
@@ -538,15 +538,13 @@ EXPORT_SYMBOL(fw_card_add); | |||
538 | * as all IO to the card will be handled (and failed) by the dummy driver | 538 | * as all IO to the card will be handled (and failed) by the dummy driver |
539 | * instead of calling into the module. Only functions for iso context | 539 | * instead of calling into the module. Only functions for iso context |
540 | * shutdown still need to be provided by the card driver. | 540 | * shutdown still need to be provided by the card driver. |
541 | * | ||
542 | * .read/write_csr() should never be called anymore after the dummy driver | ||
543 | * was bound since they are only used within request handler context. | ||
544 | * .set_config_rom() is never called since the card is taken out of card_list | ||
545 | * before switching to the dummy driver. | ||
541 | */ | 546 | */ |
542 | 547 | ||
543 | static int dummy_enable(struct fw_card *card, | ||
544 | const __be32 *config_rom, size_t length) | ||
545 | { | ||
546 | BUG(); | ||
547 | return -1; | ||
548 | } | ||
549 | |||
550 | static int dummy_read_phy_reg(struct fw_card *card, int address) | 548 | static int dummy_read_phy_reg(struct fw_card *card, int address) |
551 | { | 549 | { |
552 | return -ENODEV; | 550 | return -ENODEV; |
@@ -558,17 +556,6 @@ static int dummy_update_phy_reg(struct fw_card *card, int address, | |||
558 | return -ENODEV; | 556 | return -ENODEV; |
559 | } | 557 | } |
560 | 558 | ||
561 | static int dummy_set_config_rom(struct fw_card *card, | ||
562 | const __be32 *config_rom, size_t length) | ||
563 | { | ||
564 | /* | ||
565 | * We take the card out of card_list before setting the dummy | ||
566 | * driver, so this should never get called. | ||
567 | */ | ||
568 | BUG(); | ||
569 | return -1; | ||
570 | } | ||
571 | |||
572 | static void dummy_send_request(struct fw_card *card, struct fw_packet *packet) | 559 | static void dummy_send_request(struct fw_card *card, struct fw_packet *packet) |
573 | { | 560 | { |
574 | packet->callback(packet, card, RCODE_CANCELLED); | 561 | packet->callback(packet, card, RCODE_CANCELLED); |
@@ -590,15 +577,40 @@ static int dummy_enable_phys_dma(struct fw_card *card, | |||
590 | return -ENODEV; | 577 | return -ENODEV; |
591 | } | 578 | } |
592 | 579 | ||
580 | static struct fw_iso_context *dummy_allocate_iso_context(struct fw_card *card, | ||
581 | int type, int channel, size_t header_size) | ||
582 | { | ||
583 | return ERR_PTR(-ENODEV); | ||
584 | } | ||
585 | |||
586 | static int dummy_start_iso(struct fw_iso_context *ctx, | ||
587 | s32 cycle, u32 sync, u32 tags) | ||
588 | { | ||
589 | return -ENODEV; | ||
590 | } | ||
591 | |||
592 | static int dummy_set_iso_channels(struct fw_iso_context *ctx, u64 *channels) | ||
593 | { | ||
594 | return -ENODEV; | ||
595 | } | ||
596 | |||
597 | static int dummy_queue_iso(struct fw_iso_context *ctx, struct fw_iso_packet *p, | ||
598 | struct fw_iso_buffer *buffer, unsigned long payload) | ||
599 | { | ||
600 | return -ENODEV; | ||
601 | } | ||
602 | |||
593 | static const struct fw_card_driver dummy_driver_template = { | 603 | static const struct fw_card_driver dummy_driver_template = { |
594 | .enable = dummy_enable, | 604 | .read_phy_reg = dummy_read_phy_reg, |
595 | .read_phy_reg = dummy_read_phy_reg, | 605 | .update_phy_reg = dummy_update_phy_reg, |
596 | .update_phy_reg = dummy_update_phy_reg, | 606 | .send_request = dummy_send_request, |
597 | .set_config_rom = dummy_set_config_rom, | 607 | .send_response = dummy_send_response, |
598 | .send_request = dummy_send_request, | 608 | .cancel_packet = dummy_cancel_packet, |
599 | .cancel_packet = dummy_cancel_packet, | 609 | .enable_phys_dma = dummy_enable_phys_dma, |
600 | .send_response = dummy_send_response, | 610 | .allocate_iso_context = dummy_allocate_iso_context, |
601 | .enable_phys_dma = dummy_enable_phys_dma, | 611 | .start_iso = dummy_start_iso, |
612 | .set_iso_channels = dummy_set_iso_channels, | ||
613 | .queue_iso = dummy_queue_iso, | ||
602 | }; | 614 | }; |
603 | 615 | ||
604 | void fw_card_release(struct kref *kref) | 616 | void fw_card_release(struct kref *kref) |