Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131723
b: refs/heads/master
c: 612262a
h: refs/heads/master
i:
  131721: e90d7f5
  131719: 0761608
v: v3
  • Loading branch information
Stefan Richter committed Feb 24, 2009
1 parent 51e2bad commit 2d00d58
Show file tree
Hide file tree
Showing 22 changed files with 503 additions and 527 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 81c67b7f82769292a86b802590be5879413f9278
refs/heads/master: 612262a53352af839a14b3395975a3440c95080a
1 change: 1 addition & 0 deletions trunk/drivers/ieee1394/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include <asm/types.h>

struct file;
struct pci_dev;
struct scatterlist;
struct vm_area_struct;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/ieee1394/ieee1394_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,7 @@ EXPORT_SYMBOL(hpsb_make_lock64packet);
EXPORT_SYMBOL(hpsb_make_phypacket);
EXPORT_SYMBOL(hpsb_read);
EXPORT_SYMBOL(hpsb_write);
EXPORT_SYMBOL(hpsb_lock);
EXPORT_SYMBOL(hpsb_packet_success);

/** highlevel.c **/
Expand Down
29 changes: 29 additions & 0 deletions trunk/drivers/ieee1394/ieee1394_transactions.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,3 +570,32 @@ int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation,

return retval;
}

int hpsb_lock(struct hpsb_host *host, nodeid_t node, unsigned int generation,
u64 addr, int extcode, quadlet_t *data, quadlet_t arg)
{
struct hpsb_packet *packet;
int retval = 0;

BUG_ON(in_interrupt());

packet = hpsb_make_lockpacket(host, node, addr, extcode, data, arg);
if (!packet)
return -ENOMEM;

packet->generation = generation;
retval = hpsb_send_packet_and_wait(packet);
if (retval < 0)
goto hpsb_lock_fail;

retval = hpsb_packet_success(packet);

if (retval == 0)
*data = packet->data[0];

hpsb_lock_fail:
hpsb_free_tlabel(packet);
hpsb_free_packet(packet);

return retval;
}
2 changes: 2 additions & 0 deletions trunk/drivers/ieee1394/ieee1394_transactions.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ int hpsb_read(struct hpsb_host *host, nodeid_t node, unsigned int generation,
u64 addr, quadlet_t *buffer, size_t length);
int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation,
u64 addr, quadlet_t *buffer, size_t length);
int hpsb_lock(struct hpsb_host *host, nodeid_t node, unsigned int generation,
u64 addr, int extcode, quadlet_t *data, quadlet_t arg);

#ifdef HPSB_DEBUG_TLABELS
extern spinlock_t hpsb_tlabel_lock;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/ieee1394/iso.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define IEEE1394_ISO_H

#include <linux/spinlock_types.h>
#include <linux/wait.h>
#include <asm/atomic.h>
#include <asm/types.h>

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/dvb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

obj-y := dvb-core/ frontends/ ttpci/ ttusb-dec/ ttusb-budget/ b2c2/ bt8xx/ dvb-usb/ pluto2/ siano/ dm1105/

obj-$(CONFIG_DVB_FIRESAT) += firesat/
obj-$(CONFIG_DVB_FIREDTV) += firesat/
13 changes: 7 additions & 6 deletions trunk/drivers/media/dvb/firesat/Kconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
config DVB_FIRESAT
tristate "FireSAT devices"
config DVB_FIREDTV
tristate "FireDTV (FireWire attached DVB receivers)"
depends on DVB_CORE && IEEE1394 && INPUT
help
Support for external IEEE1394 adapters designed by Digital Everywhere and
produced by El Gato, shipped under the brand name 'FireDTV/FloppyDTV'.
Support for DVB receivers from Digital Everywhere, known as FireDTV
and FloppyDTV, which are connected via IEEE 1394 (FireWire).

These devices don't have a MPEG decoder built in, so you need
These devices don't have an MPEG decoder built in, so you need
an external software decoder to watch TV.

