aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2010-06-10 02:35:37 -0400
committerClemens Ladisch <clemens@ladisch.de>2010-06-10 02:35:37 -0400
commit3d1f46eb60b155c705e389ecdf313f11b4b91976 (patch)
tree6a28e68a7372d49f172f73a2c30e1a72dd124ffa
parenta1a1132bd83d0aea51d4f19be4b4a58a064a0131 (diff)
firewire: core: add CSR MAINT_UTILITY support
Implement the MAIN_UTILITY register, which is utterly optional but useful as a safe target for diagnostic read/write/broadcast transactions. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
-rw-r--r--drivers/firewire/core-transaction.c9
-rw-r--r--include/linux/firewire.h3
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index a61eb3fb9573..dd8ef650a7cb 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -1140,6 +1140,15 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
1140 rcode = RCODE_TYPE_ERROR; 1140 rcode = RCODE_TYPE_ERROR;
1141 break; 1141 break;
1142 1142
1143 case CSR_MAINT_UTILITY:
1144 if (tcode == TCODE_READ_QUADLET_REQUEST)
1145 *data = card->maint_utility_register;
1146 else if (tcode == TCODE_WRITE_QUADLET_REQUEST)
1147 card->maint_utility_register = *data;
1148 else
1149 rcode = RCODE_TYPE_ERROR;
1150 break;
1151
1143 case CSR_BROADCAST_CHANNEL: 1152 case CSR_BROADCAST_CHANNEL:
1144 if (tcode == TCODE_READ_QUADLET_REQUEST) 1153 if (tcode == TCODE_READ_QUADLET_REQUEST)
1145 *data = cpu_to_be32(card->broadcast_channel); 1154 *data = cpu_to_be32(card->broadcast_channel);
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index a50377d91254..f1160e831dad 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -38,6 +38,7 @@
38#define CSR_CHANNELS_AVAILABLE 0x224 38#define CSR_CHANNELS_AVAILABLE 0x224
39#define CSR_CHANNELS_AVAILABLE_HI 0x224 39#define CSR_CHANNELS_AVAILABLE_HI 0x224
40#define CSR_CHANNELS_AVAILABLE_LO 0x228 40#define CSR_CHANNELS_AVAILABLE_LO 0x228
41#define CSR_MAINT_UTILITY 0x230
41#define CSR_BROADCAST_CHANNEL 0x234 42#define CSR_BROADCAST_CHANNEL 0x234
42#define CSR_CONFIG_ROM 0x400 43#define CSR_CONFIG_ROM 0x400
43#define CSR_CONFIG_ROM_END 0x800 44#define CSR_CONFIG_ROM_END 0x800
@@ -122,6 +123,8 @@ struct fw_card {
122 bool broadcast_channel_allocated; 123 bool broadcast_channel_allocated;
123 u32 broadcast_channel; 124 u32 broadcast_channel;
124 __be32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; 125 __be32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4];
126
127 __be32 maint_utility_register;
125}; 128};
126 129
127struct fw_attribute_group { 130struct fw_attribute_group {