summaryrefslogtreecommitdiff
path: root/v4l_experimental/firesat
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-06-24 08:32:26 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-24 08:32:26 -0300
commit04e2c76f8d845ee90c1e85ee6a170618b22ff933 (patch)
treedc39e43391782e48e9cc697ccf040cd7e9574509 /v4l_experimental/firesat
parentde2d21cb87c4d4e3124c02d856e632f355f1a002 (diff)
downloadmediapointer-dvb-s2-04e2c76f8d845ee90c1e85ee6a170618b22ff933.tar.gz
mediapointer-dvb-s2-04e2c76f8d845ee90c1e85ee6a170618b22ff933.tar.bz2
Whitespace cleanups
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l_experimental/firesat')
-rw-r--r--v4l_experimental/firesat/avc_api.c182
-rw-r--r--v4l_experimental/firesat/cmp.c18
-rw-r--r--v4l_experimental/firesat/firesat-ci.c10
-rw-r--r--v4l_experimental/firesat/firesat-rc.c6
-rw-r--r--v4l_experimental/firesat/firesat.c332
5 files changed, 274 insertions, 274 deletions
diff --git a/v4l_experimental/firesat/avc_api.c b/v4l_experimental/firesat/avc_api.c
index bff42413c..eb597eaa4 100644
--- a/v4l_experimental/firesat/avc_api.c
+++ b/v4l_experimental/firesat/avc_api.c
@@ -11,7 +11,7 @@
#include <ieee1394_transactions.h>
#include <nodemgr.h>
-#include <asm/byteorder.h>
+#include <asm/byteorder.h>
#include <linux/delay.h>
#include "firesat.h"
#include "avc_api.h"
@@ -47,51 +47,51 @@ static int avc_down_timeout(atomic_t *done, int timeout)
}
static int __AVCWrite(struct firesat *firesat, const AVCCmdFrm *CmdFrm, AVCRspFrm *RspFrm) {
- struct hpsb_packet *packet;
+ struct hpsb_packet *packet;
struct node_entry *ne;
-
+
ne = firesat->nodeentry;
if(!ne) {
printk("%s: lost node!\n",__FUNCTION__);
return -EIO;
}
-
+
/* need all input data */
if(!firesat || !ne || !CmdFrm)
return -EINVAL;
-
+
// printk(KERN_INFO "AVCWrite command %x\n",CmdFrm->opcode);
-
+
// for(k=0;k<CmdFrm->length;k++)
// printk(KERN_INFO "CmdFrm[%d] = %08x\n", k, ((quadlet_t*)CmdFrm)[k]);
-
+
packet=hpsb_make_writepacket(ne->host, ne->nodeid, COMMAND_REGISTER,
(quadlet_t*)CmdFrm, CmdFrm->length);
-
+
hpsb_set_packet_complete_task(packet, (void (*)(void*))avc_free_packet,
packet);
-
+
hpsb_node_fill_packet(ne, packet);
- if(RspFrm)
+ if(RspFrm)
atomic_set(&firesat->avc_reply_received, 0);
if (hpsb_send_packet(packet) < 0) {
- avc_free_packet(packet);
- atomic_set(&firesat->avc_reply_received, 1);
+ avc_free_packet(packet);
+ atomic_set(&firesat->avc_reply_received, 1);
return -EIO;
}
-
+
if(RspFrm) {
- if(avc_down_timeout(&firesat->avc_reply_received,HZ/2)) {
- printk("%s: timeout waiting for avc response\n",__FUNCTION__);
- atomic_set(&firesat->avc_reply_received, 1);
- return -ETIMEDOUT;
- }
-
+ if(avc_down_timeout(&firesat->avc_reply_received,HZ/2)) {
+ printk("%s: timeout waiting for avc response\n",__FUNCTION__);
+ atomic_set(&firesat->avc_reply_received, 1);
+ return -ETIMEDOUT;
+ }
+
memcpy(RspFrm,firesat->respfrm,firesat->resp_length);
}
-
+
return 0;
}
@@ -99,9 +99,9 @@ int AVCWrite(struct firesat*firesat, const AVCCmdFrm *CmdFrm, AVCRspFrm *RspFrm)
int ret;
if(down_interruptible(&firesat->avc_sem))
return -EINTR;
-
+
ret = __AVCWrite(firesat, CmdFrm, RspFrm);
-
+
up(&firesat->avc_sem);
return ret;
}
@@ -111,7 +111,7 @@ DECLARE_TASKLET(schedule_remotecontrol, do_schedule_remotecontrol, 0);
static void do_schedule_remotecontrol(unsigned long ignored) {
struct firesat *firesat;
- unsigned long flags;
+ unsigned long flags;
spin_lock_irqsave(&firesat_list_lock, flags);
list_for_each_entry(firesat,&firesat_list,list) {
@@ -125,7 +125,7 @@ static void do_schedule_remotecontrol(unsigned long ignored) {
tasklet_schedule(&schedule_remotecontrol);
up(&firesat->avc_sem);
- }
+ }
}
}
spin_unlock_irqrestore(&firesat_list_lock, flags);
@@ -135,8 +135,8 @@ int AVCRecv(struct firesat *firesat, u8 *data, size_t length) {
// printk(KERN_INFO "%s\n",__FUNCTION__);
// remote control handling
-
- AVCRspFrm *RspFrm = (AVCRspFrm*)data;
+
+ AVCRspFrm *RspFrm = (AVCRspFrm*)data;
if(/*RspFrm->length >= 8 && ###*/
((RspFrm->operand[0] == SFE_VENDOR_DE_COMPANYID_0 &&
@@ -144,59 +144,59 @@ int AVCRecv(struct firesat *firesat, u8 *data, size_t length) {
RspFrm->operand[2] == SFE_VENDOR_DE_COMPANYID_2) ||
(RspFrm->operand[0] == SFE_VENDOR_EL_COMPANYID_0 &&
RspFrm->operand[1] == SFE_VENDOR_EL_COMPANYID_1 &&
- RspFrm->operand[2] == SFE_VENDOR_EL_COMPANYID_2)) &&
+ RspFrm->operand[2] == SFE_VENDOR_EL_COMPANYID_2)) &&
RspFrm->operand[3] == SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL) {
if(RspFrm->resp == CHANGED) {
// printk(KERN_INFO "%s: code = %02x %02x\n",__FUNCTION__,RspFrm->operand[4],RspFrm->operand[5]);
firesat_got_remotecontrolcode((((u16)RspFrm->operand[4]) << 8) | ((u16)RspFrm->operand[5]));
- // schedule
+ // schedule
atomic_set(&firesat->reschedule_remotecontrol, 1);
tasklet_schedule(&schedule_remotecontrol);
} else if(RspFrm->resp != INTERIM)
printk(KERN_INFO "%s: remote control result = %d\n",__FUNCTION__, RspFrm->resp);
return 0;
}
-
+
if(atomic_read(&firesat->avc_reply_received) == 1) {
printk("%s: received out-of-order AVC response, ignored\n",__FUNCTION__);
return -EINVAL;
}
// AVCRspFrm *resp=(AVCRspFrm *)data;
// int k;
-/*
+/*
printk(KERN_INFO "resp=0x%x\n",resp->resp);
printk(KERN_INFO "cts=0x%x\n",resp->cts);
printk(KERN_INFO "suid=0x%x\n",resp->suid);
printk(KERN_INFO "sutyp=0x%x\n",resp->sutyp);
printk(KERN_INFO "opcode=0x%x\n",resp->opcode);
printk(KERN_INFO "length=%d\n",resp->length);
-*/
+*/
// for(k=0;k<2;k++)
// printk(KERN_INFO "operand[%d]=%02x\n",k,resp->operand[k]);
-
+
memcpy(firesat->respfrm,data,length);
firesat->resp_length=length;
atomic_set(&firesat->avc_reply_received, 1);
-
+
return 0;
}
// tuning command for setting the relative LNB frequency (not supported by the AVC standard)
static void AVCTuner_DSD_directcmd(struct firesat *firesat, struct dvb_frontend_parameters *params, AVCCmdFrm *CmdFrm) {
memset(CmdFrm, 0, sizeof(AVCCmdFrm));
-
+
CmdFrm->cts = AVC;
CmdFrm->ctype = CONTROL;
CmdFrm->sutyp = 0x5;
CmdFrm->suid = firesat->subunit;
CmdFrm->opcode = VENDOR;
- /* ### should check for elgato and use SFE_VENDOR_EL_COMPANYID_0 in this case */
- CmdFrm->operand[0]=SFE_VENDOR_DE_COMPANYID_0;
- CmdFrm->operand[1]=SFE_VENDOR_DE_COMPANYID_1;
- CmdFrm->operand[2]=SFE_VENDOR_DE_COMPANYID_2;
+ /* ### should check for elgato and use SFE_VENDOR_EL_COMPANYID_0 in this case */
+ CmdFrm->operand[0]=SFE_VENDOR_DE_COMPANYID_0;
+ CmdFrm->operand[1]=SFE_VENDOR_DE_COMPANYID_1;
+ CmdFrm->operand[2]=SFE_VENDOR_DE_COMPANYID_2;
CmdFrm->operand[3]=0x58;
printk(KERN_INFO "%s: tuning to frequency %u\n",__FUNCTION__,params->frequency);
@@ -207,7 +207,7 @@ static void AVCTuner_DSD_directcmd(struct firesat *firesat, struct dvb_frontend_
CmdFrm->operand[7] = params->frequency & 0xFF;
printk(KERN_INFO "%s: symbol rate = %uBd\n",__FUNCTION__,params->u.qpsk.symbol_rate);
-
+
CmdFrm->operand[8] = ((params->u.qpsk.symbol_rate/1000) >> 8) & 0xFF;
CmdFrm->operand[9] = (params->u.qpsk.symbol_rate/1000) & 0xFF;
@@ -233,7 +233,7 @@ static void AVCTuner_DSD_directcmd(struct firesat *firesat, struct dvb_frontend_
default:
CmdFrm->operand[10] = 0x0;
}
-
+
if(firesat->voltage == 0xff)
CmdFrm->operand[11] = 0xff;
else
@@ -242,7 +242,7 @@ static void AVCTuner_DSD_directcmd(struct firesat *firesat, struct dvb_frontend_
CmdFrm->operand[12] = 0xff;
else
CmdFrm->operand[12] = (firesat->tone==SEC_TONE_ON)?1:0; // band
-
+
CmdFrm->length = 16;
}
@@ -251,9 +251,9 @@ int AVCTuner_DSD(struct firesat *firesat, struct dvb_frontend_parameters *params
AVCRspFrm RspFrm;
M_VALID_FLAGS flags;
int k;
-
+
// printk(KERN_INFO "%s\n", __FUNCTION__);
-
+
if(firesat->type == FireSAT_DVB_S)
AVCTuner_DSD_directcmd(firesat, params, &CmdFrm);
else {
@@ -290,15 +290,15 @@ int AVCTuner_DSD(struct firesat *firesat, struct dvb_frontend_parameters *params
flags.Bits.reserved1 = 0;
flags.Bits.Network_ID = 0;
}
-
+
memset(&CmdFrm, 0, sizeof(AVCCmdFrm));
-
+
CmdFrm.cts = AVC;
CmdFrm.ctype = CONTROL;
CmdFrm.sutyp = 0x5;
CmdFrm.suid = firesat->subunit;
CmdFrm.opcode = DSD;
-
+
CmdFrm.operand[0] = 0; // source plug
CmdFrm.operand[1] = 0xD2; // subfunction replace
CmdFrm.operand[2] = 0x20; // system id = DVB
@@ -306,7 +306,7 @@ int AVCTuner_DSD(struct firesat *firesat, struct dvb_frontend_parameters *params
CmdFrm.operand[4] = (firesat->type == FireSAT_DVB_T)?0x0c:0x11; // system_specific_multiplex selection_length
CmdFrm.operand[5] = flags.Valid_Word.ByteHi; // valid_flags [0]
CmdFrm.operand[6] = flags.Valid_Word.ByteLo; // valid_flags [1]
-
+
if(firesat->type == FireSAT_DVB_T) {
CmdFrm.operand[7] = 0x0;
CmdFrm.operand[8] = (params->frequency/10) >> 24;
@@ -408,18 +408,18 @@ int AVCTuner_DSD(struct firesat *firesat, struct dvb_frontend_parameters *params
default:
break;
}
-
+
CmdFrm.operand[15] = 0x00; // network_ID[0]
CmdFrm.operand[16] = 0x00; // network_ID[1]
CmdFrm.operand[17] = 0x00; // Nr_of_dsd_sel_specs = 0 - > No PIDs are transmitted
-
+
CmdFrm.length = 20;
} else {
CmdFrm.operand[7] = 0x00;
CmdFrm.operand[8] = (((firesat->voltage==SEC_VOLTAGE_18)?0:1)<<6); /* 0 = H, 1 = V */
CmdFrm.operand[9] = 0x00;
CmdFrm.operand[10] = 0x00;
-
+
if(firesat->type == FireSAT_DVB_S) {
/* ### relative frequency -> absolute frequency */
CmdFrm.operand[11] = (((params->frequency/4) >> 16) & 0xFF) | (2 << 6);
@@ -430,11 +430,11 @@ int AVCTuner_DSD(struct firesat *firesat, struct dvb_frontend_parameters *params
CmdFrm.operand[12] = ((params->frequency/4000) >> 8) & 0xFF;
CmdFrm.operand[13] = (params->frequency/4000) & 0xFF;
}
-
+
CmdFrm.operand[14] = ((params->u.qpsk.symbol_rate/1000) >> 12) & 0xFF;
CmdFrm.operand[15] = ((params->u.qpsk.symbol_rate/1000) >> 4) & 0xFF;
CmdFrm.operand[16] = ((params->u.qpsk.symbol_rate/1000) << 4) & 0xF0;
-
+
CmdFrm.operand[17] = 0x00;
switch(params->u.qpsk.fec_inner) {
case FEC_1_2:
@@ -485,7 +485,7 @@ int AVCTuner_DSD(struct firesat *firesat, struct dvb_frontend_parameters *params
CmdFrm.operand[20] = 0x00;
CmdFrm.operand[21] = 0x00;
CmdFrm.operand[22] = 0x00; // Nr_of_dsd_sel_specs = 0 - > No PIDs are transmitted
-
+
CmdFrm.length=28;
}
} // AVCTuner_DSD_direct
@@ -495,7 +495,7 @@ int AVCTuner_DSD(struct firesat *firesat, struct dvb_frontend_parameters *params
// msleep(250);
mdelay(500);
-
+
if(status)
*status=RspFrm.operand[2];
return 0;
@@ -505,9 +505,9 @@ int AVCTuner_SetPIDs(struct firesat *firesat, unsigned char pidc, u16 pid[]) {
AVCCmdFrm CmdFrm;
AVCRspFrm RspFrm;
int pos,k;
-
+
printk(KERN_INFO "%s\n", __FUNCTION__);
-
+
if(pidc > 16 && pidc != 0xFF)
return -EINVAL;
@@ -518,7 +518,7 @@ int AVCTuner_SetPIDs(struct firesat *firesat, unsigned char pidc, u16 pid[]) {
CmdFrm.sutyp = 0x5;
CmdFrm.suid = firesat->subunit;
CmdFrm.opcode = DSD;
-
+
CmdFrm.operand[0] = 0; // source plug
CmdFrm.operand[1] = 0xD2; // subfunction replace
CmdFrm.operand[2] = 0x20; // system id = DVB
@@ -526,7 +526,7 @@ int AVCTuner_SetPIDs(struct firesat *firesat, unsigned char pidc, u16 pid[]) {
CmdFrm.operand[4] = 0x11; // system_specific_multiplex selection_length
CmdFrm.operand[5] = 0x00; // valid_flags [0]
CmdFrm.operand[6] = 0x00; // valid_flags [1]
-
+
if(firesat->type == FireSAT_DVB_T) {
/* CmdFrm.operand[7] = 0x00;
CmdFrm.operand[8] = 0x00;//(params->frequency/10) >> 24;
@@ -536,7 +536,7 @@ int AVCTuner_SetPIDs(struct firesat *firesat, unsigned char pidc, u16 pid[]) {
CmdFrm.operand[12] = 0x00;
CmdFrm.operand[13] = 0x00;
CmdFrm.operand[14] = 0x00;
-
+
CmdFrm.operand[15] = 0x00; // network_ID[0]
CmdFrm.operand[16] = 0x00; // network_ID[1]
*/ CmdFrm.operand[17] = pidc; // Nr_of_dsd_sel_specs
@@ -547,22 +547,22 @@ int AVCTuner_SetPIDs(struct firesat *firesat, unsigned char pidc, u16 pid[]) {
CmdFrm.operand[8] = 0x00;
CmdFrm.operand[9] = 0x00;
CmdFrm.operand[10] = 0x00;
-
+
CmdFrm.operand[11] = 0x00;//(((params->frequency/4) >> 16) & 0xFF) | (2 << 6);
CmdFrm.operand[12] = 0x00;//((params->frequency/4) >> 8) & 0xFF;
CmdFrm.operand[13] = 0x00;//(params->frequency/4) & 0xFF;
-
+
CmdFrm.operand[14] = 0x00;//((params->u.qpsk.symbol_rate/1000) >> 12) & 0xFF;
CmdFrm.operand[15] = 0x00;//((params->u.qpsk.symbol_rate/1000) >> 4) & 0xFF;
CmdFrm.operand[16] = 0x00;//((params->u.qpsk.symbol_rate/1000) << 4) & 0xF0;
-
+
CmdFrm.operand[17] = 0x00;
CmdFrm.operand[18] = 0x00;
CmdFrm.operand[19] = 0x00; // modulation
CmdFrm.operand[20] = 0x00;
CmdFrm.operand[21] = 0x00;*/
CmdFrm.operand[22] = pidc; // Nr_of_dsd_sel_specs
-
+
pos=23;
}
if(pidc != 0xFF)
@@ -576,7 +576,7 @@ int AVCTuner_SetPIDs(struct firesat *firesat, unsigned char pidc, u16 pid[]) {
}
CmdFrm.length = pos+3;
-
+
if((pos+3)%4)
CmdFrm.length += 4 - ((pos+3)%4);
@@ -584,14 +584,14 @@ int AVCTuner_SetPIDs(struct firesat *firesat, unsigned char pidc, u16 pid[]) {
return k;
mdelay(250);
-
+
return 0;
}
int AVCIdentifySubunit(struct firesat *firesat, unsigned char *systemId, int *transport, int *has_ci) {
AVCCmdFrm CmdFrm;
AVCRspFrm RspFrm;
-
+
memset(&CmdFrm,0,sizeof(AVCCmdFrm));
CmdFrm.cts = AVC;
@@ -612,7 +612,7 @@ int AVCIdentifySubunit(struct firesat *firesat, unsigned char *systemId, int *tr
if(AVCWrite(firesat,&CmdFrm,&RspFrm)<0)
return -EIO;
-
+
if(RspFrm.resp != STABLE && RspFrm.resp != ACCEPTED) {
printk("%s: AVCWrite returned error code %d\n",__FUNCTION__,RspFrm.resp);
return -EINVAL;
@@ -649,15 +649,15 @@ int AVCTunerStatus(struct firesat *firesat, ANTENNA_INPUT_INFO *antenna_input_in
int length;
printk(KERN_INFO "%s\n", __FUNCTION__);
-
+
memset(&CmdFrm, 0, sizeof(AVCCmdFrm));
-
+
CmdFrm.cts=AVC;
CmdFrm.ctype=CONTROL;
CmdFrm.sutyp=0x05; // tuner
CmdFrm.suid=firesat->subunit;
CmdFrm.opcode=READ_DESCRIPTOR;
-
+
CmdFrm.operand[0]=DESCRIPTOR_TUNER_STATUS;
CmdFrm.operand[1]=0xff;
CmdFrm.operand[2]=0x00;
@@ -669,7 +669,7 @@ int AVCTunerStatus(struct firesat *firesat, ANTENNA_INPUT_INFO *antenna_input_in
//Absenden des AVC request und warten auf response
if (AVCWrite(firesat,&CmdFrm,&RspFrm) < 0)
return -EIO;
-
+
if(RspFrm.resp != STABLE && RspFrm.resp != ACCEPTED) {
printk("%s: AVCWrite returned code %d\n",__FUNCTION__,RspFrm.resp);
return -EINVAL;
@@ -678,7 +678,7 @@ int AVCTunerStatus(struct firesat *firesat, ANTENNA_INPUT_INFO *antenna_input_in
length = (RspFrm.operand[3] << 8) + RspFrm.operand[4];
if(length == sizeof(ANTENNA_INPUT_INFO))
{
- memcpy(antenna_input_info,&RspFrm.operand[7],length);
+ memcpy(antenna_input_info,&RspFrm.operand[7],length);
return 0;
}
printk("%s: invalid info returned from AVC\n",__FUNCTION__);
@@ -689,17 +689,17 @@ int AVCLNBControl(struct firesat *firesat, char voltage, char burst, char contto
AVCCmdFrm CmdFrm;
AVCRspFrm RspFrm;
int i,j;
-
+
printk(KERN_INFO "%s: voltage = %x, burst = %x, conttone = %x\n",__FUNCTION__,voltage,burst,conttone);
-
+
memset(&CmdFrm, 0, sizeof(AVCCmdFrm));
-
+
CmdFrm.cts=AVC;
CmdFrm.ctype=CONTROL;
CmdFrm.sutyp=0x05;
CmdFrm.suid=firesat->subunit;
CmdFrm.opcode=VENDOR;
-
+
/* ### should check for elgato and use SFE_VENDOR_EL_COMPANYID_0 in this case */
CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0;
CmdFrm.operand[1]=SFE_VENDOR_DE_COMPANYID_1;
@@ -708,40 +708,40 @@ int AVCLNBControl(struct firesat *firesat, char voltage, char burst, char contto
CmdFrm.operand[4]=voltage;
CmdFrm.operand[5]=nrdiseq;
-
+
i=6;
-
+
for(j=0;j<nrdiseq;j++) {
int k;
printk(KERN_INFO "%s: diseq %d len %x\n",__FUNCTION__,j,diseqcmd[j].msg_len);
CmdFrm.operand[i++]=diseqcmd[j].msg_len;
-
+
for(k=0;k<diseqcmd[j].msg_len;k++) {
printk(KERN_INFO "%s: diseq %d msg[%d] = %x\n",__FUNCTION__,j,k,diseqcmd[j].msg[k]);
CmdFrm.operand[i++]=diseqcmd[j].msg[k];
}
}
-
+
CmdFrm.operand[i++]=burst;
CmdFrm.operand[i++]=conttone;
-
+
CmdFrm.length=i+3;
if((i+3)%4)
CmdFrm.length += 4 - ((i+3)%4);
-
+
/* for(j=0;j<CmdFrm.length;j++)
printk(KERN_INFO "%s: CmdFrm.operand[%d]=0x%x\n",__FUNCTION__,j,CmdFrm.operand[j]);
-
+
printk(KERN_INFO "%s: cmdfrm.length = %u\n",__FUNCTION__,CmdFrm.length);
*/
if(AVCWrite(firesat,&CmdFrm,&RspFrm) < 0)
return -EIO;
-
+
if(RspFrm.resp != ACCEPTED) {
printk("%s: AVCWrite returned code %d\n",__FUNCTION__,RspFrm.resp);
return -EINVAL;
}
-
+
return 0;
}
@@ -780,7 +780,7 @@ int AVCSubUnitInfo(struct firesat*firesat, char *subunitcount) {
}
static int __AVCRegisterRemoteControl(struct firesat*firesat, int internal) {
- AVCCmdFrm CmdFrm;
+ AVCCmdFrm CmdFrm;
// printk(KERN_INFO "%s\n",__FUNCTION__);
@@ -807,7 +807,7 @@ static int __AVCRegisterRemoteControl(struct firesat*firesat, int internal) {
return -EIO;
} else
if(AVCWrite(firesat,&CmdFrm,NULL) < 0)
- return -EIO;
+ return -EIO;
return 0;
}
@@ -845,7 +845,7 @@ int AVCResetTPDU(struct firesat*firesat) {
if(RspFrm.resp != STABLE) {
printk("%s: AVCWrite returned error %d\n", __FUNCTION__, RspFrm.resp);
return RspFrm.resp;
- }
+ }
return 0;
}
@@ -881,7 +881,7 @@ int AVCWriteTPDU(struct firesat*firesat, const char *tpdupacket, int length) {
if(CmdFrm.length % 4)
CmdFrm.length += 4 - (CmdFrm.length % 4);
-
+
if(AVCWrite(firesat, &CmdFrm, &RspFrm) < 0)
return -EIO;
@@ -912,14 +912,14 @@ int AVCReadTPDU(struct firesat*firesat, char *tpdupacket, int *length) {
// CmdFrm.operand[1] = SFE_VENDOR_EL_COMPANYID_1;
CmdFrm.operand[1] = SFE_VENDOR_DE_COMPANYID_1;
// CmdFrm.operand[2] = SFE_VENDOR_EL_COMPANYID_2;
- CmdFrm.operand[2] = SFE_VENDOR_DE_COMPANYID_2;
+ CmdFrm.operand[2] = SFE_VENDOR_DE_COMPANYID_2;
// CmdFrm.operand[3] = SFE_VENDOR_OPCODE_CI_READ_TPDU;
CmdFrm.length = 8;
if(AVCWrite(firesat, &CmdFrm, &RspFrm) < 0)
return -EIO;
-
+
if(RspFrm.resp != STABLE) {
printk("%s: AVCWrite returned error %d\n",__FUNCTION__,RspFrm.resp);
return RspFrm.resp;
diff --git a/v4l_experimental/firesat/cmp.c b/v4l_experimental/firesat/cmp.c
index c302a4127..29f8a7d3c 100644
--- a/v4l_experimental/firesat/cmp.c
+++ b/v4l_experimental/firesat/cmp.c
@@ -29,10 +29,10 @@ static int cmp_read(struct firesat *firesat, void *buffer, u64 addr, size_t leng
int ret;
if(down_interruptible(&firesat->avc_sem))
return -EINTR;
-
+
ret = hpsb_read(firesat->host, firesat->nodeentry->nodeid, firesat->nodeentry->generation,
addr, buffer, length);
-
+
up(&firesat->avc_sem);
return ret;
}
@@ -41,10 +41,10 @@ static int cmp_lock(struct firesat *firesat, quadlet_t *data, u64 addr, quadlet_
int ret;
if(down_interruptible(&firesat->avc_sem))
return -EINTR;
-
+
ret = hpsb_lock(firesat->host, firesat->nodeentry->nodeid, firesat->nodeentry->generation,
addr, ext_tcode, data, arg);
-
+
up(&firesat->avc_sem);
return ret;
}
@@ -52,13 +52,13 @@ static int cmp_lock(struct firesat *firesat, quadlet_t *data, u64 addr, quadlet_
//try establishing a point-to-point connection (may be interrupted by a busreset
int try_CMPEstablishPPconnection(struct firesat *firesat, int output_plug, int iso_channel) {
unsigned int BWU; //bandwidth to allocate
-
+
quadlet_t old_oPCR,test_oPCR = 0x0;
u64 oPCR_address=0xfffff0000904ull+(output_plug << 2);
int result=cmp_read(firesat, &test_oPCR, oPCR_address, 4);
-
+
printk(KERN_INFO "%s: nodeid = %d\n",__FUNCTION__,firesat->nodeentry->nodeid);
-
+
if (result < 0) {
printk("%s: cannot read oPCR\n", __FUNCTION__);
return result;
@@ -100,7 +100,7 @@ int try_CMPEstablishPPconnection(struct firesat *firesat, int output_plug, int i
printk(KERN_INFO "%s: trying compare_swap...\n",__FUNCTION__);
printk(KERN_INFO "%s: oPCR_old: %08x, oPCR_new: %08x\n",__FUNCTION__, old_oPCR, new_oPCR);
result=cmp_lock(firesat, &test_oPCR, oPCR_address, old_oPCR, 2);
-
+
if (result < 0) {
printk("%s: cannot compare_swap oPCR\n",__FUNCTION__);
return result;
@@ -131,7 +131,7 @@ int try_CMPBreakPPconnection(struct firesat *firesat, int output_plug,int iso_ch
u64 oPCR_address=0xfffff0000904ull+(output_plug << 2);
int result=cmp_read(firesat, &test_oPCR, oPCR_address, 4);
-
+
printk(KERN_INFO "%s\n",__FUNCTION__);
if (result < 0) {
diff --git a/v4l_experimental/firesat/firesat-ci.c b/v4l_experimental/firesat/firesat-ci.c
index 1fd96cf63..3d005cb56 100644
--- a/v4l_experimental/firesat/firesat-ci.c
+++ b/v4l_experimental/firesat/firesat-ci.c
@@ -11,7 +11,7 @@ static int firesat_ca_do_ioctl(struct inode *inode, struct file *file, unsigned
int err;
// printk(KERN_INFO "%s: ioctl %d\n",__FUNCTION__,cmd);
-
+
switch(cmd) {
case CA_RESET:
err = AVCResetTPDU(firesat);
@@ -67,7 +67,7 @@ static ssize_t firesat_ca_io_read(struct file *file, char __user *buf, size_t co
struct firesat *firesat = (struct firesat*)((struct dvb_device*)file->private_data)->priv;
char *data=kmalloc(count,GFP_KERNEL);
// printk(KERN_INFO "%s: count = %d\n",__FUNCTION__,count);
- int r=AVCReadTPDU(firesat, data, &count);
+ int r=AVCReadTPDU(firesat, data, &count);
if(!r) {
copy_to_user(buf,data,count);
kfree(data);
@@ -77,9 +77,9 @@ static ssize_t firesat_ca_io_read(struct file *file, char __user *buf, size_t co
return 0;
}
-static int firesat_ca_io_open(struct inode *inode, struct file *file) {
+static int firesat_ca_io_open(struct inode *inode, struct file *file) {
printk(KERN_INFO "%s!\n",__FUNCTION__);
- return dvb_generic_open(inode, file);
+ return dvb_generic_open(inode, file);
}
static int firesat_ca_io_release(struct inode *inode, struct file *file) {
@@ -89,7 +89,7 @@ static int firesat_ca_io_release(struct inode *inode, struct file *file) {
static unsigned int firesat_ca_io_poll(struct file *file, poll_table *wait) {
// printk(KERN_INFO "%s!\n",__FUNCTION__);
- return POLLIN;
+ return POLLIN;
}
static struct file_operations firesat_ca_fops = {
diff --git a/v4l_experimental/firesat/firesat-rc.c b/v4l_experimental/firesat/firesat-rc.c
index 8cc57573d..702f90f6c 100644
--- a/v4l_experimental/firesat/firesat-rc.c
+++ b/v4l_experimental/firesat/firesat-rc.c
@@ -49,7 +49,7 @@ int firesat_register_rc(void) {
memset(&firesat_idev, 0, sizeof(firesat_idev));
firesat_idev.evbit[0] = BIT(EV_KEY);
-
+
for(index=0;firesat_irtable[index] != 0; index++)
set_bit(firesat_irtable[index], firesat_idev.keybit);
@@ -65,7 +65,7 @@ int firesat_unregister_rc(void) {
int firesat_got_remotecontrolcode(u16 code) {
u16 keycode;
-
+
if(code > 0x4500 && code < 0x4520)
keycode = firesat_irtable[code - 0x4501];
else if(code > 0x453f && code < 0x4543)
@@ -73,7 +73,7 @@ int firesat_got_remotecontrolcode(u16 code) {
else {
printk("%s: invalid key code 0x%04x\n",__FUNCTION__,code);
return -EINVAL;
- }
+ }
input_report_key(&firesat_idev, keycode, 1);
input_report_key(&firesat_idev, keycode, 0);
diff --git a/v4l_experimental/firesat/firesat.c b/v4l_experimental/firesat/firesat.c
index 167c5a709..dcf268702 100644
--- a/v4l_experimental/firesat/firesat.c
+++ b/v4l_experimental/firesat/firesat.c
@@ -44,111 +44,111 @@
static struct ieee1394_device_id firesat_id_table[] = {
{
.match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
- .model_id = 0x11,
- .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
- .version = AVC_SW_VERSION_ENTRY & 0xffffff
+ .model_id = 0x11,
+ .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
+ .version = AVC_SW_VERSION_ENTRY & 0xffffff
},
{
.match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
- .model_id = 0x12,
- .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
- .version = AVC_SW_VERSION_ENTRY & 0xffffff
+ .model_id = 0x12,
+ .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
+ .version = AVC_SW_VERSION_ENTRY & 0xffffff
},
{
.match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
// .vendor_id = FIRESAT_Vendor_ID & 0xffffff,
// .vendor_id = 0x000000,
- .model_id = 0x13,
- .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
- .version = AVC_SW_VERSION_ENTRY & 0xffffff
+ .model_id = 0x13,
+ .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
+ .version = AVC_SW_VERSION_ENTRY & 0xffffff
},
{
.match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
// .vendor_id = FIRESAT_Vendor_ID & 0xffffff,
// .vendor_id = 0x000000,
- .model_id = 0x14,
- .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
- .version = AVC_SW_VERSION_ENTRY & 0xffffff
+ .model_id = 0x14,
+ .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
+ .version = AVC_SW_VERSION_ENTRY & 0xffffff
},
{
.match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
// .vendor_id = FIRESAT_Vendor_ID & 0xffffff,
// .vendor_id = 0x000000,
- .model_id = 0x21,
- .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
- .version = AVC_SW_VERSION_ENTRY & 0xffffff
+ .model_id = 0x21,
+ .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
+ .version = AVC_SW_VERSION_ENTRY & 0xffffff
},
{
.match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
// .vendor_id = FIRESAT_Vendor_ID & 0xffffff,
// .vendor_id = 0x000000,
- .model_id = 0x22,
- .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
- .version = AVC_SW_VERSION_ENTRY & 0xffffff
+ .model_id = 0x22,
+ .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
+ .version = AVC_SW_VERSION_ENTRY & 0xffffff
},
{
.match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
// .vendor_id = FIRESAT_Vendor_ID & 0xffffff,
// .vendor_id = 0x000000,
- .model_id = 0x23,
- .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
- .version = AVC_SW_VERSION_ENTRY & 0xffffff
+ .model_id = 0x23,
+ .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
+ .version = AVC_SW_VERSION_ENTRY & 0xffffff
},
{
.match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
// .vendor_id = FIRESAT_Vendor_ID & 0xffffff,
// .vendor_id = 0x000000,
- .model_id = 0x24,
- .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
- .version = AVC_SW_VERSION_ENTRY & 0xffffff
+ .model_id = 0x24,
+ .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
+ .version = AVC_SW_VERSION_ENTRY & 0xffffff
},
{
.match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
// .vendor_id = FIRESAT_Vendor_ID & 0xffffff,
// .vendor_id = 0x000000,
- .model_id = 0x25,
- .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
- .version = AVC_SW_VERSION_ENTRY & 0xffffff
+ .model_id = 0x25,
+ .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
+ .version = AVC_SW_VERSION_ENTRY & 0xffffff
},
{
.match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
// .vendor_id = FIRESAT_Vendor_ID & 0xffffff,
// .vendor_id = 0x000000,
- .model_id = 0x26,
- .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
- .version = AVC_SW_VERSION_ENTRY & 0xffffff
+ .model_id = 0x26,
+ .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
+ .version = AVC_SW_VERSION_ENTRY & 0xffffff
},
{
.match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
// .vendor_id = FIRESAT_Vendor_ID & 0xffffff,
// .vendor_id = 0x000000,
- .model_id = 0x27,
- .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
- .version = AVC_SW_VERSION_ENTRY & 0xffffff
+ .model_id = 0x27,
+ .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
+ .version = AVC_SW_VERSION_ENTRY & 0xffffff
},
{
.match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
// .vendor_id = FIRESAT_Vendor_ID & 0xffffff,
// .vendor_id = 0x000000,
- .model_id = 0x34,
- .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
- .version = AVC_SW_VERSION_ENTRY & 0xffffff
+ .model_id = 0x34,
+ .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
+ .version = AVC_SW_VERSION_ENTRY & 0xffffff
},
{
.match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
// .vendor_id = FIRESAT_Vendor_ID & 0xffffff,
// .vendor_id = 0x000000,
- .model_id = 0x35,
- .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
- .version = AVC_SW_VERSION_ENTRY & 0xffffff
+ .model_id = 0x35,
+ .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
+ .version = AVC_SW_VERSION_ENTRY & 0xffffff
},
{
.match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
// .vendor_id = FIRESAT_Vendor_ID & 0xffffff,
// .vendor_id = 0x000000,
- .model_id = 0x36,
- .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
- .version = AVC_SW_VERSION_ENTRY & 0xffffff
+ .model_id = 0x36,
+ .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff,
+ .version = AVC_SW_VERSION_ENTRY & 0xffffff
},
{ }
};
@@ -163,7 +163,7 @@ static void firesat_add_host (struct hpsb_host *host);
static void firesat_remove_host (struct hpsb_host *host);
static void firesat_host_reset(struct hpsb_host *host);
static void iso_receive(struct hpsb_host *host, int channel, quadlet_t *data,
- size_t length);
+ size_t length);
static void fcp_request(struct hpsb_host *host, int nodeid, int direction,
int cts, u8 *data, size_t length);
@@ -187,7 +187,7 @@ static struct dvb_frontend_info firesat_S_frontend_info = {
.symbol_rate_max = 40000000,
.caps = FE_CAN_INVERSION_AUTO | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 |
FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 |
- FE_CAN_FEC_AUTO | FE_CAN_QPSK,
+ FE_CAN_FEC_AUTO | FE_CAN_QPSK,
};
static struct dvb_frontend_info firesat_C_frontend_info = {
@@ -217,18 +217,18 @@ static struct dvb_frontend_info firesat_T_frontend_info = {
static void firesat_add_host (struct hpsb_host *host) {
struct ti_ohci *ohci;
// printk(KERN_INFO "FireSAT add_host (nodeid = 0x%x)\n",host->node_id);
-
+
/* We only work with the OHCI-1394 driver */
if (strcmp(host->driver->name, OHCI1394_DRIVER_NAME))
return;
-
+
ohci = (struct ti_ohci *)host->hostdata;
-
+
if (!hpsb_create_hostinfo(&firesat_highlevel, host, 0)) {
printk(KERN_ERR "Cannot allocate hostinfo\n");
return;
}
-
+
hpsb_set_hostinfo(&firesat_highlevel, host, ohci);
hpsb_set_hostinfo_key(&firesat_highlevel, host, ohci->host->id);
}
@@ -243,65 +243,65 @@ static void firesat_host_reset(struct hpsb_host *host) {
struct firewireheader {
union {
- struct {
- unsigned char tcode:4;
- unsigned char sy:4;
- unsigned char tag:2;
- unsigned char channel:6;
-
- unsigned char length_l;
- unsigned char length_h;
- } hdr;
- unsigned long val;
+ struct {
+ unsigned char tcode:4;
+ unsigned char sy:4;
+ unsigned char tag:2;
+ unsigned char channel:6;
+
+ unsigned char length_l;
+ unsigned char length_h;
+ } hdr;
+ unsigned long val;
};
};
struct CIPHeader {
union {
- struct {
- unsigned char syncbits:2;
- unsigned char sid:6;
- unsigned char dbs;
- unsigned char fn:2;
- unsigned char qpc:3;
- unsigned char sph:1;
- unsigned char rsv:2;
- unsigned char dbc;
- unsigned char syncbits2:2;
- unsigned char fmt:6;
- unsigned long fdf:24;
- } cip;
- unsigned long long val;
+ struct {
+ unsigned char syncbits:2;
+ unsigned char sid:6;
+ unsigned char dbs;
+ unsigned char fn:2;
+ unsigned char qpc:3;
+ unsigned char sph:1;
+ unsigned char rsv:2;
+ unsigned char dbc;
+ unsigned char syncbits2:2;
+ unsigned char fmt:6;
+ unsigned long fdf:24;
+ } cip;
+ unsigned long long val;
};
};
struct MPEG2Header {
union {
- struct {
- unsigned char sync; // must be 0x47
- unsigned char transport_error_indicator:1;
- unsigned char payload_unit_start_indicator:1;
- unsigned char transport_priority:1;
- unsigned short pid:13;
- unsigned char transport_scrambling_control:2;
- unsigned char adaption_field_control:2;
- unsigned char continuity_counter:4;
- } hdr;
- unsigned long val;
+ struct {
+ unsigned char sync; // must be 0x47
+ unsigned char transport_error_indicator:1;
+ unsigned char payload_unit_start_indicator:1;
+ unsigned char transport_priority:1;
+ unsigned short pid:13;
+ unsigned char transport_scrambling_control:2;
+ unsigned char adaption_field_control:2;
+ unsigned char continuity_counter:4;
+ } hdr;
+ unsigned long val;
};
};
static void iso_receive(struct hpsb_host *host, int channel, quadlet_t *data,
- size_t length) {
+ size_t length) {
// printk(KERN_INFO "FireSAT iso_receive: channel %d, length = %d\n", channel, length);
-
+
if(length <= 12)
return; // ignore empty packets
else {
struct firesat *firesat=NULL;
struct firesat *firesat_entry;
unsigned long flags;
-
+
spin_lock_irqsave(&firesat_list_lock, flags);
list_for_each_entry(firesat_entry,&firesat_list,list) {
if(firesat_entry->host == host && firesat_entry->isochannel == channel) {
@@ -310,15 +310,15 @@ static void iso_receive(struct hpsb_host *host, int channel, quadlet_t *data,
}
}
spin_unlock_irqrestore(&firesat_list_lock, flags);
-
+
if(firesat) {
char *buf=((char*)data) + sizeof(struct firewireheader)+sizeof(struct CIPHeader);
int count = (length-sizeof(struct CIPHeader)) / 192;
-
+
// printk(KERN_INFO "%s: length = %u\n data[0] = %08x\n data[1] = %08x\n data[2] = %08x\n data[3] = %08x\n data[4] = %08x\n",__FUNCTION__, length, data[0],data[1],data[2],data[3],data[4]);
-
+
while (count--) {
-
+
if(buf[sizeof(quadlet_t) /*timestamp*/] == 0x47)
dvb_dmx_swfilter_packet(&firesat->demux, &buf[sizeof(quadlet_t)]);
else
@@ -332,10 +332,10 @@ static void iso_receive(struct hpsb_host *host, int channel, quadlet_t *data,
static void fcp_request(struct hpsb_host *host, int nodeid, int direction,
int cts, u8 *data, size_t length) {
// printk(KERN_INFO "FireSAT fcp_request length=%d\n",length);
- if(length>0 && ((data[0] & 0xF0) >> 4) == 0) {
+ if(length>0 && ((data[0] & 0xF0) >> 4) == 0) {
struct firesat *firesat=NULL;
struct firesat *firesat_entry;
- unsigned long flags;
+ unsigned long flags;
spin_lock_irqsave(&firesat_list_lock, flags);
list_for_each_entry(firesat_entry,&firesat_list,list) {
@@ -356,7 +356,7 @@ static void fcp_request(struct hpsb_host *host, int nodeid, int direction,
static int firesat_frontend_ioctl(struct dvb_frontend *frontend,
unsigned int cmd, void *arg) {
struct firesat *firesat=frontend->data;
-
+
switch(cmd) {
case FE_INIT:
firesat->isochannel = firesat->adapter->num << 1 | (firesat->subunit & 0x1); // ### ask IRM
@@ -401,13 +401,13 @@ static int firesat_frontend_ioctl(struct dvb_frontend *frontend,
if(AVCTunerStatus(firesat,&info)) {
return -EINVAL;
}
-// printk(KERN_INFO "%s: NoRF=%c\n",__FUNCTION__,info.NoRF?'y':'n');
+// printk(KERN_INFO "%s: NoRF=%c\n",__FUNCTION__,info.NoRF?'y':'n');
if(info.NoRF)
*status = 0;
else
*status = *status = FE_HAS_SIGNAL | FE_HAS_VITERBI |
FE_HAS_SYNC | FE_HAS_CARRIER | FE_HAS_LOCK;
-
+
break;
}
case FE_READ_BER: {
@@ -418,10 +418,10 @@ static int firesat_frontend_ioctl(struct dvb_frontend *frontend,
if(AVCTunerStatus(firesat,&info)) {
return -EINVAL;
}
-
+
// *ber = *(u32*)info.BER; /* might need some byte ordering correction */
*ber = ((info.BER[0] << 24) & 0xFF) | ((info.BER[1] << 16) & 0xFF) | ((info.BER[2] << 8) & 0xFF) | (info.BER[3] & 0xFF);
-
+
break;
}
case FE_READ_SIGNAL_STRENGTH: {
@@ -432,9 +432,9 @@ static int firesat_frontend_ioctl(struct dvb_frontend *frontend,
if(AVCTunerStatus(firesat,&info)) {
return -EINVAL;
}
-
+
*signal = info.SignalStrength;
-
+
break;
}
case FE_READ_SNR:
@@ -444,18 +444,18 @@ static int firesat_frontend_ioctl(struct dvb_frontend *frontend,
struct dvb_frontend_parameters *p =
(struct dvb_frontend_parameters *)arg;
// printk(KERN_INFO "FE_GET_INFO\n");
-
+
// printk(KERN_INFO "%s: FE_SET_FRONTEND\n", __FUNCTION__);
-
+
// printk(KERN_INFO " frequency->%d\n", p->frequency);
// printk(KERN_INFO " symbol_rate->%d\n",p->u.qam.symbol_rate);
// printk(KERN_INFO " inversion->%d\n", p->inversion);
-
+
// if(AVCTuner_DSIT(firesat, 0/*###*/, p, NULL))
// return -EINVAL;
if(AVCTuner_DSD(firesat, p, NULL) != ACCEPTED)
return -EINVAL;
-
+
break;
}
case FE_GET_FRONTEND:
@@ -464,7 +464,7 @@ static int firesat_frontend_ioctl(struct dvb_frontend *frontend,
default:
return -EINVAL;
}
-
+
return 0;
}
@@ -472,10 +472,10 @@ static struct firesat_channel *firesat_channel_allocate(struct firesat *firesat)
int k;
printk(KERN_INFO "%s\n",__FUNCTION__);
-
+
if(down_interruptible(&firesat->demux_sem))
return NULL;
-
+
for(k=0;k<16;k++) {
printk(KERN_INFO "%s: channel %d: active = %d, pid = 0x%x\n",__FUNCTION__,k,firesat->channel[k].active,firesat->channel[k].pid);
if(firesat->channel[k].active == 0) {
@@ -484,25 +484,25 @@ static struct firesat_channel *firesat_channel_allocate(struct firesat *firesat)
return &firesat->channel[k];
}
}
-
+
up(&firesat->demux_sem);
return NULL; // no more channels available
}
static int firesat_channel_collect(struct firesat *firesat, int *pidc, u16 pid[]) {
int k, l=0;
-
+
if(down_interruptible(&firesat->demux_sem))
return -EINTR;
-
+
for(k=0;k<16;k++)
if(firesat->channel[k].active == 1)
pid[l++] = firesat->channel[k].pid;
-
+
up(&firesat->demux_sem);
-
+
*pidc = l;
-
+
return 0;
}
@@ -523,7 +523,7 @@ static int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed) {
u16 pids[16];
printk(KERN_INFO "%s (pid %u)\n",__FUNCTION__,dvbdmxfeed->pid);
-
+
switch (dvbdmxfeed->type) {
case DMX_TYPE_TS:
case DMX_TYPE_SEC:
@@ -549,30 +549,30 @@ static int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed) {
} else {
channel = firesat_channel_allocate(firesat);
}
-
+
if(!channel) {
printk("%s: busy!\n",__FUNCTION__);
return -EBUSY;
}
-
+
dvbdmxfeed->priv = channel;
channel->dvbdmxfeed = dvbdmxfeed;
channel->pid = dvbdmxfeed->pid;
channel->type = dvbdmxfeed->type;
channel->firesat = firesat;
-
+
if(firesat_channel_collect(firesat, &pidc, pids)) {
firesat_channel_release(firesat, channel);
return -EINTR;
}
-
+
if((k=AVCTuner_SetPIDs(firesat, pidc, pids))) {
firesat_channel_release(firesat, channel);
printk("%s: AVCTuner failed with error %d\n",__FUNCTION__,k);
return k;
}
-
+
return 0;
}
@@ -581,11 +581,11 @@ static int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed) {
struct firesat *firesat=(struct firesat*)demux->priv;
int k, l=0;
u16 pids[16];
-
+
printk(KERN_INFO "%s (pid %u)\n",__FUNCTION__,dvbdmxfeed->pid);
- if (dvbdmxfeed->type == DMX_TYPE_TS && !((dvbdmxfeed->ts_type & TS_PACKET) &&
- (demux->dmx.frontend->source != DMX_MEMORY_FE))) {
+ if (dvbdmxfeed->type == DMX_TYPE_TS && !((dvbdmxfeed->ts_type & TS_PACKET) &&
+ (demux->dmx.frontend->source != DMX_MEMORY_FE))) {
if (dvbdmxfeed->ts_type & TS_DECODER) {
if (dvbdmxfeed->pes_type >= DMX_TS_PES_OTHER ||
!demux->pesfilter[dvbdmxfeed->pes_type])
@@ -596,7 +596,7 @@ static int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed) {
if (!(dvbdmxfeed->ts_type & TS_DECODER &&
dvbdmxfeed->pes_type < DMX_TS_PES_OTHER)) {
return 0;
- }
+ }
}
if(down_interruptible(&firesat->demux_sem))
@@ -611,11 +611,11 @@ static int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed) {
up(&firesat->demux_sem);
return k;
}
-
+
((struct firesat_channel*)dvbdmxfeed->priv)->active = 0;
up(&firesat->demux_sem);
-
+
return 0;
}
@@ -631,16 +631,16 @@ static int firesat_probe(struct device *dev) {
printk("%s: couldn't allocate memory.\n", __FUNCTION__);
return -ENOMEM;
}
-
+
// printk(KERN_INFO "FireSAT: Detected device with GUID %08lx%04lx%04lx\n",(unsigned long)((ud->ne->guid)>>32),(unsigned long)(ud->ne->guid & 0xFFFF),(unsigned long)ud->ne->guid_vendor_id);
printk(KERN_INFO "%s: loading device\n", __FUNCTION__);
-
+
firesats[0]=NULL;
firesats[1]=NULL;
-
+
ud->device.driver_data = firesats;
-
- for(subunit=0;subunit<subunitcount;subunit++) {
+
+ for(subunit=0;subunit<subunitcount;subunit++) {
if (!(firesat = kmalloc(sizeof(struct firesat), GFP_KERNEL))) {
printk("%s: couldn't allocate memory.\n", __FUNCTION__);
kfree(firesats);
@@ -660,12 +660,12 @@ static int firesat_probe(struct device *dev) {
kfree(firesat);
return -ENOMEM;
}
-
+
sema_init(&firesat->avc_sem, 1);
atomic_set(&firesat->avc_reply_received, 1);
sema_init(&firesat->demux_sem, 1);
atomic_set(&firesat->reschedule_remotecontrol, 0);
-
+
spin_lock_irqsave(&firesat_list_lock, flags);
INIT_LIST_HEAD(&firesat->list);
list_add_tail(&firesat->list, &firesat_list);
@@ -727,18 +727,18 @@ static int firesat_probe(struct device *dev) {
firesat->model_name, THIS_MODULE)) < 0) {
printk("%s: dvb_register_adapter failed: error %d\n",
__FUNCTION__, result);
-
+
/* ### cleanup */
spin_lock_irqsave(&firesat_list_lock, flags);
list_del(&firesat->list);
spin_unlock_irqrestore(&firesat_list_lock, flags);
kfree(firesat);
-
+
return result;
}
-
+
firesat->demux.dmx.capabilities = 0/*DMX_TS_FILTERING | DMX_SECTION_FILTERING*/;
-
+
firesat->demux.priv = (void *)firesat;
firesat->demux.filternum = 16;
firesat->demux.feednum = 16;
@@ -746,82 +746,82 @@ static int firesat_probe(struct device *dev) {
firesat->demux.stop_feed = firesat_stop_feed;
firesat->demux.write_to_decoder = NULL;
-
+
if ((result = dvb_dmx_init(&firesat->demux)) < 0) {
printk("%s: dvb_dmx_init failed: error %d\n", __FUNCTION__,
result);
-
+
dvb_unregister_adapter(firesat->adapter);
-
+
return result;
}
-
+
firesat->dmxdev.filternum = 16;
firesat->dmxdev.demux = &firesat->demux.dmx;
firesat->dmxdev.capabilities = 0;
-
+
if ((result = dvb_dmxdev_init(&firesat->dmxdev, firesat->adapter)) < 0) {
printk("%s: dvb_dmxdev_init failed: error %d\n",
__FUNCTION__, result);
-
+
dvb_dmx_release(&firesat->demux);
dvb_unregister_adapter(firesat->adapter);
-
+
return result;
}
-
+
firesat->frontend.source = DMX_FRONTEND_0;
-
+
if ((result = firesat->demux.dmx.add_frontend(&firesat->demux.dmx,
&firesat->frontend)) < 0) {
printk("%s: dvb_dmx_init failed: error %d\n", __FUNCTION__,
result);
-
+
dvb_dmxdev_release(&firesat->dmxdev);
dvb_dmx_release(&firesat->demux);
dvb_unregister_adapter(firesat->adapter);
-
+
return result;
}
-
+
if ((result = firesat->demux.dmx.connect_frontend(&firesat->demux.dmx,
&firesat->frontend)) < 0) {
printk("%s: dvb_dmx_init failed: error %d\n", __FUNCTION__,
result);
-
+
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);
-
+
return result;
}
-
+
dvb_net_init(firesat->adapter, &firesat->dvbnet, &firesat->demux.dmx);
-
+
if((result= dvb_register_frontend(firesat_frontend_ioctl,firesat->adapter,firesat,firesat->frontend_info,THIS_MODULE)) < 0) {
printk("%s: dvb_register_frontend_new failed: error %d\n", __FUNCTION__, result);
/* ### cleanup */
-
+
return result;
}
if(firesat->has_ci)
firesat_ca_init(firesat);
-
+
firesats[subunit] = firesat;
} // loop fuer alle tuner am board
if(firesats[0])
AVCRegisterRemoteControl(firesats[0]);
-
+
return 0;
}
static int firesat_remove(struct device *dev) {
struct unit_directory *ud=container_of(dev, struct unit_directory, device);
struct firesat **firesats=ud->device.driver_data;
-
+
if(firesats) {
int k;
for(k=0;k<2;k++)
@@ -830,7 +830,7 @@ static int firesat_remove(struct device *dev) {
if(firesats[k]->has_ci)
firesat_ca_release(firesats[k]);
dvb_unregister_frontend(firesat_frontend_ioctl,firesats[k]->adapter);
-
+
dvb_net_release(&firesats[k]->dvbnet);
firesats[k]->demux.dmx.close(&firesats[k]->demux.dmx);
firesats[k]->demux.dmx.remove_frontend(&firesats[k]->demux.dmx, &firesats[k]->frontend);
@@ -841,14 +841,14 @@ static int firesat_remove(struct device *dev) {
spin_lock_irqsave(&firesat_list_lock, flags);
list_del(&firesats[k]->list);
spin_unlock_irqrestore(&firesat_list_lock, flags);
-
+
kfree(firesats[k]->respfrm);
kfree(firesats[k]);
}
kfree(firesats);
} else
printk("%s: can't get firesat handle\n",__FUNCTION__);
-
+
printk(KERN_INFO "FireSAT: Removing device with vendor id 0x%x, model id 0x%x.\n",ud->vendor_id,ud->model_id);
return 0;
}
@@ -858,7 +858,7 @@ static int firesat_update(struct unit_directory *ud) {
struct firesat **firesats=ud->device.driver_data;
int k;
// loop over subunits
-
+
for(k=0;k<2;k++)
if(firesats[k]) {
firesats[k]->nodeentry=ud->ne;
@@ -877,8 +877,8 @@ static struct hpsb_protocol_driver firesat_driver = {
.driver = {
.name = "firesat",
.bus = &ieee1394_bus_type,
- .probe = firesat_probe,
- .remove = firesat_remove,
+ .probe = firesat_probe,
+ .remove = firesat_remove,
},
};
@@ -889,20 +889,20 @@ static int __init firesat_init(void)
hpsb_register_highlevel(&firesat_highlevel);
ret = hpsb_register_protocol(&firesat_driver);
if(ret) {
- printk(KERN_ERR "FireSAT: failed to register protocol\n");
- hpsb_unregister_highlevel(&firesat_highlevel);
- return ret;
+ printk(KERN_ERR "FireSAT: failed to register protocol\n");
+ hpsb_unregister_highlevel(&firesat_highlevel);
+ return ret;
}
if((ret=firesat_register_rc()))
printk("%s: firesat_register_rc return error code %d (ignored)\n",__FUNCTION__,ret);
-
+
return 0;
}
static void __exit firesat_exit(void){
firesat_unregister_rc();
-
+
hpsb_unregister_protocol(&firesat_driver);
hpsb_unregister_highlevel(&firesat_highlevel);
printk("FireSAT quit\n");