firewire-lib: replace hexadecimal 8bit value to int value

Here I expect compiler to apply widening conversion from int to __be32.

[alsa-devel] [PATCH 06/39] firewire-lib: Add support for MIDI capture/playback
http://mailman.alsa-project.org/pipermail/alsa-devel/2014-March/074037.html
firewire-lib: obsolete get_address() and introduce new two functions

The get_address() need 'master' parameter but codes in each branch don't
share much codes. It can be split to two functions and it's easy to
read.

[alsa-devel] [PATCH 14/39] firewire-lib: Add handling output connection by CMP
http://mailman.alsa-project.org/pipermail/alsa-devel/2014-March/074042.html
firewire-lib: Add support for deferred transaction

Some devices based on BeBoB use this type of transaction.

'Deferred Transaction' is defined in 'AV/C Digital Interface Command Set
General Specification' and is used by targets to make a response deferred
during processing it.

If a target may not be able to complete a command within 100msec since
receiving the command, then the target shall return INTERIM response,
to which final response will follow later. CONTROL/NOTIFY commands are
allowed for deferred transaction.

There is an issue. In the specification, the interval between INTERIM
response and final response is 'Unspecified interval'. The specification
depends on each subunit specification for this interval.

But we promise to finish this function for caller. In this reason, I use
FCP_TIMEOUT_MS for this interval. Currently it's 125msec.
firewire-lib: improvement for return value of AV/C commands

With previous commit, firewire-lib can handle deferred transaction
correctly. This means caller don't need to judge response code and
firewire-lib replace the codes to Linux's error codes.
bebob: improvement for command processing

With previous commit, firewire-lib can returns error codes instead of
response codes. The caller can just check return value as Linux's error
code.

And, with post commit, firewire-lib can handle command without response.
M-Audio Firewire 1814 and ProjectMix I/O are known as a device which use
this type of transaction (so rude). bebob_maudio.c has some codes for
this transaction but the codes are obsoleted.

Additionally, with post commit, firewire-lib can handle deferred
transaction. M-Audio Firewire 410 is known as a device which uses this
type of transaction. bebob_command.c has some codes for this transaction
but the codes can be obsoleted. But this device has a quirk to send a
wrong value for fdf field in AV/C Plug Signal Format command in its
beginning of startup and just after break connections.
oxfw: optimization for command processing

With previous commit, firewire-lib can returns error codes instead of
response codes. The caller can just check return value as Linux's error
code.
firewire-lib: remove sort processing

I need more time to gather information to persist my reasoning but currently
I don't have...

[alsa-devel] [PATCH 09/39] firewire-lib: Add sort function for transmitted packet
http://mailman.alsa-project.org/pipermail/alsa-devel/2014-March/074157.html
firewire-lib: Add checking continuity of data block counter

In IEC 61883-1, the value of dbc refers to the first data block following
a CIP header in current bus packet and a first packet a sequence number with
value zero.
In IEC 61883-6, data block count is running count of transmitted data blocks.

According to these specifications, this commit add codes to check continuity
of data blocks. When detecting discontinuity, streaming is stopped.

I note that discontinuity means there are some packets lost in theory. But
there may be devices which don't report continuous value for dbc field.
firewire-lib/bebob: Add a quirk for initial tx packets

BeBoB has a quirk for continuity of transmitted packet.
It don't increment dbc at the beginning of its transmittion.

For example, Yamaha GO46:
[13803.762518] 00050000 9001ffff
[13803.762523] 00050000 9001ffff
[13803.762525] 00050000 9001ffff
[13803.762527] 00050000 9001ffff
...
[13804.737925] 00050000 90014a1d
[13804.737927] 00050008 90016387
[13804.737929] 00050010 9001ffff
...

This commit adds a flag named 'skip_initial_tx_packets'. When this flag is true,
in_packets are not handled till dbc is incremented. Once incremented, this flag
becomes false.
firewire-lib/fireworks: Add a quirk for the meaning of dbc

Fireworks has a quirk for the value of dbc field in transmitted packets.
For Fireworks, dbc means the end of events in current packet. This is out
of specification.

For example, AudioFire4:
CIP0	CIP1	Payload
01070092 90FFFFFF 02
0107009A 9001E17B 3A
010700A2 9001F6E5 3A
010700A2 90FFFFFF 02
010700AA 9001104F 3A
010700B2 900125B9 3A
010700BA 90013B23 3A
010700BA 90FFFFFF 02
010700C2 9001548E 3A
010700CA 900169F8 3A
010700CA 90FFFFFF 02
010700D2 90018362 3A
010700DA 900198CC 3A

According to IEC 61883-6, a packet following to empty packet has the same
value for its dbc. But for Fireworks, it's incremented and empty packet has
the same value for its dbc as previous packet.

This commit adds a flag for Fireworks and some codes to checking dbc continuity.
firewire-lib/fireworks: Add a quirk for wrong dbs in tx packets

One of Fireworks firmware, named  as 'AudioFire9', seems to transmit
packets with wrong value of dbs. It's always 0x11 but actual size of
data block is different.

This commit adds a flag for this quirk and some codes to calculate
correct size.
firewire-lib/fireworks: Add a quirk for fixed interval of reported dbc

Fireworks firmware version 5.5 reports fix interval for dbc in each packet.

For example, AudioFire4:
CIP0	CIP1	Payload
00070000 900484FF 72
00070008 9004A8FF 72
00070008 90FFFFFF 02
00070010 9004D0FF 72
00070018 9004C4FF 72
00070020 9004E8FF 72
00070020 90FFFFFF 02
00070028 900410FE 72

The interval of each dbc should be 16 except for empty packet but it's not.

This commit adds a flag for this quirk and codes to refer to a fixed value.
firewire-lib/fireworks: Add a quirk for NODATA packet with TAG0

Fireworks has a quirk to tranmit NODATA packets with TAG0. This commit
is to avoid side effect for the other devices.
firewire-lib/fireworks: rename a quirk of rx packets for MIDI

Fireworks has a quirk to ignore MIDI messages in data blocks more than 8.
This commit rename an existed flag to keep naming rule.