TxSkipPatched: iso_xmit_cycle_skip.patch
| File iso_xmit_cycle_skip.patch, 3.5 kB (added by ppalmers, 8 months ago) |
|---|
-
ieee1394-2.6.22-14-rt-1/iso.h
old new 123 123 124 124 /* how many times the buffer has overflowed or underflowed */ 125 125 atomic_t overflows; 126 /* how many cycles were skipped for a given context */ 127 atomic_t skips; 126 128 127 129 /* Current number of bytes lost in discarded packets */ 128 130 int bytes_discarded; -
ieee1394-2.6.22-14-rt-1/ohci1394.c
old new 1882 1882 struct dma_prog_region prog; 1883 1883 struct ohci1394_iso_tasklet task; 1884 1884 int task_active; 1885 int last_cycle; 1886 atomic_t skips; 1885 1887 1886 1888 u32 ContextControlSet; 1887 1889 u32 ContextControlClear; … … 1918 1920 iso->hostdata = xmit; 1919 1921 xmit->ohci = iso->host->hostdata; 1920 1922 xmit->task_active = 0; 1923 xmit->last_cycle = -1; 1924 atomic_set(&iso->skips, 0); 1921 1925 1922 1926 dma_prog_region_init(&xmit->prog); 1923 1927 … … 2015 2019 /* parse cycle */ 2016 2020 cycle = le32_to_cpu(cmd->output_last.status) & 0x1FFF; 2017 2021 2022 if (xmit->last_cycle > -1) { 2023 int cycle_diff = cycle - xmit->last_cycle; 2024 int skip; 2025 2026 // unwrap 2027 if(cycle_diff < 0) { 2028 cycle_diff += 8000; 2029 if(cycle_diff < 0) { 2030 PRINT(KERN_ERR, 2031 "bogus cycle diff %d\n", cycle_diff); 2032 } 2033 } 2034 2035 skip = cycle_diff - 1; 2036 if(skip > 0) { 2037 DBGMSG("skipped %d cycles without packet loss", skip); 2038 atomic_add(skip, &iso->skips); 2039 } 2040 } 2041 xmit->last_cycle = cycle; 2042 2018 2043 /* tell the subsystem the packet has gone out */ 2019 2044 hpsb_iso_packet_sent(iso, cycle, event != 0x11); 2020 2045 … … 2102 2127 prev->output_last.branchAddress = cpu_to_le32( 2103 2128 dma_prog_region_offset_to_bus(&xmit->prog, sizeof(struct iso_xmit_cmd) * next_i) | 3); 2104 2129 2130 /* link the skip address to this descriptor itself 2131 this causes a context to skip a cycle whenever lost cycles 2132 or FIFO overruns occur, without dropping the data at that point 2133 the application should then decide whether this is an error condition 2134 or not. Some protocols can deal with this by dropping some rate-matching 2135 padding packets 2136 */ 2137 next->output_more_immediate.branchAddress = prev->output_last.branchAddress; 2138 2105 2139 /* disable interrupt, unless required by the IRQ interval */ 2106 2140 if (prev_i % iso->irq_interval) { 2107 2141 prev->output_last.control &= cpu_to_le32(~(3 << 20)); /* no interrupt */ -
ieee1394-2.6.22-14-rt-1/raw1394.c
old new 2507 2507 static void raw1394_iso_fill_status(struct hpsb_iso *iso, 2508 2508 struct raw1394_iso_status *stat) 2509 2509 { 2510 int overflows = atomic_read(&iso->overflows); 2511 int skips = atomic_read(&iso->skips); 2510 2512 stat->config.data_buf_size = iso->buf_size; 2511 2513 stat->config.buf_packets = iso->buf_packets; 2512 2514 stat->config.channel = iso->channel; 2513 2515 stat->config.speed = iso->speed; 2514 2516 stat->config.irq_interval = iso->irq_interval; 2515 2517 stat->n_packets = hpsb_iso_n_ready(iso); 2516 stat->overflows = atomic_read(&iso->overflows);2518 stat->overflows = ((skips & 0xFFFF) << 16) | ((overflows & 0xFFFF)); 2517 2519 stat->xmit_cycle = iso->xmit_cycle; 2518 2520 } 2519 2521 … … 2588 2590 2589 2591 /* reset overflow counter */ 2590 2592 atomic_set(&iso->overflows, 0); 2593 /* reset skip counter */ 2594 atomic_set(&iso->skips, 0); 2591 2595 2592 2596 return 0; 2593 2597 }
