aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-25 15:24:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-25 15:24:06 -0400
commit5f3b28781cbc030351e2fa0712602afbea592aae (patch)
tree1387cb2fcea6d4119cd7ad13c76e79c41d5ff4ac /drivers
parentf7ce1f5e083fc099346019fb1f8d56a5452703ed (diff)
parente38649702ea64fdbbab3dd459bf8558142dd3bc4 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: ieee1394: silence defined but not used warning in non-modular builds ieee1394: rawiso: requeue packet for transmission after skipped cycle
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ieee1394/dv1394.c2
-rw-r--r--drivers/ieee1394/iso.h2
-rw-r--r--drivers/ieee1394/ohci1394.c34
-rw-r--r--drivers/ieee1394/raw1394.c9
-rw-r--r--drivers/ieee1394/video1394.c2
5 files changed, 48 insertions, 1 deletions
diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c
index 6228fadacd38..9d19aec5820a 100644
--- a/drivers/ieee1394/dv1394.c
+++ b/drivers/ieee1394/dv1394.c
@@ -2167,6 +2167,7 @@ static const struct file_operations dv1394_fops=
2167/* 2167/*
2168 * Export information about protocols/devices supported by this driver. 2168 * Export information about protocols/devices supported by this driver.
2169 */ 2169 */
2170#ifdef MODULE
2170static struct ieee1394_device_id dv1394_id_table[] = { 2171static struct ieee1394_device_id dv1394_id_table[] = {
2171 { 2172 {
2172 .match_flags = IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, 2173 .match_flags = IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
@@ -2177,6 +2178,7 @@ static struct ieee1394_device_id dv1394_id_table[] = {
2177}; 2178};
2178 2179
2179MODULE_DEVICE_TABLE(ieee1394, dv1394_id_table); 2180MODULE_DEVICE_TABLE(ieee1394, dv1394_id_table);
2181#endif /* MODULE */
2180 2182
2181static struct hpsb_protocol_driver dv1394_driver = { 2183static struct hpsb_protocol_driver dv1394_driver = {
2182 .name = "dv1394", 2184 .name = "dv1394",
diff --git a/drivers/ieee1394/iso.h b/drivers/ieee1394/iso.h
index b94e55e6eaa5..b5de5f21ef78 100644
--- a/drivers/ieee1394/iso.h
+++ b/drivers/ieee1394/iso.h
@@ -123,6 +123,8 @@ struct hpsb_iso {
123 123
124 /* how many times the buffer has overflowed or underflowed */ 124 /* how many times the buffer has overflowed or underflowed */
125 atomic_t overflows; 125 atomic_t overflows;
126 /* how many cycles were skipped for a given context */
127 atomic_t skips;
126 128
127 /* Current number of bytes lost in discarded packets */ 129 /* Current number of bytes lost in discarded packets */
128 int bytes_discarded; 130 int bytes_discarded;
diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c
index 0690469fcecf..e509e13cb7a7 100644
--- a/drivers/ieee1394/ohci1394.c
+++ b/drivers/ieee1394/ohci1394.c
@@ -1723,6 +1723,8 @@ struct ohci_iso_xmit {
1723 struct dma_prog_region prog; 1723 struct dma_prog_region prog;
1724 struct ohci1394_iso_tasklet task; 1724 struct ohci1394_iso_tasklet task;
1725 int task_active; 1725 int task_active;
1726 int last_cycle;
1727 atomic_t skips;
1726 1728
1727 u32 ContextControlSet; 1729 u32 ContextControlSet;
1728 u32 ContextControlClear; 1730 u32 ContextControlClear;
@@ -1759,6 +1761,8 @@ static int ohci_iso_xmit_init(struct hpsb_iso *iso)
1759 iso->hostdata = xmit; 1761 iso->hostdata = xmit;
1760 xmit->ohci = iso->host->hostdata; 1762 xmit->ohci = iso->host->hostdata;
1761 xmit->task_active = 0; 1763 xmit->task_active = 0;
1764 xmit->last_cycle = -1;
1765 atomic_set(&iso->skips, 0);
1762 1766
1763 dma_prog_region_init(&xmit->prog); 1767 dma_prog_region_init(&xmit->prog);
1764 1768
@@ -1856,6 +1860,26 @@ static void ohci_iso_xmit_task(unsigned long data)
1856 /* parse cycle */ 1860 /* parse cycle */
1857 cycle = le32_to_cpu(cmd->output_last.status) & 0x1FFF; 1861 cycle = le32_to_cpu(cmd->output_last.status) & 0x1FFF;
1858 1862
1863 if (xmit->last_cycle > -1) {
1864 int cycle_diff = cycle - xmit->last_cycle;
1865 int skip;
1866
1867 /* unwrap */
1868 if (cycle_diff < 0) {
1869 cycle_diff += 8000;
1870 if (cycle_diff < 0)
1871 PRINT(KERN_ERR, "bogus cycle diff %d\n",
1872 cycle_diff);
1873 }
1874
1875 skip = cycle_diff - 1;
1876 if (skip > 0) {
1877 DBGMSG("skipped %d cycles without packet loss", skip);
1878 atomic_add(skip, &iso->skips);
1879 }
1880 }
1881 xmit->last_cycle = cycle;
1882
1859 /* tell the subsystem the packet has gone out */ 1883 /* tell the subsystem the packet has gone out */
1860 hpsb_iso_packet_sent(iso, cycle, event != 0x11); 1884 hpsb_iso_packet_sent(iso, cycle, event != 0x11);
1861 1885
@@ -1943,6 +1967,16 @@ static int ohci_iso_xmit_queue(struct hpsb_iso *iso, struct hpsb_iso_packet_info
1943 prev->output_last.branchAddress = cpu_to_le32( 1967 prev->output_last.branchAddress = cpu_to_le32(
1944 dma_prog_region_offset_to_bus(&xmit->prog, sizeof(struct iso_xmit_cmd) * next_i) | 3); 1968 dma_prog_region_offset_to_bus(&xmit->prog, sizeof(struct iso_xmit_cmd) * next_i) | 3);
1945 1969
1970 /*
1971 * Link the skip address to this descriptor itself. This causes a
1972 * context to skip a cycle whenever lost cycles or FIFO overruns occur,
1973 * without dropping the data at that point the application should then
1974 * decide whether this is an error condition or not. Some protocols
1975 * can deal with this by dropping some rate-matching padding packets.
1976 */
1977 next->output_more_immediate.branchAddress =
1978 prev->output_last.branchAddress;
1979
1946 /* disable interrupt, unless required by the IRQ interval */ 1980 /* disable interrupt, unless required by the IRQ interval */
1947 if (prev_i % iso->irq_interval) { 1981 if (prev_i % iso->irq_interval) {
1948 prev->output_last.control &= cpu_to_le32(~(3 << 20)); /* no interrupt */ 1982 prev->output_last.control &= cpu_to_le32(~(3 << 20)); /* no interrupt */
diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c
index 04e96ba56e09..ec2a0adbedb2 100644
--- a/drivers/ieee1394/raw1394.c
+++ b/drivers/ieee1394/raw1394.c
@@ -2356,13 +2356,16 @@ static void rawiso_activity_cb(struct hpsb_iso *iso)
2356static void raw1394_iso_fill_status(struct hpsb_iso *iso, 2356static void raw1394_iso_fill_status(struct hpsb_iso *iso,
2357 struct raw1394_iso_status *stat) 2357 struct raw1394_iso_status *stat)
2358{ 2358{
2359 int overflows = atomic_read(&iso->overflows);
2360 int skips = atomic_read(&iso->skips);
2361
2359 stat->config.data_buf_size = iso->buf_size; 2362 stat->config.data_buf_size = iso->buf_size;
2360 stat->config.buf_packets = iso->buf_packets; 2363 stat->config.buf_packets = iso->buf_packets;
2361 stat->config.channel = iso->channel; 2364 stat->config.channel = iso->channel;
2362 stat->config.speed = iso->speed; 2365 stat->config.speed = iso->speed;
2363 stat->config.irq_interval = iso->irq_interval; 2366 stat->config.irq_interval = iso->irq_interval;
2364 stat->n_packets = hpsb_iso_n_ready(iso); 2367 stat->n_packets = hpsb_iso_n_ready(iso);
2365 stat->overflows = atomic_read(&iso->overflows); 2368 stat->overflows = ((skips & 0xFFFF) << 16) | ((overflows & 0xFFFF));
2366 stat->xmit_cycle = iso->xmit_cycle; 2369 stat->xmit_cycle = iso->xmit_cycle;
2367} 2370}
2368 2371
@@ -2437,6 +2440,8 @@ static int raw1394_iso_get_status(struct file_info *fi, void __user * uaddr)
2437 2440
2438 /* reset overflow counter */ 2441 /* reset overflow counter */
2439 atomic_set(&iso->overflows, 0); 2442 atomic_set(&iso->overflows, 0);
2443 /* reset skip counter */
2444 atomic_set(&iso->skips, 0);
2440 2445
2441 return 0; 2446 return 0;
2442} 2447}
@@ -2935,6 +2940,7 @@ static int raw1394_release(struct inode *inode, struct file *file)
2935/* 2940/*
2936 * Export information about protocols/devices supported by this driver. 2941 * Export information about protocols/devices supported by this driver.
2937 */ 2942 */
2943#ifdef MODULE
2938static struct ieee1394_device_id raw1394_id_table[] = { 2944static struct ieee1394_device_id raw1394_id_table[] = {
2939 { 2945 {
2940 .match_flags = IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, 2946 .match_flags = IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
@@ -2956,6 +2962,7 @@ static struct ieee1394_device_id raw1394_id_table[] = {
2956}; 2962};
2957 2963
2958MODULE_DEVICE_TABLE(ieee1394, raw1394_id_table); 2964MODULE_DEVICE_TABLE(ieee1394, raw1394_id_table);
2965#endif /* MODULE */
2959 2966
2960static struct hpsb_protocol_driver raw1394_driver = { 2967static struct hpsb_protocol_driver raw1394_driver = {
2961 .name = "raw1394", 2968 .name = "raw1394",
diff --git a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c
index e03024eeeac1..e24772d336e1 100644
--- a/drivers/ieee1394/video1394.c
+++ b/drivers/ieee1394/video1394.c
@@ -1293,6 +1293,7 @@ static const struct file_operations video1394_fops=
1293/* 1293/*
1294 * Export information about protocols/devices supported by this driver. 1294 * Export information about protocols/devices supported by this driver.
1295 */ 1295 */
1296#ifdef MODULE
1296static struct ieee1394_device_id video1394_id_table[] = { 1297static struct ieee1394_device_id video1394_id_table[] = {
1297 { 1298 {
1298 .match_flags = IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, 1299 .match_flags = IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION,
@@ -1313,6 +1314,7 @@ static struct ieee1394_device_id video1394_id_table[] = {
1313}; 1314};
1314 1315
1315MODULE_DEVICE_TABLE(ieee1394, video1394_id_table); 1316MODULE_DEVICE_TABLE(ieee1394, video1394_id_table);
1317#endif /* MODULE */
1316 1318
1317static struct hpsb_protocol_driver video1394_driver = { 1319static struct hpsb_protocol_driver video1394_driver = {
1318 .name = VIDEO1394_DRIVER_NAME, 1320 .name = VIDEO1394_DRIVER_NAME,