diff options
author | Simon Arlott <simon@fire.lp0.eu> | 2009-11-21 10:15:47 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:53:01 -0500 |
commit | 817db5b34e70650c488f22b072b7efb950812adb (patch) | |
tree | 058facd7c16a943cdcafa26d600e057cdb244213 /drivers/usb | |
parent | 4ac37208e9b30b36b615ed22a79b4ee787fdc9b5 (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 'drivers/usb')
-rw-r--r-- | drivers/usb/atm/cxacru.c | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index c2163d0826e3..2490c81138ce 100644 --- a/drivers/usb/atm/cxacru.c +++ b/drivers/usb/atm/cxacru.c | |||
@@ -978,11 +978,9 @@ cleanup: | |||
978 | 978 | ||
979 | static void cxacru_upload_firmware(struct cxacru_data *instance, | 979 | static void cxacru_upload_firmware(struct cxacru_data *instance, |
980 | const struct firmware *fw, | 980 | const struct firmware *fw, |
981 | const struct firmware *bp, | 981 | const struct firmware *bp) |
982 | const struct firmware *cf) | ||
983 | { | 982 | { |
984 | int ret; | 983 | int ret; |
985 | int off; | ||
986 | struct usbatm_data *usbatm = instance->usbatm; | 984 | struct usbatm_data *usbatm = instance->usbatm; |
987 | struct usb_device *usb_dev = usbatm->usb_dev; | 985 | struct usb_device *usb_dev = usbatm->usb_dev; |
988 | __le16 signature[] = { usb_dev->descriptor.idVendor, | 986 | __le16 signature[] = { usb_dev->descriptor.idVendor, |
@@ -1066,24 +1064,6 @@ static void cxacru_upload_firmware(struct cxacru_data *instance, | |||
1066 | usb_err(usbatm, "modem failed to initialize: %d\n", ret); | 1064 | usb_err(usbatm, "modem failed to initialize: %d\n", ret); |
1067 | return; | 1065 | return; |
1068 | } | 1066 | } |
1069 | |||
1070 | /* Load config data (le32), doing one packet at a time */ | ||
1071 | if (cf) | ||
1072 | for (off = 0; off < cf->size / 4; ) { | ||
1073 | __le32 buf[CMD_PACKET_SIZE / 4 - 1]; | ||
1074 | int i, len = min_t(int, cf->size / 4 - off, CMD_PACKET_SIZE / 4 / 2 - 1); | ||
1075 | buf[0] = cpu_to_le32(len); | ||
1076 | for (i = 0; i < len; i++, off++) { | ||
1077 | buf[i * 2 + 1] = cpu_to_le32(off); | ||
1078 | memcpy(buf + i * 2 + 2, cf->data + off * 4, 4); | ||
1079 | } | ||
1080 | ret = cxacru_cm(instance, CM_REQUEST_CARD_DATA_SET, | ||
1081 | (u8 *) buf, len, NULL, 0); | ||
1082 | if (ret < 0) { | ||
1083 | usb_err(usbatm, "load config data failed: %d\n", ret); | ||
1084 | return; | ||
1085 | } | ||
1086 | } | ||
1087 | } | 1067 | } |
1088 | 1068 | ||
1089 | static int cxacru_find_firmware(struct cxacru_data *instance, | 1069 | static int cxacru_find_firmware(struct cxacru_data *instance, |
@@ -1109,7 +1089,7 @@ static int cxacru_find_firmware(struct cxacru_data *instance, | |||
1109 | static int cxacru_heavy_init(struct usbatm_data *usbatm_instance, | 1089 | static int cxacru_heavy_init(struct usbatm_data *usbatm_instance, |
1110 | struct usb_interface *usb_intf) | 1090 | struct usb_interface *usb_intf) |
1111 | { | 1091 | { |
1112 | const struct firmware *fw, *bp, *cf; | 1092 | const struct firmware *fw, *bp; |
1113 | struct cxacru_data *instance = usbatm_instance->driver_data; | 1093 | struct cxacru_data *instance = usbatm_instance->driver_data; |
1114 | 1094 | ||
1115 | int ret = cxacru_find_firmware(instance, "fw", &fw); | 1095 | int ret = cxacru_find_firmware(instance, "fw", &fw); |
@@ -1127,13 +1107,8 @@ static int cxacru_heavy_init(struct usbatm_data *usbatm_instance, | |||
1127 | } | 1107 | } |
1128 | } | 1108 | } |
1129 | 1109 | ||
1130 | if (cxacru_find_firmware(instance, "cf", &cf)) /* optional */ | 1110 | cxacru_upload_firmware(instance, fw, bp); |
1131 | cf = NULL; | ||
1132 | |||
1133 | cxacru_upload_firmware(instance, fw, bp, cf); | ||
1134 | 1111 | ||
1135 | if (cf) | ||
1136 | release_firmware(cf); | ||
1137 | if (instance->modem_type->boot_rom_patch) | 1112 | if (instance->modem_type->boot_rom_patch) |
1138 | release_firmware(bp); | 1113 | release_firmware(bp); |
1139 | release_firmware(fw); | 1114 | release_firmware(fw); |