[PATCH 2/2] firewire: add a parameter to force the speed of the devices.

From: Laurent Vivier
Date: Mon Apr 20 2015 - 20:36:49 EST


I was trying to use my old iPod mini firewire (first generation) with
a new firewire card I put in my PC (VIA Technologies, Inc. VT6306/7/8),
but the iPod was not mounted and failed with the following error:
reading config rom failed: no ack
It appears that the configuration rom cannot be read after the
device max speed is set to something else than SCODE_100.

According to the iPod configuration ROM, it should support SCODE_400.

This patch adds a a parameter (force_speed) to the firewire-core module
to be able to set the max speed to use with the firewire devices.

Signed-off-by: Laurent Vivier <laurent@xxxxxxxxx>
---
drivers/firewire/core-device.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c
index 5245567..a075827 100644
--- a/drivers/firewire/core-device.c
+++ b/drivers/firewire/core-device.c
@@ -44,6 +44,17 @@

#include "core.h"

+static int force_speed = -1;
+module_param_named(force_speed, force_speed, int, 0644);
+MODULE_PARM_DESC(force_speed, "Force device speed (default = -1"
+ ", FW100 = " __stringify(SCODE_100)
+ ", FW200 = " __stringify(SCODE_200)
+ ", FW400 = " __stringify(SCODE_400)
+ ", FW800 = " __stringify(SCODE_800)
+ ", FW1600 = " __stringify(SCODE_1600)
+ ", FW3200 = " __stringify(SCODE_3200)
+ ", FWBETA = " __stringify(SCODE_BETA));
+
void fw_csr_iterator_init(struct fw_csr_iterator *ci, const u32 *p)
{
ci->p = p + 1;
@@ -555,6 +566,8 @@ static int read_config_rom(struct fw_device *device, int generation)
}

device->max_speed = device->node->max_speed;
+ if (force_speed != -1)
+ device->max_speed = force_speed & 0xf;

/*
* Determine the speed of
--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/