[media] em28xx: rename isoc packet number constants and parameters
Rename EM28XX_NUM_PACKETS to EM28XX_NUM_ISOC_PACKETS and EM28XX_DVB_MAX_PACKETS to EM28XX_DVB_NUM_ISOC_PACKETS to clarify that these values are used only for isoc usb transfers. Also use the term num_packets instead of max_packets, as this is how these values are used and called in struct urb. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
8c3015676f
commit
515688a898
@ -3323,7 +3323,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
|
|||||||
if (has_dvb) {
|
if (has_dvb) {
|
||||||
/* pre-allocate DVB isoc transfer buffers */
|
/* pre-allocate DVB isoc transfer buffers */
|
||||||
retval = em28xx_alloc_isoc(dev, EM28XX_DIGITAL_MODE,
|
retval = em28xx_alloc_isoc(dev, EM28XX_DIGITAL_MODE,
|
||||||
EM28XX_DVB_MAX_PACKETS,
|
EM28XX_DVB_NUM_ISOC_PACKETS,
|
||||||
EM28XX_DVB_NUM_BUFS,
|
EM28XX_DVB_NUM_BUFS,
|
||||||
dev->dvb_max_pkt_size);
|
dev->dvb_max_pkt_size);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
|
@ -1034,7 +1034,7 @@ EXPORT_SYMBOL_GPL(em28xx_stop_urbs);
|
|||||||
* Allocate URBs
|
* Allocate URBs
|
||||||
*/
|
*/
|
||||||
int em28xx_alloc_isoc(struct em28xx *dev, enum em28xx_mode mode,
|
int em28xx_alloc_isoc(struct em28xx *dev, enum em28xx_mode mode,
|
||||||
int max_packets, int num_bufs, int max_pkt_size)
|
int num_packets, int num_bufs, int max_pkt_size)
|
||||||
{
|
{
|
||||||
struct em28xx_usb_isoc_bufs *isoc_bufs;
|
struct em28xx_usb_isoc_bufs *isoc_bufs;
|
||||||
int i;
|
int i;
|
||||||
@ -1069,7 +1069,7 @@ int em28xx_alloc_isoc(struct em28xx *dev, enum em28xx_mode mode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
isoc_bufs->max_pkt_size = max_pkt_size;
|
isoc_bufs->max_pkt_size = max_pkt_size;
|
||||||
isoc_bufs->num_packets = max_packets;
|
isoc_bufs->num_packets = num_packets;
|
||||||
dev->isoc_ctl.vid_buf = NULL;
|
dev->isoc_ctl.vid_buf = NULL;
|
||||||
dev->isoc_ctl.vbi_buf = NULL;
|
dev->isoc_ctl.vbi_buf = NULL;
|
||||||
|
|
||||||
@ -1129,7 +1129,7 @@ EXPORT_SYMBOL_GPL(em28xx_alloc_isoc);
|
|||||||
* Allocate URBs and start IRQ
|
* Allocate URBs and start IRQ
|
||||||
*/
|
*/
|
||||||
int em28xx_init_isoc(struct em28xx *dev, enum em28xx_mode mode,
|
int em28xx_init_isoc(struct em28xx *dev, enum em28xx_mode mode,
|
||||||
int max_packets, int num_bufs, int max_pkt_size,
|
int num_packets, int num_bufs, int max_pkt_size,
|
||||||
int (*isoc_copy) (struct em28xx *dev, struct urb *urb))
|
int (*isoc_copy) (struct em28xx *dev, struct urb *urb))
|
||||||
{
|
{
|
||||||
struct em28xx_dmaqueue *dma_q = &dev->vidq;
|
struct em28xx_dmaqueue *dma_q = &dev->vidq;
|
||||||
@ -1153,7 +1153,7 @@ int em28xx_init_isoc(struct em28xx *dev, enum em28xx_mode mode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (alloc) {
|
if (alloc) {
|
||||||
rc = em28xx_alloc_isoc(dev, mode, max_packets,
|
rc = em28xx_alloc_isoc(dev, mode, num_packets,
|
||||||
num_bufs, max_pkt_size);
|
num_bufs, max_pkt_size);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -173,11 +173,12 @@ static int em28xx_start_streaming(struct em28xx_dvb *dvb)
|
|||||||
return max_dvb_packet_size;
|
return max_dvb_packet_size;
|
||||||
dprintk(1, "Using %d buffers each with %d x %d bytes\n",
|
dprintk(1, "Using %d buffers each with %d x %d bytes\n",
|
||||||
EM28XX_DVB_NUM_BUFS,
|
EM28XX_DVB_NUM_BUFS,
|
||||||
EM28XX_DVB_MAX_PACKETS,
|
EM28XX_DVB_NUM_ISOC_PACKETS,
|
||||||
max_dvb_packet_size);
|
max_dvb_packet_size);
|
||||||
|
|
||||||
return em28xx_init_isoc(dev, EM28XX_DIGITAL_MODE,
|
return em28xx_init_isoc(dev, EM28XX_DIGITAL_MODE,
|
||||||
EM28XX_DVB_MAX_PACKETS, EM28XX_DVB_NUM_BUFS,
|
EM28XX_DVB_NUM_ISOC_PACKETS,
|
||||||
|
EM28XX_DVB_NUM_BUFS,
|
||||||
max_dvb_packet_size, em28xx_dvb_isoc_copy);
|
max_dvb_packet_size, em28xx_dvb_isoc_copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -764,13 +764,13 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
|
|||||||
if (urb_init) {
|
if (urb_init) {
|
||||||
if (em28xx_vbi_supported(dev) == 1)
|
if (em28xx_vbi_supported(dev) == 1)
|
||||||
rc = em28xx_init_isoc(dev, EM28XX_ANALOG_MODE,
|
rc = em28xx_init_isoc(dev, EM28XX_ANALOG_MODE,
|
||||||
EM28XX_NUM_PACKETS,
|
EM28XX_NUM_ISOC_PACKETS,
|
||||||
EM28XX_NUM_BUFS,
|
EM28XX_NUM_BUFS,
|
||||||
dev->max_pkt_size,
|
dev->max_pkt_size,
|
||||||
em28xx_isoc_copy_vbi);
|
em28xx_isoc_copy_vbi);
|
||||||
else
|
else
|
||||||
rc = em28xx_init_isoc(dev, EM28XX_ANALOG_MODE,
|
rc = em28xx_init_isoc(dev, EM28XX_ANALOG_MODE,
|
||||||
EM28XX_NUM_PACKETS,
|
EM28XX_NUM_ISOC_PACKETS,
|
||||||
EM28XX_NUM_BUFS,
|
EM28XX_NUM_BUFS,
|
||||||
dev->max_pkt_size,
|
dev->max_pkt_size,
|
||||||
em28xx_isoc_copy);
|
em28xx_isoc_copy);
|
||||||
|
@ -157,12 +157,12 @@
|
|||||||
#define EM28XX_NUM_BUFS 5
|
#define EM28XX_NUM_BUFS 5
|
||||||
#define EM28XX_DVB_NUM_BUFS 5
|
#define EM28XX_DVB_NUM_BUFS 5
|
||||||
|
|
||||||
/* number of packets for each buffer
|
/* isoc transfers: number of packets for each buffer
|
||||||
windows requests only 64 packets .. so we better do the same
|
windows requests only 64 packets .. so we better do the same
|
||||||
this is what I found out for all alternate numbers there!
|
this is what I found out for all alternate numbers there!
|
||||||
*/
|
*/
|
||||||
#define EM28XX_NUM_PACKETS 64
|
#define EM28XX_NUM_ISOC_PACKETS 64
|
||||||
#define EM28XX_DVB_MAX_PACKETS 64
|
#define EM28XX_DVB_NUM_ISOC_PACKETS 64
|
||||||
|
|
||||||
#define EM28XX_INTERLACED_DEFAULT 1
|
#define EM28XX_INTERLACED_DEFAULT 1
|
||||||
|
|
||||||
@ -667,9 +667,9 @@ int em28xx_set_outfmt(struct em28xx *dev);
|
|||||||
int em28xx_resolution_set(struct em28xx *dev);
|
int em28xx_resolution_set(struct em28xx *dev);
|
||||||
int em28xx_set_alternate(struct em28xx *dev);
|
int em28xx_set_alternate(struct em28xx *dev);
|
||||||
int em28xx_alloc_isoc(struct em28xx *dev, enum em28xx_mode mode,
|
int em28xx_alloc_isoc(struct em28xx *dev, enum em28xx_mode mode,
|
||||||
int max_packets, int num_bufs, int max_pkt_size);
|
int num_packets, int num_bufs, int max_pkt_size);
|
||||||
int em28xx_init_isoc(struct em28xx *dev, enum em28xx_mode mode,
|
int em28xx_init_isoc(struct em28xx *dev, enum em28xx_mode mode,
|
||||||
int max_packets, int num_bufs, int max_pkt_size,
|
int num_packets, int num_bufs, int max_pkt_size,
|
||||||
int (*isoc_copy) (struct em28xx *dev, struct urb *urb));
|
int (*isoc_copy) (struct em28xx *dev, struct urb *urb));
|
||||||
void em28xx_uninit_isoc(struct em28xx *dev, enum em28xx_mode mode);
|
void em28xx_uninit_isoc(struct em28xx *dev, enum em28xx_mode mode);
|
||||||
void em28xx_stop_urbs(struct em28xx *dev);
|
void em28xx_stop_urbs(struct em28xx *dev);
|
||||||
|
Loading…
Reference in New Issue
Block a user