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" ...@@ -51,7 +51,7 @@ comment "Supported SDMC DM1105 Adapters"
depends on DVB_CORE && PCI && I2C depends on DVB_CORE && PCI && I2C
source "drivers/media/dvb/dm1105/Kconfig" source "drivers/media/dvb/dm1105/Kconfig"
source "drivers/media/dvb/firesat/Kconfig" source "drivers/media/dvb/firewire/Kconfig"
comment "Supported DVB Frontends" comment "Supported DVB Frontends"
depends on DVB_CORE depends on DVB_CORE
......
...@@ -4,4 +4,4 @@ ...@@ -4,4 +4,4 @@
obj-y := dvb-core/ frontends/ ttpci/ ttusb-dec/ ttusb-budget/ b2c2/ bt8xx/ dvb-usb/ pluto2/ siano/ dm1105/ 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 \ firedtv-objs := firedtv-1394.o \
firesat_dvb.o \ firedtv-dvb.o \
firesat_fe.o \ firedtv-fe.o \
firesat_iso.o \ firedtv-iso.o \
avc_api.o \ avc.o \
cmp.o \ cmp.o \
firesat-rc.o \ firedtv-rc.o \
firesat-ci.o firedtv-ci.o
obj-$(CONFIG_DVB_FIREDTV) += firedtv.o obj-$(CONFIG_DVB_FIREDTV) += firedtv.o
......
...@@ -25,26 +25,26 @@ ...@@ -25,26 +25,26 @@
#include <ieee1394_transactions.h> #include <ieee1394_transactions.h>
#include <nodemgr.h> #include <nodemgr.h>
#include "avc_api.h" #include "avc.h"
#include "firesat.h" #include "firedtv.h"
#include "firesat-rc.h" #include "firedtv-rc.h"
#define FCP_COMMAND_REGISTER 0xfffff0000b00ULL #define FCP_COMMAND_REGISTER 0xfffff0000b00ULL
static int __avc_write(struct firesat *firesat, static int __avc_write(struct firedtv *fdtv,
const AVCCmdFrm *CmdFrm, AVCRspFrm *RspFrm) const AVCCmdFrm *CmdFrm, AVCRspFrm *RspFrm)
{ {
int err, retry; int err, retry;
if (RspFrm) if (RspFrm)
firesat->avc_reply_received = false; fdtv->avc_reply_received = false;
for (retry = 0; retry < 6; retry++) { for (retry = 0; retry < 6; retry++) {
err = hpsb_node_write(firesat->ud->ne, FCP_COMMAND_REGISTER, err = hpsb_node_write(fdtv->ud->ne, FCP_COMMAND_REGISTER,
(quadlet_t *)CmdFrm, CmdFrm->length); (quadlet_t *)CmdFrm, CmdFrm->length);
if (err) { if (err) {
firesat->avc_reply_received = true; fdtv->avc_reply_received = true;
dev_err(&firesat->ud->device, dev_err(&fdtv->ud->device,
"FCP command write failed\n"); "FCP command write failed\n");
return err; return err;
} }
...@@ -56,34 +56,34 @@ static int __avc_write(struct firesat *firesat, ...@@ -56,34 +56,34 @@ static int __avc_write(struct firesat *firesat,
* AV/C specs say that answers should be sent within 150 ms. * AV/C specs say that answers should be sent within 150 ms.
* Time out after 200 ms. * Time out after 200 ms.
*/ */
if (wait_event_timeout(firesat->avc_wait, if (wait_event_timeout(fdtv->avc_wait,
firesat->avc_reply_received, fdtv->avc_reply_received,
HZ / 5) != 0) { HZ / 5) != 0) {
memcpy(RspFrm, firesat->respfrm, firesat->resp_length); memcpy(RspFrm, fdtv->respfrm, fdtv->resp_length);
RspFrm->length = firesat->resp_length; RspFrm->length = fdtv->resp_length;
return 0; return 0;
} }
} }
dev_err(&firesat->ud->device, "FCP response timed out\n"); dev_err(&fdtv->ud->device, "FCP response timed out\n");
return -ETIMEDOUT; return -ETIMEDOUT;
} }
static int avc_write(struct firesat *firesat, static int avc_write(struct firedtv *fdtv,
const AVCCmdFrm *CmdFrm, AVCRspFrm *RspFrm) const AVCCmdFrm *CmdFrm, AVCRspFrm *RspFrm)
{ {
int ret; int ret;
if (mutex_lock_interruptible(&firesat->avc_mutex)) if (mutex_lock_interruptible(&fdtv->avc_mutex))
return -EINTR; return -EINTR;
ret = __avc_write(firesat, CmdFrm, RspFrm); ret = __avc_write(fdtv, CmdFrm, RspFrm);
mutex_unlock(&firesat->avc_mutex); mutex_unlock(&fdtv->avc_mutex);
return ret; return ret;
} }
int avc_recv(struct firesat *firesat, u8 *data, size_t length) int avc_recv(struct firedtv *fdtv, u8 *data, size_t length)
{ {
AVCRspFrm *RspFrm = (AVCRspFrm *)data; AVCRspFrm *RspFrm = (AVCRspFrm *)data;
...@@ -93,27 +93,27 @@ int avc_recv(struct firesat *firesat, u8 *data, size_t length) ...@@ -93,27 +93,27 @@ int avc_recv(struct firesat *firesat, u8 *data, size_t length)
RspFrm->operand[2] == SFE_VENDOR_DE_COMPANYID_2 && RspFrm->operand[2] == SFE_VENDOR_DE_COMPANYID_2 &&
RspFrm->operand[3] == SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL) { RspFrm->operand[3] == SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL) {
if (RspFrm->resp == CHANGED) { if (RspFrm->resp == CHANGED) {
firesat_handle_rc(firesat, fdtv_handle_rc(fdtv,
RspFrm->operand[4] << 8 | RspFrm->operand[5]); RspFrm->operand[4] << 8 | RspFrm->operand[5]);
schedule_work(&firesat->remote_ctrl_work); schedule_work(&fdtv->remote_ctrl_work);
} else if (RspFrm->resp != INTERIM) { } else if (RspFrm->resp != INTERIM) {
dev_info(&firesat->ud->device, dev_info(&fdtv->ud->device,
"remote control result = %d\n", RspFrm->resp); "remote control result = %d\n", RspFrm->resp);
} }
return 0; return 0;
} }
if (firesat->avc_reply_received) { if (fdtv->avc_reply_received) {
dev_err(&firesat->ud->device, dev_err(&fdtv->ud->device,
"received out-of-order AVC response, ignored\n"); "received out-of-order AVC response, ignored\n");
return -EIO; return -EIO;
} }
memcpy(firesat->respfrm, data, length); memcpy(fdtv->respfrm, data, length);
firesat->resp_length = length; fdtv->resp_length = length;
firesat->avc_reply_received = true; fdtv->avc_reply_received = true;
wake_up(&firesat->avc_wait); wake_up(&fdtv->avc_wait);
return 0; return 0;
} }
...@@ -122,7 +122,7 @@ int avc_recv(struct firesat *firesat, u8 *data, size_t length) ...@@ -122,7 +122,7 @@ int avc_recv(struct firesat *firesat, u8 *data, size_t length)
* tuning command for setting the relative LNB frequency * tuning command for setting the relative LNB frequency
* (not supported by the AVC standard) * (not supported by the AVC standard)
*/ */
static void avc_tuner_tuneqpsk(struct firesat *firesat, static void avc_tuner_tuneqpsk(struct firedtv *fdtv,
struct dvb_frontend_parameters *params, AVCCmdFrm *CmdFrm) struct dvb_frontend_parameters *params, AVCCmdFrm *CmdFrm)
{ {
CmdFrm->opcode = VENDOR; CmdFrm->opcode = VENDOR;
...@@ -158,21 +158,21 @@ static void avc_tuner_tuneqpsk(struct firesat *firesat, ...@@ -158,21 +158,21 @@ static void avc_tuner_tuneqpsk(struct firesat *firesat,
CmdFrm->operand[10] = 0x0; CmdFrm->operand[10] = 0x0;
} }
if (firesat->voltage == 0xff) if (fdtv->voltage == 0xff)
CmdFrm->operand[11] = 0xff; CmdFrm->operand[11] = 0xff;
else if (firesat->voltage == SEC_VOLTAGE_18) /* polarisation */ else if (fdtv->voltage == SEC_VOLTAGE_18) /* polarisation */
CmdFrm->operand[11] = 0; CmdFrm->operand[11] = 0;
else else
CmdFrm->operand[11] = 1; CmdFrm->operand[11] = 1;
if (firesat->tone == 0xff) if (fdtv->tone == 0xff)
CmdFrm->operand[12] = 0xff; CmdFrm->operand[12] = 0xff;
else if (firesat->tone == SEC_TONE_ON) /* band */ else if (fdtv->tone == SEC_TONE_ON) /* band */
CmdFrm->operand[12] = 1; CmdFrm->operand[12] = 1;
else else
CmdFrm->operand[12] = 0; CmdFrm->operand[12] = 0;
if (firesat->type == FireSAT_DVB_S2) { if (fdtv->type == FIREDTV_DVB_S2) {
CmdFrm->operand[13] = 0x1; CmdFrm->operand[13] = 0x1;
CmdFrm->operand[14] = 0xff; CmdFrm->operand[14] = 0xff;
CmdFrm->operand[15] = 0xff; CmdFrm->operand[15] = 0xff;
...@@ -394,7 +394,7 @@ static void avc_tuner_dsd_dvb_t(struct dvb_frontend_parameters *params, ...@@ -394,7 +394,7 @@ static void avc_tuner_dsd_dvb_t(struct dvb_frontend_parameters *params,
CmdFrm->length = 24; CmdFrm->length = 24;
} }
int avc_tuner_dsd(struct firesat *firesat, int avc_tuner_dsd(struct firedtv *fdtv,
struct dvb_frontend_parameters *params) struct dvb_frontend_parameters *params)
{ {
AVCCmdFrm CmdFrm; AVCCmdFrm CmdFrm;
...@@ -405,21 +405,21 @@ int avc_tuner_dsd(struct firesat *firesat, ...@@ -405,21 +405,21 @@ int avc_tuner_dsd(struct firesat *firesat,
CmdFrm.cts = AVC; CmdFrm.cts = AVC;
CmdFrm.ctype = CONTROL; CmdFrm.ctype = CONTROL;
CmdFrm.sutyp = 0x5; CmdFrm.sutyp = 0x5;
CmdFrm.suid = firesat->subunit; CmdFrm.suid = fdtv->subunit;
switch (firesat->type) { switch (fdtv->type) {
case FireSAT_DVB_S: case FIREDTV_DVB_S:
case FireSAT_DVB_S2: case FIREDTV_DVB_S2:
avc_tuner_tuneqpsk(firesat, params, &CmdFrm); break; avc_tuner_tuneqpsk(fdtv, params, &CmdFrm); break;
case FireSAT_DVB_C: case FIREDTV_DVB_C:
avc_tuner_dsd_dvb_c(params, &CmdFrm); break; avc_tuner_dsd_dvb_c(params, &CmdFrm); break;
case FireSAT_DVB_T: case FIREDTV_DVB_T:
avc_tuner_dsd_dvb_t(params, &CmdFrm); break; avc_tuner_dsd_dvb_t(params, &CmdFrm); break;
default: default:
BUG(); BUG();
} }
if (avc_write(firesat, &CmdFrm, &RspFrm) < 0) if (avc_write(fdtv, &CmdFrm, &RspFrm) < 0)
return -EIO; return -EIO;
msleep(500); msleep(500);
...@@ -432,7 +432,7 @@ int avc_tuner_dsd(struct firesat *firesat, ...@@ -432,7 +432,7 @@ int avc_tuner_dsd(struct firesat *firesat,
return 0; return 0;
} }
int avc_tuner_set_pids(struct firesat *firesat, unsigned char pidc, u16 pid[]) int avc_tuner_set_pids(struct firedtv *fdtv, unsigned char pidc, u16 pid[])
{ {
AVCCmdFrm CmdFrm; AVCCmdFrm CmdFrm;
AVCRspFrm RspFrm; AVCRspFrm RspFrm;
...@@ -446,7 +446,7 @@ int avc_tuner_set_pids(struct firesat *firesat, unsigned char pidc, u16 pid[]) ...@@ -446,7 +446,7 @@ int avc_tuner_set_pids(struct firesat *firesat, unsigned char pidc, u16 pid[])
CmdFrm.cts = AVC; CmdFrm.cts = AVC;
CmdFrm.ctype = CONTROL; CmdFrm.ctype = CONTROL;
CmdFrm.sutyp = 0x5; CmdFrm.sutyp = 0x5;
CmdFrm.suid = firesat->subunit; CmdFrm.suid = fdtv->subunit;
CmdFrm.opcode = DSD; CmdFrm.opcode = DSD;
CmdFrm.operand[0] = 0; // source plug CmdFrm.operand[0] = 0; // source plug
...@@ -469,14 +469,14 @@ int avc_tuner_set_pids(struct firesat *firesat, unsigned char pidc, u16 pid[]) ...@@ -469,14 +469,14 @@ int avc_tuner_set_pids(struct firesat *firesat, unsigned char pidc, u16 pid[])
CmdFrm.length = ALIGN(3 + pos, 4); CmdFrm.length = ALIGN(3 + pos, 4);
if (avc_write(firesat, &CmdFrm, &RspFrm) < 0) if (avc_write(fdtv, &CmdFrm, &RspFrm) < 0)
return -EIO; return -EIO;
msleep(50); msleep(50);
return 0; return 0;
} }
int avc_tuner_get_ts(struct firesat *firesat) int avc_tuner_get_ts(struct firedtv *fdtv)
{ {
AVCCmdFrm CmdFrm; AVCCmdFrm CmdFrm;
AVCRspFrm RspFrm; AVCRspFrm RspFrm;
...@@ -486,7 +486,7 @@ int avc_tuner_get_ts(struct firesat *firesat) ...@@ -486,7 +486,7 @@ int avc_tuner_get_ts(struct firesat *firesat)
CmdFrm.cts = AVC; CmdFrm.cts = AVC;
CmdFrm.ctype = CONTROL; CmdFrm.ctype = CONTROL;
CmdFrm.sutyp = 0x5; CmdFrm.sutyp = 0x5;
CmdFrm.suid = firesat->subunit; CmdFrm.suid = fdtv->subunit;
CmdFrm.opcode = DSIT; CmdFrm.opcode = DSIT;
CmdFrm.operand[0] = 0; // source plug CmdFrm.operand[0] = 0; // source plug
...@@ -495,21 +495,21 @@ int avc_tuner_get_ts(struct firesat *firesat) ...@@ -495,21 +495,21 @@ int avc_tuner_get_ts(struct firesat *firesat)
CmdFrm.operand[3] = 0x20; // system id = DVB CmdFrm.operand[3] = 0x20; // system id = DVB
CmdFrm.operand[4] = 0x00; // antenna number CmdFrm.operand[4] = 0x00; // antenna number
CmdFrm.operand[5] = 0x0; // system_specific_search_flags CmdFrm.operand[5] = 0x0; // system_specific_search_flags
CmdFrm.operand[6] = (firesat->type == FireSAT_DVB_T)?0x0c:0x11; // system_specific_multiplex selection_length CmdFrm.operand[6] = (fdtv->type == FIREDTV_DVB_T)?0x0c:0x11; // system_specific_multiplex selection_length
CmdFrm.operand[7] = 0x00; // valid_flags [0] CmdFrm.operand[7] = 0x00; // valid_flags [0]
CmdFrm.operand[8] = 0x00; // valid_flags [1] CmdFrm.operand[8] = 0x00; // valid_flags [1]
CmdFrm.operand[7 + (firesat->type == FireSAT_DVB_T)?0x0c:0x11] = 0x00; // nr_of_dsit_sel_specs (always 0) CmdFrm.operand[7 + (fdtv->type == FIREDTV_DVB_T)?0x0c:0x11] = 0x00; // nr_of_dsit_sel_specs (always 0)
CmdFrm.length = (firesat->type == FireSAT_DVB_T)?24:28; CmdFrm.length = (fdtv->type == FIREDTV_DVB_T)?24:28;
if (avc_write(firesat, &CmdFrm, &RspFrm) < 0) if (avc_write(fdtv, &CmdFrm, &RspFrm) < 0)
return -EIO; return -EIO;
msleep(250); msleep(250);
return 0; return 0;
} }
int avc_identify_subunit(struct firesat *firesat) int avc_identify_subunit(struct firedtv *fdtv)
{ {
AVCCmdFrm CmdFrm; AVCCmdFrm CmdFrm;
AVCRspFrm RspFrm; AVCRspFrm RspFrm;
...@@ -519,7 +519,7 @@ int avc_identify_subunit(struct firesat *firesat) ...@@ -519,7 +519,7 @@ int avc_identify_subunit(struct firesat *firesat)
CmdFrm.cts = AVC; CmdFrm.cts = AVC;
CmdFrm.ctype = CONTROL; CmdFrm.ctype = CONTROL;
CmdFrm.sutyp = 0x5; // tuner CmdFrm.sutyp = 0x5; // tuner
CmdFrm.suid = firesat->subunit; CmdFrm.suid = fdtv->subunit;
CmdFrm.opcode = READ_DESCRIPTOR; CmdFrm.opcode = READ_DESCRIPTOR;
CmdFrm.operand[0]=DESCRIPTOR_SUBUNIT_IDENTIFIER; CmdFrm.operand[0]=DESCRIPTOR_SUBUNIT_IDENTIFIER;
...@@ -532,19 +532,19 @@ int avc_identify_subunit(struct firesat *firesat) ...@@ -532,19 +532,19 @@ int avc_identify_subunit(struct firesat *firesat)
CmdFrm.length=12; CmdFrm.length=12;
if (avc_write(firesat, &CmdFrm, &RspFrm) < 0) if (avc_write(fdtv, &CmdFrm, &RspFrm) < 0)
return -EIO; return -EIO;
if ((RspFrm.resp != STABLE && RspFrm.resp != ACCEPTED) || if ((RspFrm.resp != STABLE && RspFrm.resp != ACCEPTED) ||
(RspFrm.operand[3] << 8) + RspFrm.operand[4] != 8) { (RspFrm.operand[3] << 8) + RspFrm.operand[4] != 8) {
dev_err(&firesat->ud->device, dev_err(&fdtv->ud->device,
"cannot read subunit identifier\n"); "cannot read subunit identifier\n");
return -EINVAL; return -EINVAL;
} }
return 0; return 0;
} }
int avc_tuner_status(struct firesat *firesat, int avc_tuner_status(struct firedtv *fdtv,
ANTENNA_INPUT_INFO *antenna_input_info) ANTENNA_INPUT_INFO *antenna_input_info)
{ {
AVCCmdFrm CmdFrm; AVCCmdFrm CmdFrm;
...@@ -556,7 +556,7 @@ int avc_tuner_status(struct firesat *firesat, ...@@ -556,7 +556,7 @@ int avc_tuner_status(struct firesat *firesat,
CmdFrm.cts=AVC; CmdFrm.cts=AVC;
CmdFrm.ctype=CONTROL; CmdFrm.ctype=CONTROL;
CmdFrm.sutyp=0x05; // tuner CmdFrm.sutyp=0x05; // tuner
CmdFrm.suid=firesat->subunit; CmdFrm.suid=fdtv->subunit;
CmdFrm.opcode=READ_DESCRIPTOR; CmdFrm.opcode=READ_DESCRIPTOR;
CmdFrm.operand[0]=DESCRIPTOR_TUNER_STATUS; CmdFrm.operand[0]=DESCRIPTOR_TUNER_STATUS;
...@@ -568,17 +568,17 @@ int avc_tuner_status(struct firesat *firesat, ...@@ -568,17 +568,17 @@ int avc_tuner_status(struct firesat *firesat,
CmdFrm.operand[6]=0x00; CmdFrm.operand[6]=0x00;
CmdFrm.length=12; CmdFrm.length=12;
if (avc_write(firesat, &CmdFrm, &RspFrm) < 0) if (avc_write(fdtv, &CmdFrm, &RspFrm) < 0)
return -EIO; return -EIO;
if (RspFrm.resp != STABLE && RspFrm.resp != ACCEPTED) { if (RspFrm.resp != STABLE && RspFrm.resp != ACCEPTED) {
dev_err(&firesat->ud->device, "cannot read tuner status\n"); dev_err(&fdtv->ud->device, "cannot read tuner status\n");
return -EINVAL; return -EINVAL;
} }
length = RspFrm.operand[9]; length = RspFrm.operand[9];
if (RspFrm.operand[1] != 0x10 || length != sizeof(ANTENNA_INPUT_INFO)) { if (RspFrm.operand[1] != 0x10 || length != sizeof(ANTENNA_INPUT_INFO)) {
dev_err(&firesat->ud->device, "got invalid tuner status\n"); dev_err(&fdtv->ud->device, "got invalid tuner status\n");
return -EINVAL; return -EINVAL;
} }
...@@ -586,7 +586,7 @@ int avc_tuner_status(struct firesat *firesat, ...@@ -586,7 +586,7 @@ int avc_tuner_status(struct firesat *firesat,
return 0; return 0;
} }
int avc_lnb_control(struct firesat *firesat, char voltage, char burst, int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst,
char conttone, char nrdiseq, char conttone, char nrdiseq,
struct dvb_diseqc_master_cmd *diseqcmd) struct dvb_diseqc_master_cmd *diseqcmd)
{ {
...@@ -599,7 +599,7 @@ int avc_lnb_control(struct firesat *firesat, char voltage, char burst, ...@@ -599,7 +599,7 @@ int avc_lnb_control(struct firesat *firesat, char voltage, char burst,
CmdFrm.cts=AVC; CmdFrm.cts=AVC;
CmdFrm.ctype=CONTROL; CmdFrm.ctype=CONTROL;
CmdFrm.sutyp=0x05; CmdFrm.sutyp=0x05;
CmdFrm.suid=firesat->subunit; CmdFrm.suid=fdtv->subunit;
CmdFrm.opcode=VENDOR; CmdFrm.opcode=VENDOR;
CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0; CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0;
...@@ -624,18 +624,18 @@ int avc_lnb_control(struct firesat *firesat, char voltage, char burst, ...@@ -624,18 +624,18 @@ int avc_lnb_control(struct firesat *firesat, char voltage, char burst,
CmdFrm.length = ALIGN(3 + i, 4); CmdFrm.length = ALIGN(3 + i, 4);
if (avc_write(firesat, &CmdFrm, &RspFrm) < 0) if (avc_write(fdtv, &CmdFrm, &RspFrm) < 0)
return -EIO; return -EIO;
if (RspFrm.resp != ACCEPTED) { if (RspFrm.resp != ACCEPTED) {
dev_err(&firesat->ud->device, "LNB control failed\n"); dev_err(&fdtv->ud->device, "LNB control failed\n");
return -EINVAL; return -EINVAL;
} }
return 0; return 0;
} }
int avc_register_remote_control(struct firesat *firesat) int avc_register_remote_control(struct firedtv *fdtv)
{ {
AVCCmdFrm CmdFrm; AVCCmdFrm CmdFrm;
...@@ -654,20 +654,20 @@ int avc_register_remote_control(struct firesat *firesat) ...@@ -654,20 +654,20 @@ int avc_register_remote_control(struct firesat *firesat)
CmdFrm.length = 8; CmdFrm.length = 8;
return avc_write(firesat, &CmdFrm, NULL); return avc_write(fdtv, &CmdFrm, NULL);
} }
void avc_remote_ctrl_work(struct work_struct *work) void avc_remote_ctrl_work(struct work_struct *work)
{ {
struct firesat *firesat = struct firedtv *fdtv =
container_of(work, struct firesat, remote_ctrl_work); container_of(work, struct firedtv, remote_ctrl_work);
/* Should it be rescheduled in failure cases? */ /* Should it be rescheduled in failure cases? */
avc_register_remote_control(firesat); avc_register_remote_control(fdtv);
} }
#if 0 /* FIXME: unused */ #if 0 /* FIXME: unused */
int avc_tuner_host2ca(struct firesat *firesat) int avc_tuner_host2ca(struct firedtv *fdtv)
{ {
AVCCmdFrm CmdFrm; AVCCmdFrm CmdFrm;
AVCRspFrm RspFrm; AVCRspFrm RspFrm;
...@@ -676,7 +676,7 @@ int avc_tuner_host2ca(struct firesat *firesat) ...@@ -676,7 +676,7 @@ int avc_tuner_host2ca(struct firesat *firesat)
CmdFrm.cts = AVC; CmdFrm.cts = AVC;
CmdFrm.ctype = CONTROL; CmdFrm.ctype = CONTROL;
CmdFrm.sutyp = 0x5; CmdFrm.sutyp = 0x5;
CmdFrm.suid = firesat->subunit; CmdFrm.suid = fdtv->subunit;
CmdFrm.opcode = VENDOR; CmdFrm.opcode = VENDOR;
CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0; CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0;
...@@ -689,7 +689,7 @@ int avc_tuner_host2ca(struct firesat *firesat) ...@@ -689,7 +689,7 @@ int avc_tuner_host2ca(struct firesat *firesat)
CmdFrm.operand[7] = 0; // length CmdFrm.operand[7] = 0; // length
CmdFrm.length = 12; CmdFrm.length = 12;
if (avc_write(firesat, &CmdFrm, &RspFrm) < 0) if (avc_write(fdtv, &CmdFrm, &RspFrm) < 0)
return -EIO; return -EIO;
return 0; return 0;
...@@ -721,7 +721,7 @@ static int get_ca_object_length(AVCRspFrm *RspFrm) ...@@ -721,7 +721,7 @@ static int get_ca_object_length(AVCRspFrm *RspFrm)
return RspFrm->operand[7]; return RspFrm->operand[7];
} }
int avc_ca_app_info(struct firesat *firesat, char *app_info, unsigned int *len) int avc_ca_app_info(struct firedtv *fdtv, char *app_info, unsigned int *len)
{ {
AVCCmdFrm CmdFrm; AVCCmdFrm CmdFrm;
AVCRspFrm RspFrm; AVCRspFrm RspFrm;
...@@ -731,7 +731,7 @@ int avc_ca_app_info(struct firesat *firesat, char *app_info, unsigned int *len) ...@@ -731,7 +731,7 @@ int avc_ca_app_info(struct firesat *firesat, char *app_info, unsigned int *len)
CmdFrm.cts = AVC; CmdFrm.cts = AVC;
CmdFrm.ctype = STATUS; CmdFrm.ctype = STATUS;
CmdFrm.sutyp = 0x5; CmdFrm.sutyp = 0x5;
CmdFrm.suid = firesat->subunit; CmdFrm.suid = fdtv->subunit;
CmdFrm.opcode = VENDOR; CmdFrm.opcode = VENDOR;
CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0; CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0;
...@@ -742,7 +742,7 @@ int avc_ca_app_info(struct firesat *firesat, char *app_info, unsigned int *len) ...@@ -742,7 +742,7 @@ int avc_ca_app_info(struct firesat *firesat, char *app_info, unsigned int *len)
CmdFrm.operand[5] = SFE_VENDOR_TAG_CA_APPLICATION_INFO; // ca tag CmdFrm.operand[5] = SFE_VENDOR_TAG_CA_APPLICATION_INFO; // ca tag
CmdFrm.length = 12; CmdFrm.length = 12;
if (avc_write(firesat, &CmdFrm, &RspFrm) < 0) if (avc_write(fdtv, &CmdFrm, &RspFrm) < 0)
return -EIO; return -EIO;
/* FIXME: check response code and validate response data */ /* FIXME: check response code and validate response data */
...@@ -759,7 +759,7 @@ int avc_ca_app_info(struct firesat *firesat, char *app_info, unsigned int *len) ...@@ -759,7 +759,7 @@ int avc_ca_app_info(struct firesat *firesat, char *app_info, unsigned int *len)
return 0; return 0;
} }
int avc_ca_info(struct firesat *firesat, char *app_info, unsigned int *len) int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len)
{ {
AVCCmdFrm CmdFrm; AVCCmdFrm CmdFrm;
AVCRspFrm RspFrm; AVCRspFrm RspFrm;
...@@ -769,7 +769,7 @@ int avc_ca_info(struct firesat *firesat, char *app_info, unsigned int *len) ...@@ -769,7 +769,7 @@ int avc_ca_info(struct firesat *firesat, char *app_info, unsigned int *len)
CmdFrm.cts = AVC; CmdFrm.cts = AVC;
CmdFrm.ctype = STATUS; CmdFrm.ctype = STATUS;
CmdFrm.sutyp = 0x5; CmdFrm.sutyp = 0x5;
CmdFrm.suid = firesat->subunit; CmdFrm.suid = fdtv->subunit;
CmdFrm.opcode = VENDOR; CmdFrm.opcode = VENDOR;
CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0; CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0;
...@@ -780,7 +780,7 @@ int avc_ca_info(struct firesat *firesat, char *app_info, unsigned int *len) ...@@ -780,7 +780,7 @@ int avc_ca_info(struct firesat *firesat, char *app_info, unsigned int *len)
CmdFrm.operand[5] = SFE_VENDOR_TAG_CA_APPLICATION_INFO; // ca tag CmdFrm.operand[5] = SFE_VENDOR_TAG_CA_APPLICATION_INFO; // ca tag
CmdFrm.length = 12; CmdFrm.length = 12;
if (avc_write(firesat, &CmdFrm, &RspFrm) < 0) if (avc_write(fdtv, &CmdFrm, &RspFrm) < 0)
return -EIO; return -EIO;
pos = get_ca_object_pos(&RspFrm); pos = get_ca_object_pos(&RspFrm);
...@@ -795,7 +795,7 @@ int avc_ca_info(struct firesat *firesat, char *app_info, unsigned int *len) ...@@ -795,7 +795,7 @@ int avc_ca_info(struct firesat *firesat, char *app_info, unsigned int *len)
return 0; return 0;
} }
int avc_ca_reset(struct firesat *firesat) int avc_ca_reset(struct firedtv *fdtv)
{ {
AVCCmdFrm CmdFrm; AVCCmdFrm CmdFrm;
AVCRspFrm RspFrm; AVCRspFrm RspFrm;
...@@ -804,7 +804,7 @@ int avc_ca_reset(struct firesat *firesat) ...@@ -804,7 +804,7 @@ int avc_ca_reset(struct firesat *firesat)
CmdFrm.cts = AVC; CmdFrm.cts = AVC;
CmdFrm.ctype = CONTROL; CmdFrm.ctype = CONTROL;
CmdFrm.sutyp = 0x5; CmdFrm.sutyp = 0x5;
CmdFrm.suid = firesat->subunit; CmdFrm.suid = fdtv->subunit;
CmdFrm.opcode = VENDOR; CmdFrm.opcode = VENDOR;
CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0; CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0;
...@@ -818,13 +818,13 @@ int avc_ca_reset(struct firesat *firesat) ...@@ -818,13 +818,13 @@ int avc_ca_reset(struct firesat *firesat)
CmdFrm.operand[8] = 0; // force hardware reset CmdFrm.operand[8] = 0; // force hardware reset
CmdFrm.length = 12; CmdFrm.length = 12;
if (avc_write(firesat, &CmdFrm, &RspFrm) < 0) if (avc_write(fdtv, &CmdFrm, &RspFrm) < 0)
return -EIO; return -EIO;
return 0; return 0;
} }
int avc_ca_pmt(struct firesat *firesat, char *msg, int length) int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length)
{ {
AVCCmdFrm CmdFrm; AVCCmdFrm CmdFrm;
AVCRspFrm RspFrm; AVCRspFrm RspFrm;
...@@ -840,11 +840,11 @@ int avc_ca_pmt(struct firesat *firesat, char *msg, int length) ...@@ -840,11 +840,11 @@ int avc_ca_pmt(struct firesat *firesat, char *msg, int length)
CmdFrm.cts = AVC; CmdFrm.cts = AVC;
CmdFrm.ctype = CONTROL; CmdFrm.ctype = CONTROL;
CmdFrm.sutyp = 0x5; CmdFrm.sutyp = 0x5;
CmdFrm.suid = firesat->subunit; CmdFrm.suid = fdtv->subunit;
CmdFrm.opcode = VENDOR; CmdFrm.opcode = VENDOR;
if (msg[0] != LIST_MANAGEMENT_ONLY) { if (msg[0] != LIST_MANAGEMENT_ONLY) {
dev_info(&firesat->ud->device, dev_info(&fdtv->ud->device,
"forcing list_management to ONLY\n"); "forcing list_management to ONLY\n");
msg[0] = LIST_MANAGEMENT_ONLY; msg[0] = LIST_MANAGEMENT_ONLY;
} }
...@@ -894,7 +894,7 @@ int avc_ca_pmt(struct firesat *firesat, char *msg, int length) ...@@ -894,7 +894,7 @@ int avc_ca_pmt(struct firesat *firesat, char *msg, int length)
if (program_info_length > 0) { if (program_info_length > 0) {
pmt_cmd_id = msg[read_pos++]; pmt_cmd_id = msg[read_pos++];
if (pmt_cmd_id != 1 && pmt_cmd_id != 4) if (pmt_cmd_id != 1 && pmt_cmd_id != 4)
dev_err(&firesat->ud->device, dev_err(&fdtv->ud->device,
"invalid pmt_cmd_id %d\n", pmt_cmd_id); "invalid pmt_cmd_id %d\n", pmt_cmd_id);
memcpy(&CmdFrm.operand[write_pos], &msg[read_pos], memcpy(&CmdFrm.operand[write_pos], &msg[read_pos],
...@@ -916,7 +916,7 @@ int avc_ca_pmt(struct firesat *firesat, char *msg, int length) ...@@ -916,7 +916,7 @@ int avc_ca_pmt(struct firesat *firesat, char *msg, int length)
if (es_info_length > 0) { if (es_info_length > 0) {
pmt_cmd_id = msg[read_pos++]; pmt_cmd_id = msg[read_pos++];
if (pmt_cmd_id != 1 && pmt_cmd_id != 4) if (pmt_cmd_id != 1 && pmt_cmd_id != 4)
dev_err(&firesat->ud->device, dev_err(&fdtv->ud->device,
"invalid pmt_cmd_id %d " "invalid pmt_cmd_id %d "
"at stream level\n", pmt_cmd_id); "at stream level\n", pmt_cmd_id);
...@@ -945,11 +945,11 @@ int avc_ca_pmt(struct firesat *firesat, char *msg, int length) ...@@ -945,11 +945,11 @@ int avc_ca_pmt(struct firesat *firesat, char *msg, int length)
CmdFrm.length = ALIGN(3 + write_pos, 4); CmdFrm.length = ALIGN(3 + write_pos, 4);
if (avc_write(firesat, &CmdFrm, &RspFrm) < 0) if (avc_write(fdtv, &CmdFrm, &RspFrm) < 0)
return -EIO; return -EIO;
if (RspFrm.resp != ACCEPTED) { if (RspFrm.resp != ACCEPTED) {
dev_err(&firesat->ud->device, dev_err(&fdtv->ud->device,
"CA PMT failed with response 0x%x\n", RspFrm.resp); "CA PMT failed with response 0x%x\n", RspFrm.resp);
return -EFAULT; return -EFAULT;
} }
...@@ -957,7 +957,7 @@ int avc_ca_pmt(struct firesat *firesat, char *msg, int length) ...@@ -957,7 +957,7 @@ int avc_ca_pmt(struct firesat *firesat, char *msg, int length)
return 0; return 0;
} }
int avc_ca_get_time_date(struct firesat *firesat, int *interval) int avc_ca_get_time_date(struct firedtv *fdtv, int *interval)
{ {
AVCCmdFrm CmdFrm; AVCCmdFrm CmdFrm;
AVCRspFrm RspFrm; AVCRspFrm RspFrm;
...@@ -966,7 +966,7 @@ int avc_ca_get_time_date(struct firesat *firesat, int *interval) ...@@ -966,7 +966,7 @@ int avc_ca_get_time_date(struct firesat *firesat, int *interval)
CmdFrm.cts = AVC; CmdFrm.cts = AVC;
CmdFrm.ctype = STATUS; CmdFrm.ctype = STATUS;
CmdFrm.sutyp = 0x5; CmdFrm.sutyp = 0x5;
CmdFrm.suid = firesat->subunit; CmdFrm.suid = fdtv->subunit;
CmdFrm.opcode = VENDOR; CmdFrm.opcode = VENDOR;
CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0; CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0;
...@@ -979,7 +979,7 @@ int avc_ca_get_time_date(struct firesat *firesat, int *interval) ...@@ -979,7 +979,7 @@ int avc_ca_get_time_date(struct firesat *firesat, int *interval)
CmdFrm.operand[7] = 0; // length CmdFrm.operand[7] = 0; // length
CmdFrm.length = 12; CmdFrm.length = 12;
if (avc_write(firesat, &CmdFrm, &RspFrm) < 0) if (avc_write(fdtv, &CmdFrm, &RspFrm) < 0)
return -EIO; return -EIO;
/* FIXME: check response code and validate response data */ /* FIXME: check response code and validate response data */
...@@ -989,7 +989,7 @@ int avc_ca_get_time_date(struct firesat *firesat, int *interval) ...@@ -989,7 +989,7 @@ int avc_ca_get_time_date(struct firesat *firesat, int *interval)
return 0; return 0;
} }
int avc_ca_enter_menu(struct firesat *firesat) int avc_ca_enter_menu(struct firedtv *fdtv)
{ {
AVCCmdFrm CmdFrm; AVCCmdFrm CmdFrm;
AVCRspFrm RspFrm; AVCRspFrm RspFrm;
...@@ -998,7 +998,7 @@ int avc_ca_enter_menu(struct firesat *firesat) ...@@ -998,7 +998,7 @@ int avc_ca_enter_menu(struct firesat *firesat)
CmdFrm.cts = AVC; CmdFrm.cts = AVC;
CmdFrm.ctype = STATUS; CmdFrm.ctype = STATUS;
CmdFrm.sutyp = 0x5; CmdFrm.sutyp = 0x5;
CmdFrm.suid = firesat->subunit; CmdFrm.suid = fdtv->subunit;
CmdFrm.opcode = VENDOR; CmdFrm.opcode = VENDOR;
CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0; CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0;
...@@ -1011,13 +1011,13 @@ int avc_ca_enter_menu(struct firesat *firesat) ...@@ -1011,13 +1011,13 @@ int avc_ca_enter_menu(struct firesat *firesat)
CmdFrm.operand[7] = 0; // length CmdFrm.operand[7] = 0; // length
CmdFrm.length = 12; CmdFrm.length = 12;
if (avc_write(firesat, &CmdFrm, &RspFrm) < 0) if (avc_write(fdtv, &CmdFrm, &RspFrm) < 0)
return -EIO; return -EIO;
return 0; return 0;
} }
int avc_ca_get_mmi(struct firesat *firesat, char *mmi_object, unsigned int *len) int avc_ca_get_mmi(struct firedtv *fdtv, char *mmi_object, unsigned int *len)
{ {
AVCCmdFrm CmdFrm; AVCCmdFrm CmdFrm;
AVCRspFrm RspFrm; AVCRspFrm RspFrm;
...@@ -1026,7 +1026,7 @@ int avc_ca_get_mmi(struct firesat *firesat, char *mmi_object, unsigned int *len) ...@@ -1026,7 +1026,7 @@ int avc_ca_get_mmi(struct firesat *firesat, char *mmi_object, unsigned int *len)
CmdFrm.cts = AVC; CmdFrm.cts = AVC;
CmdFrm.ctype = STATUS; CmdFrm.ctype = STATUS;
CmdFrm.sutyp = 0x5; CmdFrm.sutyp = 0x5;
CmdFrm.suid = firesat->subunit; CmdFrm.suid = fdtv->subunit;
CmdFrm.opcode = VENDOR; CmdFrm.opcode = VENDOR;
CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0; CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0;
...@@ -1039,7 +1039,7 @@ int avc_ca_get_mmi(struct firesat *firesat, char *mmi_object, unsigned int *len) ...@@ -1039,7 +1039,7 @@ int avc_ca_get_mmi(struct firesat *firesat, char *mmi_object, unsigned int *len)
CmdFrm.operand[7] = 0; // length CmdFrm.operand[7] = 0; // length
CmdFrm.length = 12; CmdFrm.length = 12;
if (avc_write(firesat, &CmdFrm, &RspFrm) < 0) if (avc_write(fdtv, &CmdFrm, &RspFrm) < 0)
return -EIO; return -EIO;
/* FIXME: check response code and validate response data */ /* FIXME: check response code and validate response data */
......
...@@ -402,31 +402,31 @@ typedef struct ...@@ -402,31 +402,31 @@ typedef struct
struct dvb_diseqc_master_cmd; struct dvb_diseqc_master_cmd;
struct dvb_frontend_parameters; 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); 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); 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); struct dvb_frontend_parameters *params);
int avc_tuner_set_pids(struct firesat *firesat, unsigned char pidc, u16 pid[]); int avc_tuner_set_pids(struct firedtv *fdtv, unsigned char pidc, u16 pid[]);
int avc_tuner_get_ts(struct firesat *firesat); int avc_tuner_get_ts(struct firedtv *fdtv);
int avc_identify_subunit(struct firesat *firesat); int avc_identify_subunit(struct firedtv *fdtv);
int avc_lnb_control(struct firesat *firesat, char voltage, char burst, int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst,
char conttone, char nrdiseq, char conttone, char nrdiseq,
struct dvb_diseqc_master_cmd *diseqcmd); struct dvb_diseqc_master_cmd *diseqcmd);
void avc_remote_ctrl_work(struct work_struct *work); void avc_remote_ctrl_work(struct work_struct *work);
int avc_register_remote_control(struct firesat *firesat); int avc_register_remote_control(struct firedtv *fdtv);
int avc_ca_app_info(struct firesat *firesat, char *app_info, unsigned int *len); int avc_ca_app_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
int avc_ca_info(struct firesat *firesat, char *app_info, unsigned int *len); int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
int avc_ca_reset(struct firesat *firesat); int avc_ca_reset(struct firedtv *fdtv);
int avc_ca_pmt(struct firesat *firesat, char *app_info, int length); int avc_ca_pmt(struct firedtv *fdtv, char *app_info, int length);
int avc_ca_get_time_date(struct firesat *firesat, int *interval); int avc_ca_get_time_date(struct firedtv *fdtv, int *interval);
int avc_ca_enter_menu(struct firesat *firesat); int avc_ca_enter_menu(struct firedtv *fdtv);
int avc_ca_get_mmi(struct firesat *firesat, char *mmi_object, unsigned int *len); int avc_ca_get_mmi(struct firedtv *fdtv, char *mmi_object, unsigned int *len);
#endif /* _AVC_API_H */ #endif /* _AVC_API_H */
...@@ -20,41 +20,41 @@ ...@@ -20,41 +20,41 @@
#include <ieee1394.h> #include <ieee1394.h>
#include <nodemgr.h> #include <nodemgr.h>
#include "avc_api.h" #include "avc.h"
#include "cmp.h" #include "cmp.h"
#include "firesat.h" #include "firedtv.h"
#define CMP_OUTPUT_PLUG_CONTROL_REG_0 0xfffff0000904ULL #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; int ret;
if (mutex_lock_interruptible(&firesat->avc_mutex)) if (mutex_lock_interruptible(&fdtv->avc_mutex))
return -EINTR; 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) 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; 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 ext_tcode)
{ {
int ret; int ret;
if (mutex_lock_interruptible(&firesat->avc_mutex)) if (mutex_lock_interruptible(&fdtv->avc_mutex))
return -EINTR; 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); (__force quadlet_t)arg);
if (ret < 0) 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; return ret;
} }
...@@ -78,20 +78,20 @@ static inline void set_opcr(__be32 *opcr, u32 value, u32 mask, u32 shift) ...@@ -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_data_rate(p, v) set_opcr((p), (v), 0x3, 14)
#define set_opcr_overhead_id(p, v) set_opcr((p), (v), 0xf, 10) #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; __be32 old_opcr, opcr;
u64 opcr_address = CMP_OUTPUT_PLUG_CONTROL_REG_0 + (plug << 2); u64 opcr_address = CMP_OUTPUT_PLUG_CONTROL_REG_0 + (plug << 2);
int attempts = 0; int attempts = 0;
int ret; int ret;
ret = cmp_read(firesat, &opcr, opcr_address, 4); ret = cmp_read(fdtv, &opcr, opcr_address, 4);
if (ret < 0) if (ret < 0)
return ret; return ret;
repeat: repeat:
if (!get_opcr_online(opcr)) { 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; return -EBUSY;
} }
...@@ -99,11 +99,11 @@ repeat: ...@@ -99,11 +99,11 @@ repeat:
if (get_opcr_p2p_connections(opcr)) { if (get_opcr_p2p_connections(opcr)) {
if (get_opcr_channel(opcr) != channel) { if (get_opcr_channel(opcr) != channel) {
dev_err(&firesat->ud->device, dev_err(&fdtv->ud->device,
"CMP: cannot change channel\n"); "CMP: cannot change channel\n");
return -EBUSY; return -EBUSY;
} }
dev_info(&firesat->ud->device, dev_info(&fdtv->ud->device,
"CMP: overlaying existing connection\n"); "CMP: overlaying existing connection\n");
/* We don't allocate isochronous resources. */ /* We don't allocate isochronous resources. */
...@@ -119,7 +119,7 @@ repeat: ...@@ -119,7 +119,7 @@ repeat:
set_opcr_p2p_connections(&opcr, get_opcr_p2p_connections(opcr) + 1); 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) if (ret < 0)
return ret; return ret;
...@@ -137,26 +137,26 @@ repeat: ...@@ -137,26 +137,26 @@ repeat:
return 0; 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; __be32 old_opcr, opcr;
u64 opcr_address = CMP_OUTPUT_PLUG_CONTROL_REG_0 + (plug << 2); u64 opcr_address = CMP_OUTPUT_PLUG_CONTROL_REG_0 + (plug << 2);
int attempts = 0; int attempts = 0;
if (cmp_read(firesat, &opcr, opcr_address, 4) < 0) if (cmp_read(fdtv, &opcr, opcr_address, 4) < 0)
return; return;
repeat: repeat:
if (!get_opcr_online(opcr) || !get_opcr_p2p_connections(opcr) || if (!get_opcr_online(opcr) || !get_opcr_p2p_connections(opcr) ||
get_opcr_channel(opcr) != channel) { 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; return;
} }
old_opcr = opcr; old_opcr = opcr;
set_opcr_p2p_connections(&opcr, get_opcr_p2p_connections(opcr) - 1); 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; return;
if (old_opcr != opcr) { 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 @@ ...@@ -33,17 +33,17 @@
#include <ieee1394_hotplug.h> #include <ieee1394_hotplug.h>
#include <nodemgr.h> #include <nodemgr.h>
#include "avc_api.h" #include "avc.h"
#include "cmp.h" #include "cmp.h"
#include "firesat.h" #include "firedtv.h"
#include "firesat-ci.h" #include "firedtv-ci.h"
#include "firesat-rc.h" #include "firedtv-rc.h"
#define MATCH_FLAGS IEEE1394_MATCH_VENDOR_ID | IEEE1394_MATCH_MODEL_ID | \ #define MATCH_FLAGS IEEE1394_MATCH_VENDOR_ID | IEEE1394_MATCH_MODEL_ID | \
IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION
#define DIGITAL_EVERYWHERE_OUI 0x001287 #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 */ /* FloppyDTV S/CI and FloppyDTV S2 */
...@@ -90,11 +90,11 @@ static struct ieee1394_device_id firesat_id_table[] = { ...@@ -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 of all firedtv devices */
LIST_HEAD(firesat_list); LIST_HEAD(fdtv_list);
DEFINE_SPINLOCK(firesat_list_lock); DEFINE_SPINLOCK(fdtv_list_lock);
static void fcp_request(struct hpsb_host *host, static void fcp_request(struct hpsb_host *host,
int nodeid, int nodeid,
...@@ -103,186 +103,186 @@ static void fcp_request(struct hpsb_host *host, ...@@ -103,186 +103,186 @@ static void fcp_request(struct hpsb_host *host,
u8 *data, u8 *data,
size_t length) size_t length)
{ {
struct firesat *firesat = NULL; struct firedtv *fdtv = NULL;
struct firesat *firesat_entry; struct firedtv *fdtv_entry;
unsigned long flags; unsigned long flags;
if (length > 0 && ((data[0] & 0xf0) >> 4) == 0) { if (length > 0 && ((data[0] & 0xf0) >> 4) == 0) {
spin_lock_irqsave(&firesat_list_lock, flags); spin_lock_irqsave(&fdtv_list_lock, flags);
list_for_each_entry(firesat_entry,&firesat_list,list) { list_for_each_entry(fdtv_entry,&fdtv_list,list) {
if (firesat_entry->ud->ne->host == host && if (fdtv_entry->ud->ne->host == host &&
firesat_entry->ud->ne->nodeid == nodeid && fdtv_entry->ud->ne->nodeid == nodeid &&
(firesat_entry->subunit == (data[1]&0x7) || (fdtv_entry->subunit == (data[1]&0x7) ||
(firesat_entry->subunit == 0 && (fdtv_entry->subunit == 0 &&
(data[1]&0x7) == 0x7))) { (data[1]&0x7) == 0x7))) {
firesat=firesat_entry; fdtv=fdtv_entry;
break; break;
} }
} }
spin_unlock_irqrestore(&firesat_list_lock, flags); spin_unlock_irqrestore(&fdtv_list_lock, flags);
if (firesat) if (fdtv)
avc_recv(firesat, data, length); avc_recv(fdtv, data, length);
} }
} }
const char *firedtv_model_names[] = { const char *fdtv_model_names[] = {
[FireSAT_UNKNOWN] = "unknown type", [FIREDTV_UNKNOWN] = "unknown type",
[FireSAT_DVB_S] = "FireDTV S/CI", [FIREDTV_DVB_S] = "FireDTV S/CI",
[FireSAT_DVB_C] = "FireDTV C/CI", [FIREDTV_DVB_C] = "FireDTV C/CI",
[FireSAT_DVB_T] = "FireDTV T/CI", [FIREDTV_DVB_T] = "FireDTV T/CI",
[FireSAT_DVB_S2] = "FireDTV S2 ", [FIREDTV_DVB_S2] = "FireDTV S2 ",
}; };
static int firesat_probe(struct device *dev) static int fdtv_probe(struct device *dev)
{ {
struct unit_directory *ud = struct unit_directory *ud =
container_of(dev, struct unit_directory, device); container_of(dev, struct unit_directory, device);
struct firesat *firesat; struct firedtv *fdtv;
unsigned long flags; unsigned long flags;
int kv_len; int kv_len;
void *kv_str; void *kv_str;
int i; int i;
int err = -ENOMEM; int err = -ENOMEM;
firesat = kzalloc(sizeof(*firesat), GFP_KERNEL); fdtv = kzalloc(sizeof(*fdtv), GFP_KERNEL);
if (!firesat) if (!fdtv)
return -ENOMEM; return -ENOMEM;
dev->driver_data = firesat; dev->driver_data = fdtv;
firesat->ud = ud; fdtv->ud = ud;
firesat->subunit = 0; fdtv->subunit = 0;
firesat->isochannel = -1; fdtv->isochannel = -1;
firesat->tone = 0xff; fdtv->tone = 0xff;
firesat->voltage = 0xff; fdtv->voltage = 0xff;
mutex_init(&firesat->avc_mutex); mutex_init(&fdtv->avc_mutex);
init_waitqueue_head(&firesat->avc_wait); init_waitqueue_head(&fdtv->avc_wait);
firesat->avc_reply_received = true; fdtv->avc_reply_received = true;
mutex_init(&firesat->demux_mutex); mutex_init(&fdtv->demux_mutex);
INIT_WORK(&firesat->remote_ctrl_work, avc_remote_ctrl_work); INIT_WORK(&fdtv->remote_ctrl_work, avc_remote_ctrl_work);
/* Reading device model from ROM */ /* Reading device model from ROM */
kv_len = (ud->model_name_kv->value.leaf.len - 2) * sizeof(quadlet_t); kv_len = (ud->model_name_kv->value.leaf.len - 2) * sizeof(quadlet_t);
kv_str = CSR1212_TEXTUAL_DESCRIPTOR_LEAF_DATA(ud->model_name_kv); kv_str = CSR1212_TEXTUAL_DESCRIPTOR_LEAF_DATA(ud->model_name_kv);
for (i = ARRAY_SIZE(firedtv_model_names); --i;) for (i = ARRAY_SIZE(fdtv_model_names); --i;)
if (strlen(firedtv_model_names[i]) <= kv_len && if (strlen(fdtv_model_names[i]) <= kv_len &&
strncmp(kv_str, firedtv_model_names[i], kv_len) == 0) strncmp(kv_str, fdtv_model_names[i], kv_len) == 0)
break; break;
firesat->type = i; fdtv->type = i;
/* /*
* Work around a bug in udev's path_id script: Use the fw-host's dev * 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. * 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) if (err)
goto fail_free; goto fail_free;
INIT_LIST_HEAD(&firesat->list); INIT_LIST_HEAD(&fdtv->list);
spin_lock_irqsave(&firesat_list_lock, flags); spin_lock_irqsave(&fdtv_list_lock, flags);
list_add_tail(&firesat->list, &firesat_list); list_add_tail(&fdtv->list, &fdtv_list);
spin_unlock_irqrestore(&firesat_list_lock, flags); spin_unlock_irqrestore(&fdtv_list_lock, flags);
err = avc_identify_subunit(firesat); err = avc_identify_subunit(fdtv);
if (err) if (err)
goto fail; goto fail;
err = firesat_dvbdev_init(firesat, dev); err = fdtv_dvbdev_init(fdtv, dev);
if (err) if (err)
goto fail; goto fail;
avc_register_remote_control(firesat); avc_register_remote_control(fdtv);
return 0; return 0;
fail: fail:
spin_lock_irqsave(&firesat_list_lock, flags); spin_lock_irqsave(&fdtv_list_lock, flags);
list_del(&firesat->list); list_del(&fdtv->list);
spin_unlock_irqrestore(&firesat_list_lock, flags); spin_unlock_irqrestore(&fdtv_list_lock, flags);
firesat_unregister_rc(firesat); fdtv_unregister_rc(fdtv);
fail_free: fail_free:
kfree(firesat); kfree(fdtv);
return err; 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; unsigned long flags;
firesat_ca_release(firesat); fdtv_ca_release(fdtv);
dvb_unregister_frontend(&firesat->fe); dvb_unregister_frontend(&fdtv->fe);
dvb_net_release(&firesat->dvbnet); dvb_net_release(&fdtv->dvbnet);
firesat->demux.dmx.close(&firesat->demux.dmx); fdtv->demux.dmx.close(&fdtv->demux.dmx);
firesat->demux.dmx.remove_frontend(&firesat->demux.dmx, fdtv->demux.dmx.remove_frontend(&fdtv->demux.dmx,
&firesat->frontend); &fdtv->frontend);
dvb_dmxdev_release(&firesat->dmxdev); dvb_dmxdev_release(&fdtv->dmxdev);
dvb_dmx_release(&firesat->demux); dvb_dmx_release(&fdtv->demux);
dvb_unregister_adapter(&firesat->adapter); dvb_unregister_adapter(&fdtv->adapter);
spin_lock_irqsave(&firesat_list_lock, flags); spin_lock_irqsave(&fdtv_list_lock, flags);
list_del(&firesat->list); list_del(&fdtv->list);
spin_unlock_irqrestore(&firesat_list_lock, flags); spin_unlock_irqrestore(&fdtv_list_lock, flags);
cancel_work_sync(&firesat->remote_ctrl_work); cancel_work_sync(&fdtv->remote_ctrl_work);
firesat_unregister_rc(firesat); fdtv_unregister_rc(fdtv);
kfree(firesat); kfree(fdtv);
return 0; 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) if (fdtv->isochannel >= 0)
cmp_establish_pp_connection(firesat, firesat->subunit, cmp_establish_pp_connection(fdtv, fdtv->subunit,
firesat->isochannel); fdtv->isochannel);
return 0; return 0;
} }
static struct hpsb_protocol_driver firesat_driver = { static struct hpsb_protocol_driver fdtv_driver = {
.name = "firedtv", .name = "firedtv",
.id_table = firesat_id_table, .id_table = fdtv_id_table,
.update = firesat_update, .update = fdtv_update,
.driver = { .driver = {
//.name and .bus are filled in for us in more recent linux versions //.name and .bus are filled in for us in more recent linux versions
//.name = "FireSAT", //.name = "FireDTV",
//.bus = &ieee1394_bus_type, //.bus = &ieee1394_bus_type,
.probe = firesat_probe, .probe = fdtv_probe,
.remove = firesat_remove, .remove = fdtv_remove,
}, },
}; };
static struct hpsb_highlevel firesat_highlevel = { static struct hpsb_highlevel fdtv_highlevel = {
.name = "firedtv", .name = "firedtv",
.fcp_request = fcp_request, .fcp_request = fcp_request,
}; };
static int __init firesat_init(void) static int __init fdtv_init(void)
{ {
int ret; int ret;
hpsb_register_highlevel(&firesat_highlevel); hpsb_register_highlevel(&fdtv_highlevel);
ret = hpsb_register_protocol(&firesat_driver); ret = hpsb_register_protocol(&fdtv_driver);
if (ret) { if (ret) {
printk(KERN_ERR "firedtv: failed to register protocol\n"); printk(KERN_ERR "firedtv: failed to register protocol\n");
hpsb_unregister_highlevel(&firesat_highlevel); hpsb_unregister_highlevel(&fdtv_highlevel);
} }
return ret; return ret;
} }
static void __exit firesat_exit(void) static void __exit fdtv_exit(void)
{ {
hpsb_unregister_protocol(&firesat_driver); hpsb_unregister_protocol(&fdtv_driver);
hpsb_unregister_highlevel(&firesat_highlevel); hpsb_unregister_highlevel(&fdtv_highlevel);
} }
module_init(firesat_init); module_init(fdtv_init);
module_exit(firesat_exit); module_exit(fdtv_exit);
MODULE_AUTHOR("Andreas Monitzer <andy@monitzer.com>"); MODULE_AUTHOR("Andreas Monitzer <andy@monitzer.com>");
MODULE_AUTHOR("Ben Backx <ben@bbackx.com>"); MODULE_AUTHOR("Ben Backx <ben@bbackx.com>");
......
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
#include <dvbdev.h> #include <dvbdev.h>
#include "avc_api.h" #include "avc.h"
#include "firesat.h" #include "firedtv.h"
#include "firesat-ci.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 && return info->CaInitializationStatus == 1 &&
info->CaErrorFlag == 0 && info->CaErrorFlag == 0 &&
...@@ -28,7 +28,7 @@ static int firesat_ca_ready(ANTENNA_INPUT_INFO *info) ...@@ -28,7 +28,7 @@ static int firesat_ca_ready(ANTENNA_INPUT_INFO *info)
info->CaModulePresentStatus == 1; 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; int flags = 0;
...@@ -41,12 +41,12 @@ static int firesat_get_ca_flags(ANTENNA_INPUT_INFO *info) ...@@ -41,12 +41,12 @@ static int firesat_get_ca_flags(ANTENNA_INPUT_INFO *info)
return flags; 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; struct ca_caps *cap = arg;
...@@ -57,73 +57,73 @@ static int firesat_ca_get_caps(void *arg) ...@@ -57,73 +57,73 @@ static int firesat_ca_get_caps(void *arg)
return 0; 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; ANTENNA_INPUT_INFO info;
struct ca_slot_info *slot = arg; struct ca_slot_info *slot = arg;
if (avc_tuner_status(firesat, &info)) if (avc_tuner_status(fdtv, &info))
return -EFAULT; return -EFAULT;
if (slot->num != 0) if (slot->num != 0)
return -EFAULT; return -EFAULT;
slot->type = CA_CI; slot->type = CA_CI;
slot->flags = firesat_get_ca_flags(&info); slot->flags = fdtv_get_ca_flags(&info);
return 0; 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; struct ca_msg *reply = arg;
return 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; 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; struct ca_msg *reply = arg;
return 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; ANTENNA_INPUT_INFO info;
int err; int err;
switch (firesat->ca_last_command) { switch (fdtv->ca_last_command) {
case TAG_APP_INFO_ENQUIRY: case TAG_APP_INFO_ENQUIRY:
err = firesat_ca_app_info(firesat, arg); err = fdtv_ca_app_info(fdtv, arg);
break; break;
case TAG_CA_INFO_ENQUIRY: case TAG_CA_INFO_ENQUIRY:
err = firesat_ca_info(firesat, arg); err = fdtv_ca_info(fdtv, arg);
break; break;
default: default:
if (avc_tuner_status(firesat, &info)) if (avc_tuner_status(fdtv, &info))
err = -EFAULT; err = -EFAULT;
else if (info.CaMmi == 1) else if (info.CaMmi == 1)
err = firesat_ca_get_mmi(firesat, arg); err = fdtv_ca_get_mmi(fdtv, arg);
else { else {
printk(KERN_INFO "%s: Unhandled message 0x%08X\n", printk(KERN_INFO "%s: Unhandled message 0x%08X\n",
__func__, firesat->ca_last_command); __func__, fdtv->ca_last_command);
err = -EFAULT; err = -EFAULT;
} }
} }
firesat->ca_last_command = 0; fdtv->ca_last_command = 0;
return err; 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; struct ca_msg *msg = arg;
int data_pos; int data_pos;
...@@ -139,21 +139,21 @@ static int firesat_ca_pmt(struct firesat *firesat, void *arg) ...@@ -139,21 +139,21 @@ static int firesat_ca_pmt(struct firesat *firesat, void *arg)
data_length = msg->msg[3]; 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; -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; struct ca_msg *msg = arg;
int err; int err;
/* Do we need a semaphore for this? */ /* 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]; (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: case TAG_CA_PMT:
err = firesat_ca_pmt(firesat, arg); err = fdtv_ca_pmt(fdtv, arg);
break; break;
case TAG_APP_INFO_ENQUIRY: case TAG_APP_INFO_ENQUIRY:
/* handled in ca_get_msg */ /* handled in ca_get_msg */
...@@ -164,39 +164,39 @@ static int firesat_ca_send_msg(struct firesat *firesat, void *arg) ...@@ -164,39 +164,39 @@ static int firesat_ca_send_msg(struct firesat *firesat, void *arg)
err = 0; err = 0;
break; break;
case TAG_ENTER_MENU: case TAG_ENTER_MENU:
err = avc_ca_enter_menu(firesat); err = avc_ca_enter_menu(fdtv);
break; break;
default: default:
printk(KERN_ERR "%s: Unhandled unknown message 0x%08X\n", printk(KERN_ERR "%s: Unhandled unknown message 0x%08X\n",
__func__, firesat->ca_last_command); __func__, fdtv->ca_last_command);
err = -EFAULT; err = -EFAULT;
} }
return err; 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) unsigned int cmd, void *arg)
{ {
struct dvb_device *dvbdev = file->private_data; struct dvb_device *dvbdev = file->private_data;
struct firesat *firesat = dvbdev->priv; struct firedtv *fdtv = dvbdev->priv;
ANTENNA_INPUT_INFO info; ANTENNA_INPUT_INFO info;
int err; int err;
switch(cmd) { switch(cmd) {
case CA_RESET: case CA_RESET:
err = firesat_ca_reset(firesat); err = fdtv_ca_reset(fdtv);
break; break;
case CA_GET_CAP: case CA_GET_CAP:
err = firesat_ca_get_caps(arg); err = fdtv_ca_get_caps(arg);
break; break;
case CA_GET_SLOT_INFO: case CA_GET_SLOT_INFO:
err = firesat_ca_get_slot_info(firesat, arg); err = fdtv_ca_get_slot_info(fdtv, arg);
break; break;
case CA_GET_MSG: case CA_GET_MSG:
err = firesat_ca_get_msg(firesat, arg); err = fdtv_ca_get_msg(fdtv, arg);
break; break;
case CA_SEND_MSG: case CA_SEND_MSG:
err = firesat_ca_send_msg(firesat, arg); err = fdtv_ca_send_msg(fdtv, arg);
break; break;
default: default:
printk(KERN_INFO "%s: Unhandled ioctl, command: %u\n",__func__, 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, ...@@ -205,57 +205,57 @@ static int firesat_ca_ioctl(struct inode *inode, struct file *file,
} }
/* FIXME Is this necessary? */ /* FIXME Is this necessary? */
avc_tuner_status(firesat, &info); avc_tuner_status(fdtv, &info);
return err; 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; return POLLIN;
} }
static struct file_operations firesat_ca_fops = { static struct file_operations fdtv_ca_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.ioctl = dvb_generic_ioctl, .ioctl = dvb_generic_ioctl,
.open = dvb_generic_open, .open = dvb_generic_open,
.release = dvb_generic_release, .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, .users = 1,
.readers = 1, .readers = 1,
.writers = 1, .writers = 1,
.fops = &firesat_ca_fops, .fops = &fdtv_ca_fops,
.kernel_ioctl = firesat_ca_ioctl, .kernel_ioctl = fdtv_ca_ioctl,
}; };
int firesat_ca_register(struct firesat *firesat) int fdtv_ca_register(struct firedtv *fdtv)
{ {
ANTENNA_INPUT_INFO info; ANTENNA_INPUT_INFO info;
int err; int err;
if (avc_tuner_status(firesat, &info)) if (avc_tuner_status(fdtv, &info))
return -EINVAL; return -EINVAL;
if (!firesat_ca_ready(&info)) if (!fdtv_ca_ready(&info))
return -EFAULT; return -EFAULT;
err = dvb_register_device(&firesat->adapter, &firesat->cadev, err = dvb_register_device(&fdtv->adapter, &fdtv->cadev,
&firesat_ca, firesat, DVB_DEVICE_CA); &fdtv_ca, fdtv, DVB_DEVICE_CA);
if (info.CaApplicationInfo == 0) if (info.CaApplicationInfo == 0)
printk(KERN_ERR "%s: CaApplicationInfo is not set.\n", printk(KERN_ERR "%s: CaApplicationInfo is not set.\n",
__func__); __func__);
if (info.CaDateTimeRequest == 1) 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; return err;
} }
void firesat_ca_release(struct firesat *firesat) void fdtv_ca_release(struct firedtv *fdtv)
{ {
if (firesat->cadev) if (fdtv->cadev)
dvb_unregister_device(firesat->cadev); dvb_unregister_device(fdtv->cadev);
} }
#ifndef _FIREDTV_CI_H #ifndef _FIREDTV_CI_H
#define _FIREDTV_CI_H #define _FIREDTV_CI_H
struct firesat; struct firedtv;
int firesat_ca_register(struct firesat *firesat); int fdtv_ca_register(struct firedtv *fdtv);
void firesat_ca_release(struct firesat *firesat); void fdtv_ca_release(struct firedtv *fdtv);
#endif /* _FIREDTV_CI_H */ #endif /* _FIREDTV_CI_H */
...@@ -19,65 +19,65 @@ ...@@ -19,65 +19,65 @@
#include <dvb_frontend.h> #include <dvb_frontend.h>
#include <dvbdev.h> #include <dvbdev.h>
#include "avc_api.h" #include "avc.h"
#include "firesat.h" #include "firedtv.h"
#include "firesat-ci.h" #include "firedtv-ci.h"
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); 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; int k;
if (mutex_lock_interruptible(&firesat->demux_mutex)) if (mutex_lock_interruptible(&fdtv->demux_mutex))
return NULL; return NULL;
for (k = 0; k < 16; k++) for (k = 0; k < 16; k++)
if (!firesat->channel[k].active) { if (!fdtv->channel[k].active) {
firesat->channel[k].active = true; fdtv->channel[k].active = true;
c = &firesat->channel[k]; c = &fdtv->channel[k];
break; break;
} }
mutex_unlock(&firesat->demux_mutex); mutex_unlock(&fdtv->demux_mutex);
return c; 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; int k, l = 0;
if (mutex_lock_interruptible(&firesat->demux_mutex)) if (mutex_lock_interruptible(&fdtv->demux_mutex))
return -EINTR; return -EINTR;
for (k = 0; k < 16; k++) for (k = 0; k < 16; k++)
if (firesat->channel[k].active) if (fdtv->channel[k].active)
pid[l++] = firesat->channel[k].pid; pid[l++] = fdtv->channel[k].pid;
mutex_unlock(&firesat->demux_mutex); mutex_unlock(&fdtv->demux_mutex);
*pidc = l; *pidc = l;
return 0; return 0;
} }
static int firesat_channel_release(struct firesat *firesat, static int fdtv_channel_release(struct firedtv *fdtv,
struct firesat_channel *channel) struct firedtv_channel *channel)
{ {
if (mutex_lock_interruptible(&firesat->demux_mutex)) if (mutex_lock_interruptible(&fdtv->demux_mutex))
return -EINTR; return -EINTR;
channel->active = false; channel->active = false;
mutex_unlock(&firesat->demux_mutex); mutex_unlock(&fdtv->demux_mutex);
return 0; 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 firedtv *fdtv = (struct firedtv*)dvbdmxfeed->demux->priv;
struct firesat_channel *channel; struct firedtv_channel *channel;
int pidc,k; int pidc,k;
u16 pids[16]; u16 pids[16];
...@@ -98,14 +98,14 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed) ...@@ -98,14 +98,14 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed)
case DMX_TS_PES_TELETEXT: case DMX_TS_PES_TELETEXT:
case DMX_TS_PES_PCR: case DMX_TS_PES_PCR:
case DMX_TS_PES_OTHER: 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++){ for(k=0;k<16;k++){
if (!firesat->channel[k].active) if (!fdtv->channel[k].active)
firesat->channel[k].pid = fdtv->channel[k].pid =
dvbdmxfeed->pid; dvbdmxfeed->pid;
break; break;
} }
channel = firesat_channel_allocate(firesat); channel = fdtv_channel_allocate(fdtv);
break; break;
default: default:
printk(KERN_ERR "%s: invalid pes type %u\n", printk(KERN_ERR "%s: invalid pes type %u\n",
...@@ -113,7 +113,7 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed) ...@@ -113,7 +113,7 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed)
return -EINVAL; return -EINVAL;
} }
} else { } else {
channel = firesat_channel_allocate(firesat); channel = fdtv_channel_allocate(fdtv);
} }
if (!channel) { if (!channel) {
...@@ -124,24 +124,24 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed) ...@@ -124,24 +124,24 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed)
dvbdmxfeed->priv = channel; dvbdmxfeed->priv = channel;
channel->pid = dvbdmxfeed->pid; channel->pid = dvbdmxfeed->pid;
if (firesat_channel_collect(firesat, &pidc, pids)) { if (fdtv_channel_collect(fdtv, &pidc, pids)) {
firesat_channel_release(firesat, channel); fdtv_channel_release(fdtv, channel);
printk(KERN_ERR "%s: could not collect pids!\n", __func__); printk(KERN_ERR "%s: could not collect pids!\n", __func__);
return -EINTR; return -EINTR;
} }
if (dvbdmxfeed->pid == 8192) { if (dvbdmxfeed->pid == 8192) {
k = avc_tuner_get_ts(firesat); k = avc_tuner_get_ts(fdtv);
if (k) { if (k) {
firesat_channel_release(firesat, channel); fdtv_channel_release(fdtv, channel);
printk("%s: AVCTuner_GetTS failed with error %d\n", printk("%s: AVCTuner_GetTS failed with error %d\n",
__func__, k); __func__, k);
return k; return k;
} }
} else { } else {
k = avc_tuner_set_pids(firesat, pidc, pids); k = avc_tuner_set_pids(fdtv, pidc, pids);
if (k) { if (k) {
firesat_channel_release(firesat, channel); fdtv_channel_release(fdtv, channel);
printk("%s: AVCTuner_SetPIDs failed with error %d\n", printk("%s: AVCTuner_SetPIDs failed with error %d\n",
__func__, k); __func__, k);
return k; return k;
...@@ -151,11 +151,11 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed) ...@@ -151,11 +151,11 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed)
return 0; 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 dvb_demux *demux = dvbdmxfeed->demux;
struct firesat *firesat = (struct firesat*)demux->priv; struct firedtv *fdtv = (struct firedtv*)demux->priv;
struct firesat_channel *c = dvbdmxfeed->priv; struct firedtv_channel *c = dvbdmxfeed->priv;
int k, l; int k, l;
u16 pids[16]; u16 pids[16];
...@@ -179,95 +179,95 @@ int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed) ...@@ -179,95 +179,95 @@ int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
return 0; return 0;
} }
if (mutex_lock_interruptible(&firesat->demux_mutex)) if (mutex_lock_interruptible(&fdtv->demux_mutex))
return -EINTR; return -EINTR;
/* list except channel to be removed */ /* list except channel to be removed */
for (k = 0, l = 0; k < 16; k++) for (k = 0, l = 0; k < 16; k++)
if (firesat->channel[k].active) { if (fdtv->channel[k].active) {
if (&firesat->channel[k] != c) if (&fdtv->channel[k] != c)
pids[l++] = firesat->channel[k].pid; pids[l++] = fdtv->channel[k].pid;
else 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) if (!k)
c->active = false; c->active = false;
mutex_unlock(&firesat->demux_mutex); mutex_unlock(&fdtv->demux_mutex);
return k; return k;
} }
int firesat_dvbdev_init(struct firesat *firesat, struct device *dev) int fdtv_dvbdev_init(struct firedtv *fdtv, struct device *dev)
{ {
int err; int err;
err = DVB_REGISTER_ADAPTER(&firesat->adapter, err = DVB_REGISTER_ADAPTER(&fdtv->adapter,
firedtv_model_names[firesat->type], fdtv_model_names[fdtv->type],
THIS_MODULE, dev, adapter_nr); THIS_MODULE, dev, adapter_nr);
if (err < 0) if (err < 0)
goto fail_log; goto fail_log;
/*DMX_TS_FILTERING | DMX_SECTION_FILTERING*/ /*DMX_TS_FILTERING | DMX_SECTION_FILTERING*/
firesat->demux.dmx.capabilities = 0; fdtv->demux.dmx.capabilities = 0;
firesat->demux.priv = (void *)firesat; fdtv->demux.priv = fdtv;
firesat->demux.filternum = 16; fdtv->demux.filternum = 16;
firesat->demux.feednum = 16; fdtv->demux.feednum = 16;
firesat->demux.start_feed = firesat_start_feed; fdtv->demux.start_feed = fdtv_start_feed;
firesat->demux.stop_feed = firesat_stop_feed; fdtv->demux.stop_feed = fdtv_stop_feed;
firesat->demux.write_to_decoder = NULL; fdtv->demux.write_to_decoder = NULL;
err = dvb_dmx_init(&firesat->demux); err = dvb_dmx_init(&fdtv->demux);
if (err) if (err)
goto fail_unreg_adapter; goto fail_unreg_adapter;
firesat->dmxdev.filternum = 16; fdtv->dmxdev.filternum = 16;
firesat->dmxdev.demux = &firesat->demux.dmx; fdtv->dmxdev.demux = &fdtv->demux.dmx;
firesat->dmxdev.capabilities = 0; fdtv->dmxdev.capabilities = 0;
err = dvb_dmxdev_init(&firesat->dmxdev, &firesat->adapter); err = dvb_dmxdev_init(&fdtv->dmxdev, &fdtv->adapter);
if (err) if (err)
goto fail_dmx_release; 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, err = fdtv->demux.dmx.add_frontend(&fdtv->demux.dmx,
&firesat->frontend); &fdtv->frontend);
if (err) if (err)
goto fail_dmxdev_release; goto fail_dmxdev_release;
err = firesat->demux.dmx.connect_frontend(&firesat->demux.dmx, err = fdtv->demux.dmx.connect_frontend(&fdtv->demux.dmx,
&firesat->frontend); &fdtv->frontend);
if (err) if (err)
goto fail_rem_frontend; 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); fdtv_frontend_init(fdtv);
err = dvb_register_frontend(&firesat->adapter, &firesat->fe); err = dvb_register_frontend(&fdtv->adapter, &fdtv->fe);
if (err) if (err)
goto fail_net_release; goto fail_net_release;
err = firesat_ca_register(firesat); err = fdtv_ca_register(fdtv);
if (err) if (err)
dev_info(dev, "Conditional Access Module not enabled\n"); dev_info(dev, "Conditional Access Module not enabled\n");
return 0; return 0;
fail_net_release: fail_net_release:
dvb_net_release(&firesat->dvbnet); dvb_net_release(&fdtv->dvbnet);
firesat->demux.dmx.close(&firesat->demux.dmx); fdtv->demux.dmx.close(&fdtv->demux.dmx);
fail_rem_frontend: fail_rem_frontend:
firesat->demux.dmx.remove_frontend(&firesat->demux.dmx, fdtv->demux.dmx.remove_frontend(&fdtv->demux.dmx,
&firesat->frontend); &fdtv->frontend);
fail_dmxdev_release: fail_dmxdev_release:
dvb_dmxdev_release(&firesat->dmxdev); dvb_dmxdev_release(&fdtv->dmxdev);
fail_dmx_release: fail_dmx_release:
dvb_dmx_release(&firesat->demux); dvb_dmx_release(&fdtv->demux);
fail_unreg_adapter: fail_unreg_adapter:
dvb_unregister_adapter(&firesat->adapter); dvb_unregister_adapter(&fdtv->adapter);
fail_log: fail_log:
dev_err(dev, "DVB initialization failed\n"); dev_err(dev, "DVB initialization failed\n");
return err; return err;
......
...@@ -17,77 +17,77 @@ ...@@ -17,77 +17,77 @@
#include <dvb_frontend.h> #include <dvb_frontend.h>
#include "avc_api.h" #include "avc.h"
#include "cmp.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; int err;
/* FIXME - allocate free channel at IRM */ /* FIXME - allocate free channel at IRM */
firesat->isochannel = firesat->adapter.num; fdtv->isochannel = fdtv->adapter.num;
err = cmp_establish_pp_connection(firesat, firesat->subunit, err = cmp_establish_pp_connection(fdtv, fdtv->subunit,
firesat->isochannel); fdtv->isochannel);
if (err) { if (err) {
printk(KERN_ERR "Could not establish point to point " printk(KERN_ERR "Could not establish point to point "
"connection.\n"); "connection.\n");
return err; 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); tear_down_iso_channel(fdtv);
cmp_break_pp_connection(firesat, firesat->subunit, firesat->isochannel); cmp_break_pp_connection(fdtv, fdtv->subunit, fdtv->isochannel);
firesat->isochannel = -1; fdtv->isochannel = -1;
return 0; 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 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); 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) fe_sec_mini_cmd_t minicmd)
{ {
return 0; 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; 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) 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; 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; ANTENNA_INPUT_INFO info;
if (avc_tuner_status(firesat, &info)) if (avc_tuner_status(fdtv, &info))
return -EINVAL; return -EINVAL;
if (info.NoRF) if (info.NoRF)
...@@ -98,12 +98,12 @@ static int firesat_read_status(struct dvb_frontend *fe, fe_status_t *status) ...@@ -98,12 +98,12 @@ static int firesat_read_status(struct dvb_frontend *fe, fe_status_t *status)
return 0; 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; ANTENNA_INPUT_INFO info;
if (avc_tuner_status(firesat, &info)) if (avc_tuner_status(fdtv, &info))
return -EINVAL; return -EINVAL;
*ber = info.BER[0] << 24 | info.BER[1] << 16 | *ber = info.BER[0] << 24 | info.BER[1] << 16 |
...@@ -111,24 +111,24 @@ static int firesat_read_ber(struct dvb_frontend *fe, u32 *ber) ...@@ -111,24 +111,24 @@ static int firesat_read_ber(struct dvb_frontend *fe, u32 *ber)
return 0; 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; ANTENNA_INPUT_INFO info;
if (avc_tuner_status(firesat, &info)) if (avc_tuner_status(fdtv, &info))
return -EINVAL; return -EINVAL;
*strength = info.SignalStrength << 8; *strength = info.SignalStrength << 8;
return 0; 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; ANTENNA_INPUT_INFO info;
if (avc_tuner_status(firesat, &info)) if (avc_tuner_status(fdtv, &info))
return -EINVAL; return -EINVAL;
/* C/N[dB] = -10 * log10(snr / 65535) */ /* C/N[dB] = -10 * log10(snr / 65535) */
...@@ -137,53 +137,53 @@ static int firesat_read_snr(struct dvb_frontend *fe, u16 *snr) ...@@ -137,53 +137,53 @@ static int firesat_read_snr(struct dvb_frontend *fe, u16 *snr)
return 0; 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; 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 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? */ /* 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; return -EINVAL;
else else
return 0; /* not sure of this... */ 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) struct dvb_frontend_parameters *params)
{ {
return -EOPNOTSUPP; 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; struct dvb_frontend_info *fi = &ops->info;
ops->init = firesat_dvb_init; ops->init = fdtv_dvb_init;
ops->sleep = firesat_sleep; ops->sleep = fdtv_sleep;
ops->set_frontend = firesat_set_frontend; ops->set_frontend = fdtv_set_frontend;
ops->get_frontend = firesat_get_frontend; ops->get_frontend = fdtv_get_frontend;
ops->read_status = firesat_read_status; ops->read_status = fdtv_read_status;
ops->read_ber = firesat_read_ber; ops->read_ber = fdtv_read_ber;
ops->read_signal_strength = firesat_read_signal_strength; ops->read_signal_strength = fdtv_read_signal_strength;
ops->read_snr = firesat_read_snr; ops->read_snr = fdtv_read_snr;
ops->read_ucblocks = firesat_read_uncorrected_blocks; ops->read_ucblocks = fdtv_read_uncorrected_blocks;
ops->diseqc_send_master_cmd = firesat_diseqc_send_master_cmd; ops->diseqc_send_master_cmd = fdtv_diseqc_send_master_cmd;
ops->diseqc_send_burst = firesat_diseqc_send_burst; ops->diseqc_send_burst = fdtv_diseqc_send_burst;
ops->set_tone = firesat_set_tone; ops->set_tone = fdtv_set_tone;
ops->set_voltage = firesat_set_voltage; ops->set_voltage = fdtv_set_voltage;
switch (firesat->type) { switch (fdtv->type) {
case FireSAT_DVB_S: case FIREDTV_DVB_S:
fi->type = FE_QPSK; fi->type = FE_QPSK;
fi->frequency_min = 950000; fi->frequency_min = 950000;
...@@ -202,7 +202,7 @@ void firesat_frontend_init(struct firesat *firesat) ...@@ -202,7 +202,7 @@ void firesat_frontend_init(struct firesat *firesat)
FE_CAN_QPSK; FE_CAN_QPSK;
break; break;
case FireSAT_DVB_C: case FIREDTV_DVB_C:
fi->type = FE_QAM; fi->type = FE_QAM;
fi->frequency_min = 47000000; fi->frequency_min = 47000000;
...@@ -220,7 +220,7 @@ void firesat_frontend_init(struct firesat *firesat) ...@@ -220,7 +220,7 @@ void firesat_frontend_init(struct firesat *firesat)
FE_CAN_QAM_AUTO; FE_CAN_QAM_AUTO;
break; break;
case FireSAT_DVB_T: case FIREDTV_DVB_T:
fi->type = FE_OFDM; fi->type = FE_OFDM;
fi->frequency_min = 49000000; fi->frequency_min = 49000000;
...@@ -236,10 +236,10 @@ void firesat_frontend_init(struct firesat *firesat) ...@@ -236,10 +236,10 @@ void firesat_frontend_init(struct firesat *firesat)
default: default:
printk(KERN_ERR "FireDTV: no frontend for model type %d\n", 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; fdtv->fe.dvb = &fdtv->adapter;
firesat->fe.sec_priv = firesat; fdtv->fe.sec_priv = fdtv;
} }
...@@ -20,35 +20,35 @@ ...@@ -20,35 +20,35 @@
#include <iso.h> #include <iso.h>
#include <nodemgr.h> #include <nodemgr.h>
#include "firesat.h" #include "firedtv.h"
static void rawiso_activity_cb(struct hpsb_iso *iso); 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) { if (fdtv->iso_handle != NULL) {
hpsb_iso_stop(firesat->iso_handle); hpsb_iso_stop(fdtv->iso_handle);
hpsb_iso_shutdown(firesat->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; int result;
firesat->iso_handle = fdtv->iso_handle =
hpsb_iso_recv_init(firesat->ud->ne->host, hpsb_iso_recv_init(fdtv->ud->ne->host,
256 * 200, //data_buf_size, 256 * 200, //data_buf_size,
256, //buf_packets, 256, //buf_packets,
firesat->isochannel, fdtv->isochannel,
HPSB_ISO_DMA_DEFAULT, //dma_mode, HPSB_ISO_DMA_DEFAULT, //dma_mode,
-1, //stat.config.irq_interval, -1, //stat.config.irq_interval,
rawiso_activity_cb); rawiso_activity_cb);
if (firesat->iso_handle == NULL) { if (fdtv->iso_handle == NULL) {
printk(KERN_ERR "Cannot initialize iso receive.\n"); printk(KERN_ERR "Cannot initialize iso receive.\n");
return -EINVAL; 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) { if (result != 0) {
printk(KERN_ERR "Cannot start iso receive.\n"); printk(KERN_ERR "Cannot start iso receive.\n");
return -EINVAL; return -EINVAL;
...@@ -62,19 +62,19 @@ static void rawiso_activity_cb(struct hpsb_iso *iso) ...@@ -62,19 +62,19 @@ static void rawiso_activity_cb(struct hpsb_iso *iso)
unsigned int i; unsigned int i;
unsigned int packet; unsigned int packet;
unsigned long flags; unsigned long flags;
struct firesat *firesat = NULL; struct firedtv *fdtv = NULL;
struct firesat *firesat_iterator; struct firedtv *fdtv_iterator;
spin_lock_irqsave(&firesat_list_lock, flags); spin_lock_irqsave(&fdtv_list_lock, flags);
list_for_each_entry(firesat_iterator, &firesat_list, list) { list_for_each_entry(fdtv_iterator, &fdtv_list, list) {
if(firesat_iterator->iso_handle == iso) { if(fdtv_iterator->iso_handle == iso) {
firesat = firesat_iterator; fdtv = fdtv_iterator;
break; break;
} }
} }
spin_unlock_irqrestore(&firesat_list_lock, flags); spin_unlock_irqrestore(&fdtv_list_lock, flags);
if (firesat) { if (fdtv) {
packet = iso->first_packet; packet = iso->first_packet;
num = hpsb_iso_n_ready(iso); num = hpsb_iso_n_ready(iso);
for (i = 0; i < num; i++, for (i = 0; i < num; i++,
...@@ -91,7 +91,7 @@ static void rawiso_activity_cb(struct hpsb_iso *iso) ...@@ -91,7 +91,7 @@ static void rawiso_activity_cb(struct hpsb_iso *iso)
while (count --) { while (count --) {
if (buf[sizeof(struct firewireheader)] == 0x47) if (buf[sizeof(struct firewireheader)] == 0x47)
dvb_dmx_swfilter_packets(&firesat->demux, dvb_dmx_swfilter_packets(&fdtv->demux,
&buf[sizeof(struct firewireheader)], 1); &buf[sizeof(struct firewireheader)], 1);
else else
printk("%s: invalid packet, skipping\n", __func__); printk("%s: invalid packet, skipping\n", __func__);
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/types.h> #include <linux/types.h>
#include "firesat-rc.h" #include "firedtv-rc.h"
#include "firesat.h" #include "firedtv.h"
/* fixed table with older keycodes, geared towards MythTV */ /* fixed table with older keycodes, geared towards MythTV */
const static u16 oldtable[] = { const static u16 oldtable[] = {
...@@ -125,7 +125,7 @@ const static u16 keytable[] = { ...@@ -125,7 +125,7 @@ const static u16 keytable[] = {
[0x34] = KEY_EXIT, [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; struct input_dev *idev;
int i, err; int i, err;
...@@ -134,7 +134,7 @@ int firesat_register_rc(struct firesat *firesat, struct device *dev) ...@@ -134,7 +134,7 @@ int firesat_register_rc(struct firesat *firesat, struct device *dev)
if (!idev) if (!idev)
return -ENOMEM; return -ENOMEM;
firesat->remote_ctrl_dev = idev; fdtv->remote_ctrl_dev = idev;
idev->name = "FireDTV remote control"; idev->name = "FireDTV remote control";
idev->dev.parent = dev; idev->dev.parent = dev;
idev->evbit[0] = BIT_MASK(EV_KEY); idev->evbit[0] = BIT_MASK(EV_KEY);
...@@ -162,15 +162,15 @@ fail: ...@@ -162,15 +162,15 @@ fail:
return err; return err;
} }
void firesat_unregister_rc(struct firesat *firesat) void fdtv_unregister_rc(struct firedtv *fdtv)
{ {
kfree(firesat->remote_ctrl_dev->keycode); kfree(fdtv->remote_ctrl_dev->keycode);
input_unregister_device(firesat->remote_ctrl_dev); 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) if (code >= 0x0300 && code <= 0x031f)
code = keycode[code - 0x0300]; code = keycode[code - 0x0300];
...@@ -186,6 +186,6 @@ void firesat_handle_rc(struct firesat *firesat, unsigned int code) ...@@ -186,6 +186,6 @@ void firesat_handle_rc(struct firesat *firesat, unsigned int code)
return; return;
} }
input_report_key(firesat->remote_ctrl_dev, code, 1); input_report_key(fdtv->remote_ctrl_dev, code, 1);
input_report_key(firesat->remote_ctrl_dev, code, 0); input_report_key(fdtv->remote_ctrl_dev, code, 0);
} }
#ifndef _FIREDTV_RC_H #ifndef _FIREDTV_RC_H
#define _FIREDTV_RC_H #define _FIREDTV_RC_H
struct firesat; struct firedtv;
struct device; struct device;
int firesat_register_rc(struct firesat *firesat, struct device *dev); int fdtv_register_rc(struct firedtv *fdtv, struct device *dev);
void firesat_unregister_rc(struct firesat *firesat); void fdtv_unregister_rc(struct firedtv *fdtv);
void firesat_handle_rc(struct firesat *firesat, unsigned int code); void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code);
#endif /* _FIREDTV_RC_H */ #endif /* _FIREDTV_RC_H */
...@@ -120,18 +120,18 @@ ...@@ -120,18 +120,18 @@
enum model_type { enum model_type {
FireSAT_UNKNOWN = 0, FIREDTV_UNKNOWN = 0,
FireSAT_DVB_S = 1, FIREDTV_DVB_S = 1,
FireSAT_DVB_C = 2, FIREDTV_DVB_C = 2,
FireSAT_DVB_T = 3, FIREDTV_DVB_T = 3,
FireSAT_DVB_S2 = 4, FIREDTV_DVB_S2 = 4,
}; };
struct input_dev; struct input_dev;
struct hpsb_iso; struct hpsb_iso;
struct unit_directory; struct unit_directory;
struct firesat { struct firedtv {
struct dvb_adapter adapter; struct dvb_adapter adapter;
struct dmxdev dmxdev; struct dmxdev dmxdev;
struct dvb_demux demux; struct dvb_demux demux;
...@@ -149,7 +149,7 @@ struct firesat { ...@@ -149,7 +149,7 @@ struct firesat {
struct work_struct remote_ctrl_work; struct work_struct remote_ctrl_work;
struct input_dev *remote_ctrl_dev; struct input_dev *remote_ctrl_dev;
struct firesat_channel { struct firedtv_channel {
bool active; bool active;
int pid; int pid;
} channel[16]; } channel[16];
...@@ -206,22 +206,22 @@ struct CIPHeader { ...@@ -206,22 +206,22 @@ struct CIPHeader {
}; };
}; };
extern const char *firedtv_model_names[]; extern const char *fdtv_model_names[];
extern struct list_head firesat_list; extern struct list_head fdtv_list;
extern spinlock_t firesat_list_lock; extern spinlock_t fdtv_list_lock;
struct device; struct device;
/* firesat_dvb.c */ /* firedtv-dvb.c */
int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed); int fdtv_start_feed(struct dvb_demux_feed *dvbdmxfeed);
int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed); int fdtv_stop_feed(struct dvb_demux_feed *dvbdmxfeed);
int firesat_dvbdev_init(struct firesat *firesat, struct device *dev); int fdtv_dvbdev_init(struct firedtv *fdtv, struct device *dev);
/* firesat_fe.c */ /* firedtv-fe.c */
void firesat_frontend_init(struct firesat *firesat); void fdtv_frontend_init(struct firedtv *fdtv);
/* firesat_iso.c */ /* firedtv-iso.c */
int setup_iso_channel(struct firesat *firesat); int setup_iso_channel(struct firedtv *fdtv);
void tear_down_iso_channel(struct firesat *firesat); void tear_down_iso_channel(struct firedtv *fdtv);
#endif /* _FIREDTV_H */ #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