snd-firewire-lib: arrange some codes related to index

I plan to re-order packets in receive stream at receive_stream_callback().
This commit is a preparation for it.
snd-firewire-lib: add sort algorism to re-order receive packets

The sequence of packets in correct order is preferable. But Fireworks sometimes
transmit the sequence of packets in wrong order. Then I realize to re-ordering
receive packets according to its syt value to confirm the sequence of PCM/MIDI
data.

IEC 61883-6 defines AMDTP (Audio and Music Data Transmission Protocol).
The AMDTP packet express its "presentation time" in the value of syt field,
then the AMDTP packets always use "CIP (Common Isochrnous Packet) header
with SYT field" defined in IEC 61883-1. The syt consists of 2 bytes. The higher
4 bits represents the lower 4 bits in cycle count and lower 2 bits represents
cyt offset (wrap around 3072). Then one syt cycle is 64511 (0xfbff) and the
range of value is between 0x0000 to 0xFBFF but 0xFFFF means "no information".

Requirements for this sort algorism:
1. Because 2 bytes is allowed for syt field, one sequence of AMDTP packets may
includes packets in some syt cycles. The end of data in previous syt cycle may
appear after the start of data in next syt cycle appears.
2. The packets with "no information" has no information about syt but it
should consist of the sequence of data.

These requirements are very severe. The perfect answer seems not to exist.

Then I'm based on the assumption that the sequence of packets is not so messy.
Two packets except for "noinfo" packets are back to front and two packets
except for "noinfo" packets are in next syt cycle. Actually Fireworks transmits
such a sequence of packets.

This sort algorism is based on "bubble sort", repeats to swap neighbour data
if needed. But the direction becomes backward when the data in previous syt
cycle is found. To detect it, the intermediate value of minimum and maximum
value of syt is used. In both direction, "no information" data is ignored and
left where it is.
snd-firewire-lib: rename function local value to keep naming consistency

In transmit_packet(), "data_blocks" is used instead of "frames" or "events".

FYI:
data_blocks = (payload_length - 2) / data_block_quadlets
(2 is the number of quadlets in CIP header for AMDTP.)
snd-firewire-lib: use sort algorism to re-order receive packets.

Fireworks with firmware version 5.5 sometimes transmits packets which is not
in order. There is two cases.

Case 1: both of dbc and syt is back to front.
Index	Payload	CIP header 1	CIP header 2
023	210	3F1100F8	900478E9
024	002	3F1100F8	90FFFFFF
025	210	3F110000	900490E9
026	210	3F110008	9004A4E9
027	210	3F110010	9004B8E9
028	002	3F110010	90FFFFFF
029	210	3F110020	9004E4E8 <-
030	210	3F110018	9004D0E8 <-
031	210	3F110028	9004F8E8
032	002	3F110028	90FFFFFF
033	210	3F110030	900410E8
034	210	3F110038	900424E8
035	210	3F110040	900438E8
036	002	3F110040	90FFFFFF
037	210	3F110050	900464E8 <-
038	210	3F110048	900450E8 <-
039	210	3F110058	900478E8
040	002	3F110058	90FFFFFF
041	210	3F110068	9004A4E8 <-
042	210	3F110060	900490E8 <-
043	210	3F110070	9004B8E8
044	002	3F110070	90FFFFFF
045	210	3F110080	9004E4E7 <-
046	210	3F110078	9004D0E8 <-

Case 2: syt is just back to front.
Index	Payload	CIP header 1	CIP header 2
022	210	3F110090	90045BFA
023	002	3F110090	90FFFFFF
024	210	3F110098	900493F9 <-
025	210	3F1100A0	900487F9 <-
026	210	3F1100A8	90049BF9
027	002	3F1100A8	90FFFFFF
028	210	3F1100B0	9004D3F9 <-
029	210	3F1100B8	9004C7F9 <-
030	210	3F1100C0	9004DBF9
031	002	3F1100C0	90FFFFFF
032	210	3F1100C8	900413F9 <-
033	210	3F1100D0	900407F9 <-
034	210	3F1100D8	90041BF9
035	002	3F1100D8	90FFFFFF
036	210	3F1100E0	900453F9 <-
037	210	3F1100E8	900447F9 <-
038	210	3F1100F0	90045BF9
039	002	3F1100F0	90FFFFFF
040	210	3F1100F8	900493F9 <-
041	210	3F110000	900487F8 <-
042	210	3F110008	90049BF8
043	002	3F110008	90FFFFFF
044	210	3F110010	9004D3F8 <-
045	210	3F110018	9004C7F8 <-
046	210	3F110020	9004DBF8
047	002	3F110020	90FFFFFF

The packets should be re-ordered according to the value of syt. But syt is a
weak key to be used for sorting.

This commit currently do "best effort", not perfect. There still remain TODO
that the latest continuous packets should be left in buffer to keep the
consistency of sequence.