Say Y if you own such a device and want to use it.
To compile this driver as a module, say M here: the module will be
called firedtv.
4 changes: 2 additions & 2 deletions trunk/drivers/media/dvb/firesat/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
firesat-objs := firesat_1394.o \
firedtv-objs := firesat_1394.o \
firesat_dvb.o \
firesat_fe.o \
firesat_iso.o \
Expand All @@ -7,7 +7,7 @@ firesat-objs := firesat_1394.o \
firesat-rc.o \
firesat-ci.o

obj-$(CONFIG_DVB_FIRESAT) += firesat.o
obj-$(CONFIG_DVB_FIREDTV) += firedtv.o

EXTRA_CFLAGS := -Idrivers/ieee1394
EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
121 changes: 47 additions & 74 deletions trunk/drivers/media/dvb/firesat/avc_api.c
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
/*
* FireSAT AVC driver
* FireDTV driver (formerly known as FireSAT)
*
* Copyright (c) 2004 Andreas Monitzer <andy@monitzer.com>
* Copyright (c) 2008 Ben Backx <ben@bbackx.com>
* Copyright (c) 2008 Henrik Kurelid <henrik@kurelid.se>
* Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
* Copyright (C) 2008 Ben Backx <ben@bbackx.com>
* Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*/

#include "firesat.h"
#include <linux/crc32.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/moduleparam.h>
#include <linux/mutex.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
#include <asm/atomic.h>

#include <ieee1394_transactions.h>
#include <nodemgr.h>
#include <asm/byteorder.h>
#include <linux/delay.h>
#include <linux/crc32.h>

#include "avc_api.h"
#include "firesat.h"
#include "firesat-rc.h"

#define RESPONSE_REGISTER 0xFFFFF0000D00ULL
Expand All @@ -28,8 +35,6 @@ static unsigned int avc_comm_debug = 0;
module_param(avc_comm_debug, int, 0644);
MODULE_PARM_DESC(avc_comm_debug, "debug logging level [0..2] of AV/C communication, default is 0 (no)");

static int __AVCRegisterRemoteControl(struct firesat*firesat, int internal);

