flexcop-usb.c (bb598c1b8c9bf56981927dcb8c0dc34b8ff95342) flexcop-usb.c (4a58d39075e1e2bc5ca8b379278659d95f072363)
1/*
2 * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III
3 * flexcop-usb.c - covers the USB part
4 * see flexcop.c for copyright information
5 */
6#define FC_LOG_PREFIX "flexcop_usb"
7#include "flexcop-usb.h"
8#include "flexcop-common.h"

--- 19 unchanged lines hidden (view full) ---

28#else
29#define dprintk(level, args...)
30#define debug_dump(b, l, method)
31#define DEBSTATUS " (debugging is not enabled)"
32#endif
33
34static int debug;
35module_param(debug, int, 0644);
1/*
2 * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III
3 * flexcop-usb.c - covers the USB part
4 * see flexcop.c for copyright information
5 */
6#define FC_LOG_PREFIX "flexcop_usb"
7#include "flexcop-usb.h"
8#include "flexcop-common.h"

--- 19 unchanged lines hidden (view full) ---

28#else
29#define dprintk(level, args...)
30#define debug_dump(b, l, method)
31#define DEBSTATUS " (debugging is not enabled)"
32#endif
33
34static int debug;
35module_param(debug, int, 0644);
36MODULE_PARM_DESC(debug, "set debugging level (1=info,ts=2,"
37 "ctrl=4,i2c=8,v8mem=16 (or-able))." DEBSTATUS);
36MODULE_PARM_DESC(debug, "set debugging level (1=info,ts=2,ctrl=4,i2c=8,v8mem=16 (or-able))." DEBSTATUS);
38#undef DEBSTATUS
39
40#define deb_info(args...) dprintk(0x01, args)
41#define deb_ts(args...) dprintk(0x02, args)
42#define deb_ctrl(args...) dprintk(0x04, args)
43#define deb_i2c(args...) dprintk(0x08, args)
44#define deb_v8(args...) dprintk(0x10, args)
45

--- 382 unchanged lines hidden (view full) ---

428static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb)
429{
430 u16 frame_size = le16_to_cpu(
431 fc_usb->uintf->cur_altsetting->endpoint[0].desc.wMaxPacketSize);
432 int bufsize = B2C2_USB_NUM_ISO_URB * B2C2_USB_FRAMES_PER_ISO *
433 frame_size, i, j, ret;
434 int buffer_offset = 0;
435
37#undef DEBSTATUS
38
39#define deb_info(args...) dprintk(0x01, args)
40#define deb_ts(args...) dprintk(0x02, args)
41#define deb_ctrl(args...) dprintk(0x04, args)
42#define deb_i2c(args...) dprintk(0x08, args)
43#define deb_v8(args...) dprintk(0x10, args)
44

--- 382 unchanged lines hidden (view full) ---

427static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb)
428{
429 u16 frame_size = le16_to_cpu(
430 fc_usb->uintf->cur_altsetting->endpoint[0].desc.wMaxPacketSize);
431 int bufsize = B2C2_USB_NUM_ISO_URB * B2C2_USB_FRAMES_PER_ISO *
432 frame_size, i, j, ret;
433 int buffer_offset = 0;
434
436 deb_ts("creating %d iso-urbs with %d frames "
437 "each of %d bytes size = %d.\n", B2C2_USB_NUM_ISO_URB,
435 deb_ts("creating %d iso-urbs with %d frames each of %d bytes size = %d.\n",
436 B2C2_USB_NUM_ISO_URB,
438 B2C2_USB_FRAMES_PER_ISO, frame_size, bufsize);
439
440 fc_usb->iso_buffer = usb_alloc_coherent(fc_usb->udev,
441 bufsize, GFP_KERNEL, &fc_usb->dma_addr);
442 if (fc_usb->iso_buffer == NULL)
443 return -ENOMEM;
444
445 memset(fc_usb->iso_buffer, 0, bufsize);

--- 8 unchanged lines hidden (view full) ---

454 goto urb_error;
455 }
456 }
457
458 /* initialising and submitting iso urbs */
459 for (i = 0; i < B2C2_USB_NUM_ISO_URB; i++) {
460 int frame_offset = 0;
461 struct urb *urb = fc_usb->iso_urb[i];
437 B2C2_USB_FRAMES_PER_ISO, frame_size, bufsize);
438
439 fc_usb->iso_buffer = usb_alloc_coherent(fc_usb->udev,
440 bufsize, GFP_KERNEL, &fc_usb->dma_addr);
441 if (fc_usb->iso_buffer == NULL)
442 return -ENOMEM;
443
444 memset(fc_usb->iso_buffer, 0, bufsize);

--- 8 unchanged lines hidden (view full) ---

453 goto urb_error;
454 }
455 }
456
457 /* initialising and submitting iso urbs */
458 for (i = 0; i < B2C2_USB_NUM_ISO_URB; i++) {
459 int frame_offset = 0;
460 struct urb *urb = fc_usb->iso_urb[i];
462 deb_ts("initializing and submitting urb no. %d "
463 "(buf_offset: %d).\n", i, buffer_offset);
461 deb_ts("initializing and submitting urb no. %d (buf_offset: %d).\n",
462 i, buffer_offset);
464
465 urb->dev = fc_usb->udev;
466 urb->context = fc_usb;
467 urb->complete = flexcop_usb_urb_complete;
468 urb->pipe = B2C2_USB_DATA_PIPE;
469 urb->transfer_flags = URB_ISO_ASAP;
470 urb->interval = 1;
471 urb->number_of_packets = B2C2_USB_FRAMES_PER_ISO;

--- 147 unchanged lines hidden ---
463
464 urb->dev = fc_usb->udev;
465 urb->context = fc_usb;
466 urb->complete = flexcop_usb_urb_complete;
467 urb->pipe = B2C2_USB_DATA_PIPE;
468 urb->transfer_flags = URB_ISO_ASAP;
469 urb->interval = 1;
470 urb->number_of_packets = B2C2_USB_FRAMES_PER_ISO;

--- 147 unchanged lines hidden ---