aboutsummaryrefslogtreecommitdiff
path: root/Documentation/networking/cxacru-cf.py
diff options
context:
space:
mode:
authorSimon Arlott <simon@fire.lp0.eu>2009-11-21 15:15:47 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 14:53:01 -0800
commit817db5b34e70650c488f22b072b7efb950812adb (patch)
tree058facd7c16a943cdcafa26d600e057cdb244213 /Documentation/networking/cxacru-cf.py
parent4ac37208e9b30b36b615ed22a79b4ee787fdc9b5 (diff)
USB: cxacru: remove cxacru-cf.bin loader
This has never worked properly because wsize passed to cxacru_cm() is incorrectly set to the number of values instead of the data bytes. The maximum number of values that can be set at once is 7 which means the device will not get enough data to work with and none of the configuration values will be used. At least one existing cxacru-cf.bin file contains invalid data which will prevent the modem from syncing properly. Fixing it is likely to break existing systems, and the new sysfs interface for setting configuration parameters can provide the same functionality. A script is provided to convert from the original format. Signed-off-by: Simon Arlott <simon@fire.lp0.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'Documentation/networking/cxacru-cf.py')
-rw-r--r--Documentation/networking/cxacru-cf.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/Documentation/networking/cxacru-cf.py b/Documentation/networking/cxacru-cf.py
new file mode 100644
index 00000000000..b41d298398c
--- /dev/null
+++ b/Documentation/networking/cxacru-cf.py
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+# Copyright 2009 Simon Arlott
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59
+# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Usage: cxacru-cf.py < cxacru-cf.bin
+# Output: values string suitable for the sysfs adsl_config attribute
+#
+# Warning: cxacru-cf.bin with MD5 hash cdbac2689969d5ed5d4850f117702110
+# contains mis-aligned values which will stop the modem from being able
+# to make a connection. If the first and last two bytes are removed then
+# the values become valid, but the modulation will be forced to ANSI
+# T1.413 only which may not be appropriate.
+#
+# The original binary format is a packed list of le32 values.
+
+import sys
+import struct
+
+i = 0
+while True:
+ buf = sys.stdin.read(4)
+
+ if len(buf) == 0:
+ break
+ elif len(buf) != 4:
+ sys.stdout.write("\n")
+ sys.stderr.write("Error: read {0} not 4 bytes\n".format(len(buf)))
+ sys.exit(1)
+
+ if i > 0:
+ sys.stdout.write(" ")
+ sys.stdout.write("{0:x}={1}".format(i, struct.unpack("<I", buf)[0]))
+ i += 1
+
+sys.stdout.write("\n")