From patchwork Wed Feb 3 20:20:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Ringel X-Patchwork-Id: 76796 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o13KLEYw015232 for ; Wed, 3 Feb 2010 20:21:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932733Ab0BCUVM (ORCPT ); Wed, 3 Feb 2010 15:21:12 -0500 Received: from mail-in-15.arcor-online.net ([151.189.21.55]:39874 "EHLO mail-in-15.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932670Ab0BCUVL (ORCPT ); Wed, 3 Feb 2010 15:21:11 -0500 Received: from mail-in-16-z2.arcor-online.net (mail-in-16-z2.arcor-online.net [151.189.8.33]) by mx.arcor.de (Postfix) with ESMTP id E47B2356944; Wed, 3 Feb 2010 21:21:09 +0100 (CET) Received: from mail-in-06.arcor-online.net (mail-in-06.arcor-online.net [151.189.21.46]) by mail-in-16-z2.arcor-online.net (Postfix) with ESMTP id CB64D2543C7; Wed, 3 Feb 2010 21:21:09 +0100 (CET) Received: from [192.168.2.102] (dslb-188-103-200-201.pools.arcor-ip.net [188.103.200.201]) (Authenticated sender: stefan.ringel@arcor.de) by mail-in-06.arcor-online.net (Postfix) with ESMTPA id 4EDC839A7C6; Wed, 3 Feb 2010 21:21:09 +0100 (CET) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-06.arcor-online.net 4EDC839A7C6 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arcor.de; s=mail-in; t=1265228469; bh=zszZ90h5tyhLmOb1IOdc/bU2rKaoGFjBGcoyCYgqDQg=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=qT8dBmox5DTZyZwaipX8FVGSI065dT5UWAj5YhKgwPDwR/2x364lLSR1xfLLxK0u3 0iJ6DcVrWvYPBd/CZeVQuiNrYvSqLRM4UyFrxJ1lU0EGqyqqPOVMwtVISw03nYTNBE ebF6/RLstpM956ZmYHGIuuZu7c2jfI/6s/xkTZQw= Message-ID: <4B69DA97.5040101@arcor.de> Date: Wed, 03 Feb 2010 21:20:39 +0100 From: Stefan Ringel User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.5) Gecko/20091130 SUSE/3.0.0-1.1.1 Thunderbird/3.0 MIME-Version: 1.0 To: Mauro Carvalho Chehab CC: linux-media@vger.kernel.org, Devin Heitmueller Subject: [PATCH 6/15] - tm6000 bugfix usb transfer in DVB mode References: <4B673790.3030706@arcor.de> <4B673B2D.6040507@arcor.de> <4B675B19.3080705@redhat.com> <4B685FB9.1010805@arcor.de> <4B688507.606@redhat.com> <4B688E41.2050806@arcor.de> <4B689094.2070204@redhat.com> <4B6894FE.6010202@arcor.de> <4B69D83D.5050809@arcor.de> <4B69D8CC.2030008@arcor.de> In-Reply-To: <4B69D8CC.2030008@arcor.de> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 03 Feb 2010 20:21:14 +0000 (UTC) --- a/drivers/staging/tm6000/tm6000-dvb.c +++ b/drivers/staging/tm6000/tm6000-dvb.c @@ -17,7 +17,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include +#include #include "tm6000.h" #include "tm6000-regs.h" @@ -30,17 +32,61 @@ #include "tuner-xc2028.h" +static void inline print_err_status (struct tm6000_core *dev, + int packet, int status) +{ + char *errmsg = "Unknown"; + + switch(status) { + case -ENOENT: + errmsg = "unlinked synchronuously"; + break; + case -ECONNRESET: + errmsg = "unlinked asynchronuously"; + break; + case -ENOSR: + errmsg = "Buffer error (overrun)"; + break; + case -EPIPE: + errmsg = "Stalled (device not responding)"; + break; + case -EOVERFLOW: + errmsg = "Babble (bad cable?)"; + break; + case -EPROTO: + errmsg = "Bit-stuff error (bad cable?)"; + break; + case -EILSEQ: + errmsg = "CRC/Timeout (could be anything)"; + break; + case -ETIME: + errmsg = "Device does not respond"; + break; + } + if (packet<0) { + dprintk(dev, 1, "URB status %d [%s].\n", + status, errmsg); + } else { + dprintk(dev, 1, "URB packet %d, status %d [%s].\n", + packet, status, errmsg); + } +} + + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +static void tm6000_urb_received(struct urb *urb, struct pt_regs *ptregs) +#else static void tm6000_urb_received(struct urb *urb) +#endif { int ret; struct tm6000_core* dev = urb->context; - if(urb->status != 0){ - printk(KERN_ERR "tm6000: status != 0\n"); + if(urb->status != 0) { + print_err_status (dev,0,urb->status); } else if(urb->actual_length>0){ - dvb_dmx_swfilter(&dev->dvb->demux, urb->transfer_buffer, - urb->actual_length); + dvb_dmx_swfilter(&dev->dvb->demux, urb->transfer_buffer, urb->actual_length); }