diff options
Diffstat (limited to 'drivers/usb/atm')
-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); |