2008-08-01 10:00:45 +02:00
|
|
|
/*
|
firesat: copyrights, rename to firedtv, API conversions, fix remote control input
Combination of the following changes:
Tue, 26 Aug 2008 00:17:30 +0200 (CEST)
firedtv: fix remote control input
and update the scancode-to-keycode mapping to a current model. Per
default, various media key keycodes are emitted which closely match what
is printed on the remote. Userland can modify the mapping by means of
evdev ioctls. (Not tested.)
The old scancode-to-keycode mapping is left in the driver but cannot be
modified by ioctls. This preserves status quo for old remotes.
Tue, 26 Aug 2008 00:11:28 +0200 (CEST)
firedtv: replace tasklet by workqueue job
Non-atomic context is a lot nicer to work with.
Sun, 24 Aug 2008 23:30:00 +0200 (CEST)
firedtv: move some code back to ieee1394 core
Partially reverts "ieee1394: remove unused code" of Linux 2.6.25.
Sun, 24 Aug 2008 23:29:30 +0200 (CEST)
firedtv: replace semaphore by mutex
firesat->avc_sem and ->demux_sem have been used exactly like a mutex.
The only exception is the schedule_remotecontrol tasklet which did a
down_trylock in atomic context. This is not possible with
mutex_trylock; however the whole remote control related code is
non-functional anyway at the moment. This should be fixed eventually,
probably by turning the tasklet into a worqueue job.
Convert everything else from semaphore to mutex.
Also rewrite a few of the affected functions to unlock the mutex at a
single exit point, instead of in several branches.
Sun, 24 Aug 2008 23:28:45 +0200 (CEST)
firedtv: some header cleanups
Unify #ifndef/#define/#endif guards against multiple inclusion.
Drop extern keyword from function declarations.
Remove #include's into header files where struct declarations suffice.
Remove unused ohci1394 interface and related unused ieee1394 interfaces.
Add a few missing #include's and remove a few apparently obsolete ones.
Sort them alphabetically.
Sun, 24 Aug 2008 23:27:45 +0200 (CEST)
firedtv: nicer registration message and some initialization fixes
Print the correct name in dvb_register_adapter().
While we are at it, replace two switch cascades by one for loop, remove
a superfluous member of struct firesat and of two unused arguments of
AVCIdentifySubunit(), and fix bogus kfree's in firesat_dvbdev_init().
Tue, 26 Aug 2008 14:24:17 +0200 (CEST)
firesat: rename to firedtv
Suggested by Andreas Monitzer. Besides DVB-S/-S2 receivers, the driver
also supports DVB-C and DVB-T receivers, hence the previous project name
is too narrow now.
Not yet done: Rename source directory, files, types, variables...
Sun, 24 Aug 2008 23:26:23 +0200 (CEST)
firesat: add missing copyright notes
Reported by Andreas Monitzer and Christian Dolzer.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-08-26 00:17:30 +02:00
|
|
|
* FireDTV driver (formerly known as FireSAT)
|
2008-08-01 10:00:45 +02:00
|
|
|
*
|
firesat: copyrights, rename to firedtv, API conversions, fix remote control input
Combination of the following changes:
Tue, 26 Aug 2008 00:17:30 +0200 (CEST)
firedtv: fix remote control input
and update the scancode-to-keycode mapping to a current model. Per
default, various media key keycodes are emitted which closely match what
is printed on the remote. Userland can modify the mapping by means of
evdev ioctls. (Not tested.)
The old scancode-to-keycode mapping is left in the driver but cannot be
modified by ioctls. This preserves status quo for old remotes.
Tue, 26 Aug 2008 00:11:28 +0200 (CEST)
firedtv: replace tasklet by workqueue job
Non-atomic context is a lot nicer to work with.
Sun, 24 Aug 2008 23:30:00 +0200 (CEST)
firedtv: move some code back to ieee1394 core
Partially reverts "ieee1394: remove unused code" of Linux 2.6.25.
Sun, 24 Aug 2008 23:29:30 +0200 (CEST)
firedtv: replace semaphore by mutex
firesat->avc_sem and ->demux_sem have been used exactly like a mutex.
The only exception is the schedule_remotecontrol tasklet which did a
down_trylock in atomic context. This is not possible with
mutex_trylock; however the whole remote control related code is
non-functional anyway at the moment. This should be fixed eventually,
probably by turning the tasklet into a worqueue job.
Convert everything else from semaphore to mutex.
Also rewrite a few of the affected functions to unlock the mutex at a
single exit point, instead of in several branches.
Sun, 24 Aug 2008 23:28:45 +0200 (CEST)
firedtv: some header cleanups
Unify #ifndef/#define/#endif guards against multiple inclusion.
Drop extern keyword from function declarations.
Remove #include's into header files where struct declarations suffice.
Remove unused ohci1394 interface and related unused ieee1394 interfaces.
Add a few missing #include's and remove a few apparently obsolete ones.
Sort them alphabetically.
Sun, 24 Aug 2008 23:27:45 +0200 (CEST)
firedtv: nicer registration message and some initialization fixes
Print the correct name in dvb_register_adapter().
While we are at it, replace two switch cascades by one for loop, remove
a superfluous member of struct firesat and of two unused arguments of
AVCIdentifySubunit(), and fix bogus kfree's in firesat_dvbdev_init().
Tue, 26 Aug 2008 14:24:17 +0200 (CEST)
firesat: rename to firedtv
Suggested by Andreas Monitzer. Besides DVB-S/-S2 receivers, the driver
also supports DVB-C and DVB-T receivers, hence the previous project name
is too narrow now.
Not yet done: Rename source directory, files, types, variables...
Sun, 24 Aug 2008 23:26:23 +0200 (CEST)
firesat: add missing copyright notes
Reported by Andreas Monitzer and Christian Dolzer.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-08-26 00:17:30 +02:00
|
|
|
* Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
|
|
|
|
* Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
|
2008-08-01 10:00:45 +02:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
2008-03-07 06:30:23 +01:00
|
|
|
#include <linux/dvb/ca.h>
|
firesat: copyrights, rename to firedtv, API conversions, fix remote control input
Combination of the following changes:
Tue, 26 Aug 2008 00:17:30 +0200 (CEST)
firedtv: fix remote control input
and update the scancode-to-keycode mapping to a current model. Per
default, various media key keycodes are emitted which closely match what
is printed on the remote. Userland can modify the mapping by means of
evdev ioctls. (Not tested.)
The old scancode-to-keycode mapping is left in the driver but cannot be
modified by ioctls. This preserves status quo for old remotes.
Tue, 26 Aug 2008 00:11:28 +0200 (CEST)
firedtv: replace tasklet by workqueue job
Non-atomic context is a lot nicer to work with.
Sun, 24 Aug 2008 23:30:00 +0200 (CEST)
firedtv: move some code back to ieee1394 core
Partially reverts "ieee1394: remove unused code" of Linux 2.6.25.
Sun, 24 Aug 2008 23:29:30 +0200 (CEST)
firedtv: replace semaphore by mutex
firesat->avc_sem and ->demux_sem have been used exactly like a mutex.
The only exception is the schedule_remotecontrol tasklet which did a
down_trylock in atomic context. This is not possible with
mutex_trylock; however the whole remote control related code is
non-functional anyway at the moment. This should be fixed eventually,
probably by turning the tasklet into a worqueue job.
Convert everything else from semaphore to mutex.
Also rewrite a few of the affected functions to unlock the mutex at a
single exit point, instead of in several branches.
Sun, 24 Aug 2008 23:28:45 +0200 (CEST)
firedtv: some header cleanups
Unify #ifndef/#define/#endif guards against multiple inclusion.
Drop extern keyword from function declarations.
Remove #include's into header files where struct declarations suffice.
Remove unused ohci1394 interface and related unused ieee1394 interfaces.
Add a few missing #include's and remove a few apparently obsolete ones.
Sort them alphabetically.
Sun, 24 Aug 2008 23:27:45 +0200 (CEST)
firedtv: nicer registration message and some initialization fixes
Print the correct name in dvb_register_adapter().
While we are at it, replace two switch cascades by one for loop, remove
a superfluous member of struct firesat and of two unused arguments of
AVCIdentifySubunit(), and fix bogus kfree's in firesat_dvbdev_init().
Tue, 26 Aug 2008 14:24:17 +0200 (CEST)
firesat: rename to firedtv
Suggested by Andreas Monitzer. Besides DVB-S/-S2 receivers, the driver
also supports DVB-C and DVB-T receivers, hence the previous project name
is too narrow now.
Not yet done: Rename source directory, files, types, variables...
Sun, 24 Aug 2008 23:26:23 +0200 (CEST)
firesat: add missing copyright notes
Reported by Andreas Monitzer and Christian Dolzer.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-08-26 00:17:30 +02:00
|
|
|
#include <linux/fs.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
|
2008-03-07 06:30:23 +01:00
|
|
|
#include <dvbdev.h>
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
#include "avc.h"
|
|
|
|
#include "firedtv.h"
|
|
|
|
#include "firedtv-ci.h"
|
firesat: copyrights, rename to firedtv, API conversions, fix remote control input
Combination of the following changes:
Tue, 26 Aug 2008 00:17:30 +0200 (CEST)
firedtv: fix remote control input
and update the scancode-to-keycode mapping to a current model. Per
default, various media key keycodes are emitted which closely match what
is printed on the remote. Userland can modify the mapping by means of
evdev ioctls. (Not tested.)
The old scancode-to-keycode mapping is left in the driver but cannot be
modified by ioctls. This preserves status quo for old remotes.
Tue, 26 Aug 2008 00:11:28 +0200 (CEST)
firedtv: replace tasklet by workqueue job
Non-atomic context is a lot nicer to work with.
Sun, 24 Aug 2008 23:30:00 +0200 (CEST)
firedtv: move some code back to ieee1394 core
Partially reverts "ieee1394: remove unused code" of Linux 2.6.25.
Sun, 24 Aug 2008 23:29:30 +0200 (CEST)
firedtv: replace semaphore by mutex
firesat->avc_sem and ->demux_sem have been used exactly like a mutex.
The only exception is the schedule_remotecontrol tasklet which did a
down_trylock in atomic context. This is not possible with
mutex_trylock; however the whole remote control related code is
non-functional anyway at the moment. This should be fixed eventually,
probably by turning the tasklet into a worqueue job.
Convert everything else from semaphore to mutex.
Also rewrite a few of the affected functions to unlock the mutex at a
single exit point, instead of in several branches.
Sun, 24 Aug 2008 23:28:45 +0200 (CEST)
firedtv: some header cleanups
Unify #ifndef/#define/#endif guards against multiple inclusion.
Drop extern keyword from function declarations.
Remove #include's into header files where struct declarations suffice.
Remove unused ohci1394 interface and related unused ieee1394 interfaces.
Add a few missing #include's and remove a few apparently obsolete ones.
Sort them alphabetically.
Sun, 24 Aug 2008 23:27:45 +0200 (CEST)
firedtv: nicer registration message and some initialization fixes
Print the correct name in dvb_register_adapter().
While we are at it, replace two switch cascades by one for loop, remove
a superfluous member of struct firesat and of two unused arguments of
AVCIdentifySubunit(), and fix bogus kfree's in firesat_dvbdev_init().
Tue, 26 Aug 2008 14:24:17 +0200 (CEST)
firesat: rename to firedtv
Suggested by Andreas Monitzer. Besides DVB-S/-S2 receivers, the driver
also supports DVB-C and DVB-T receivers, hence the previous project name
is too narrow now.
Not yet done: Rename source directory, files, types, variables...
Sun, 24 Aug 2008 23:26:23 +0200 (CEST)
firesat: add missing copyright notes
Reported by Andreas Monitzer and Christian Dolzer.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-08-26 00:17:30 +02:00
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
static int fdtv_ca_ready(ANTENNA_INPUT_INFO *info)
|
2008-08-01 10:00:45 +02:00
|
|
|
{
|
|
|
|
return info->CaInitializationStatus == 1 &&
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
info->CaErrorFlag == 0 &&
|
|
|
|
info->CaDvbFlag == 1 &&
|
|
|
|
info->CaModulePresentStatus == 1;
|
2008-08-01 10:00:45 +02:00
|
|
|
}
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
static int fdtv_get_ca_flags(ANTENNA_INPUT_INFO *info)
|
2008-08-01 10:00:45 +02:00
|
|
|
{
|
|
|
|
int flags = 0;
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
|
2008-08-01 10:00:45 +02:00
|
|
|
if (info->CaModulePresentStatus == 1)
|
|
|
|
flags |= CA_CI_MODULE_PRESENT;
|
|
|
|
if (info->CaInitializationStatus == 1 &&
|
|
|
|
info->CaErrorFlag == 0 &&
|
|
|
|
info->CaDvbFlag == 1)
|
|
|
|
flags |= CA_CI_MODULE_READY;
|
|
|
|
return flags;
|
|
|
|
}
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
static int fdtv_ca_reset(struct firedtv *fdtv)
|
2008-08-01 10:00:45 +02:00
|
|
|
{
|
2009-01-17 14:47:34 +01:00
|
|
|
return avc_ca_reset(fdtv) ? -EFAULT : 0;
|
2008-08-01 10:00:45 +02:00
|
|
|
}
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
static int fdtv_ca_get_caps(void *arg)
|
2008-08-01 10:00:45 +02:00
|
|
|
{
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
struct ca_caps *cap = arg;
|
|
|
|
|
|
|
|
cap->slot_num = 1;
|
|
|
|
cap->slot_type = CA_CI;
|
|
|
|
cap->descr_num = 1;
|
|
|
|
cap->descr_type = CA_ECD;
|
|
|
|
return 0;
|
2008-08-01 10:00:45 +02:00
|
|
|
}
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
static int fdtv_ca_get_slot_info(struct firedtv *fdtv, void *arg)
|
2008-08-01 10:00:45 +02:00
|
|
|
{
|
|
|
|
ANTENNA_INPUT_INFO info;
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
struct ca_slot_info *slot = arg;
|
2008-08-01 10:00:45 +02:00
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
if (avc_tuner_status(fdtv, &info))
|
2008-08-01 10:00:45 +02:00
|
|
|
return -EFAULT;
|
|
|
|
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
if (slot->num != 0)
|
2008-08-01 10:00:45 +02:00
|
|
|
return -EFAULT;
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
|
|
|
|
slot->type = CA_CI;
|
2009-01-17 14:47:34 +01:00
|
|
|
slot->flags = fdtv_get_ca_flags(&info);
|
2008-08-01 10:00:45 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
static int fdtv_ca_app_info(struct firedtv *fdtv, void *arg)
|
2008-08-01 10:00:45 +02:00
|
|
|
{
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
struct ca_msg *reply = arg;
|
2008-08-01 10:00:45 +02:00
|
|
|
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
return
|
2009-01-17 14:47:34 +01:00
|
|
|
avc_ca_app_info(fdtv, reply->msg, &reply->length) ? -EFAULT : 0;
|
2008-08-01 10:00:45 +02:00
|
|
|
}
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
static int fdtv_ca_info(struct firedtv *fdtv, void *arg)
|
2008-08-01 10:00:45 +02:00
|
|
|
{
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
struct ca_msg *reply = arg;
|
2008-08-01 10:00:45 +02:00
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
return avc_ca_info(fdtv, reply->msg, &reply->length) ? -EFAULT : 0;
|
2008-08-01 10:00:45 +02:00
|
|
|
}
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
static int fdtv_ca_get_mmi(struct firedtv *fdtv, void *arg)
|
2008-08-01 10:00:45 +02:00
|
|
|
{
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
struct ca_msg *reply = arg;
|
2008-08-01 10:00:45 +02:00
|
|
|
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
return
|
2009-01-17 14:47:34 +01:00
|
|
|
avc_ca_get_mmi(fdtv, reply->msg, &reply->length) ? -EFAULT : 0;
|
2008-08-01 10:00:45 +02:00
|
|
|
}
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
static int fdtv_ca_get_msg(struct firedtv *fdtv, void *arg)
|
2008-08-01 10:00:45 +02:00
|
|
|
{
|
|
|
|
ANTENNA_INPUT_INFO info;
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
int err;
|
2008-08-01 10:00:45 +02:00
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
switch (fdtv->ca_last_command) {
|
2008-08-01 10:00:45 +02:00
|
|
|
case TAG_APP_INFO_ENQUIRY:
|
2009-01-17 14:47:34 +01:00
|
|
|
err = fdtv_ca_app_info(fdtv, arg);
|
2008-08-01 10:00:45 +02:00
|
|
|
break;
|
|
|
|
case TAG_CA_INFO_ENQUIRY:
|
2009-01-17 14:47:34 +01:00
|
|
|
err = fdtv_ca_info(fdtv, arg);
|
2008-03-07 06:30:23 +01:00
|
|
|
break;
|
2008-08-01 10:00:45 +02:00
|
|
|
default:
|
2009-01-17 14:47:34 +01:00
|
|
|
if (avc_tuner_status(fdtv, &info))
|
2008-08-01 10:00:45 +02:00
|
|
|
err = -EFAULT;
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
else if (info.CaMmi == 1)
|
2009-01-17 14:47:34 +01:00
|
|
|
err = fdtv_ca_get_mmi(fdtv, arg);
|
2008-08-01 10:00:45 +02:00
|
|
|
else {
|
|
|
|
printk(KERN_INFO "%s: Unhandled message 0x%08X\n",
|
2009-01-17 14:47:34 +01:00
|
|
|
__func__, fdtv->ca_last_command);
|
2008-08-01 10:00:45 +02:00
|
|
|
err = -EFAULT;
|
|
|
|
}
|
|
|
|
}
|
2009-01-17 14:47:34 +01:00
|
|
|
fdtv->ca_last_command = 0;
|
2008-08-01 10:00:45 +02:00
|
|
|
return err;
|
|
|
|
}
|
2008-03-07 06:30:23 +01:00
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
static int fdtv_ca_pmt(struct firedtv *fdtv, void *arg)
|
2008-08-01 10:00:45 +02:00
|
|
|
{
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
struct ca_msg *msg = arg;
|
2008-08-01 10:00:45 +02:00
|
|
|
int data_pos;
|
2008-12-05 10:00:16 +01:00
|
|
|
int data_length;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
data_pos = 4;
|
|
|
|
if (msg->msg[3] & 0x80) {
|
|
|
|
data_length = 0;
|
|
|
|
for (i = 0; i < (msg->msg[3] & 0x7F); i++)
|
|
|
|
data_length = (data_length << 8) + msg->msg[data_pos++];
|
|
|
|
} else {
|
|
|
|
data_length = msg->msg[3];
|
|
|
|
}
|
2008-08-01 10:00:45 +02:00
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
return avc_ca_pmt(fdtv, &msg->msg[data_pos], data_length) ?
|
2008-12-05 10:00:16 +01:00
|
|
|
-EFAULT : 0;
|
2008-08-01 10:00:45 +02:00
|
|
|
}
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
static int fdtv_ca_send_msg(struct firedtv *fdtv, void *arg)
|
2008-08-01 10:00:45 +02:00
|
|
|
{
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
struct ca_msg *msg = arg;
|
2008-08-01 10:00:45 +02:00
|
|
|
int err;
|
|
|
|
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
/* Do we need a semaphore for this? */
|
2009-01-17 14:47:34 +01:00
|
|
|
fdtv->ca_last_command =
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
(msg->msg[0] << 16) + (msg->msg[1] << 8) + msg->msg[2];
|
2009-01-17 14:47:34 +01:00
|
|
|
switch (fdtv->ca_last_command) {
|
2008-08-01 10:00:45 +02:00
|
|
|
case TAG_CA_PMT:
|
2009-01-17 14:47:34 +01:00
|
|
|
err = fdtv_ca_pmt(fdtv, arg);
|
2008-08-01 10:00:45 +02:00
|
|
|
break;
|
|
|
|
case TAG_APP_INFO_ENQUIRY:
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
/* handled in ca_get_msg */
|
2008-03-07 06:30:23 +01:00
|
|
|
err = 0;
|
|
|
|
break;
|
2008-08-01 10:00:45 +02:00
|
|
|
case TAG_CA_INFO_ENQUIRY:
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
/* handled in ca_get_msg */
|
2008-03-07 06:30:23 +01:00
|
|
|
err = 0;
|
|
|
|
break;
|
2008-08-01 10:00:45 +02:00
|
|
|
case TAG_ENTER_MENU:
|
2009-01-17 14:47:34 +01:00
|
|
|
err = avc_ca_enter_menu(fdtv);
|
2008-08-01 10:00:45 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
printk(KERN_ERR "%s: Unhandled unknown message 0x%08X\n",
|
2009-01-17 14:47:34 +01:00
|
|
|
__func__, fdtv->ca_last_command);
|
2008-08-01 10:00:45 +02:00
|
|
|
err = -EFAULT;
|
2008-03-07 06:30:23 +01:00
|
|
|
}
|
2008-08-01 10:00:45 +02:00
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
static int fdtv_ca_ioctl(struct inode *inode, struct file *file,
|
2008-08-01 10:00:45 +02:00
|
|
|
unsigned int cmd, void *arg)
|
|
|
|
{
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
struct dvb_device *dvbdev = file->private_data;
|
2009-01-17 14:47:34 +01:00
|
|
|
struct firedtv *fdtv = dvbdev->priv;
|
2008-08-01 10:00:45 +02:00
|
|
|
ANTENNA_INPUT_INFO info;
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
int err;
|
2008-08-01 10:00:45 +02:00
|
|
|
|
|
|
|
switch(cmd) {
|
|
|
|
case CA_RESET:
|
2009-01-17 14:47:34 +01:00
|
|
|
err = fdtv_ca_reset(fdtv);
|
2008-08-01 10:00:45 +02:00
|
|
|
break;
|
|
|
|
case CA_GET_CAP:
|
2009-01-17 14:47:34 +01:00
|
|
|
err = fdtv_ca_get_caps(arg);
|
2008-08-01 10:00:45 +02:00
|
|
|
break;
|
|
|
|
case CA_GET_SLOT_INFO:
|
2009-01-17 14:47:34 +01:00
|
|
|
err = fdtv_ca_get_slot_info(fdtv, arg);
|
2008-08-01 10:00:45 +02:00
|
|
|
break;
|
|
|
|
case CA_GET_MSG:
|
2009-01-17 14:47:34 +01:00
|
|
|
err = fdtv_ca_get_msg(fdtv, arg);
|
2008-08-01 10:00:45 +02:00
|
|
|
break;
|
|
|
|
case CA_SEND_MSG:
|
2009-01-17 14:47:34 +01:00
|
|
|
err = fdtv_ca_send_msg(fdtv, arg);
|
2008-08-01 10:00:45 +02:00
|
|
|
break;
|
2008-03-07 06:30:23 +01:00
|
|
|
default:
|
2008-08-01 10:00:45 +02:00
|
|
|
printk(KERN_INFO "%s: Unhandled ioctl, command: %u\n",__func__,
|
|
|
|
cmd);
|
|
|
|
err = -EOPNOTSUPP;
|
2008-03-07 06:30:23 +01:00
|
|
|
}
|
2008-08-01 10:00:45 +02:00
|
|
|
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
/* FIXME Is this necessary? */
|
2009-01-17 14:47:34 +01:00
|
|
|
avc_tuner_status(fdtv, &info);
|
2008-08-01 10:00:45 +02:00
|
|
|
|
2008-03-07 06:30:23 +01:00
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
static unsigned int fdtv_ca_io_poll(struct file *file, poll_table *wait)
|
2008-08-01 10:00:45 +02:00
|
|
|
{
|
2008-03-07 06:30:23 +01:00
|
|
|
return POLLIN;
|
|
|
|
}
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
static struct file_operations fdtv_ca_fops = {
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.ioctl = dvb_generic_ioctl,
|
|
|
|
.open = dvb_generic_open,
|
|
|
|
.release = dvb_generic_release,
|
2009-01-17 14:47:34 +01:00
|
|
|
.poll = fdtv_ca_io_poll,
|
2008-03-07 06:30:23 +01:00
|
|
|
};
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
static struct dvb_device fdtv_ca = {
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
.users = 1,
|
|
|
|
.readers = 1,
|
|
|
|
.writers = 1,
|
2009-01-17 14:47:34 +01:00
|
|
|
.fops = &fdtv_ca_fops,
|
|
|
|
.kernel_ioctl = fdtv_ca_ioctl,
|
2008-03-07 06:30:23 +01:00
|
|
|
};
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
int fdtv_ca_register(struct firedtv *fdtv)
|
2008-08-01 10:00:45 +02:00
|
|
|
{
|
|
|
|
ANTENNA_INPUT_INFO info;
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
int err;
|
2008-03-07 06:30:23 +01:00
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
if (avc_tuner_status(fdtv, &info))
|
2008-08-01 10:00:45 +02:00
|
|
|
return -EINVAL;
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
if (!fdtv_ca_ready(&info))
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
return -EFAULT;
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
err = dvb_register_device(&fdtv->adapter, &fdtv->cadev,
|
|
|
|
&fdtv_ca, fdtv, DVB_DEVICE_CA);
|
firedtv: cleanups and minor fixes
Combination of the following changes:
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: increase FCP frame length for DVB-S2 tune QSPK
The last three bytes didn't go out to the wire.
Effect of the fix not yet tested.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: replace mdelay by msleep
These functions can sleep (and in fact sleep for the duration of a whole
FCP transaction). Hence msleep is more appropriate here.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial reorganization in avc_api
Reduce nesting level by factoring code out of avc_tuner_dsd() into
helper functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in avc_api
Use dev_err(), no CamelCase function names, adjust comment style, put
#if 0 around unused code and add FIXME comments, standardize on
lower-case hexadecimal constants, use ALIGN() for some frame length
calculations, make a local function static...
The code which writes FCP command frames and reads FCP response frames
is not yet brought into canonical kernel coding style because this
involves changes of typedefs (on-the-wire bitfields).
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: don't retry oPCR updates endlessly
In the theoretical case that the target node wasn't handling the lock
transactions as expected or there was continued interference by other
initiating nodes, these functions wouldn't return for ages.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs
Use macros/ inline functions/ standard byte order accessors to read and
write oPCR register values (big endian bitfields, on-the-wire data).
The new code may not be the ultimate optimum, but it doesn't occur in a
hot path.
This fixes the CMP code for big endian CPUs. So far I tested it only on
a little endian CPU though.
For now, include <asm/byteorder.h> instead of <linux/byteorder.h>
because drivers/ieee1394/*.h also include the former. I will fix this
in drivers/ieee1394 and firedtv later.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in cmp
Reduce nesting level by means of early exit and goto.
Remove obsolete includes, use dev_err(), no CamelCase function names...
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: trivial cleanups in firesat-ci
Whitespace, variable names, comment style...
Also, use dvb_generic_open() and dvb_generic_release() directly as
our hooks in struct file_operations because firedtv's wrappers merely
called these generic functions.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove CA debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove AV/C debug code
This looks like it is not necessary to have available for endusers who
cannot patch kernels for bug reporting and tests of fixes.
Sun, 2 Nov 2008 13:45:00 +0100 (CET)
firedtv: remove various debug code
Most of this was already commented out. And that which wasn't is not
relevant in normal use.
Mon, 29 Sep 2008 19:22:48 +0200 (CEST)
firedtv: register input device as child of a FireWire device
Instead of one virtual input device which exists for the whole lifetime
of the driver and receives events from all connected FireDTVs, register
one input device for each firedtv device. These input devices will show
up as children of the respective firedtv devices in the sysfs hierarchy.
However, the implementation falls short because of a bug in userspace:
Udev's path_id script gets stuck with 100% CPU utilization, maybe
because of an assumption about the maximum ieee1394 device hierarchy
depth.
To avoid this bug, we use the fw-host device instead of the proper
unit_directory device as parent of the input device.
There is hope that the port to the new firewire stack won't be inhibited
by this userspace bug because there are no fw-host devices there.
Mon, 29 Sep 2008 19:21:52 +0200 (CEST)
firedtv: fix string comparison and a few sparse warnings
Sparse found a bug:
while ((kv_buf + kv_len - 1) == '\0')
should have been
while (kv_buf[kv_len - 1] == '\0')
We fix it by a better implementation without a temporary copy.
Also fix sparse warnings of 0 instead of NULL and signedness mismatches.
Mon, 29 Sep 2008 19:21:20 +0200 (CEST)
firedtv: remove unused struct members
and redefine an int as a bool.
Mon, 29 Sep 2008 19:20:36 +0200 (CEST)
firedtv: fix initialization of dvb_frontend.ops
There was a NULL pointer reference if no dvb_frontend_info was found.
Also, don't directly assign struct typed values to struct typed
variables. Instead write out assignments to individual strcut members.
This reduces module size by about 1 kB.
Mon, 29 Sep 2008 19:19:41 +0200 (CEST)
firedtv: remove unused dual subunit code from initialization
No FireDTVs with more than one subunit exists, hence simplify the
initialization for the special case of one subunit. The driver was able
to check for more than one subunit but was broken for more than two
subunits.
While we are at it, add several missing cleanups after failure, and
include a few dynamically allocated structures diretly into struct
firesat instead of allocating them separately.
Mon, 29 Sep 2008 19:19:08 +0200 (CEST)
firedtv: add vendor_id and version to driver match table
Now that nodemgr was enhanced to match against the root directory's
vendor ID if there isn't one in the unit directory, use this to
prevent firedtv to be bound to wrong devices by accident.
Also add the AV/C software version ID to the match flags for
completeness; specifier ID and software only make sense as a pair.
Mon, 29 Sep 2008 19:18:30 +0200 (CEST)
firedtv: use hpsb_node_read(), _write(), _lock()
because they are simpler and treat the node generation more correctly.
While we are at it, clean up and simplify surrounding code.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-02 13:45:00 +01:00
|
|
|
|
|
|
|
if (info.CaApplicationInfo == 0)
|
|
|
|
printk(KERN_ERR "%s: CaApplicationInfo is not set.\n",
|
|
|
|
__func__);
|
|
|
|
if (info.CaDateTimeRequest == 1)
|
2009-01-17 14:47:34 +01:00
|
|
|
avc_ca_get_time_date(fdtv, &fdtv->ca_time_interval);
|
2008-08-01 10:00:45 +02:00
|
|
|
|
|
|
|
return err;
|
2008-03-07 06:30:23 +01:00
|
|
|
}
|
|
|
|
|
2009-01-17 14:47:34 +01:00
|
|
|
void fdtv_ca_release(struct firedtv *fdtv)
|
2008-08-01 10:00:45 +02:00
|
|
|
{
|
2009-01-17 14:47:34 +01:00
|
|
|
if (fdtv->cadev)
|
|
|
|
dvb_unregister_device(fdtv->cadev);
|
2008-03-07 06:30:23 +01:00
|
|
|
}
|