diff options
Diffstat (limited to 'drivers/net/usb/hso.c')
| -rw-r--r-- | drivers/net/usb/hso.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 1a482344b3f5..660bd5ea9fc0 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
| @@ -1201,16 +1201,18 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb) | |||
| 1201 | struct hso_serial *serial = urb->context; | 1201 | struct hso_serial *serial = urb->context; |
| 1202 | int status = urb->status; | 1202 | int status = urb->status; |
| 1203 | 1203 | ||
| 1204 | D4("\n--- Got serial_read_bulk callback %02x ---", status); | ||
| 1205 | |||
| 1204 | /* sanity check */ | 1206 | /* sanity check */ |
| 1205 | if (!serial) { | 1207 | if (!serial) { |
| 1206 | D1("serial == NULL"); | 1208 | D1("serial == NULL"); |
| 1207 | return; | 1209 | return; |
| 1208 | } else if (status) { | 1210 | } |
| 1211 | if (status) { | ||
| 1209 | handle_usb_error(status, __func__, serial->parent); | 1212 | handle_usb_error(status, __func__, serial->parent); |
| 1210 | return; | 1213 | return; |
| 1211 | } | 1214 | } |
| 1212 | 1215 | ||
| 1213 | D4("\n--- Got serial_read_bulk callback %02x ---", status); | ||
| 1214 | D1("Actual length = %d\n", urb->actual_length); | 1216 | D1("Actual length = %d\n", urb->actual_length); |
| 1215 | DUMP1(urb->transfer_buffer, urb->actual_length); | 1217 | DUMP1(urb->transfer_buffer, urb->actual_length); |
| 1216 | 1218 | ||
| @@ -1218,25 +1220,13 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb) | |||
| 1218 | if (serial->port.count == 0) | 1220 | if (serial->port.count == 0) |
| 1219 | return; | 1221 | return; |
| 1220 | 1222 | ||
| 1221 | if (status == 0) { | 1223 | if (serial->parent->port_spec & HSO_INFO_CRC_BUG) |
| 1222 | if (serial->parent->port_spec & HSO_INFO_CRC_BUG) | 1224 | fix_crc_bug(urb, serial->in_endp->wMaxPacketSize); |
| 1223 | fix_crc_bug(urb, serial->in_endp->wMaxPacketSize); | 1225 | /* Valid data, handle RX data */ |
| 1224 | /* Valid data, handle RX data */ | 1226 | spin_lock(&serial->serial_lock); |
| 1225 | spin_lock(&serial->serial_lock); | 1227 | serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 1; |
| 1226 | serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 1; | 1228 | put_rxbuf_data_and_resubmit_bulk_urb(serial); |
| 1227 | put_rxbuf_data_and_resubmit_bulk_urb(serial); | 1229 | spin_unlock(&serial->serial_lock); |
| 1228 | spin_unlock(&serial->serial_lock); | ||
| 1229 | } else if (status == -ENOENT || status == -ECONNRESET) { | ||
| 1230 | /* Unlinked - check for throttled port. */ | ||
| 1231 | D2("Port %d, successfully unlinked urb", serial->minor); | ||
| 1232 | spin_lock(&serial->serial_lock); | ||
| 1233 | serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 0; | ||
| 1234 | hso_resubmit_rx_bulk_urb(serial, urb); | ||
| 1235 | spin_unlock(&serial->serial_lock); | ||
| 1236 | } else { | ||
| 1237 | D2("Port %d, status = %d for read urb", serial->minor, status); | ||
| 1238 | return; | ||
| 1239 | } | ||
| 1240 | } | 1230 | } |
| 1241 | 1231 | ||
| 1242 | /* | 1232 | /* |
