2019-05-19 20:08:20 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2009-11-09 05:30:54 +08:00
|
|
|
/*
|
|
|
|
* FireDTV driver -- firewire I/O backend
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/device.h>
|
|
|
|
#include <linux/errno.h>
|
|
|
|
#include <linux/firewire.h>
|
|
|
|
#include <linux/firewire-constants.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/list.h>
|
2009-11-19 03:00:55 +08:00
|
|
|
#include <linux/mm.h>
|
2011-02-06 22:41:44 +08:00
|
|
|
#include <linux/mod_devicetable.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/mutex.h>
|
2009-11-09 05:30:54 +08:00
|
|
|
#include <linux/slab.h>
|
|
|
|
#include <linux/spinlock.h>
|
2011-02-06 22:41:44 +08:00
|
|
|
#include <linux/string.h>
|
2009-11-09 05:30:54 +08:00
|
|
|
#include <linux/types.h>
|
2011-02-06 22:41:44 +08:00
|
|
|
#include <linux/wait.h>
|
|
|
|
#include <linux/workqueue.h>
|
2009-11-09 05:30:54 +08:00
|
|
|
|
|
|
|
#include <asm/page.h>
|
|
|
|
|
2017-12-29 02:03:51 +08:00
|
|
|
#include <media/dvb_demux.h>
|
2009-11-09 05:30:54 +08:00
|
|
|
|
|
|
|
#include "firedtv.h"
|
|
|
|
|
|
|
|
static LIST_HEAD(node_list);
|
|
|
|
static DEFINE_SPINLOCK(node_list_lock);
|
|
|
|
|
|
|
|
static inline struct fw_device *device_of(struct firedtv *fdtv)
|
|
|
|
{
|
|
|
|
return fw_device(fdtv->device->parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int node_req(struct firedtv *fdtv, u64 addr, void *data, size_t len,
|
|
|
|
int tcode)
|
|
|
|
{
|
|
|
|
struct fw_device *device = device_of(fdtv);
|
|
|
|
int rcode, generation = device->generation;
|
|
|
|
|
|
|
|
smp_rmb(); /* node_id vs. generation */
|
|
|
|
|
|
|
|
rcode = fw_run_transaction(device->card, tcode, device->node_id,
|
|
|
|
generation, device->max_speed, addr, data, len);
|
|
|
|
|
|
|
|
return rcode != RCODE_COMPLETE ? -EIO : 0;
|
|
|
|
}
|
|
|
|
|
2011-02-06 22:41:44 +08:00
|
|
|
int fdtv_lock(struct firedtv *fdtv, u64 addr, void *data)
|
2009-11-09 05:30:54 +08:00
|
|
|
{
|
|
|
|
return node_req(fdtv, addr, data, 8, TCODE_LOCK_COMPARE_SWAP);
|
|
|
|
}
|
|
|
|
|
2011-02-06 22:41:44 +08:00
|
|
|
int fdtv_read(struct firedtv *fdtv, u64 addr, void *data)
|
2009-11-09 05:30:54 +08:00
|
|
|
{
|
2009-11-19 03:01:34 +08:00
|
|
|
return node_req(fdtv, addr, data, 4, TCODE_READ_QUADLET_REQUEST);
|
2009-11-09 05:30:54 +08:00
|
|
|
}
|
|
|
|
|
2011-02-06 22:41:44 +08:00
|
|
|
int fdtv_write(struct firedtv *fdtv, u64 addr, void *data, size_t len)
|
2009-11-09 05:30:54 +08:00
|
|
|
{
|
|
|
|
return node_req(fdtv, addr, data, len, TCODE_WRITE_BLOCK_REQUEST);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define ISO_HEADER_SIZE 4
|
|
|
|
#define CIP_HEADER_SIZE 8
|
|
|
|
#define MPEG2_TS_HEADER_SIZE 4
|
|
|
|
#define MPEG2_TS_SOURCE_PACKET_SIZE (4 + 188)
|
|
|
|
|
|
|
|
#define MAX_PACKET_SIZE 1024 /* 776, rounded up to 2^n */
|
|
|
|
#define PACKETS_PER_PAGE (PAGE_SIZE / MAX_PACKET_SIZE)
|
|
|
|
#define N_PACKETS 64 /* buffer size */
|
|
|
|
#define N_PAGES DIV_ROUND_UP(N_PACKETS, PACKETS_PER_PAGE)
|
|
|
|
#define IRQ_INTERVAL 16
|
|
|
|
|
2011-02-06 22:41:44 +08:00
|
|
|
struct fdtv_ir_context {
|
2009-11-09 05:30:54 +08:00
|
|
|
struct fw_iso_context *context;
|
|
|
|
struct fw_iso_buffer buffer;
|
|
|
|
int interrupt_packet;
|
|
|
|
int current_packet;
|
2009-11-19 03:00:55 +08:00
|
|
|
char *pages[N_PAGES];
|
2009-11-09 05:30:54 +08:00
|
|
|
};
|
|
|
|
|
2011-02-06 22:41:44 +08:00
|
|
|
static int queue_iso(struct fdtv_ir_context *ctx, int index)
|
2009-11-09 05:30:54 +08:00
|
|
|
{
|
|
|
|
struct fw_iso_packet p;
|
|
|
|
|
|
|
|
p.payload_length = MAX_PACKET_SIZE;
|
2009-11-19 03:01:14 +08:00
|
|
|
p.interrupt = !(++ctx->interrupt_packet & (IRQ_INTERVAL - 1));
|
2009-11-09 05:30:54 +08:00
|
|
|
p.skip = 0;
|
|
|
|
p.header_length = ISO_HEADER_SIZE;
|
|
|
|
|
2009-11-19 03:01:14 +08:00
|
|
|
return fw_iso_context_queue(ctx->context, &p, &ctx->buffer,
|
|
|
|
index * MAX_PACKET_SIZE);
|
2009-11-09 05:30:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void handle_iso(struct fw_iso_context *context, u32 cycle,
|
|
|
|
size_t header_length, void *header, void *data)
|
|
|
|
{
|
|
|
|
struct firedtv *fdtv = data;
|
2011-02-06 22:41:44 +08:00
|
|
|
struct fdtv_ir_context *ctx = fdtv->ir_context;
|
2009-11-09 05:30:54 +08:00
|
|
|
__be32 *h, *h_end;
|
2009-11-19 03:00:55 +08:00
|
|
|
int length, err, i = ctx->current_packet;
|
2009-11-09 05:30:54 +08:00
|
|
|
char *p, *p_end;
|
|
|
|
|
|
|
|
for (h = header, h_end = h + header_length / 4; h < h_end; h++) {
|
|
|
|
length = be32_to_cpup(h) >> 16;
|
|
|
|
if (unlikely(length > MAX_PACKET_SIZE)) {
|
|
|
|
dev_err(fdtv->device, "length = %d\n", length);
|
|
|
|
length = MAX_PACKET_SIZE;
|
|
|
|
}
|
|
|
|
|
2009-11-19 03:00:55 +08:00
|
|
|
p = ctx->pages[i / PACKETS_PER_PAGE]
|
|
|
|
+ (i % PACKETS_PER_PAGE) * MAX_PACKET_SIZE;
|
2009-11-09 05:30:54 +08:00
|
|
|
p_end = p + length;
|
|
|
|
|
|
|
|
for (p += CIP_HEADER_SIZE + MPEG2_TS_HEADER_SIZE; p < p_end;
|
|
|
|
p += MPEG2_TS_SOURCE_PACKET_SIZE)
|
|
|
|
dvb_dmx_swfilter_packets(&fdtv->demux, p, 1);
|
|
|
|
|
|
|
|
err = queue_iso(ctx, i);
|
|
|
|
if (unlikely(err))
|
|
|
|
dev_err(fdtv->device, "requeue failed\n");
|
|
|
|
|
|
|
|
i = (i + 1) & (N_PACKETS - 1);
|
|
|
|
}
|
2011-05-02 15:33:56 +08:00
|
|
|
fw_iso_context_queue_flush(ctx->context);
|
2009-11-09 05:30:54 +08:00
|
|
|
ctx->current_packet = i;
|
|
|
|
}
|
|
|
|
|
2011-02-06 22:41:44 +08:00
|
|
|
int fdtv_start_iso(struct firedtv *fdtv)
|
2009-11-09 05:30:54 +08:00
|
|
|
{
|
2011-02-06 22:41:44 +08:00
|
|
|
struct fdtv_ir_context *ctx;
|
2009-11-09 05:30:54 +08:00
|
|
|
struct fw_device *device = device_of(fdtv);
|
2009-11-19 03:00:55 +08:00
|
|
|
int i, err;
|
2009-11-09 05:30:54 +08:00
|
|
|
|
|
|
|
ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
|
|
|
|
if (!ctx)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
ctx->context = fw_iso_context_create(device->card,
|
|
|
|
FW_ISO_CONTEXT_RECEIVE, fdtv->isochannel,
|
|
|
|
device->max_speed, ISO_HEADER_SIZE, handle_iso, fdtv);
|
|
|
|
if (IS_ERR(ctx->context)) {
|
|
|
|
err = PTR_ERR(ctx->context);
|
|
|
|
goto fail_free;
|
|
|
|
}
|
|
|
|
|
|
|
|
err = fw_iso_buffer_init(&ctx->buffer, device->card,
|
|
|
|
N_PAGES, DMA_FROM_DEVICE);
|
|
|
|
if (err)
|
|
|
|
goto fail_context_destroy;
|
|
|
|
|
2009-11-19 03:01:14 +08:00
|
|
|
ctx->interrupt_packet = 0;
|
2009-11-09 05:30:54 +08:00
|
|
|
ctx->current_packet = 0;
|
|
|
|
|
2009-11-19 03:00:55 +08:00
|
|
|
for (i = 0; i < N_PAGES; i++)
|
|
|
|
ctx->pages[i] = page_address(ctx->buffer.pages[i]);
|
2009-11-09 05:30:54 +08:00
|
|
|
|
|
|
|
for (i = 0; i < N_PACKETS; i++) {
|
|
|
|
err = queue_iso(ctx, i);
|
|
|
|
if (err)
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
err = fw_iso_context_start(ctx->context, -1, 0,
|
|
|
|
FW_ISO_CONTEXT_MATCH_ALL_TAGS);
|
|
|
|
if (err)
|
|
|
|
goto fail;
|
|
|
|
|
2011-02-06 22:41:44 +08:00
|
|
|
fdtv->ir_context = ctx;
|
2009-11-09 05:30:54 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
fail:
|
|
|
|
fw_iso_buffer_destroy(&ctx->buffer, device->card);
|
|
|
|
fail_context_destroy:
|
|
|
|
fw_iso_context_destroy(ctx->context);
|
|
|
|
fail_free:
|
|
|
|
kfree(ctx);
|
|
|
|
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2011-02-06 22:41:44 +08:00
|
|
|
void fdtv_stop_iso(struct firedtv *fdtv)
|
2009-11-09 05:30:54 +08:00
|
|
|
{
|
2011-02-06 22:41:44 +08:00
|
|
|
struct fdtv_ir_context *ctx = fdtv->ir_context;
|
2009-11-09 05:30:54 +08:00
|
|
|
|
|
|
|
fw_iso_context_stop(ctx->context);
|
|
|
|
fw_iso_buffer_destroy(&ctx->buffer, device_of(fdtv)->card);
|
|
|
|
fw_iso_context_destroy(ctx->context);
|
|
|
|
kfree(ctx);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void handle_fcp(struct fw_card *card, struct fw_request *request,
|
|
|
|
int tcode, int destination, int source, int generation,
|
2010-06-21 04:50:35 +08:00
|
|
|
unsigned long long offset, void *payload, size_t length,
|
|
|
|
void *callback_data)
|
2009-11-09 05:30:54 +08:00
|
|
|
{
|
|
|
|
struct firedtv *f, *fdtv = NULL;
|
|
|
|
struct fw_device *device;
|
|
|
|
unsigned long flags;
|
|
|
|
int su;
|
|
|
|
|
firewire: fix use of multiple AV/C devices, allow multiple FCP listeners
Control of more than one AV/C device at once --- e.g. camcorders, tape
decks, audio devices, TV tuners --- failed or worked only unreliably,
depending on driver implementation. This affected kernelspace and
userspace drivers alike and was caused by firewire-core's inability to
accept multiple registrations of FCP listeners.
The fix allows multiple address handlers to be registered for the FCP
command and response registers. When a request for these registers is
received, all handlers are invoked, and the Firewire response is
generated by the core and not by any handler.
The cdev API does not change, i.e., userspace is still expected to send
a response for FCP requests; this response is silently ignored.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (changelog, rebased, whitespace)
2009-12-24 19:05:58 +08:00
|
|
|
if (length < 2 || (((u8 *)payload)[0] & 0xf0) != 0)
|
2009-11-09 05:30:54 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
su = ((u8 *)payload)[1] & 0x7;
|
|
|
|
|
|
|
|
spin_lock_irqsave(&node_list_lock, flags);
|
|
|
|
list_for_each_entry(f, &node_list, list) {
|
|
|
|
device = device_of(f);
|
|
|
|
if (device->generation != generation)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
smp_rmb(); /* node_id vs. generation */
|
|
|
|
|
|
|
|
if (device->card == card &&
|
|
|
|
device->node_id == source &&
|
|
|
|
(f->subunit == su || (f->subunit == 0 && su == 0x7))) {
|
|
|
|
fdtv = f;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
spin_unlock_irqrestore(&node_list_lock, flags);
|
|
|
|
|
firewire: fix use of multiple AV/C devices, allow multiple FCP listeners
Control of more than one AV/C device at once --- e.g. camcorders, tape
decks, audio devices, TV tuners --- failed or worked only unreliably,
depending on driver implementation. This affected kernelspace and
userspace drivers alike and was caused by firewire-core's inability to
accept multiple registrations of FCP listeners.
The fix allows multiple address handlers to be registered for the FCP
command and response registers. When a request for these registers is
received, all handlers are invoked, and the Firewire response is
generated by the core and not by any handler.
The cdev API does not change, i.e., userspace is still expected to send
a response for FCP requests; this response is silently ignored.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (changelog, rebased, whitespace)
2009-12-24 19:05:58 +08:00
|
|
|
if (fdtv)
|
2009-11-09 05:30:54 +08:00
|
|
|
avc_recv(fdtv, payload, length);
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct fw_address_handler fcp_handler = {
|
|
|
|
.length = CSR_FCP_END - CSR_FCP_RESPONSE,
|
|
|
|
.address_callback = handle_fcp,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct fw_address_region fcp_region = {
|
|
|
|
.start = CSR_REGISTER_BASE + CSR_FCP_RESPONSE,
|
|
|
|
.end = CSR_REGISTER_BASE + CSR_FCP_END,
|
|
|
|
};
|
|
|
|
|
2011-02-06 22:41:44 +08:00
|
|
|
static const char * const model_names[] = {
|
|
|
|
[FIREDTV_UNKNOWN] = "unknown type",
|
|
|
|
[FIREDTV_DVB_S] = "FireDTV S/CI",
|
|
|
|
[FIREDTV_DVB_C] = "FireDTV C/CI",
|
|
|
|
[FIREDTV_DVB_T] = "FireDTV T/CI",
|
|
|
|
[FIREDTV_DVB_S2] = "FireDTV S2 ",
|
|
|
|
};
|
|
|
|
|
2009-11-09 05:30:54 +08:00
|
|
|
/* Adjust the template string if models with longer names appear. */
|
2009-12-24 18:59:57 +08:00
|
|
|
#define MAX_MODEL_NAME_LEN sizeof("FireDTV ????")
|
2009-11-09 05:30:54 +08:00
|
|
|
|
2013-06-10 00:15:00 +08:00
|
|
|
static int node_probe(struct fw_unit *unit, const struct ieee1394_device_id *id)
|
2009-11-09 05:30:54 +08:00
|
|
|
{
|
|
|
|
struct firedtv *fdtv;
|
2009-12-24 18:59:57 +08:00
|
|
|
char name[MAX_MODEL_NAME_LEN];
|
2011-02-06 22:41:44 +08:00
|
|
|
int name_len, i, err;
|
2009-11-09 05:30:54 +08:00
|
|
|
|
2011-02-06 22:41:44 +08:00
|
|
|
fdtv = kzalloc(sizeof(*fdtv), GFP_KERNEL);
|
2009-11-09 05:30:54 +08:00
|
|
|
if (!fdtv)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
2013-06-10 00:15:00 +08:00
|
|
|
dev_set_drvdata(&unit->device, fdtv);
|
|
|
|
fdtv->device = &unit->device;
|
2011-02-06 22:41:44 +08:00
|
|
|
fdtv->isochannel = -1;
|
|
|
|
fdtv->voltage = 0xff;
|
|
|
|
fdtv->tone = 0xff;
|
|
|
|
|
|
|
|
mutex_init(&fdtv->avc_mutex);
|
|
|
|
init_waitqueue_head(&fdtv->avc_wait);
|
|
|
|
mutex_init(&fdtv->demux_mutex);
|
|
|
|
INIT_WORK(&fdtv->remote_ctrl_work, avc_remote_ctrl_work);
|
|
|
|
|
2013-06-10 00:15:00 +08:00
|
|
|
name_len = fw_csr_string(unit->directory, CSR_MODEL,
|
2011-02-06 22:41:44 +08:00
|
|
|
name, sizeof(name));
|
|
|
|
for (i = ARRAY_SIZE(model_names); --i; )
|
|
|
|
if (strlen(model_names[i]) <= name_len &&
|
|
|
|
strncmp(name, model_names[i], name_len) == 0)
|
|
|
|
break;
|
|
|
|
fdtv->type = i;
|
|
|
|
|
2013-06-10 00:15:00 +08:00
|
|
|
err = fdtv_register_rc(fdtv, &unit->device);
|
2009-11-09 05:30:54 +08:00
|
|
|
if (err)
|
|
|
|
goto fail_free;
|
|
|
|
|
|
|
|
spin_lock_irq(&node_list_lock);
|
|
|
|
list_add_tail(&fdtv->list, &node_list);
|
|
|
|
spin_unlock_irq(&node_list_lock);
|
|
|
|
|
|
|
|
err = avc_identify_subunit(fdtv);
|
|
|
|
if (err)
|
|
|
|
goto fail;
|
|
|
|
|
2011-02-06 22:41:44 +08:00
|
|
|
err = fdtv_dvb_register(fdtv, model_names[fdtv->type]);
|
2009-11-09 05:30:54 +08:00
|
|
|
if (err)
|
|
|
|
goto fail;
|
|
|
|
|
|
|
|
avc_register_remote_control(fdtv);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
fail:
|
|
|
|
spin_lock_irq(&node_list_lock);
|
|
|
|
list_del(&fdtv->list);
|
|
|
|
spin_unlock_irq(&node_list_lock);
|
|
|
|
fdtv_unregister_rc(fdtv);
|
|
|
|
fail_free:
|
|
|
|
kfree(fdtv);
|
|
|
|
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2013-06-10 00:15:00 +08:00
|
|
|
static void node_remove(struct fw_unit *unit)
|
2009-11-09 05:30:54 +08:00
|
|
|
{
|
2013-06-10 00:15:00 +08:00
|
|
|
struct firedtv *fdtv = dev_get_drvdata(&unit->device);
|
2009-11-09 05:30:54 +08:00
|
|
|
|
|
|
|
fdtv_dvb_unregister(fdtv);
|
|
|
|
|
|
|
|
spin_lock_irq(&node_list_lock);
|
|
|
|
list_del(&fdtv->list);
|
|
|
|
spin_unlock_irq(&node_list_lock);
|
|
|
|
|
|
|
|
fdtv_unregister_rc(fdtv);
|
|
|
|
|
|
|
|
kfree(fdtv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void node_update(struct fw_unit *unit)
|
|
|
|
{
|
|
|
|
struct firedtv *fdtv = dev_get_drvdata(&unit->device);
|
|
|
|
|
|
|
|
if (fdtv->isochannel >= 0)
|
|
|
|
cmp_establish_pp_connection(fdtv, fdtv->subunit,
|
|
|
|
fdtv->isochannel);
|
|
|
|
}
|
|
|
|
|
2011-02-06 22:41:44 +08:00
|
|
|
#define MATCH_FLAGS (IEEE1394_MATCH_VENDOR_ID | IEEE1394_MATCH_MODEL_ID | \
|
|
|
|
IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION)
|
|
|
|
|
|
|
|
#define DIGITAL_EVERYWHERE_OUI 0x001287
|
|
|
|
#define AVC_UNIT_SPEC_ID_ENTRY 0x00a02d
|
|
|
|
#define AVC_SW_VERSION_ENTRY 0x010001
|
|
|
|
|
|
|
|
static const struct ieee1394_device_id fdtv_id_table[] = {
|
|
|
|
{
|
|
|
|
/* FloppyDTV S/CI and FloppyDTV S2 */
|
|
|
|
.match_flags = MATCH_FLAGS,
|
|
|
|
.vendor_id = DIGITAL_EVERYWHERE_OUI,
|
|
|
|
.model_id = 0x000024,
|
|
|
|
.specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
|
|
|
|
.version = AVC_SW_VERSION_ENTRY,
|
|
|
|
}, {
|
|
|
|
/* FloppyDTV T/CI */
|
|
|
|
.match_flags = MATCH_FLAGS,
|
|
|
|
.vendor_id = DIGITAL_EVERYWHERE_OUI,
|
|
|
|
.model_id = 0x000025,
|
|
|
|
.specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
|
|
|
|
.version = AVC_SW_VERSION_ENTRY,
|
|
|
|
}, {
|
|
|
|
/* FloppyDTV C/CI */
|
|
|
|
.match_flags = MATCH_FLAGS,
|
|
|
|
.vendor_id = DIGITAL_EVERYWHERE_OUI,
|
|
|
|
.model_id = 0x000026,
|
|
|
|
.specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
|
|
|
|
.version = AVC_SW_VERSION_ENTRY,
|
|
|
|
}, {
|
|
|
|
/* FireDTV S/CI and FloppyDTV S2 */
|
|
|
|
.match_flags = MATCH_FLAGS,
|
|
|
|
.vendor_id = DIGITAL_EVERYWHERE_OUI,
|
|
|
|
.model_id = 0x000034,
|
|
|
|
.specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
|
|
|
|
.version = AVC_SW_VERSION_ENTRY,
|
|
|
|
}, {
|
|
|
|
/* FireDTV T/CI */
|
|
|
|
.match_flags = MATCH_FLAGS,
|
|
|
|
.vendor_id = DIGITAL_EVERYWHERE_OUI,
|
|
|
|
.model_id = 0x000035,
|
|
|
|
.specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
|
|
|
|
.version = AVC_SW_VERSION_ENTRY,
|
|
|
|
}, {
|
|
|
|
/* FireDTV C/CI */
|
|
|
|
.match_flags = MATCH_FLAGS,
|
|
|
|
.vendor_id = DIGITAL_EVERYWHERE_OUI,
|
|
|
|
.model_id = 0x000036,
|
|
|
|
.specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
|
|
|
|
.version = AVC_SW_VERSION_ENTRY,
|
|
|
|
}, {}
|
|
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE(ieee1394, fdtv_id_table);
|
|
|
|
|
2009-11-09 05:30:54 +08:00
|
|
|
static struct fw_driver fdtv_driver = {
|
|
|
|
.driver = {
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.name = "firedtv",
|
|
|
|
.bus = &fw_bus_type,
|
|
|
|
},
|
2013-06-10 00:15:00 +08:00
|
|
|
.probe = node_probe,
|
2009-11-09 05:30:54 +08:00
|
|
|
.update = node_update,
|
2013-06-10 00:15:00 +08:00
|
|
|
.remove = node_remove,
|
2009-11-09 05:30:54 +08:00
|
|
|
.id_table = fdtv_id_table,
|
|
|
|
};
|
|
|
|
|
2011-02-06 22:41:44 +08:00
|
|
|
static int __init fdtv_init(void)
|
2009-11-09 05:30:54 +08:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
ret = fw_core_add_address_handler(&fcp_handler, &fcp_region);
|
|
|
|
if (ret < 0)
|
|
|
|
return ret;
|
|
|
|
|
2011-02-06 22:41:44 +08:00
|
|
|
ret = driver_register(&fdtv_driver.driver);
|
|
|
|
if (ret < 0)
|
|
|
|
fw_core_remove_address_handler(&fcp_handler);
|
|
|
|
|
|
|
|
return ret;
|
2009-11-09 05:30:54 +08:00
|
|
|
}
|
|
|
|
|
2011-02-06 22:41:44 +08:00
|
|
|
static void __exit fdtv_exit(void)
|
2009-11-09 05:30:54 +08:00
|
|
|
{
|
|
|
|
driver_unregister(&fdtv_driver.driver);
|
|
|
|
fw_core_remove_address_handler(&fcp_handler);
|
|
|
|
}
|
2011-02-06 22:41:44 +08:00
|
|
|
|
|
|
|
module_init(fdtv_init);
|
|
|
|
module_exit(fdtv_exit);
|
|
|
|
|
|
|
|
MODULE_AUTHOR("Andreas Monitzer <andy@monitzer.com>");
|
|
|
|
MODULE_AUTHOR("Ben Backx <ben@bbackx.com>");
|
|
|
|
MODULE_DESCRIPTION("FireDTV DVB Driver");
|
|
|
|
MODULE_LICENSE("GPL");
|
|
|
|
MODULE_SUPPORTED_DEVICE("FireDTV DVB");
|