Lines Matching full:cycle

231 	// of syt interval. This comes from the interval of isoc cycle. As 1394
484 static unsigned int compute_syt_offset(unsigned int syt, unsigned int cycle,
487 unsigned int cycle_lo = (cycle % CYCLES_PER_SECOND) & 0x0f;
534 dst->syt_offset = compute_syt_offset(src->syt, src->cycle, transfer_delay);
705 static void build_it_pkt_header(struct amdtp_stream *s, unsigned int cycle,
725 trace_amdtp_packet(s, cycle, cip_header, payload_length + header_length, data_blocks,
828 static int parse_ir_ctx_header(struct amdtp_stream *s, unsigned int cycle,
863 // Handle the cycle so that empty packet arrives.
877 trace_amdtp_packet(s, cycle, cip_header, payload_length, *data_blocks,
897 static inline u32 increment_ohci_cycle_count(u32 cycle, unsigned int addend)
899 cycle += addend;
900 if (cycle >= OHCI_SECOND_MODULUS * CYCLES_PER_SECOND)
901 cycle -= OHCI_SECOND_MODULUS * CYCLES_PER_SECOND;
902 return cycle;
923 // Align to actual cycle count for the packet which is going to be scheduled.
924 // This module queued the same number of isochronous cycle as the size of queue
925 // to kip isochronous cycle, therefore it's OK to just increment the cycle by
926 // the size of queue for scheduled cycle.
930 u32 cycle = compute_ohci_cycle_count(ctx_header_tstamp);
931 return increment_ohci_cycle_count(cycle, queue_size);
951 unsigned int cycle;
956 cycle = compute_ohci_cycle_count(ctx_header[1]);
957 lost = (next_cycle != cycle);
960 // Fireface skips transmission just for an isoc cycle corresponding
965 lost = (next_cycle != cycle);
967 // Prepare a description for the skipped cycle for
969 desc->cycle = prev_cycle;
983 lost = (compare_ohci_cycle_count(safe_cycle, cycle) < 0);
986 dev_err(&s->unit->device, "Detect discontinuity of cycle: %d %d\n",
987 next_cycle, cycle);
992 err = parse_ir_ctx_header(s, cycle, ctx_header, &data_blocks, &dbc, &syt,
997 desc->cycle = cycle;
1019 static unsigned int compute_syt(unsigned int syt_offset, unsigned int cycle,
1025 syt = ((cycle + syt_offset / TICKS_PER_CYCLE) << 12) |
1046 desc->cycle = compute_ohci_it_cycle(*ctx_header, s->queue_size);
1049 desc->syt = compute_syt(seq->syt_offset, desc->cycle, s->transfer_delay);
1106 latest_cycle = desc->cycle;
1112 // Compute cycle count with lower 3 bits of second field and cycle field like timestamp
1117 // NOTE: The AMDTP packet descriptor should be for the past isochronous cycle since
1125 // the most recent isochronous cycle has been already processed.
1131 // NOTE: The AMDTP packet descriptor should be for the future isochronous cycle
1218 build_it_pkt_header(s, desc->cycle, template, pkt_header_length,
1249 unsigned int cycle;
1257 cycle = compute_ohci_it_cycle(ctx_header[packets - 1], s->queue_size);
1258 s->next_cycle = increment_ohci_cycle_count(cycle, 1);
1294 unsigned int cycle = compute_ohci_it_cycle(ctx_header[offset], queue_size);
1296 if (compare_ohci_cycle_count(cycle, d->processing_cycle.rx_start) >= 0)
1384 unsigned int cycle;
1393 cycle = compute_ohci_cycle_count(ctx_header[1]);
1394 s->next_cycle = increment_ohci_cycle_count(cycle, 1);
1423 unsigned int cycle = compute_ohci_cycle_count(ctx_header[1]);
1425 if (compare_ohci_cycle_count(cycle, d->processing_cycle.tx_start) >= 0)
1515 // Decide the cycle count to begin processing content of packet in IR contexts.
1519 unsigned int cycle = UINT_MAX;
1538 if (cycle == UINT_MAX ||
1539 compare_ohci_cycle_count(next_cycle, cycle) > 0)
1540 cycle = next_cycle;
1545 d->processing_cycle.tx_start = cycle;
1627 // Decide the cycle count to begin processing content of packet in IT contexts. All of IT
1630 unsigned int cycle = s->next_cycle;
1635 if (compare_ohci_cycle_count(s->next_cycle, cycle) > 0)
1636 cycle = s->next_cycle;
1644 d->processing_cycle.rx_start = cycle;
1899 // Process isochronous packets for recent isochronous cycle to handle