/*
* FireSAT AVC driver
*
* 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 <ieee1394_transactions.h>
#include <nodemgr.h>
#include <asm/byteorder.h>
#include <linux/delay.h>
#include <linux/crc32.h>
#include "avc_api.h"
#include "firesat-rc.h"
#define RESPONSE_REGISTER 0xFFFFF0000D00ULL
#define COMMAND_REGISTER 0xFFFFF0000B00ULL
#define PCR_BASE_ADDRESS 0xFFFFF0000900ULL
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)
{
hpsb_free_tlabel(packet);
hpsb_free_packet(packet);
}
static const char* get_ctype_string(__u8 ctype)
{
switch(ctype)
{
case 0:
return "CONTROL";
case 1:
return "STATUS";
case 2:
return "SPECIFIC_INQUIRY";
case 3:
return "NOTIFY";
case 4:
return "GENERAL_INQUIRY";
}
return "UNKNOWN";
}
static const char* get_resp_string(__u8 ctype)
{
switch(ctype)
{
case 8:
return "NOT_IMPLEMENTED";
case 9:
return "ACCEPTED";
case 10:
return "REJECTED";
case 11:
return "IN_TRANSITION";
case 12:
return "IMPLEMENTED_STABLE";
case 13:
return "CHANGED";
case 15:
return "INTERIM";
}
return "UNKNOWN";
}
static const char* get_subunit_address(__u8 subunit_id, __u8 subunit_type)
{
if (subunit_id == 7 && subunit_type == 0x1F)
return "Unit";
if (subunit_id == 0 && subunit_type == 0x05)
return "Tuner(0)";
return "Unsupported";
}
static const char* get_opcode_string(__u8 opcode)
{