aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/firewire/fw-card.c14
-rw-r--r--drivers/firewire/fw-transaction.h6
2 files changed, 16 insertions, 4 deletions
diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index d929eb6fef6a..34863b60e23f 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -395,9 +395,9 @@ fw_card_add(struct fw_card *card,
395 card->link_speed = link_speed; 395 card->link_speed = link_speed;
396 card->guid = guid; 396 card->guid = guid;
397 397
398 /* FIXME: add #define's for phy registers. */
399 /* Activate link_on bit and contender bit in our self ID packets.*/ 398 /* Activate link_on bit and contender bit in our self ID packets.*/
400 if (card->driver->update_phy_reg(card, 4, 0, 0x80 | 0x40) < 0) 399 if (card->driver->update_phy_reg(card, 4, 0,
400 PHY_LINK_ACTIVE | PHY_CONTENDER) < 0)
401 return -EIO; 401 return -EIO;
402 402
403 /* The subsystem grabs a reference when the card is added and 403 /* The subsystem grabs a reference when the card is added and
@@ -483,7 +483,8 @@ static struct fw_card_driver dummy_driver = {
483void 483void
484fw_core_remove_card(struct fw_card *card) 484fw_core_remove_card(struct fw_card *card)
485{ 485{
486 card->driver->update_phy_reg(card, 4, 0x80 | 0x40, 0); 486 card->driver->update_phy_reg(card, 4,
487 PHY_LINK_ACTIVE | PHY_CONTENDER, 0);
487 fw_core_initiate_bus_reset(card, 1); 488 fw_core_initiate_bus_reset(card, 1);
488 489
489 down_write(&fw_bus_type.subsys.rwsem); 490 down_write(&fw_bus_type.subsys.rwsem);
@@ -531,6 +532,11 @@ EXPORT_SYMBOL(fw_card_put);
531int 532int
532fw_core_initiate_bus_reset(struct fw_card *card, int short_reset) 533fw_core_initiate_bus_reset(struct fw_card *card, int short_reset)
533{ 534{
534 return card->driver->update_phy_reg(card, short_reset ? 5 : 1, 0, 0x40); 535 int reg = short_reset ? 5 : 1;
536 /* The following values happen to be the same bit. However be
537 * explicit for clarity. */
538 int bit = short_reset ? PHY_BUS_SHORT_RESET : PHY_BUS_RESET;
539
540 return card->driver->update_phy_reg(card, reg, 0, bit);
535} 541}
536EXPORT_SYMBOL(fw_core_initiate_bus_reset); 542EXPORT_SYMBOL(fw_core_initiate_bus_reset);
diff --git a/drivers/firewire/fw-transaction.h b/drivers/firewire/fw-transaction.h
index 662149723e98..63527340152b 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ -107,6 +107,12 @@
107#define PHY_PACKET_LINK_ON 0x1 107#define PHY_PACKET_LINK_ON 0x1
108#define PHY_PACKET_SELF_ID 0x2 108#define PHY_PACKET_SELF_ID 0x2
109 109
110/* Bit fields _within_ the PHY registers. */
111#define PHY_LINK_ACTIVE 0x80
112#define PHY_CONTENDER 0x40
113#define PHY_BUS_RESET 0x40
114#define PHY_BUS_SHORT_RESET 0x40
115
110#define CSR_REGISTER_BASE 0xfffff0000000ULL 116#define CSR_REGISTER_BASE 0xfffff0000000ULL
111 117
112/* register offsets relative to CSR_REGISTER_BASE */ 118/* register offsets relative to CSR_REGISTER_BASE */