aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/bas-gigaset.c
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2009-10-06 08:18:36 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-07 01:20:59 -0400
commiteb4459ff3a3bdedb7a4da03fb9da2ba800b19f74 (patch)
tree7079d02767ea736756e50a77a90c0187e93e3220 /drivers/isdn/gigaset/bas-gigaset.c
parentee239d9901c13040598f6c46d5017869c6d14e2e (diff)
gigaset: handle isoc frame errors more gracefully
Don't drop the remainder of an URB if an isochronous frame has an error. Impact: error handling improvement Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/gigaset/bas-gigaset.c')
-rw-r--r--drivers/isdn/gigaset/bas-gigaset.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
index 781c4041f7b0..9e7108a3109b 100644
--- a/drivers/isdn/gigaset/bas-gigaset.c
+++ b/drivers/isdn/gigaset/bas-gigaset.c
@@ -1331,28 +1331,24 @@ static void read_iso_tasklet(unsigned long data)
1331 rcvbuf = urb->transfer_buffer; 1331 rcvbuf = urb->transfer_buffer;
1332 totleft = urb->actual_length; 1332 totleft = urb->actual_length;
1333 for (frame = 0; totleft > 0 && frame < BAS_NUMFRAMES; frame++) { 1333 for (frame = 0; totleft > 0 && frame < BAS_NUMFRAMES; frame++) {
1334 if (unlikely(urb->iso_frame_desc[frame].status)) { 1334 numbytes = urb->iso_frame_desc[frame].actual_length;
1335 if (unlikely(urb->iso_frame_desc[frame].status))
1335 dev_warn(cs->dev, 1336 dev_warn(cs->dev,
1336 "isochronous read: frame %d: %s\n", 1337 "isochronous read: frame %d[%d]: %s\n",
1337 frame, 1338 frame, numbytes,
1338 get_usb_statmsg( 1339 get_usb_statmsg(
1339 urb->iso_frame_desc[frame].status)); 1340 urb->iso_frame_desc[frame].status));
1340 break; 1341 if (unlikely(numbytes > BAS_MAXFRAME))
1341 }
1342 numbytes = urb->iso_frame_desc[frame].actual_length;
1343 if (unlikely(numbytes > BAS_MAXFRAME)) {
1344 dev_warn(cs->dev, 1342 dev_warn(cs->dev,
1345 "isochronous read: frame %d: " 1343 "isochronous read: frame %d: "
1346 "numbytes (%d) > BAS_MAXFRAME\n", 1344 "numbytes (%d) > BAS_MAXFRAME\n",
1347 frame, numbytes); 1345 frame, numbytes);
1348 break;
1349 }
1350 if (unlikely(numbytes > totleft)) { 1346 if (unlikely(numbytes > totleft)) {
1351 dev_warn(cs->dev, 1347 dev_warn(cs->dev,
1352 "isochronous read: frame %d: " 1348 "isochronous read: frame %d: "
1353 "numbytes (%d) > totleft (%d)\n", 1349 "numbytes (%d) > totleft (%d)\n",
1354 frame, numbytes, totleft); 1350 frame, numbytes, totleft);
1355 break; 1351 numbytes = totleft;
1356 } 1352 }
1357 offset = urb->iso_frame_desc[frame].offset; 1353 offset = urb->iso_frame_desc[frame].offset;
1358 if (unlikely(offset + numbytes > BAS_INBUFSIZE)) { 1354 if (unlikely(offset + numbytes > BAS_INBUFSIZE)) {
@@ -1361,7 +1357,7 @@ static void read_iso_tasklet(unsigned long data)
1361 "offset (%d) + numbytes (%d) " 1357 "offset (%d) + numbytes (%d) "
1362 "> BAS_INBUFSIZE\n", 1358 "> BAS_INBUFSIZE\n",
1363 frame, offset, numbytes); 1359 frame, offset, numbytes);
1364 break; 1360 numbytes = BAS_INBUFSIZE - offset;
1365 } 1361 }
1366 gigaset_isoc_receive(rcvbuf + offset, numbytes, bcs); 1362 gigaset_isoc_receive(rcvbuf + offset, numbytes, bcs);
1367 totleft -= numbytes; 1363 totleft -= numbytes;