/* Frees an allocated packet */
static void avc_free_packet(struct hpsb_packet *packet)
{
Expand Down Expand Up @@ -232,67 +237,39 @@ static int __AVCWrite(struct firesat *firesat, const AVCCmdFrm *CmdFrm,
return 0;
}

int AVCWrite(struct firesat*firesat, const AVCCmdFrm *CmdFrm, AVCRspFrm *RspFrm) {
int AVCWrite(struct firesat*firesat, const AVCCmdFrm *CmdFrm, AVCRspFrm *RspFrm)
{
int ret;
if(down_interruptible(&firesat->avc_sem))

if (mutex_lock_interruptible(&firesat->avc_mutex))
return -EINTR;

ret = __AVCWrite(firesat, CmdFrm, RspFrm);

up(&firesat->avc_sem);
mutex_unlock(&firesat->avc_mutex);
return ret;
}

static void do_schedule_remotecontrol(unsigned long ignored);
DECLARE_TASKLET(schedule_remotecontrol, do_schedule_remotecontrol, 0);

static void do_schedule_remotecontrol(unsigned long ignored) {
struct firesat *firesat;
unsigned long flags;

spin_lock_irqsave(&firesat_list_lock, flags);
list_for_each_entry(firesat,&firesat_list,list) {
if(atomic_read(&firesat->reschedule_remotecontrol) == 1) {
if(down_trylock(&firesat->avc_sem))
tasklet_schedule(&schedule_remotecontrol);
else {
if(__AVCRegisterRemoteControl(firesat, 1) == 0)
atomic_set(&firesat->reschedule_remotecontrol, 0);
else
tasklet_schedule(&schedule_remotecontrol);

up(&firesat->avc_sem);
}
int AVCRecv(struct firesat *firesat, u8 *data, size_t length)
{
AVCRspFrm *RspFrm = (AVCRspFrm *)data;

if (length >= 8 &&
RspFrm->operand[0] == SFE_VENDOR_DE_COMPANYID_0 &&
RspFrm->operand[1] == SFE_VENDOR_DE_COMPANYID_1 &&
RspFrm->operand[2] == SFE_VENDOR_DE_COMPANYID_2 &&
RspFrm->operand[3] == SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL) {
if (RspFrm->resp == CHANGED) {
firesat_handle_rc(RspFrm->operand[4] << 8 |
RspFrm->operand[5]);
schedule_work(&firesat->remote_ctrl_work);
} else if (RspFrm->resp != INTERIM) {
printk(KERN_INFO "firedtv: remote control result = "
"%d\n", RspFrm->resp);
}
}
spin_unlock_irqrestore(&firesat_list_lock, flags);
}

int AVCRecv(struct firesat *firesat, u8 *data, size_t length) {
// printk(KERN_INFO "%s\n",__func__);

// remote control handling

#if 0
AVCRspFrm *RspFrm = (AVCRspFrm*)data;

if(/*RspFrm->length >= 8 && ###*/
((RspFrm->operand[0] == SFE_VENDOR_DE_COMPANYID_0 &&
RspFrm->operand[1] == SFE_VENDOR_DE_COMPANYID_1 &&
RspFrm->operand[2] == SFE_VENDOR_DE_COMPANYID_2)) &&
RspFrm->operand[3] == SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL) {
if(RspFrm->resp == CHANGED) {
// printk(KERN_INFO "%s: code = %02x %02x\n",__func__,RspFrm->operand[4],RspFrm->operand[5]);
firesat_got_remotecontrolcode((((u16)RspFrm->operand[4]) << 8) | ((u16)RspFrm->operand[5]));

// 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",__func__, RspFrm->resp);
return 0;
}
#endif

if(atomic_read(&firesat->avc_reply_received) == 1) {
printk(KERN_ERR "%s: received out-of-order AVC response, "
"ignored\n",__func__);
Expand Down Expand Up @@ -718,7 +695,8 @@ int AVCTuner_GetTS(struct firesat *firesat){
return 0;
}

int AVCIdentifySubunit(struct firesat *firesat, unsigned char *systemId, int *transport) {
int AVCIdentifySubunit(struct firesat *firesat)
{
AVCCmdFrm CmdFrm;
AVCRspFrm RspFrm;

Expand Down Expand Up @@ -752,8 +730,6 @@ int AVCIdentifySubunit(struct firesat *firesat, unsigned char *systemId, int *tr
printk(KERN_ERR "%s: Invalid response length\n", __func__);
return -EINVAL;
}
if(systemId)
*systemId = RspFrm.operand[7];
return 0;
}

Expand Down Expand Up @@ -901,7 +877,7 @@ int AVCSubUnitInfo(struct firesat *firesat, char *subunitcount)
return 0;
}

static int __AVCRegisterRemoteControl(struct firesat*firesat, int internal)
int AVCRegisterRemoteControl(struct firesat *firesat)
{
AVCCmdFrm CmdFrm;

Expand All @@ -922,19 +898,16 @@ static int __AVCRegisterRemoteControl(struct firesat*firesat, int internal)

CmdFrm.length = 8;

if(internal) {
if(__AVCWrite(firesat,&CmdFrm,NULL) < 0)
return -EIO;
} else
if(AVCWrite(firesat,&CmdFrm,NULL) < 0)
return -EIO;

return 0;
return AVCWrite(firesat, &CmdFrm, NULL);
}

int AVCRegisterRemoteControl(struct firesat*firesat)
void avc_remote_ctrl_work(struct work_struct *work)
{
return __AVCRegisterRemoteControl(firesat, 0);
struct firesat *firesat =
container_of(work, struct firesat, remote_ctrl_work);

/* Should it be rescheduled in failure cases? */
AVCRegisterRemoteControl(firesat);
}

int AVCTuner_Host2Ca(struct firesat *firesat)
Expand Down
Loading

0 comments on commit 2d00d58

Please sign in to comment.