Commit a70f81c1 authored by Rambaldi's avatar Rambaldi Committed by Stefan Richter

firedtv: rename files, variables, functions from firesat to firedtv

Combination of the following changes:

Sat, 17 Jan 2009 14:47:34 +0100
firedtv: rename variables and functions from firesat to firedtv
Signed-off-by: default avatarRambaldi <Rambaldi@xs4all.nl>

    Additional changes by Stefan Richter:

    Renamed struct firedtv *firedtv to struct firedtv *fdtv and
    firedtv_foo_bar() to fdtv_foo_bar() for brevity.

Sat, 17 Jan 2009 13:07:44 +0100
firedtv: rename files from firesat to firedtv
Signed-off-by: default avatarRambaldi <Rambaldi@xs4all.nl>

    Additional changes by Stefan Richter:

    Name the directory "firewire" instead of "firedtv".
    Standardize on "-" instead of "_" in file names, because that's what
    drivers/firewire/ and drivers/media/dvb/dvb-usb/ use too.
    Build fix.
Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
parent 291f006e
......@@ -51,7 +51,7 @@ comment "Supported SDMC DM1105 Adapters"
depends on DVB_CORE && PCI && I2C
source "drivers/media/dvb/dm1105/Kconfig"
source "drivers/media/dvb/firesat/Kconfig"
source "drivers/media/dvb/firewire/Kconfig"
comment "Supported DVB Frontends"
depends on DVB_CORE
......
......@@ -4,4 +4,4 @@
obj-y := dvb-core/ frontends/ ttpci/ ttusb-dec/ ttusb-budget/ b2c2/ bt8xx/ dvb-usb/ pluto2/ siano/ dm1105/
obj-$(CONFIG_DVB_FIREDTV) += firesat/
obj-$(CONFIG_DVB_FIREDTV) += firewire/
#ifndef _CMP_H
#define _CMP_H
struct firesat;
int cmp_establish_pp_connection(struct firesat *firesat, int plug, int channel);
void cmp_break_pp_connection(struct firesat *firesat, int plug, int channel);
#endif /* _CMP_H */
firedtv-objs := firesat_1394.o \
firesat_dvb.o \
firesat_fe.o \
firesat_iso.o \
avc_api.o \
firedtv-objs := firedtv-1394.o \
firedtv-dvb.o \
firedtv-fe.o \
firedtv-iso.o \
avc.o \
cmp.o \
firesat-rc.o \
firesat-ci.o
firedtv-rc.o \
firedtv-ci.o
obj-$(CONFIG_DVB_FIREDTV) += firedtv.o
......
......@@ -402,31 +402,31 @@ typedef struct
struct dvb_diseqc_master_cmd;
struct dvb_frontend_parameters;
struct firesat;
struct firedtv;
int avc_recv(struct firesat *firesat, u8 *data, size_t length);
int avc_recv(struct firedtv *fdtv, u8 *data, size_t length);
int AVCTuner_DSIT(struct firesat *firesat, int Source_Plug,
int AVCTuner_DSIT(struct firedtv *fdtv, int Source_Plug,
struct dvb_frontend_parameters *params, __u8 *status);
int avc_tuner_status(struct firesat *firesat,
int avc_tuner_status(struct firedtv *fdtv,
ANTENNA_INPUT_INFO *antenna_input_info);
int avc_tuner_dsd(struct firesat *firesat,
int avc_tuner_dsd(struct firedtv *fdtv,
struct dvb_frontend_parameters *params);
int avc_tuner_set_pids(struct firesat *firesat, unsigned char pidc, u16 pid[]);
int avc_tuner_get_ts(struct firesat *firesat);
int avc_identify_subunit(struct firesat *firesat);
int avc_lnb_control(struct firesat *firesat, char voltage, char burst,
int avc_tuner_set_pids(struct firedtv *fdtv, unsigned char pidc, u16 pid[]);
int avc_tuner_get_ts(struct firedtv *fdtv);
int avc_identify_subunit(struct firedtv *fdtv);
int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst,
char conttone, char nrdiseq,
struct dvb_diseqc_master_cmd *diseqcmd);
void avc_remote_ctrl_work(struct work_struct *work);
int avc_register_remote_control(struct firesat *firesat);
int avc_ca_app_info(struct firesat *firesat, char *app_info, unsigned int *len);
int avc_ca_info(struct firesat *firesat, char *app_info, unsigned int *len);
int avc_ca_reset(struct firesat *firesat);
int avc_ca_pmt(struct firesat *firesat, char *app_info, int length);
int avc_ca_get_time_date(struct firesat *firesat, int *interval);
int avc_ca_enter_menu(struct firesat *firesat);
int avc_ca_get_mmi(struct firesat *firesat, char *mmi_object, unsigned int *len);
int avc_register_remote_control(struct firedtv *fdtv);
int avc_ca_app_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
int avc_ca_reset(struct firedtv *fdtv);
int avc_ca_pmt(struct firedtv *fdtv, char *app_info, int length);
int avc_ca_get_time_date(struct firedtv *fdtv, int *interval);
int avc_ca_enter_menu(struct firedtv *fdtv);
int avc_ca_get_mmi(struct firedtv *fdtv, char *mmi_object, unsigned int *len);
#endif /* _AVC_API_H */
......@@ -20,41 +20,41 @@
#include <ieee1394.h>
#include <nodemgr.h>
#include "avc_api.h"
#include "avc.h"
#include "cmp.h"
#include "firesat.h"
#include "firedtv.h"
#define CMP_OUTPUT_PLUG_CONTROL_REG_0 0xfffff0000904ULL
static int cmp_read(struct firesat *firesat, void *buf, u64 addr, size_t len)
static int cmp_read(struct firedtv *fdtv, void *buf, u64 addr, size_t len)
{
int ret;
if (mutex_lock_interruptible(&firesat->avc_mutex))
if (mutex_lock_interruptible(&fdtv->avc_mutex))
return -EINTR;
ret = hpsb_node_read(firesat->ud->ne, addr, buf, len);
ret = hpsb_node_read(fdtv->ud->ne, addr, buf, len);
if (ret < 0)
dev_err(&firesat->ud->device, "CMP: read I/O error\n");
dev_err(&fdtv->ud->device, "CMP: read I/O error\n");
mutex_unlock(&firesat->avc_mutex);
mutex_unlock(&fdtv->avc_mutex);
return ret;
}
static int cmp_lock(struct firesat *firesat, void *data, u64 addr, __be32 arg,
static int cmp_lock(struct firedtv *fdtv, void *data, u64 addr, __be32 arg,
int ext_tcode)
{
int ret;
if (mutex_lock_interruptible(&firesat->avc_mutex))
if (mutex_lock_interruptible(&fdtv->avc_mutex))
return -EINTR;
ret = hpsb_node_lock(firesat->ud->ne, addr, ext_tcode, data,
ret = hpsb_node_lock(fdtv->ud->ne, addr, ext_tcode, data,
(__force quadlet_t)arg);
if (ret < 0)
dev_err(&firesat->ud->device, "CMP: lock I/O error\n");
dev_err(&fdtv->ud->device, "CMP: lock I/O error\n");
mutex_unlock(&firesat->avc_mutex);
mutex_unlock(&fdtv->avc_mutex);
return ret;
}
......@@ -78,20 +78,20 @@ static inline void set_opcr(__be32 *opcr, u32 value, u32 mask, u32 shift)
#define set_opcr_data_rate(p, v) set_opcr((p), (v), 0x3, 14)
#define set_opcr_overhead_id(p, v) set_opcr((p), (v), 0xf, 10)
int cmp_establish_pp_connection(struct firesat *firesat, int plug, int channel)
int cmp_establish_pp_connection(struct firedtv *fdtv, int plug, int channel)
{
__be32 old_opcr, opcr;
u64 opcr_address = CMP_OUTPUT_PLUG_CONTROL_REG_0 + (plug << 2);
int attempts = 0;
int ret;
ret = cmp_read(firesat, &opcr, opcr_address, 4);
ret = cmp_read(fdtv, &opcr, opcr_address, 4);
if (ret < 0)
return ret;
repeat:
if (!get_opcr_online(opcr)) {
dev_err(&firesat->ud->device, "CMP: output offline\n");
dev_err(&fdtv->ud->device, "CMP: output offline\n");
return -EBUSY;
}
......@@ -99,11 +99,11 @@ int cmp_establish_pp_connection(struct firesat *firesat, int plug, int channel)
if (get_opcr_p2p_connections(opcr)) {
if (get_opcr_channel(opcr) != channel) {
dev_err(&firesat->ud->device,
dev_err(&fdtv->ud->device,
"CMP: cannot change channel\n");
return -EBUSY;
}
dev_info(&firesat->ud->device,
dev_info(&fdtv->ud->device,
"CMP: overlaying existing connection\n");
/* We don't allocate isochronous resources. */
......@@ -119,7 +119,7 @@ int cmp_establish_pp_connection(struct firesat *firesat, int plug, int channel)
set_opcr_p2p_connections(&opcr, get_opcr_p2p_connections(opcr) + 1);
ret = cmp_lock(firesat, &opcr, opcr_address, old_opcr, 2);
ret = cmp_lock(fdtv, &opcr, opcr_address, old_opcr, 2);
if (ret < 0)
return ret;
......@@ -137,26 +137,26 @@ int cmp_establish_pp_connection(struct firesat *firesat, int plug, int channel)
return 0;
}
void cmp_break_pp_connection(struct firesat *firesat, int plug, int channel)
void cmp_break_pp_connection(struct firedtv *fdtv, int plug, int channel)
{
__be32 old_opcr, opcr;
u64 opcr_address = CMP_OUTPUT_PLUG_CONTROL_REG_0 + (plug << 2);
int attempts = 0;
if (cmp_read(firesat, &opcr, opcr_address, 4) < 0)
if (cmp_read(fdtv, &opcr, opcr_address, 4) < 0)
return;
repeat:
if (!get_opcr_online(opcr) || !get_opcr_p2p_connections(opcr) ||
get_opcr_channel(opcr) != channel) {
dev_err(&firesat->ud->device, "CMP: no connection to break\n");
dev_err(&fdtv->ud->device, "CMP: no connection to break\n");
return;
}
old_opcr = opcr;
set_opcr_p2p_connections(&opcr, get_opcr_p2p_connections(opcr) - 1);
if (cmp_lock(firesat, &opcr, opcr_address, old_opcr, 2) < 0)
if (cmp_lock(fdtv, &opcr, opcr_address, old_opcr, 2) < 0)
return;
if (old_opcr != opcr) {
......
#ifndef _CMP_H
#define _CMP_H
struct firedtv;
int cmp_establish_pp_connection(struct firedtv *fdtv, int plug, int channel);
void cmp_break_pp_connection(struct firedtv *fdtv, int plug, int channel);
#endif /* _CMP_H */
......@@ -33,17 +33,17 @@
#include <ieee1394_hotplug.h>
#include <nodemgr.h>
#include "avc_api.h"
#include "avc.h"
#include "cmp.h"
#include "firesat.h"
#include "firesat-ci.h"
#include "firesat-rc.h"
#include "firedtv.h"
#include "firedtv-ci.h"
#include "firedtv-rc.h"
#define MATCH_FLAGS IEEE1394_MATCH_VENDOR_ID | IEEE1394_MATCH_MODEL_ID | \
IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION
#define DIGITAL_EVERYWHERE_OUI 0x001287
static struct ieee1394_device_id firesat_id_table[] = {
static struct ieee1394_device_id fdtv_id_table[] = {
{
/* FloppyDTV S/CI and FloppyDTV S2 */
......@@ -90,11 +90,11 @@ static struct ieee1394_device_id firesat_id_table[] = {
}, { }
};
MODULE_DEVICE_TABLE(ieee1394, firesat_id_table);
MODULE_DEVICE_TABLE(ieee1394, fdtv_id_table);
/* list of all firesat devices */
LIST_HEAD(firesat_list);
DEFINE_SPINLOCK(firesat_list_lock);
/* list of all firedtv devices */
LIST_HEAD(fdtv_list);
DEFINE_SPINLOCK(fdtv_list_lock);
static void fcp_request(struct hpsb_host *host,
int nodeid,
......@@ -103,186 +103,186 @@ static void fcp_request(struct hpsb_host *host,
u8 *data,
size_t length)
{
struct firesat *firesat = NULL;
struct firesat *firesat_entry;
struct firedtv *fdtv = NULL;
struct firedtv *fdtv_entry;
unsigned long flags;
if (length > 0 && ((data[0] & 0xf0) >> 4) == 0) {
spin_lock_irqsave(&firesat_list_lock, flags);
list_for_each_entry(firesat_entry,&firesat_list,list) {
if (firesat_entry->ud->ne->host == host &&
firesat_entry->ud->ne->nodeid == nodeid &&
(firesat_entry->subunit == (data[1]&0x7) ||
(firesat_entry->subunit == 0 &&
spin_lock_irqsave(&fdtv_list_lock, flags);
list_for_each_entry(fdtv_entry,&fdtv_list,list) {
if (fdtv_entry->ud->ne->host == host &&
fdtv_entry->ud->ne->nodeid == nodeid &&
(fdtv_entry->subunit == (data[1]&0x7) ||
(fdtv_entry->subunit == 0 &&
(data[1]&0x7) == 0x7))) {
firesat=firesat_entry;
fdtv=fdtv_entry;
break;
}
}
spin_unlock_irqrestore(&firesat_list_lock, flags);
spin_unlock_irqrestore(&fdtv_list_lock, flags);
if (firesat)
avc_recv(firesat, data, length);
if (fdtv)
avc_recv(fdtv, data, length);
}
}
const char *firedtv_model_names[] = {
[FireSAT_UNKNOWN] = "unknown type",
[FireSAT_DVB_S] = "FireDTV S/CI",
[FireSAT_DVB_C] = "FireDTV C/CI",
[FireSAT_DVB_T] = "FireDTV T/CI",
[FireSAT_DVB_S2] = "FireDTV S2 ",
const char *fdtv_model_names[] = {
[FIREDTV_UNKNOWN] = "unknown type",
[FIREDTV_DVB_S] = "FireDTV S/CI",
[FIREDTV_DVB_C] = "FireDTV C/CI",
[FIREDTV_DVB_T] = "FireDTV T/CI",
[FIREDTV_DVB_S2] = "FireDTV S2 ",
};
static int firesat_probe(struct device *dev)
static int fdtv_probe(struct device *dev)
{
struct unit_directory *ud =
container_of(dev, struct unit_directory, device);
struct firesat *firesat;
struct firedtv *fdtv;
unsigned long flags;
int kv_len;
void *kv_str;
int i;
int err = -ENOMEM;
firesat = kzalloc(sizeof(*firesat), GFP_KERNEL);
if (!firesat)
fdtv = kzalloc(sizeof(*fdtv), GFP_KERNEL);
if (!fdtv)
return -ENOMEM;
dev->driver_data = firesat;
firesat->ud = ud;
firesat->subunit = 0;
firesat->isochannel = -1;
firesat->tone = 0xff;
firesat->voltage = 0xff;
dev->driver_data = fdtv;
fdtv->ud = ud;
fdtv->subunit = 0;
fdtv->isochannel = -1;
fdtv->tone = 0xff;
fdtv->voltage = 0xff;
mutex_init(&firesat->avc_mutex);
init_waitqueue_head(&firesat->avc_wait);
firesat->avc_reply_received = true;
mutex_init(&firesat->demux_mutex);
INIT_WORK(&firesat->remote_ctrl_work, avc_remote_ctrl_work);
mutex_init(&fdtv->avc_mutex);
init_waitqueue_head(&fdtv->avc_wait);
fdtv->avc_reply_received = true;
mutex_init(&fdtv->demux_mutex);
INIT_WORK(&fdtv->remote_ctrl_work, avc_remote_ctrl_work);
/* Reading device model from ROM */
kv_len = (ud->model_name_kv->value.leaf.len - 2) * sizeof(quadlet_t);
kv_str = CSR1212_TEXTUAL_DESCRIPTOR_LEAF_DATA(ud->model_name_kv);
for (i = ARRAY_SIZE(firedtv_model_names); --i;)
if (strlen(firedtv_model_names[i]) <= kv_len &&
strncmp(kv_str, firedtv_model_names[i], kv_len) == 0)
for (i = ARRAY_SIZE(fdtv_model_names); --i;)
if (strlen(fdtv_model_names[i]) <= kv_len &&
strncmp(kv_str, fdtv_model_names[i], kv_len) == 0)
break;
firesat->type = i;
fdtv->type = i;
/*
* Work around a bug in udev's path_id script: Use the fw-host's dev
* instead of the unit directory's dev as parent of the input device.
*/
err = firesat_register_rc(firesat, dev->parent->parent);
err = fdtv_register_rc(fdtv, dev->parent->parent);
if (err)
goto fail_free;
INIT_LIST_HEAD(&firesat->list);
spin_lock_irqsave(&firesat_list_lock, flags);
list_add_tail(&firesat->list, &firesat_list);
spin_unlock_irqrestore(&firesat_list_lock, flags);
INIT_LIST_HEAD(&fdtv->list);
spin_lock_irqsave(&fdtv_list_lock, flags);
list_add_tail(&fdtv->list, &fdtv_list);
spin_unlock_irqrestore(&fdtv_list_lock, flags);
err = avc_identify_subunit(firesat);
err = avc_identify_subunit(fdtv);
if (err)
goto fail;
err = firesat_dvbdev_init(firesat, dev);
err = fdtv_dvbdev_init(fdtv, dev);
if (err)
goto fail;
avc_register_remote_control(firesat);
avc_register_remote_control(fdtv);
return 0;
fail:
spin_lock_irqsave(&firesat_list_lock, flags);
list_del(&firesat->list);
spin_unlock_irqrestore(&firesat_list_lock, flags);
firesat_unregister_rc(firesat);
spin_lock_irqsave(&fdtv_list_lock, flags);
list_del(&fdtv->list);
spin_unlock_irqrestore(&fdtv_list_lock, flags);
fdtv_unregister_rc(fdtv);
fail_free:
kfree(firesat);
kfree(fdtv);
return err;
}
static int firesat_remove(struct device *dev)
static int fdtv_remove(struct device *dev)
{
struct firesat *firesat = dev->driver_data;
struct firedtv *fdtv = dev->driver_data;
unsigned long flags;
firesat_ca_release(firesat);
dvb_unregister_frontend(&firesat->fe);
dvb_net_release(&firesat->dvbnet);
firesat->demux.dmx.close(&firesat->demux.dmx);
firesat->demux.dmx.remove_frontend(&firesat->demux.dmx,
&firesat->frontend);
dvb_dmxdev_release(&firesat->dmxdev);
dvb_dmx_release(&firesat->demux);
dvb_unregister_adapter(&firesat->adapter);
fdtv_ca_release(fdtv);
dvb_unregister_frontend(&fdtv->fe);
dvb_net_release(&fdtv->dvbnet);
fdtv->demux.dmx.close(&fdtv->demux.dmx);
fdtv->demux.dmx.remove_frontend(&fdtv->demux.dmx,
&fdtv->frontend);
dvb_dmxdev_release(&fdtv->dmxdev);
dvb_dmx_release(&fdtv->demux);
dvb_unregister_adapter(&fdtv->adapter);
spin_lock_irqsave(&firesat_list_lock, flags);
list_del(&firesat->list);
spin_unlock_irqrestore(&firesat_list_lock, flags);
spin_lock_irqsave(&fdtv_list_lock, flags);
list_del(&fdtv->list);
spin_unlock_irqrestore(&fdtv_list_lock, flags);
cancel_work_sync(&firesat->remote_ctrl_work);
firesat_unregister_rc(firesat);
cancel_work_sync(&fdtv->remote_ctrl_work);
fdtv_unregister_rc(fdtv);
kfree(firesat);
kfree(fdtv);
return 0;
}
static int firesat_update(struct unit_directory *ud)
static int fdtv_update(struct unit_directory *ud)
{
struct firesat *firesat = ud->device.driver_data;
struct firedtv *fdtv = ud->device.driver_data;
if (firesat->isochannel >= 0)
cmp_establish_pp_connection(firesat, firesat->subunit,
firesat->isochannel);
if (fdtv->isochannel >= 0)
cmp_establish_pp_connection(fdtv, fdtv->subunit,
fdtv->isochannel);
return 0;
}
static struct hpsb_protocol_driver firesat_driver = {
static struct hpsb_protocol_driver fdtv_driver = {
.name = "firedtv",
.id_table = firesat_id_table,
.update = firesat_update,
.id_table = fdtv_id_table,
.update = fdtv_update,
.driver = {
//.name and .bus are filled in for us in more recent linux versions
//.name = "FireSAT",
//.name = "FireDTV",
//.bus = &ieee1394_bus_type,
.probe = firesat_probe,
.remove = firesat_remove,
.probe = fdtv_probe,
.remove = fdtv_remove,
},
};
static struct hpsb_highlevel firesat_highlevel = {
static struct hpsb_highlevel fdtv_highlevel = {
.name = "firedtv",
.fcp_request = fcp_request,
};
static int __init firesat_init(void)
static int __init fdtv_init(void)
{
int ret;
hpsb_register_highlevel(&firesat_highlevel);
ret = hpsb_register_protocol(&firesat_driver);
hpsb_register_highlevel(&fdtv_highlevel);
ret = hpsb_register_protocol(&fdtv_driver);
if (ret) {
printk(KERN_ERR "firedtv: failed to register protocol\n");
hpsb_unregister_highlevel(&firesat_highlevel);
hpsb_unregister_highlevel(&fdtv_highlevel);
}
return ret;
}
static void __exit firesat_exit(void)
static void __exit fdtv_exit(void)
{
hpsb_unregister_protocol(&firesat_driver);
hpsb_unregister_highlevel(&firesat_highlevel);
hpsb_unregister_protocol(&fdtv_driver);
hpsb_unregister_highlevel(&fdtv_highlevel);
}
module_init(firesat_init);
module_exit(firesat_exit);
module_init(fdtv_init);
module_exit(fdtv_exit);
MODULE_AUTHOR("Andreas Monitzer <andy@monitzer.com>");
MODULE_AUTHOR("Ben Backx <ben@bbackx.com>");
......
......@@ -16,11 +16,11 @@
#include <dvbdev.h>
#include "avc_api.h"
#include "firesat.h"
#include "firesat-ci.h"
#include "avc.h"
#include "firedtv.h"
#include "firedtv-ci.h"
static int firesat_ca_ready(ANTENNA_INPUT_INFO *info)
static int fdtv_ca_ready(ANTENNA_INPUT_INFO *info)
{
return info->CaInitializationStatus == 1 &&
info->CaErrorFlag == 0 &&
......@@ -28,7 +28,7 @@ static int firesat_ca_ready(ANTENNA_INPUT_INFO *info)
info->CaModulePresentStatus == 1;
}
static int firesat_get_ca_flags(ANTENNA_INPUT_INFO *info)
static int fdtv_get_ca_flags(ANTENNA_INPUT_INFO *info)
{
int flags = 0;
......@@ -41,12 +41,12 @@ static int firesat_get_ca_flags(ANTENNA_INPUT_INFO *info)
return flags;
}
static int firesat_ca_reset(struct firesat *firesat)
static int fdtv_ca_reset(struct firedtv *fdtv)
{
return avc_ca_reset(firesat) ? -EFAULT : 0;
return avc_ca_reset(fdtv) ? -EFAULT : 0;
}
static int firesat_ca_get_caps(void *arg)
static int fdtv_ca_get_caps(void *arg)
{
struct ca_caps *cap = arg;
......@@ -57,73 +57,73 @@ static int firesat_ca_get_caps(void *arg)
return 0;
}
static int firesat_ca_get_slot_info(struct firesat *firesat, void *arg)
static int fdtv_ca_get_slot_info(struct firedtv *fdtv, void *arg)
{
ANTENNA_INPUT_INFO info;
struct ca_slot_info *slot = arg;
if (avc_tuner_status(firesat, &info))
if (avc_tuner_status(fdtv, &info))
return -EFAULT;
if (slot->num != 0)
return -EFAULT;
slot->type = CA_CI;
slot->flags = firesat_get_ca_flags(&info);
slot->flags = fdtv_get_ca_flags(&info);
return 0;
}
static int firesat_ca_app_info(struct firesat *firesat, void *arg)
static int fdtv_ca_app_info(struct firedtv *fdtv, void *arg)
{
struct ca_msg *reply = arg;
return
avc_ca_app_info(firesat, reply->msg, &reply->length) ? -EFAULT : 0;
avc_ca_app_info(fdtv, reply->msg, &reply->length) ? -EFAULT : 0;
}
static int firesat_ca_info(struct firesat *firesat, void *arg)
static int fdtv_ca_info(struct firedtv *fdtv, void *arg)
{
struct ca_msg *reply = arg;
return avc_ca_info(firesat, reply->msg, &reply->length) ? -EFAULT : 0;
return avc_ca_info(fdtv, reply->msg, &reply->length) ? -EFAULT : 0;
}
static int firesat_ca_get_mmi(struct firesat *firesat, void *arg)
static int fdtv_ca_get_mmi(struct firedtv *fdtv, void *arg)
{
struct ca_msg *reply = arg;
return
avc_ca_get_mmi(firesat, reply->msg, &reply->length) ? -EFAULT : 0;
avc_ca_get_mmi(fdtv, reply->msg, &reply->length) ? -EFAULT : 0;
}
static int firesat_ca_get_msg(struct firesat *firesat, void *arg)
static int fdtv_ca_get_msg(struct firedtv *fdtv, void *arg)
{
ANTENNA_INPUT_INFO info;
int err;
switch (firesat->ca_last_command) {
switch (fdtv->ca_last_command) {
case TAG_APP_INFO_ENQUIRY:
err = firesat_ca_app_info(firesat, arg);
err = fdtv_ca_app_info(fdtv, arg);
break;
case TAG_CA_INFO_ENQUIRY:
err = firesat_ca_info(firesat, arg);
err = fdtv_ca_info(fdtv, arg);
break;
default:
if (avc_tuner_status(firesat, &info))
if (avc_tuner_status(fdtv, &info))
err = -EFAULT;
else if (info.CaMmi == 1)
err = firesat_ca_get_mmi(firesat, arg);
err = fdtv_ca_get_mmi(fdtv, arg);
else {
printk(KERN_INFO "%s: Unhandled message 0x%08X\n",
__func__, firesat->ca_last_command);
__func__, fdtv->ca_last_command);
err = -EFAULT;
}
}
firesat->ca_last_command = 0;
fdtv->ca_last_command = 0;
return err;
}
static int firesat_ca_pmt(struct firesat *firesat, void *arg)
static int fdtv_ca_pmt(struct firedtv *fdtv, void *arg)
{
struct ca_msg *msg = arg;
int data_pos;
......@@ -139,21 +139,21 @@ static int firesat_ca_pmt(struct firesat *firesat, void *arg)
data_length = msg->msg[3];
}
return avc_ca_pmt(firesat, &msg->msg[data_pos], data_length) ?
return avc_ca_pmt(fdtv, &msg->msg[data_pos], data_length) ?
-EFAULT : 0;
}
static int firesat_ca_send_msg(struct firesat *firesat, void *arg)
static int fdtv_ca_send_msg(struct firedtv *fdtv, void *arg)
{
struct ca_msg *msg = arg;
int err;
/* Do we need a semaphore for this? */
firesat->ca_last_command =
fdtv->ca_last_command =
(msg->msg[0] << 16) + (msg->msg[1] << 8) + msg->msg[2];
switch (firesat->ca_last_command) {
switch (fdtv->ca_last_command) {
case TAG_CA_PMT:
err = firesat_ca_pmt(firesat, arg);
err = fdtv_ca_pmt(fdtv, arg);
break;
case TAG_APP_INFO_ENQUIRY:
/* handled in ca_get_msg */
......@@ -164,39 +164,39 @@ static int firesat_ca_send_msg(struct firesat *firesat, void *arg)
err = 0;
break;
case TAG_ENTER_MENU:
err = avc_ca_enter_menu(firesat);
err = avc_ca_enter_menu(fdtv);
break;
default:
printk(KERN_ERR "%s: Unhandled unknown message 0x%08X\n",
__func__, firesat->ca_last_command);
__func__, fdtv->ca_last_command);
err = -EFAULT;
}
return err;
}
static int firesat_ca_ioctl(struct inode *inode, struct file *file,
static int fdtv_ca_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *arg)
{
struct dvb_device *dvbdev = file->private_data;
struct firesat *firesat = dvbdev->priv;
struct firedtv *fdtv = dvbdev->priv;
ANTENNA_INPUT_INFO info;
int err;
switch(cmd) {
case CA_RESET:
err = firesat_ca_reset(firesat);
err = fdtv_ca_reset(fdtv);
break;
case CA_GET_CAP:
err = firesat_ca_get_caps(arg);
err = fdtv_ca_get_caps(arg);
break;
case CA_GET_SLOT_INFO:
err = firesat_ca_get_slot_info(firesat, arg);
err = fdtv_ca_get_slot_info(fdtv, arg);
break;
case CA_GET_MSG:
err = firesat_ca_get_msg(firesat, arg);
err = fdtv_ca_get_msg(fdtv, arg);
break;
case CA_SEND_MSG:
err = firesat_ca_send_msg(firesat, arg);
err = fdtv_ca_send_msg(fdtv, arg);
break;
default:
printk(KERN_INFO "%s: Unhandled ioctl, command: %u\n",__func__,
......@@ -205,57 +205,57 @@ static int firesat_ca_ioctl(struct inode *inode, struct file *file,
}
/* FIXME Is this necessary? */
avc_tuner_status(firesat, &info);
avc_tuner_status(fdtv, &info);
return err;
}
static unsigned int firesat_ca_io_poll(struct file *file, poll_table *wait)
static unsigned int fdtv_ca_io_poll(struct file *file, poll_table *wait)
{
return POLLIN;
}
static struct file_operations firesat_ca_fops = {
static struct file_operations fdtv_ca_fops = {
.owner = THIS_MODULE,
.ioctl = dvb_generic_ioctl,
.open = dvb_generic_open,
.release = dvb_generic_release,
.poll = firesat_ca_io_poll,
.poll = fdtv_ca_io_poll,
};
static struct dvb_device firesat_ca = {
static struct dvb_device fdtv_ca = {
.users = 1,
.readers = 1,
.writers = 1,
.fops = &firesat_ca_fops,
.kernel_ioctl = firesat_ca_ioctl,
.fops = &fdtv_ca_fops,
.kernel_ioctl = fdtv_ca_ioctl,
};
int firesat_ca_register(struct firesat *firesat)
int fdtv_ca_register(struct firedtv *fdtv)
{
ANTENNA_INPUT_INFO info;
int err;
if (avc_tuner_status(firesat, &info))
if (avc_tuner_status(fdtv, &info))
return -EINVAL;
if (!firesat_ca_ready(&info))
if (!fdtv_ca_ready(&info))
return -EFAULT;
err = dvb_register_device(&firesat->adapter, &firesat->cadev,
&firesat_ca, firesat, DVB_DEVICE_CA);
err = dvb_register_device(&fdtv->adapter, &fdtv->cadev,
&fdtv_ca, fdtv, DVB_DEVICE_CA);
if (info.CaApplicationInfo == 0)
printk(KERN_ERR "%s: CaApplicationInfo is not set.\n",
__func__);
if (info.CaDateTimeRequest == 1)
avc_ca_get_time_date(firesat, &firesat->ca_time_interval);
avc_ca_get_time_date(fdtv, &fdtv->ca_time_interval);
return err;
}
void firesat_ca_release(struct firesat *firesat)
void fdtv_ca_release(struct firedtv *fdtv)
{
if (firesat->cadev)
dvb_unregister_device(firesat->cadev);
if (fdtv->cadev)
dvb_unregister_device(fdtv->cadev);
}
#ifndef _FIREDTV_CI_H
#define _FIREDTV_CI_H
struct firesat;
struct firedtv;
int firesat_ca_register(struct firesat *firesat);
void firesat_ca_release(struct firesat *firesat);
int fdtv_ca_register(struct firedtv *fdtv);
void fdtv_ca_release(struct firedtv *fdtv);
#endif /* _FIREDTV_CI_H */
......@@ -19,65 +19,65 @@
#include <dvb_frontend.h>
#include <dvbdev.h>
#include "avc_api.h"
#include "firesat.h"
#include "firesat-ci.h"
#include "avc.h"
#include "firedtv.h"
#include "firedtv-ci.h"
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static struct firesat_channel *firesat_channel_allocate(struct firesat *firesat)
static struct firedtv_channel *fdtv_channel_allocate(struct firedtv *fdtv)
{
struct firesat_channel *c = NULL;
struct firedtv_channel *c = NULL;
int k;
if (mutex_lock_interruptible(&firesat->demux_mutex))
if (mutex_lock_interruptible(&fdtv->demux_mutex))
return NULL;
for (k = 0; k < 16; k++)
if (!firesat->channel[k].active) {
firesat->channel[k].active = true;
c = &firesat->channel[k];
if (!fdtv->channel[k].active) {
fdtv->channel[k].active = true;
c = &fdtv->channel[k];
break;
}
mutex_unlock(&firesat->demux_mutex);
mutex_unlock(&fdtv->demux_mutex);
return c;
}
static int firesat_channel_collect(struct firesat *firesat, int *pidc, u16 pid[])
static int fdtv_channel_collect(struct firedtv *fdtv, int *pidc, u16 pid[])
{
int k, l = 0;
if (mutex_lock_interruptible(&firesat->demux_mutex))
if (mutex_lock_interruptible(&fdtv->demux_mutex))
return -EINTR;
for (k = 0; k < 16; k++)
if (firesat->channel[k].active)
pid[l++] = firesat->channel[k].pid;
if (fdtv->channel[k].active)
pid[l++] = fdtv->channel[k].pid;
mutex_unlock(&firesat->demux_mutex);
mutex_unlock(&fdtv->demux_mutex);
*pidc = l;
return 0;
}
static int firesat_channel_release(struct firesat *firesat,
struct firesat_channel *channel)
static int fdtv_channel_release(struct firedtv *fdtv,
struct firedtv_channel *channel)
{
if (mutex_lock_interruptible(&firesat->demux_mutex))
if (mutex_lock_interruptible(&fdtv->demux_mutex))
return -EINTR;
channel->active = false;
mutex_unlock(&firesat->demux_mutex);
mutex_unlock(&fdtv->demux_mutex);
return 0;
}
int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed)
int fdtv_start_feed(struct dvb_demux_feed *dvbdmxfeed)
{
struct firesat *firesat = (struct firesat*)dvbdmxfeed->demux->priv;
struct firesat_channel *channel;
struct firedtv *fdtv = (struct firedtv*)dvbdmxfeed->demux->priv;
struct firedtv_channel *channel;
int pidc,k;
u16 pids[16];
......@@ -98,14 +98,14 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed)
case DMX_TS_PES_TELETEXT:
case DMX_TS_PES_PCR:
case DMX_TS_PES_OTHER:
//Dirty fix to keep firesat->channel pid-list up to date
//Dirty fix to keep fdtv->channel pid-list up to date
for(k=0;k<16;k++){
if (!firesat->channel[k].active)
firesat->channel[k].pid =
if (!fdtv->channel[k].active)
fdtv->channel[k].pid =
dvbdmxfeed->pid;
break;
}
channel = firesat_channel_allocate(firesat);
channel = fdtv_channel_allocate(fdtv);
break;
default:
printk(KERN_ERR "%s: invalid pes type %u\n",
......@@ -113,7 +113,7 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed)
return -EINVAL;
}
} else {
channel = firesat_channel_allocate(firesat);
channel = fdtv_channel_allocate(fdtv);
}
if (!channel) {
......@@ -124,24 +124,24 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed)
dvbdmxfeed->priv = channel;
channel->pid = dvbdmxfeed->pid;
if (firesat_channel_collect(firesat, &pidc, pids)) {
firesat_channel_release(firesat, channel);
if (fdtv_channel_collect(fdtv, &pidc, pids)) {
fdtv_channel_release(fdtv, channel);
printk(KERN_ERR "%s: could not collect pids!\n", __func__);
return -EINTR;
}
if (dvbdmxfeed->pid == 8192) {
k = avc_tuner_get_ts(firesat);
k = avc_tuner_get_ts(fdtv);
if (k) {
firesat_channel_release(firesat, channel);
fdtv_channel_release(fdtv, channel);
printk("%s: AVCTuner_GetTS failed with error %d\n",
__func__, k);
return k;
}
} else {
k = avc_tuner_set_pids(firesat, pidc, pids);
k = avc_tuner_set_pids(fdtv, pidc, pids);
if (k) {
firesat_channel_release(firesat, channel);
fdtv_channel_release(fdtv, channel);
printk("%s: AVCTuner_SetPIDs failed with error %d\n",
__func__, k);
return k;
......@@ -151,11 +151,11 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed)
return 0;
}
int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
int fdtv_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
{
struct dvb_demux *demux = dvbdmxfeed->demux;
struct firesat *firesat = (struct firesat*)demux->priv;
struct firesat_channel *c = dvbdmxfeed->priv;
struct firedtv *fdtv = (struct firedtv*)demux->priv;
struct firedtv_channel *c = dvbdmxfeed->priv;
int k, l;
u16 pids[16];
......@@ -179,95 +179,95 @@ int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
return 0;
}
if (mutex_lock_interruptible(&firesat->demux_mutex))
if (mutex_lock_interruptible(&fdtv->demux_mutex))
return -EINTR;
/* list except channel to be removed */
for (k = 0, l = 0; k < 16; k++)
if (firesat->channel[k].active) {
if (&firesat->channel[k] != c)
pids[l++] = firesat->channel[k].pid;
if (fdtv->channel[k].active) {
if (&fdtv->channel[k] != c)
pids[l++] = fdtv->channel[k].pid;
else
firesat->channel[k].active = false;
fdtv->channel[k].active = false;
}
k = avc_tuner_set_pids(firesat, l, pids);
k = avc_tuner_set_pids(fdtv, l, pids);
if (!k)
c->active = false;
mutex_unlock(&firesat->demux_mutex);
mutex_unlock(&fdtv->demux_mutex);
return k;
}
int firesat_dvbdev_init(struct firesat *firesat, struct device *dev)
int fdtv_dvbdev_init(struct firedtv *fdtv, struct device *dev)
{
int err;
err = DVB_REGISTER_ADAPTER(&firesat->adapter,
firedtv_model_names[firesat->type],
err = DVB_REGISTER_ADAPTER(&fdtv->adapter,
fdtv_model_names[fdtv->type],
THIS_MODULE, dev, adapter_nr);
if (err < 0)
goto fail_log;
/*DMX_TS_FILTERING | DMX_SECTION_FILTERING*/
firesat->demux.dmx.capabilities = 0;
fdtv->demux.dmx.capabilities = 0;
firesat->demux.priv = (void *)firesat;
firesat->demux.filternum = 16;
firesat->demux.feednum = 16;
firesat->demux.start_feed = firesat_start_feed;
firesat->demux.stop_feed = firesat_stop_feed;
firesat->demux.write_to_decoder = NULL;
fdtv->demux.priv = fdtv;
fdtv->demux.filternum = 16;
fdtv->demux.feednum = 16;
fdtv->demux.start_feed = fdtv_start_feed;
fdtv->demux.stop_feed = fdtv_stop_feed;
fdtv->demux.write_to_decoder = NULL;
err = dvb_dmx_init(&firesat->demux);
err = dvb_dmx_init(&fdtv->demux);
if (err)
goto fail_unreg_adapter;
firesat->dmxdev.filternum = 16;
firesat->dmxdev.demux = &firesat->demux.dmx;
firesat->dmxdev.capabilities = 0;
fdtv->dmxdev.filternum = 16;
fdtv->dmxdev.demux = &fdtv->demux.dmx;
fdtv->dmxdev.capabilities = 0;
err = dvb_dmxdev_init(&firesat->dmxdev, &firesat->adapter);
err = dvb_dmxdev_init(&fdtv->dmxdev, &fdtv->adapter);
if (err)
goto fail_dmx_release;
firesat->frontend.source = DMX_FRONTEND_0;
fdtv->frontend.source = DMX_FRONTEND_0;
err = firesat->demux.dmx.add_frontend(&firesat->demux.dmx,
&firesat->frontend);
err = fdtv->demux.dmx.add_frontend(&fdtv->demux.dmx,
&fdtv->frontend);
if (err)
goto fail_dmxdev_release;
err = firesat->demux.dmx.connect_frontend(&firesat->demux.dmx,
&firesat->frontend);
err = fdtv->demux.dmx.connect_frontend(&fdtv->demux.dmx,
&fdtv->frontend);
if (err)
goto fail_rem_frontend;
dvb_net_init(&firesat->adapter, &firesat->dvbnet, &firesat->demux.dmx);
dvb_net_init(&fdtv->adapter, &fdtv->dvbnet, &fdtv->demux.dmx);
firesat_frontend_init(firesat);
err = dvb_register_frontend(&firesat->adapter, &firesat->fe);
fdtv_frontend_init(fdtv);
err = dvb_register_frontend(&fdtv->adapter, &fdtv->fe);
if (err)
goto fail_net_release;
err = firesat_ca_register(firesat);
err = fdtv_ca_register(fdtv);
if (err)
dev_info(dev, "Conditional Access Module not enabled\n");
return 0;
fail_net_release:
dvb_net_release(&firesat->dvbnet);
firesat->demux.dmx.close(&firesat->demux.dmx);
dvb_net_release(&fdtv->dvbnet);
fdtv->demux.dmx.close(&fdtv->demux.dmx);
fail_rem_frontend:
firesat->demux.dmx.remove_frontend(&firesat->demux.dmx,
&firesat->frontend);
fdtv->demux.dmx.remove_frontend(&fdtv->demux.dmx,
&fdtv->frontend);
fail_dmxdev_release:
dvb_dmxdev_release(&firesat->dmxdev);
dvb_dmxdev_release(&fdtv->dmxdev);
fail_dmx_release:
dvb_dmx_release(&firesat->demux);
dvb_dmx_release(&fdtv->demux);
fail_unreg_adapter:
dvb_unregister_adapter(&firesat->adapter);
dvb_unregister_adapter(&fdtv->adapter);
fail_log:
dev_err(dev, "DVB initialization failed\n");
return err;
......
......@@ -17,77 +17,77 @@
#include <dvb_frontend.h>
#include "avc_api.h"
#include "avc.h"
#include "cmp.h"
#include "firesat.h"
#include "firedtv.h"
static int firesat_dvb_init(struct dvb_frontend *fe)
static int fdtv_dvb_init(struct dvb_frontend *fe)
{
struct firesat *firesat = fe->sec_priv;
struct firedtv *fdtv = fe->sec_priv;
int err;
/* FIXME - allocate free channel at IRM */
firesat->isochannel = firesat->adapter.num;
fdtv->isochannel = fdtv->adapter.num;
err = cmp_establish_pp_connection(firesat, firesat->subunit,
firesat->isochannel);
err = cmp_establish_pp_connection(fdtv, fdtv->subunit,
fdtv->isochannel);
if (err) {
printk(KERN_ERR "Could not establish point to point "
"connection.\n");
return err;
}
return setup_iso_channel(firesat);
return setup_iso_channel(fdtv);
}
static int firesat_sleep(struct dvb_frontend *fe)
static int fdtv_sleep(struct dvb_frontend *fe)
{
struct firesat *firesat = fe->sec_priv;
struct firedtv *fdtv = fe->sec_priv;
tear_down_iso_channel(firesat);
cmp_break_pp_connection(firesat, firesat->subunit, firesat->isochannel);
firesat->isochannel = -1;
tear_down_iso_channel(fdtv);
cmp_break_pp_connection(fdtv, fdtv->subunit, fdtv->isochannel);
fdtv->isochannel = -1;
return 0;
}
static int firesat_diseqc_send_master_cmd(struct dvb_frontend *fe,
static int fdtv_diseqc_send_master_cmd(struct dvb_frontend *fe,
struct dvb_diseqc_master_cmd *cmd)
{
struct firesat *firesat = fe->sec_priv;
struct firedtv *fdtv = fe->sec_priv;
return avc_lnb_control(firesat, LNBCONTROL_DONTCARE,
return avc_lnb_control(fdtv, LNBCONTROL_DONTCARE,
LNBCONTROL_DONTCARE, LNBCONTROL_DONTCARE, 1, cmd);
}
static int firesat_diseqc_send_burst(struct dvb_frontend *fe,
static int fdtv_diseqc_send_burst(struct dvb_frontend *fe,
fe_sec_mini_cmd_t minicmd)
{
return 0;
}
static int firesat_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
static int fdtv_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
{
struct firesat *firesat = fe->sec_priv;
struct firedtv *fdtv = fe->sec_priv;
firesat->tone = tone;
fdtv->tone = tone;
return 0;
}
static int firesat_set_voltage(struct dvb_frontend *fe,
static int fdtv_set_voltage(struct dvb_frontend *fe,
fe_sec_voltage_t voltage)
{
struct firesat *firesat = fe->sec_priv;
struct firedtv *fdtv = fe->sec_priv;
firesat->voltage = voltage;
fdtv->voltage = voltage;
return 0;
}
static int firesat_read_status(struct dvb_frontend *fe, fe_status_t *status)
static int fdtv_read_status(struct dvb_frontend *fe, fe_status_t *status)
{
struct firesat *firesat = fe->sec_priv;
struct firedtv *fdtv = fe->sec_priv;
ANTENNA_INPUT_INFO info;
if (avc_tuner_status(firesat, &info))
if (avc_tuner_status(fdtv, &info))
return -EINVAL;
if (info.NoRF)
......@@ -98,12 +98,12 @@ static int firesat_read_status(struct dvb_frontend *fe, fe_status_t *status)
return 0;
}
static int firesat_read_ber(struct dvb_frontend *fe, u32 *ber)
static int fdtv_read_ber(struct dvb_frontend *fe, u32 *ber)
{
struct firesat *firesat = fe->sec_priv;
struct firedtv *fdtv = fe->sec_priv;
ANTENNA_INPUT_INFO info;
if (avc_tuner_status(firesat, &info))
if (avc_tuner_status(fdtv, &info))
return -EINVAL;
*ber = info.BER[0] << 24 | info.BER[1] << 16 |
......@@ -111,24 +111,24 @@ static int firesat_read_ber(struct dvb_frontend *fe, u32 *ber)
return 0;
}
static int firesat_read_signal_strength (struct dvb_frontend *fe, u16 *strength)
static int fdtv_read_signal_strength (struct dvb_frontend *fe, u16 *strength)
{
struct firesat *firesat = fe->sec_priv;
struct firedtv *fdtv = fe->sec_priv;
ANTENNA_INPUT_INFO info;
if (avc_tuner_status(firesat, &info))
if (avc_tuner_status(fdtv, &info))
return -EINVAL;
*strength = info.SignalStrength << 8;
return 0;
}
static int firesat_read_snr(struct dvb_frontend *fe, u16 *snr)
static int fdtv_read_snr(struct dvb_frontend *fe, u16 *snr)
{
struct firesat *firesat = fe->sec_priv;
struct firedtv *fdtv = fe->sec_priv;
ANTENNA_INPUT_INFO info;
if (avc_tuner_status(firesat, &info))
if (avc_tuner_status(fdtv, &info))
return -EINVAL;
/* C/N[dB] = -10 * log10(snr / 65535) */
......@@ -137,53 +137,53 @@ static int firesat_read_snr(struct dvb_frontend *fe, u16 *snr)
return 0;
}
static int firesat_read_uncorrected_blocks(struct dvb_frontend *fe, u32 *ucblocks)
static int fdtv_read_uncorrected_blocks(struct dvb_frontend *fe, u32 *ucblocks)
{
return -EOPNOTSUPP;
}
static int firesat_set_frontend(struct dvb_frontend *fe,
static int fdtv_set_frontend(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
struct firesat *firesat = fe->sec_priv;
struct firedtv *fdtv = fe->sec_priv;
/* FIXME: avc_tuner_dsd never returns ACCEPTED. Check status? */
if (avc_tuner_dsd(firesat, params) != ACCEPTED)
if (avc_tuner_dsd(fdtv, params) != ACCEPTED)
return -EINVAL;
else
return 0; /* not sure of this... */
}
static int firesat_get_frontend(struct dvb_frontend *fe,
static int fdtv_get_frontend(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
return -EOPNOTSUPP;
}
void firesat_frontend_init(struct firesat *firesat)
void fdtv_frontend_init(struct firedtv *fdtv)
{
struct dvb_frontend_ops *ops = &firesat->fe.ops;
struct dvb_frontend_ops *ops = &fdtv->fe.ops;
struct dvb_frontend_info *fi = &ops->info;
ops->init = firesat_dvb_init;
ops->sleep = firesat_sleep;
ops->init = fdtv_dvb_init;
ops->sleep = fdtv_sleep;
ops->set_frontend = firesat_set_frontend;
ops->get_frontend = firesat_get_frontend;
ops->set_frontend = fdtv_set_frontend;
ops->get_frontend = fdtv_get_frontend;
ops->read_status = firesat_read_status;
ops->read_ber = firesat_read_ber;
ops->read_signal_strength = firesat_read_signal_strength;
ops->read_snr = firesat_read_snr;
ops->read_ucblocks = firesat_read_uncorrected_blocks;
ops->read_status = fdtv_read_status;
ops->read_ber = fdtv_read_ber;
ops->read_signal_strength = fdtv_read_signal_strength;
ops->read_snr = fdtv_read_snr;
ops->read_ucblocks = fdtv_read_uncorrected_blocks;
ops->diseqc_send_master_cmd = firesat_diseqc_send_master_cmd;
ops->diseqc_send_burst = firesat_diseqc_send_burst;
ops->set_tone = firesat_set_tone;
ops->set_voltage = firesat_set_voltage;
ops->diseqc_send_master_cmd = fdtv_diseqc_send_master_cmd;
ops->diseqc_send_burst = fdtv_diseqc_send_burst;
ops->set_tone = fdtv_set_tone;
ops->set_voltage = fdtv_set_voltage;
switch (firesat->type) {
case FireSAT_DVB_S:
switch (fdtv->type) {
case FIREDTV_DVB_S:
fi->type = FE_QPSK;
fi->frequency_min = 950000;
......@@ -202,7 +202,7 @@ void firesat_frontend_init(struct firesat *firesat)
FE_CAN_QPSK;
break;
case FireSAT_DVB_C:
case FIREDTV_DVB_C:
fi->type = FE_QAM;
fi->frequency_min = 47000000;
......@@ -220,7 +220,7 @@ void firesat_frontend_init(struct firesat *firesat)
FE_CAN_QAM_AUTO;
break;
case FireSAT_DVB_T:
case FIREDTV_DVB_T:
fi->type = FE_OFDM;
fi->frequency_min = 49000000;
......@@ -236,10 +236,10 @@ void firesat_frontend_init(struct firesat *firesat)
default:
printk(KERN_ERR "FireDTV: no frontend for model type %d\n",
firesat->type);
fdtv->type);
}
strcpy(fi->name, firedtv_model_names[firesat->type]);
strcpy(fi->name, fdtv_model_names[fdtv->type]);
firesat->fe.dvb = &firesat->adapter;
firesat->fe.sec_priv = firesat;
fdtv->fe.dvb = &fdtv->adapter;
fdtv->fe.sec_priv = fdtv;
}
......@@ -20,35 +20,35 @@
#include <iso.h>
#include <nodemgr.h>
#include "firesat.h"
#include "firedtv.h"
static void rawiso_activity_cb(struct hpsb_iso *iso);
void tear_down_iso_channel(struct firesat *firesat)
void tear_down_iso_channel(struct firedtv *fdtv)
{
if (firesat->iso_handle != NULL) {
hpsb_iso_stop(firesat->iso_handle);
hpsb_iso_shutdown(firesat->iso_handle);
if (fdtv->iso_handle != NULL) {
hpsb_iso_stop(fdtv->iso_handle);
hpsb_iso_shutdown(fdtv->iso_handle);
}
firesat->iso_handle = NULL;
fdtv->iso_handle = NULL;
}
int setup_iso_channel(struct firesat *firesat)
int setup_iso_channel(struct firedtv *fdtv)
{
int result;
firesat->iso_handle =
hpsb_iso_recv_init(firesat->ud->ne->host,
fdtv->iso_handle =
hpsb_iso_recv_init(fdtv->ud->ne->host,
256 * 200, //data_buf_size,
256, //buf_packets,
firesat->isochannel,
fdtv->isochannel,
HPSB_ISO_DMA_DEFAULT, //dma_mode,
-1, //stat.config.irq_interval,
rawiso_activity_cb);
if (firesat->iso_handle == NULL) {
if (fdtv->iso_handle == NULL) {
printk(KERN_ERR "Cannot initialize iso receive.\n");
return -EINVAL;
}
result = hpsb_iso_recv_start(firesat->iso_handle, -1, -1, 0);
result = hpsb_iso_recv_start(fdtv->iso_handle, -1, -1, 0);
if (result != 0) {
printk(KERN_ERR "Cannot start iso receive.\n");
return -EINVAL;
......@@ -62,19 +62,19 @@ static void rawiso_activity_cb(struct hpsb_iso *iso)
unsigned int i;
unsigned int packet;
unsigned long flags;
struct firesat *firesat = NULL;
struct firesat *firesat_iterator;
struct firedtv *fdtv = NULL;
struct firedtv *fdtv_iterator;
spin_lock_irqsave(&firesat_list_lock, flags);
list_for_each_entry(firesat_iterator, &firesat_list, list) {
if(firesat_iterator->iso_handle == iso) {
firesat = firesat_iterator;
spin_lock_irqsave(&fdtv_list_lock, flags);
list_for_each_entry(fdtv_iterator, &fdtv_list, list) {
if(fdtv_iterator->iso_handle == iso) {
fdtv = fdtv_iterator;
break;
}
}
spin_unlock_irqrestore(&firesat_list_lock, flags);
spin_unlock_irqrestore(&fdtv_list_lock, flags);
if (firesat) {
if (fdtv) {
packet = iso->first_packet;
num = hpsb_iso_n_ready(iso);
for (i = 0; i < num; i++,
......@@ -91,7 +91,7 @@ static void rawiso_activity_cb(struct hpsb_iso *iso)
while (count --) {
if (buf[sizeof(struct firewireheader)] == 0x47)
dvb_dmx_swfilter_packets(&firesat->demux,
dvb_dmx_swfilter_packets(&fdtv->demux,
&buf[sizeof(struct firewireheader)], 1);
else
printk("%s: invalid packet, skipping\n", __func__);
......
......@@ -15,8 +15,8 @@
#include <linux/string.h>
#include <linux/types.h>
#include "firesat-rc.h"
#include "firesat.h"
#include "firedtv-rc.h"
#include "firedtv.h"
/* fixed table with older keycodes, geared towards MythTV */
const static u16 oldtable[] = {
......@@ -125,7 +125,7 @@ const static u16 keytable[] = {
[0x34] = KEY_EXIT,
};
int firesat_register_rc(struct firesat *firesat, struct device *dev)
int fdtv_register_rc(struct firedtv *fdtv, struct device *dev)
{
struct input_dev *idev;
int i, err;
......@@ -134,7 +134,7 @@ int firesat_register_rc(struct firesat *firesat, struct device *dev)
if (!idev)
return -ENOMEM;
firesat->remote_ctrl_dev = idev;
fdtv->remote_ctrl_dev = idev;
idev->name = "FireDTV remote control";
idev->dev.parent = dev;
idev->evbit[0] = BIT_MASK(EV_KEY);
......@@ -162,15 +162,15 @@ int firesat_register_rc(struct firesat *firesat, struct device *dev)
return err;
}
void firesat_unregister_rc(struct firesat *firesat)
void fdtv_unregister_rc(struct firedtv *fdtv)
{
kfree(firesat->remote_ctrl_dev->keycode);
input_unregister_device(firesat->remote_ctrl_dev);
kfree(fdtv->remote_ctrl_dev->keycode);
input_unregister_device(fdtv->remote_ctrl_dev);
}
void firesat_handle_rc(struct firesat *firesat, unsigned int code)
void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code)
{
u16 *keycode = firesat->remote_ctrl_dev->keycode;
u16 *keycode = fdtv->remote_ctrl_dev->keycode;
if (code >= 0x0300 && code <= 0x031f)
code = keycode[code - 0x0300];
......@@ -186,6 +186,6 @@ void firesat_handle_rc(struct firesat *firesat, unsigned int code)
return;
}
input_report_key(firesat->remote_ctrl_dev, code, 1);
input_report_key(firesat->remote_ctrl_dev, code, 0);
input_report_key(fdtv->remote_ctrl_dev, code, 1);
input_report_key(fdtv->remote_ctrl_dev, code, 0);
}
#ifndef _FIREDTV_RC_H
#define _FIREDTV_RC_H
struct firesat;
struct firedtv;
struct device;
int firesat_register_rc(struct firesat *firesat, struct device *dev);
void firesat_unregister_rc(struct firesat *firesat);
void firesat_handle_rc(struct firesat *firesat, unsigned int code);
int fdtv_register_rc(struct firedtv *fdtv, struct device *dev);
void fdtv_unregister_rc(struct firedtv *fdtv);
void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code);
#endif /* _FIREDTV_RC_H */
......@@ -120,18 +120,18 @@
enum model_type {
FireSAT_UNKNOWN = 0,
FireSAT_DVB_S = 1,
FireSAT_DVB_C = 2,
FireSAT_DVB_T = 3,
FireSAT_DVB_S2 = 4,
FIREDTV_UNKNOWN = 0,
FIREDTV_DVB_S = 1,
FIREDTV_DVB_C = 2,
FIREDTV_DVB_T = 3,
FIREDTV_DVB_S2 = 4,
};
struct input_dev;
struct hpsb_iso;
struct unit_directory;
struct firesat {
struct firedtv {
struct dvb_adapter adapter;
struct dmxdev dmxdev;
struct dvb_demux demux;
......@@ -149,7 +149,7 @@ struct firesat {
struct work_struct remote_ctrl_work;
struct input_dev *remote_ctrl_dev;
struct firesat_channel {
struct firedtv_channel {
bool active;
int pid;
} channel[16];
......@@ -206,22 +206,22 @@ struct CIPHeader {
};
};
extern const char *firedtv_model_names[];
extern struct list_head firesat_list;
extern spinlock_t firesat_list_lock;
extern const char *fdtv_model_names[];
extern struct list_head fdtv_list;
extern spinlock_t fdtv_list_lock;
struct device;
/* firesat_dvb.c */
int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed);
int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed);
int firesat_dvbdev_init(struct firesat *firesat, struct device *dev);
/* firedtv-dvb.c */
int fdtv_start_feed(struct dvb_demux_feed *dvbdmxfeed);
int fdtv_stop_feed(struct dvb_demux_feed *dvbdmxfeed);
int fdtv_dvbdev_init(struct firedtv *fdtv, struct device *dev);
/* firesat_fe.c */
void firesat_frontend_init(struct firesat *firesat);
/* firedtv-fe.c */
void fdtv_frontend_init(struct firedtv *fdtv);
/* firesat_iso.c */
int setup_iso_channel(struct firesat *firesat);
void tear_down_iso_channel(struct firesat *firesat);
/* firedtv-iso.c */
int setup_iso_channel(struct firedtv *fdtv);
void tear_down_iso_channel(struct firedtv *fdtv);
#endif /* _FIREDTV_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment