linux1394-cvslog Mailing List for IEEE 1394 for Linux (Page 8)
Brought to you by:
aeb,
bencollins
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(10) |
Jul
(12) |
Aug
(8) |
Sep
(9) |
Oct
(4) |
Nov
(5) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(7) |
Feb
(3) |
Mar
(15) |
Apr
(12) |
May
(5) |
Jun
(9) |
Jul
(32) |
Aug
(39) |
Sep
(42) |
Oct
(22) |
Nov
(28) |
Dec
(8) |
2002 |
Jan
(37) |
Feb
(47) |
Mar
(6) |
Apr
(29) |
May
(33) |
Jun
(9) |
Jul
(28) |
Aug
(30) |
Sep
(15) |
Oct
(75) |
Nov
(37) |
Dec
(31) |
2003 |
Jan
|
Feb
(89) |
Mar
(41) |
Apr
(13) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: SVN U. <ben...@li...> - 2002-11-18 18:48:38
|
Author: bencollins Date: 2002-11-18 13:48:05 -0500 (Mon, 18 Nov 2002) New Revision: 693 Modified: branches/linux-2.4/ohci1394.c Log: Pull in selfID bus interrupt handler fix for busReset storms, from trunk. Modified: branches/linux-2.4/ohci1394.c ============================================================================== --- branches/linux-2.4/ohci1394.c (original) +++ branches/linux-2.4/ohci1394.c 2002-11-18 13:48:05.000000000 -0500 @@ -1173,74 +1173,60 @@ } if (event & OHCI1394_selfIDComplete) { if (host->in_bus_reset) { - node_id = reg_read(ohci, OHCI1394_NodeID); + node_id = reg_read(ohci, OHCI1394_NodeID); - /* If our nodeid is not valid, give a msec delay - * to let it settle in and try again. */ if (!(node_id & 0x80000000)) { - mdelay(1); - node_id = reg_read(ohci, OHCI1394_NodeID); + PRINT(KERN_ERR, ohci->id, + "SelfID received, but NodeID invalid " + "(probably new bus reset occured): %08X", + node_id); + goto selfid_not_valid; } - if (node_id & 0x80000000) { /* NodeID valid */ - phyid = node_id & 0x0000003f; - isroot = (node_id & 0x40000000) != 0; - - DBGMSG(ohci->id, - "SelfID interrupt received " - "(phyid %d, %s)", phyid, - (isroot ? "root" : "not root")); + phyid = node_id & 0x0000003f; + isroot = (node_id & 0x40000000) != 0; + + DBGMSG(ohci->id, + "SelfID interrupt received " + "(phyid %d, %s)", phyid, + (isroot ? "root" : "not root")); + + handle_selfid(ohci, host, phyid, isroot); + + /* Clear the bus reset event and re-enable the + * busReset interrupt. */ + spin_lock_irqsave(&ohci->event_lock, flags); + reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset); + reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset); + spin_unlock_irqrestore(&ohci->event_lock, flags); + + /* Accept Physical requests from all nodes. */ + reg_write(ohci,OHCI1394_AsReqFilterHiSet, 0xffffffff); + reg_write(ohci,OHCI1394_AsReqFilterLoSet, 0xffffffff); - handle_selfid(ohci, host, - phyid, isroot); + /* Turn on phys dma reception. + * + * TODO: Enable some sort of filtering management. + */ + if (phys_dma) { + reg_write(ohci,OHCI1394_PhyReqFilterHiSet, 0xffffffff); + reg_write(ohci,OHCI1394_PhyReqFilterLoSet, 0xffffffff); + reg_write(ohci,OHCI1394_PhyUpperBound, 0xffff0000); } else { - PRINT(KERN_ERR, ohci->id, - "SelfID interrupt received, but " - "NodeID is not valid: %08X", - node_id); + reg_write(ohci,OHCI1394_PhyReqFilterHiSet, 0x00000000); + reg_write(ohci,OHCI1394_PhyReqFilterLoSet, 0x00000000); } + DBGMSG(ohci->id, "PhyReqFilter=%08x%08x\n", + reg_read(ohci,OHCI1394_PhyReqFilterHiSet), + reg_read(ohci,OHCI1394_PhyReqFilterLoSet)); - /* Accept Physical requests from all nodes. */ - reg_write(ohci,OHCI1394_AsReqFilterHiSet, - 0xffffffff); - reg_write(ohci,OHCI1394_AsReqFilterLoSet, - 0xffffffff); + hpsb_selfid_complete(host, phyid, isroot); } else - PRINT(KERN_ERR, ohci->id, + PRINT(KERN_ERR, ohci->id, "SelfID received outside of bus reset sequence"); - /* Finally, we clear the busReset event and reenable - * the busReset interrupt. */ - spin_lock_irqsave(&ohci->event_lock, flags); - reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset); - reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset); - spin_unlock_irqrestore(&ohci->event_lock, flags); - event &= ~OHCI1394_selfIDComplete; - - /* Turn on phys dma reception. We should - * probably manage the filtering somehow, - * instead of blindly turning it on. */ - - /* - * CAUTION! - * Some chips (TI TSB43AB22) won't take a value in - * the PhyReqFilter register until after the IntEvent - * is cleared for bus reset, and even then a short - * delay is required. - */ - if (phys_dma) { - mdelay(1); - reg_write(ohci,OHCI1394_PhyReqFilterHiSet, - 0xffffffff); - reg_write(ohci,OHCI1394_PhyReqFilterLoSet, - 0xffffffff); - reg_write(ohci,OHCI1394_PhyUpperBound, - 0xffff0000); - } - - DBGMSG(ohci->id, "PhyReqFilter=%08x%08x\n", - reg_read(ohci,OHCI1394_PhyReqFilterHiSet), - reg_read(ohci,OHCI1394_PhyReqFilterLoSet)); + event &= ~OHCI1394_selfIDComplete; +selfid_not_valid: } /* Make sure we handle everything, just in case we accidentally |
From: SVN U. <ben...@li...> - 2002-11-18 18:44:40
|
Author: bencollins Date: 2002-11-18 13:44:04 -0500 (Mon, 18 Nov 2002) New Revision: 692 Modified: trunk/raw1394.c Log: Use C99 initializers, noted by Art Haas. Modified: trunk/raw1394.c ============================================================================== --- trunk/raw1394.c (original) +++ trunk/raw1394.c 2002-11-18 13:44:04.000000000 -0500 @@ -92,10 +92,10 @@ static int arm_lock64 (struct hpsb_host *host, int nodeid, octlet_t *store, u64 addr, octlet_t data, octlet_t arg, int ext_tcode, u16 flags); static struct hpsb_address_ops arm_ops = { - read: arm_read, - write: arm_write, - lock: arm_lock, - lock64: arm_lock64, + .read = arm_read, + .write = arm_write, + .lock = arm_lock, + .lock64 = arm_lock64, }; static void queue_complete_cb(struct pending_request *req); |
From: SVN U. <ben...@li...> - 2002-11-18 18:07:53
|
Author: bencollins Date: 2002-11-18 13:07:11 -0500 (Mon, 18 Nov 2002) New Revision: 691 Modified: trunk/sbp2.c Log: Make sure to include linux/version.h before using the KERNEL_VERSION macro. Modified: trunk/sbp2.c ============================================================================== --- trunk/sbp2.c (original) +++ trunk/sbp2.c 2002-11-18 13:07:11.000000000 -0500 @@ -319,6 +319,7 @@ #include <linux/smp_lock.h> #include <linux/init.h> #include <linux/blk.h> +#include <linux/version.h> #include <asm/current.h> #include <asm/uaccess.h> #include <asm/io.h> |
From: SVN U. <dde...@li...> - 2002-11-18 07:23:17
|
Author: ddennedy Date: 2002-11-18 02:22:43 -0500 (Mon, 18 Nov 2002) New Revision: 690 Modified: trunk/dv1394.c Log: improved reception overrun handling between DMA, packet buffer, and frame buffer Modified: trunk/dv1394.c ============================================================================== --- trunk/dv1394.c (original) +++ trunk/dv1394.c 2002-11-18 02:22:44.000000000 -0500 @@ -53,6 +53,8 @@ via pci_alloc_consistent() DONE: + - during reception, better handling of dropped frames and continuity errors + - during reception, prevent DMA from bypassing the irq tasklets - reduce irq rate during reception (1/250 packets). - add many more internal buffers during reception with scatter/gather dma. - add dbc (continuity) checking on receive, increment status.dropped_frames @@ -760,6 +762,9 @@ int dif_sequence = p->data[1] >> 4; /* dif sequence number is in bits 4 - 7 */ int dif_block = p->data[2]; + /* sanity check */ + if (dif_sequence > 11 || dif_block > 149) return; + switch (section_type) { case 0: /* 1 Header block */ memcpy( (void *) f->data + dif_sequence * 150 * 80, p->data, 480); @@ -898,10 +903,6 @@ } /* next j */ - /* loop tail to head */ - if (f != NULL && f->frame_end_branch != NULL) - *(f->frame_end_branch) = cpu_to_le32(video->frames[0]->descriptor_pool_dma | 1); /* set Z=1 */ - spin_unlock_irqrestore(&video->spinlock, irq_flags); } @@ -1142,7 +1143,7 @@ struct dv1394_init init; init.api_version = DV1394_API_VERSION; - init.n_frames = 2; + init.n_frames = DV1394_MAX_FRAMES / 4; /* the following are now set via proc_fs or devfs */ init.channel = video->channel; init.format = video->pal_or_ntsc; @@ -2292,8 +2293,9 @@ spin_lock(&video->spinlock); - if( (video->ohci_ir_ctx != -1) && - (reg_read(video->ohci, video->ohci_IsoRcvContextControlSet) & (1 << 10)) ) { + if( (video->ohci_ir_ctx != -1) + && (reg_read(video->ohci, video->ohci_IsoRcvContextControlSet) & (1 << 10)) ) + { int sof=0; /* start-of-frame flag */ struct frame *f; @@ -2301,7 +2303,12 @@ int i, dbc=0; struct DMA_descriptor_block *block = NULL; u16 xferstatus; - + + int next_i, prev_i; + struct DMA_descriptor_block *next = NULL; + dma_addr_t next_dma = 0; + struct DMA_descriptor_block *prev = NULL; + /* loop over all descriptors in all frames */ for (i = 0; i < video->n_frames*MAX_PACKETS; i++) { struct packet *p = dma_region_i(&video->packet_buf, struct packet, video->current_packet); @@ -2338,7 +2345,12 @@ dbc = (int) (p->cip_h1 >> 24); if ( video->continuity_counter != -1 && dbc > ((video->continuity_counter + 1) % 256) ) - video->dropped_frames++; + { + video->dropped_frames += video->n_clear_frames + 1; + video->first_frame = 0; + video->n_clear_frames = 0; + video->first_clear_frame = -1; + } video->continuity_counter = dbc; if (!video->first_frame) { @@ -2351,8 +2363,11 @@ frame_reset(f); /* f->state = STATE_CLEAR */ video->n_clear_frames++; if (video->n_clear_frames > video->n_frames) { - video->n_clear_frames = video->n_frames; video->dropped_frames++; + video->n_clear_frames--; + if (video->n_clear_frames < 0) + video->n_clear_frames = 0; + video->first_clear_frame = (video->first_clear_frame + 1) % video->n_frames; } if (video->first_clear_frame == -1) video->first_clear_frame = video->active_frame; @@ -2388,6 +2403,29 @@ /* reset xferStatus & resCount */ block->u.in.il.q[3] = cpu_to_le32(512); + /* terminate dma chain at this (next) packet */ + next_i = video->current_packet; + f = video->frames[next_i / MAX_PACKETS]; + next = &(f->descriptor_pool[next_i % MAX_PACKETS]); + next_dma = ((unsigned long) block - (unsigned long) f->descriptor_pool) + f->descriptor_pool_dma; + next->u.in.il.q[0] |= 3 << 20; /* enable interrupt */ + next->u.in.il.q[2] = 0; /* disable branch */ + + /* link previous to next */ + prev_i = (next_i == 0) ? (MAX_PACKETS * video->n_frames - 1) : (next_i - 1); + f = video->frames[prev_i / MAX_PACKETS]; + prev = &(f->descriptor_pool[prev_i % MAX_PACKETS]); + if(prev_i % (MAX_PACKETS/2)) { + prev->u.in.il.q[0] &= ~(3 << 20); /* no interrupt */ + } else { + prev->u.in.il.q[0] |= 3 << 20; /* enable interrupt */ + } + prev->u.in.il.q[2] = (cpu_to_le32(next_dma) | 1); /* set Z=1 */ + wmb(); + + /* wake up DMA in case it fell asleep */ + reg_write(video->ohci, video->ohci_IsoRcvContextControlSet, (1 << 12)); + /* advance packet_buffer cursor */ video->current_packet = (video->current_packet + 1) % (MAX_PACKETS * video->n_frames); @@ -2396,7 +2434,7 @@ wake = 1; /* why the hell not? */ } /* receive interrupt */ - + spin_unlock(&video->spinlock); if(wake) { |
From: SVN U. <ben...@li...> - 2002-11-17 02:20:18
|
Author: bencollins Date: 2002-11-16 21:19:46 -0500 (Sat, 16 Nov 2002) New Revision: 689 Modified: trunk/Kconfig Log: Tidy cleanup Modified: trunk/Kconfig ============================================================================== --- trunk/Kconfig (original) +++ trunk/Kconfig 2002-11-16 21:19:46.000000000 -0500 @@ -5,7 +5,7 @@ config IEEE1394 tristate "IEEE 1394 (FireWire) support (EXPERIMENTAL)" - ---help--- + help IEEE 1394 describes a high performance serial bus, which is also known as FireWire(tm) or i.Link(tm) and is used for connecting all sorts of devices (most notably digital video cameras) to your @@ -26,7 +26,7 @@ config IEEE1394_VERBOSEDEBUG bool "Excessive debugging output" depends on IEEE1394 - ---help--- + help If you say Y here, you will get very verbose debugging logs from the subsystem which includes a dump of the header of every sent and received packet. This can amount to a high amount of data |
From: SVN U. <ben...@li...> - 2002-11-17 02:18:26
|
Author: bencollins Date: 2002-11-16 21:17:51 -0500 (Sat, 16 Nov 2002) New Revision: 688 Modified: trunk/Kconfig Log: Update to match Config.in Modified: trunk/Kconfig ============================================================================== --- trunk/Kconfig (original) +++ trunk/Kconfig 2002-11-16 21:17:52.000000000 -0500 @@ -20,6 +20,36 @@ say M here and read <file:Documentation/modules.txt>. The module will be called ieee1394.o. +comment "Subsystem Options" + depends on IEEE1394 + +config IEEE1394_VERBOSEDEBUG + bool "Excessive debugging output" + depends on IEEE1394 + ---help--- + If you say Y here, you will get very verbose debugging logs from + the subsystem which includes a dump of the header of every sent + and received packet. This can amount to a high amount of data + collected in a very short time which is usually also saved to + disk by the system logging daemons. + + Say Y if you really want or need the debugging output, everyone + else says N. + +config IEEE1394_OUI_DB + bool "OUI Database built-in" + depends on IEEE1394 + help + If you say Y here, then an OUI list (vendor unique ID's) will be + compiled into the ieee1394 module. This doesn't really do much + accept being able to display the vendor of a hardware node. The + downside is that it adds about 300k to the size of the module, + or kernel (depending on whether you compile ieee1394 as a + module, or static in the kernel). + + This option is not needed for userspace programs like gscanbus + to show this information. + comment "Device Drivers" depends on IEEE1394 @@ -47,7 +77,7 @@ config IEEE1394_OHCI1394 tristate "OHCI-1394 support" depends on IEEE1394 - ---help--- + help Enable this driver if you have an IEEE 1394 controller based on the OHCI-1394 specification. The current driver is only tested with OHCI chipsets made by Texas Instruments and NEC. Most third-party vendors @@ -64,7 +94,7 @@ config IEEE1394_VIDEO1394 tristate "OHCI-1394 Video support" - depends on IEEE1394_OHCI1394 + depends on IEEE1394 && IEEE1394_OHCI1394 help This option enables video device usage for OHCI-1394 cards. Enable this option only if you have an IEEE 1394 video device connected to @@ -72,14 +102,14 @@ config IEEE1394_SBP2 tristate "SBP-2 support (Harddisks etc.)" - depends on SCSI && IEEE1394 + depends on IEEE1394 && SCSI help This option enables you to use SBP-2 devices connected to your IEEE 1394 bus. SBP-2 devices include harddrives and DVD devices. config IEEE1394_SBP2_PHYS_DMA bool "Enable Phys DMA support for SBP2 (Debug)" - depends on IEEE1394_SBP2 + depends on IEEE1394 && IEEE1394_SBP2 config IEEE1394_ETH1394 tristate "Ethernet over 1394" @@ -90,8 +120,8 @@ config IEEE1394_DV1394 tristate "OHCI-DV I/O support" - depends on IEEE1394_OHCI1394 - ---help--- + depends on IEEE1394 && IEEE1394_OHCI1394 + help This driver allows you to transmit and receive DV (digital video) streams on an OHCI-1394 card using a simple frame-oriented interface. @@ -131,8 +161,8 @@ config IEEE1394_AMDTP tristate "IEC61883-6 (Audio transmission) support" - depends on IEEE1394_OHCI1394 && IEEE1394_CMP - ---help--- + depends on IEEE1394 && IEEE1394_OHCI1394 && IEEE1394_CMP + help This option enables the Audio & Music Data Transmission Protocol (IEC61883-6) driver, which implements audio transmission over IEEE1394. @@ -144,18 +174,4 @@ say M here and read <file:Documentation/modules.txt>. The module will be called amdtp.o. -config IEEE1394_VERBOSEDEBUG - bool "Excessive debugging output" - depends on IEEE1394 - help - If you say Y here, you will get very verbose debugging logs from the - subsystem which includes a dump of the header of every sent and - received packet. This can amount to a high amount of data collected - in a very short time which is usually also saved to disk by the - system logging daemons. - - Say Y if you really want or need the debugging output, everyone else - says N. - endmenu - |
From: SVN U. <ben...@li...> - 2002-11-17 01:40:32
|
Author: bencollins Date: 2002-11-16 20:39:58 -0500 (Sat, 16 Nov 2002) New Revision: 687 Added: tags/v2.5/2.5.47-r686/ Log: Patch sent to Linus Copied: 2.5.47-r686 (from rev 686, trunk) |
From: SVN U. <ben...@li...> - 2002-11-17 00:58:53
|
Author: bencollins Date: 2002-11-16 19:58:20 -0500 (Sat, 16 Nov 2002) New Revision: 686 Added: branches/linux-2.4/ Log: Copied to form the continous 2.4 kernel branch. This is where bug fixes for the 2.4 tree will go. No new features. Copied: linux-2.4 (from rev 685, tags/v2.4/2.4.20-r604) |
From: SVN U. <ben...@li...> - 2002-11-17 00:57:22
|
Author: bencollins Date: 2002-11-16 19:56:48 -0500 (Sat, 16 Nov 2002) New Revision: 685 Removed: branches/rawiso/ Log: Old branch, no longer needed. All merged into trunk |
From: SVN U. <ben...@li...> - 2002-11-16 22:01:01
|
Author: bencollins Date: 2002-11-16 17:00:28 -0500 (Sat, 16 Nov 2002) New Revision: 684 Modified: trunk/sbp2.c Log: Feh. The patch in 2.5 to fix sbp2scsi_biosparam broken 2.4 compilation. No such thing as sector_t in 2.4. Modified: trunk/sbp2.c ============================================================================== --- trunk/sbp2.c (original) +++ trunk/sbp2.c 2002-11-16 17:00:29.000000000 -0500 @@ -2954,7 +2954,7 @@ #else static int sbp2scsi_biosparam (Scsi_Disk *disk, kdev_t dev, int geom[]) { - sector_t capacity = disk->capacity; + unsigned capacity = disk->capacity; #endif int heads, sectors, cylinders; |
From: SVN U. <ben...@li...> - 2002-11-16 21:58:52
|
Author: bencollins Date: 2002-11-16 16:58:19 -0500 (Sat, 16 Nov 2002) New Revision: 683 Modified: trunk/sbp2.c Log: Fixes for 2.5.47 compat. in sbp2scsi_biosparam() Modified: trunk/sbp2.c ============================================================================== --- trunk/sbp2.c (original) +++ trunk/sbp2.c 2002-11-16 16:58:20.000000000 -0500 @@ -2947,24 +2947,27 @@ /* * Called by scsi stack to get bios parameters (used by fdisk, and at boot). */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,28) -static int sbp2scsi_biosparam (Scsi_Disk *disk, kdev_t dev, int geom[]) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,43) +static int sbp2scsi_biosparam (struct scsi_device *sdev, + struct block_device *dev, sector_t capacity, int geom[]) +{ #else -static int sbp2scsi_biosparam (Scsi_Disk *disk, struct block_device *dev, int geom[]) -#endif +static int sbp2scsi_biosparam (Scsi_Disk *disk, kdev_t dev, int geom[]) { + sector_t capacity = disk->capacity; +#endif int heads, sectors, cylinders; SBP2_DEBUG("Request for bios parameters"); heads = 64; sectors = 32; - cylinders = (int)disk->capacity / (heads * sectors); + cylinders = (int)capacity / (heads * sectors); if (cylinders > 1024) { heads = 255; sectors = 63; - cylinders = (int)disk->capacity / (heads * sectors); + cylinders = (int)capacity / (heads * sectors); } geom[0] = heads; |
From: SVN U. <ben...@li...> - 2002-11-16 21:58:26
|
Author: bencollins Date: 2002-11-16 16:57:52 -0500 (Sat, 16 Nov 2002) New Revision: 682 Modified: trunk/dv1394.c Log: Don't include tqueue.h. Modified: trunk/dv1394.c ============================================================================== --- trunk/dv1394.c (original) +++ trunk/dv1394.c 2002-11-16 16:57:54.000000000 -0500 @@ -101,7 +101,6 @@ #include <asm/io.h> #include <asm/uaccess.h> #include <linux/proc_fs.h> -#include <linux/tqueue.h> #include <linux/delay.h> #include <asm/pgtable.h> #include <asm/page.h> |
From: SVN U. <ben...@li...> - 2002-11-16 21:53:23
|
Author: bencollins Date: 2002-11-16 16:52:50 -0500 (Sat, 16 Nov 2002) New Revision: 681 Modified: trunk/sbp2.c Log: 2.5.47 no longer has sd.h Modified: trunk/sbp2.c ============================================================================== --- trunk/sbp2.c (original) +++ trunk/sbp2.c 2002-11-16 16:52:51.000000000 -0500 @@ -328,13 +328,9 @@ #include <asm/io.h> #include <asm/scatterlist.h> -#ifdef CONFIG_KBUILD_2_5 -#include <scsi.h> -#include <hosts.h> -#include <sd.h> -#else #include "../scsi/scsi.h" #include "../scsi/hosts.h" +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,47) #include "../scsi/sd.h" #endif |
From: SVN U. <ben...@li...> - 2002-11-16 21:50:24
|
Author: bencollins Date: 2002-11-16 16:49:51 -0500 (Sat, 16 Nov 2002) New Revision: 680 Modified: trunk/video1394.c Log: Change to DEVFS_FL_DEFAULT. Patch from upstream. Modified: trunk/video1394.c ============================================================================== --- trunk/video1394.c (original) +++ trunk/video1394.c 2002-11-16 16:49:51.000000000 -0500 @@ -1363,8 +1363,7 @@ sprintf(name, "%d", video->id); minor = IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + video->id; - video->devfs = devfs_register(devfs_handle, name, - DEVFS_FL_AUTO_OWNER, + video->devfs = devfs_register(devfs_handle, name, DEVFS_FL_DEFAULT, IEEE1394_MAJOR, minor, S_IFCHR | S_IRUSR | S_IWUSR, &video1394_fops, NULL); |
From: SVN U. <ben...@li...> - 2002-11-16 21:32:52
|
Author: bencollins Date: 2002-11-16 16:32:20 -0500 (Sat, 16 Nov 2002) New Revision: 679 Modified: trunk/ieee1394_types.h Log: Include string.h. Patch pulled in from 2.5.47 Modified: trunk/ieee1394_types.h ============================================================================== --- trunk/ieee1394_types.h (original) +++ trunk/ieee1394_types.h 2002-11-16 16:32:21.000000000 -0500 @@ -7,6 +7,7 @@ #include <linux/version.h> #include <linux/list.h> #include <linux/init.h> +#include <linux/string.h> #include <asm/semaphore.h> #include <asm/byteorder.h> |
From: SVN U. <ben...@li...> - 2002-11-16 21:32:12
|
Author: bencollins Date: 2002-11-16 16:31:35 -0500 (Sat, 16 Nov 2002) New Revision: 678 Added: trunk/Kconfig Log: New replacement for Config.in/Config.help in 2.5.x Added: trunk/Kconfig ============================================================================== --- trunk/Kconfig (original) +++ trunk/Kconfig 2002-11-16 16:31:35.000000000 -0500 @@ -0,0 +1,161 @@ +# -*- shell-script -*- + +menu "IEEE 1394 (FireWire) support (EXPERIMENTAL)" + depends on PCI && EXPERIMENTAL + +config IEEE1394 + tristate "IEEE 1394 (FireWire) support (EXPERIMENTAL)" + ---help--- + IEEE 1394 describes a high performance serial bus, which is also + known as FireWire(tm) or i.Link(tm) and is used for connecting all + sorts of devices (most notably digital video cameras) to your + computer. + + If you have FireWire hardware and want to use it, say Y here. This + is the core support only, you will also need to select a driver for + your IEEE 1394 adapter. + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read <file:Documentation/modules.txt>. The module + will be called ieee1394.o. + +comment "Device Drivers" + depends on IEEE1394 + +comment "Texas Instruments PCILynx requires I2C bit-banging" + depends on IEEE1394 && (I2C=n || I2C_ALGOBIT=n) + +config IEEE1394_PCILYNX + tristate "Texas Instruments PCILynx support" + depends on IEEE1394 && I2C_ALGOBIT + help + Say Y here if you have an IEEE-1394 controller with the Texas + Instruments PCILynx chip. Note: this driver is written for revision + 2 of this chip and may not work with revision 0. + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read <file:Documentation/modules.txt>. The module + will be called pcilynx.o. + +# Non-maintained pcilynx options +# if [ "$CONFIG_IEEE1394_PCILYNX" != "n" ]; then +# bool ' Use PCILynx local RAM' CONFIG_IEEE1394_PCILYNX_LOCALRAM +# bool ' Support for non-IEEE1394 local ports' CONFIG_IEEE1394_PCILYNX_PORTS +# fi +config IEEE1394_OHCI1394 + tristate "OHCI-1394 support" + depends on IEEE1394 + ---help--- + Enable this driver if you have an IEEE 1394 controller based on the + OHCI-1394 specification. The current driver is only tested with OHCI + chipsets made by Texas Instruments and NEC. Most third-party vendors + use one of these chipsets. It should work with any OHCI-1394 + compliant card, however. + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read <file:Documentation/modules.txt>. The module + will be called ohci1394.o. + +comment "Protocol Drivers" + depends on IEEE1394 + +config IEEE1394_VIDEO1394 + tristate "OHCI-1394 Video support" + depends on IEEE1394_OHCI1394 + help + This option enables video device usage for OHCI-1394 cards. Enable + this option only if you have an IEEE 1394 video device connected to + an OHCI-1394 card. + +config IEEE1394_SBP2 + tristate "SBP-2 support (Harddisks etc.)" + depends on SCSI && IEEE1394 + help + This option enables you to use SBP-2 devices connected to your IEEE + 1394 bus. SBP-2 devices include harddrives and DVD devices. + +config IEEE1394_SBP2_PHYS_DMA + bool "Enable Phys DMA support for SBP2 (Debug)" + depends on IEEE1394_SBP2 + +config IEEE1394_ETH1394 + tristate "Ethernet over 1394" + depends on IEEE1394 + help + Extremely Experimental! This driver is a Linux specific way to use your + IEEE1394 Host as an Ethernet type device. This is _NOT_ IP1394. + +config IEEE1394_DV1394 + tristate "OHCI-DV I/O support" + depends on IEEE1394_OHCI1394 + ---help--- + This driver allows you to transmit and receive DV (digital video) + streams on an OHCI-1394 card using a simple frame-oriented + interface. + + The user-space API for dv1394 is documented in dv1394.h. + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read <file:Documentation/modules.txt>. The module + will be called dv1394.o. + +config IEEE1394_RAWIO + tristate "Raw IEEE1394 I/O support" + depends on IEEE1394 + help + Say Y here if you want support for the raw device. This is generally + a good idea, so you should say Y here. The raw device enables + direct communication of user programs with the IEEE 1394 bus and + thus with the attached peripherals. + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read <file:Documentation/modules.txt>. The module + will be called raw1394.o. + +config IEEE1394_CMP + tristate "IEC61883-1 Plug support" + depends on IEEE1394 + help + This option enables the Connection Management Procedures + (IEC61883-1) driver, which implements input and output plugs. + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read <file:Documentation/modules.txt>. The module + will be called amdtp.o. + +config IEEE1394_AMDTP + tristate "IEC61883-6 (Audio transmission) support" + depends on IEEE1394_OHCI1394 && IEEE1394_CMP + ---help--- + This option enables the Audio & Music Data Transmission Protocol + (IEC61883-6) driver, which implements audio transmission over + IEEE1394. + + The userspace interface is documented in amdtp.h. + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read <file:Documentation/modules.txt>. The module + will be called amdtp.o. + +config IEEE1394_VERBOSEDEBUG + bool "Excessive debugging output" + depends on IEEE1394 + help + If you say Y here, you will get very verbose debugging logs from the + subsystem which includes a dump of the header of every sent and + received packet. This can amount to a high amount of data collected + in a very short time which is usually also saved to disk by the + system logging daemons. + + Say Y if you really want or need the debugging output, everyone else + says N. + +endmenu + |
From: SVN U. <ben...@li...> - 2002-11-16 20:39:55
|
Author: bencollins Date: 2002-11-16 15:39:21 -0500 (Sat, 16 Nov 2002) New Revision: 677 Modified: trunk/raw1394.c Log: Fix raw1394 so that it only needs to call hpsb_make_writepacket once, and not special case it. Modified: trunk/raw1394.c ============================================================================== --- trunk/raw1394.c (original) +++ trunk/raw1394.c 2002-11-16 15:39:22.000000000 -0500 @@ -666,27 +666,20 @@ case RAW1394_REQ_ASYNC_WRITE: DBGMSG("write_request called"); + + packet = hpsb_make_writepacket(fi->host, node, addr, NULL, + req->req.length); + if (!packet) + return -ENOMEM; + if (req->req.length == 4) { - quadlet_t x; - - if (copy_from_user(&x, int2ptr(req->req.sendb), + if (copy_from_user(&packet->header[3], int2ptr(req->req.sendb), req->req.length)) - req->req.error = RAW1394_ERROR_MEMFAULT; - - packet = hpsb_make_writepacket(fi->host, node, addr, &x, - req->req.length); - if (!packet) - return -ENOMEM; - + req->req.error = RAW1394_ERROR_MEMFAULT; } else { - packet = hpsb_make_writepacket(fi->host, node, addr, NULL, - req->req.length); - if (!packet) - return -ENOMEM; - if (copy_from_user(packet->data, int2ptr(req->req.sendb), req->req.length)) - req->req.error = RAW1394_ERROR_MEMFAULT; + req->req.error = RAW1394_ERROR_MEMFAULT; } req->req.length = 0; |
From: SVN U. <ben...@li...> - 2002-11-16 20:34:10
|
Author: bencollins Date: 2002-11-16 15:33:37 -0500 (Sat, 16 Nov 2002) New Revision: 676 Modified: trunk/ieee1394_core.c Log: Get rid of excesive messages regarding cycle master Modified: trunk/ieee1394_core.c ============================================================================== --- trunk/ieee1394_core.c (original) +++ trunk/ieee1394_core.c 2002-11-16 15:33:38.000000000 -0500 @@ -419,24 +419,21 @@ void hpsb_check_cycle_master(struct hpsb_host *host) { - HPSB_INFO("Checking for host IRM cycle master"); - - /* check if host is IRM and not ROOT */ - if (host->is_irm && !host->is_root) { - HPSB_NOTICE("Host IRM is not root, resetting"); - if (host->reset_retries++ < 4) { - /* selfid stage did not yield valid cycle master */ - hpsb_reset_bus(host, LONG_RESET_FORCE_ROOT); - } else { - host->reset_retries = 0; - HPSB_NOTICE("Stopping out-of-control reset loop"); - HPSB_NOTICE("Warning - Cycle Master not set correctly"); - } - return; - } + /* check if host is IRM and not ROOT */ + if (host->is_irm && !host->is_root) { + HPSB_NOTICE("Host is IRM but not root, resetting"); + if (host->reset_retries++ < 4) { + /* selfid stage did not yield valid cycle master */ + hpsb_reset_bus(host, LONG_RESET_FORCE_ROOT); + } else { + host->reset_retries = 0; + HPSB_NOTICE("Stopping out-of-control reset loop"); + HPSB_NOTICE("Warning - Cycle Master not set correctly"); + } + return; + } - host->reset_retries = 0; - HPSB_INFO("Valid cycle master found"); + host->reset_retries = 0; } |
From: SVN U. <ben...@li...> - 2002-11-16 20:31:31
|
Author: bencollins Date: 2002-11-16 15:30:58 -0500 (Sat, 16 Nov 2002) New Revision: 675 Modified: trunk/ohci1394.c Log: Fix typo from last commit Modified: trunk/ohci1394.c ============================================================================== --- trunk/ohci1394.c (original) +++ trunk/ohci1394.c 2002-11-16 15:30:59.000000000 -0500 @@ -2003,7 +2003,7 @@ reg_read(ohci,OHCI1394_PhyReqFilterHiSet), reg_read(ohci,OHCI1394_PhyReqFilterLoSet)); - hpsb_selfid_complete(host, phyid, isroot) + hpsb_selfid_complete(host, phyid, isroot); } else PRINT(KERN_ERR, ohci->id, "SelfID received outside of bus reset sequence"); |
From: SVN U. <ben...@li...> - 2002-11-16 20:30:04
|
Author: bencollins Date: 2002-11-16 15:29:30 -0500 (Sat, 16 Nov 2002) New Revision: 674 Modified: trunk/hosts.h trunk/ieee1394_core.c trunk/ieee1394_core.h trunk/ohci1394.c trunk/pcilynx.c Log: Patch from Manfred for cycle master check Modified: trunk/ieee1394_core.c ============================================================================== --- trunk/ieee1394_core.c (original) +++ trunk/ieee1394_core.c 2002-11-16 15:29:31.000000000 -0500 @@ -378,6 +378,7 @@ /* selfid stage did not complete without error */ HPSB_NOTICE("Error in SelfID stage, resetting"); host->in_bus_reset = 0; + /* this should work from ohci1394 now... */ hpsb_reset_bus(host, LONG_RESET); return; } else { @@ -403,7 +404,6 @@ host->is_irm = 0; } - host->reset_retries = 0; if (isroot) { host->driver->devctl(host, ACT_CYCLE_MASTER, 1); host->is_cycmst = 1; @@ -411,6 +411,32 @@ atomic_inc(&host->generation); host->in_bus_reset = 0; highlevel_host_reset(host); + + /* check for common cycle master error */ + hpsb_check_cycle_master(host); +} + + +void hpsb_check_cycle_master(struct hpsb_host *host) +{ + HPSB_INFO("Checking for host IRM cycle master"); + + /* check if host is IRM and not ROOT */ + if (host->is_irm && !host->is_root) { + HPSB_NOTICE("Host IRM is not root, resetting"); + if (host->reset_retries++ < 4) { + /* selfid stage did not yield valid cycle master */ + hpsb_reset_bus(host, LONG_RESET_FORCE_ROOT); + } else { + host->reset_retries = 0; + HPSB_NOTICE("Stopping out-of-control reset loop"); + HPSB_NOTICE("Warning - Cycle Master not set correctly"); + } + return; + } + + host->reset_retries = 0; + HPSB_INFO("Valid cycle master found"); } @@ -1215,6 +1241,7 @@ EXPORT_SYMBOL(hpsb_bus_reset); EXPORT_SYMBOL(hpsb_selfid_received); EXPORT_SYMBOL(hpsb_selfid_complete); +EXPORT_SYMBOL(hpsb_check_cycle_master); EXPORT_SYMBOL(hpsb_packet_sent); EXPORT_SYMBOL(hpsb_packet_received); EXPORT_SYMBOL(ieee1394_register_chardev); Modified: trunk/ohci1394.c ============================================================================== --- trunk/ohci1394.c (original) +++ trunk/ohci1394.c 2002-11-16 15:29:31.000000000 -0500 @@ -38,6 +38,7 @@ * * Known bugs: * . devctl BUS_RESET arg confusion (reset type or root holdoff?) + * added LONG_RESET_ROOT and SHORT_RESET_ROOT for root holdoff --kk */ /* @@ -75,6 +76,10 @@ * . Updated to 2.4.x module scheme (PCI aswell) * . Removed procfs support since it trashes random mem * . Config ROM generation + * + * Manfred Weihs <we...@ic...> + * . Reworked code for initiating bus resets + * (long, short, with or without hold-off) */ #include <linux/config.h> @@ -158,10 +163,6 @@ "$Rev$ Ben Collins <bco...@de...>"; /* Module Parameters */ -MODULE_PARM(attempt_root,"i"); -MODULE_PARM_DESC(attempt_root, "Attempt to make the host root (default = 0)."); -static int attempt_root = 0; - MODULE_PARM(phys_dma,"i"); MODULE_PARM_DESC(phys_dma, "Enable physical dma (default = 1)."); static int phys_dma = 1; @@ -338,8 +339,6 @@ DBGMSG(ohci->id, "SelfID complete"); - hpsb_selfid_complete(host, phyid, isroot); - return; } @@ -843,12 +842,57 @@ struct ti_ohci *ohci = host->hostdata; int retval = 0; unsigned long flags; + int phy_reg; switch (cmd) { case RESET_BUS: - DBGMSG(ohci->id, "devctl: Bus reset requested%s", - attempt_root ? " and attempting to become root" : ""); - set_phy_reg_mask (ohci, 1, 0x40 | (attempt_root ? 0x80 : 0)); + switch (arg) { + case SHORT_RESET: + phy_reg = get_phy_reg(ohci, 5); + phy_reg |= 0x40; + set_phy_reg(ohci, 5, phy_reg); /* set ISBR */ + break; + case LONG_RESET: + phy_reg = get_phy_reg(ohci, 1); + phy_reg |= 0x40; + set_phy_reg(ohci, 1, phy_reg); /* set IBR */ + break; + case SHORT_RESET_NO_FORCE_ROOT: + phy_reg = get_phy_reg(ohci, 1); + if (phy_reg & 0x80) { + phy_reg &= ~0x80; + set_phy_reg(ohci, 1, phy_reg); /* clear RHB */ + } + + phy_reg = get_phy_reg(ohci, 5); + phy_reg |= 0x40; + set_phy_reg(ohci, 5, phy_reg); /* set ISBR */ + break; + case LONG_RESET_NO_FORCE_ROOT: + phy_reg = get_phy_reg(ohci, 1); + phy_reg &= ~0x80; + phy_reg |= 0x40; + set_phy_reg(ohci, 1, phy_reg); /* clear RHB, set IBR */ + break; + case SHORT_RESET_FORCE_ROOT: + phy_reg = get_phy_reg(ohci, 1); + if (!(phy_reg & 0x80)) { + phy_reg |= 0x80; + set_phy_reg(ohci, 1, phy_reg); /* set RHB */ + } + + phy_reg = get_phy_reg(ohci, 5); + phy_reg |= 0x40; + set_phy_reg(ohci, 5, phy_reg); /* set ISBR */ + break; + case LONG_RESET_FORCE_ROOT: + phy_reg = get_phy_reg(ohci, 1); + phy_reg |= 0xc0; + set_phy_reg(ohci, 1, phy_reg); /* set RHB and IBR */ + break; + default: + retval = -1; + } break; case GET_CYCLE_COUNTER: @@ -1754,7 +1798,7 @@ unsigned long flags; /* Read and clear the interrupt event register. Don't clear - * the busReset event, though, this is done when we get the + * the busReset event, though. This is done when we get the * selfIDComplete interrupt. */ spin_lock_irqsave(&ohci->event_lock, flags); event = reg_read(ohci, OHCI1394_IntEventClear); @@ -1839,9 +1883,7 @@ } spin_unlock_irqrestore(&ohci->event_lock, flags); if (!host->in_bus_reset) { - DBGMSG(ohci->id, "irq_handler: Bus reset requested%s", - (attempt_root) ? " and attempting to become root" - : ""); + DBGMSG(ohci->id, "irq_handler: Bus reset requested"); /* Subsystem call */ hpsb_bus_reset(ohci->host); @@ -1912,8 +1954,6 @@ event &= ~OHCI1394_isochTx; } if (event & OHCI1394_selfIDComplete) { - event &= ~OHCI1394_selfIDComplete; - if (host->in_bus_reset) { node_id = reg_read(ohci, OHCI1394_NodeID); @@ -1962,10 +2002,13 @@ DBGMSG(ohci->id, "PhyReqFilter=%08x%08x\n", reg_read(ohci,OHCI1394_PhyReqFilterHiSet), reg_read(ohci,OHCI1394_PhyReqFilterLoSet)); + + hpsb_selfid_complete(host, phyid, isroot) } else PRINT(KERN_ERR, ohci->id, "SelfID received outside of bus reset sequence"); + event &= ~OHCI1394_selfIDComplete; selfid_not_valid: } Modified: trunk/ieee1394_core.h ============================================================================== --- trunk/ieee1394_core.h (original) +++ trunk/ieee1394_core.h 2002-11-16 15:29:32.000000000 -0500 @@ -140,6 +140,12 @@ */ void hpsb_selfid_complete(struct hpsb_host *host, int phyid, int isroot); +/* + * Check bus reset results to find cycle master + */ +void hpsb_check_cycle_master(struct hpsb_host *host); + + /* * Notify core of sending a packet. Ackcode is the ack code returned for async * transmits or ACKX_SEND_ERROR if the transmission failed completely; ACKX_NONE Modified: trunk/hosts.h ============================================================================== --- trunk/hosts.h (original) +++ trunk/hosts.h 2002-11-16 15:29:32.000000000 -0500 @@ -134,7 +134,13 @@ /* Short (arbitrated) reset -- only available on 1394a capable IEEE 1394 capable controllers */ - SHORT_RESET + SHORT_RESET, + + /* Variants, that set force_root before issueing the bus reset */ + LONG_RESET_FORCE_ROOT, SHORT_RESET_FORCE_ROOT, + + /* Variants, that clear force_root before issueing the bus reset */ + LONG_RESET_NO_FORCE_ROOT, SHORT_RESET_NO_FORCE_ROOT }; struct hpsb_host_driver { Modified: trunk/pcilynx.c ============================================================================== --- trunk/pcilynx.c (original) +++ trunk/pcilynx.c 2002-11-16 15:29:32.000000000 -0500 @@ -19,6 +19,16 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* + * Contributions: + * + * Manfred Weihs <we...@ic...> + * reading bus info block (containing GUID) from serial + * eeprom via i2c and storing it in config ROM + * Reworked code for initiating bus resets + * (long, short, with or without hold-off) + */ + #include <linux/config.h> #include <linux/kernel.h> #include <linux/slab.h> @@ -450,7 +460,7 @@ if (host->in_bus_reset) return; /* in bus reset again */ - if (isroot) reg_set_bits(lynx, LINK_CONTROL, LINK_CONTROL_CYCMASTER); + if (isroot) reg_set_bits(lynx, LINK_CONTROL, LINK_CONTROL_CYCMASTER); //FIXME: I do not think, we need this here reg_set_bits(lynx, LINK_CONTROL, LINK_CONTROL_RCV_CMP_VALID | LINK_CONTROL_TX_ASYNC_EN | LINK_CONTROL_RX_ASYNC_EN | LINK_CONTROL_CYCTIMEREN); @@ -563,6 +573,7 @@ struct hpsb_packet *packet; LIST_HEAD(packet_list); unsigned long flags; + int phy_reg; switch (cmd) { case RESET_BUS: @@ -571,21 +582,140 @@ break; } - if (arg) { - arg = 3 << 6; - } else { - arg = 1 << 6; - } - - retval = get_phy_reg(lynx, 1); - arg |= (retval == -1 ? 63 : retval); - retval = 0; - - PRINT(KERN_INFO, lynx->id, "resetting bus on request"); + switch (arg) { + case SHORT_RESET: + if (lynx->phyic.reg_1394a) { + phy_reg = get_phy_reg(lynx, 5); + if (phy_reg == -1) { + PRINT(KERN_ERR, lynx->id, "cannot reset bus, because read phy reg failed"); + retval = -1; + break; + } + phy_reg |= 0x40; + + PRINT(KERN_INFO, lynx->id, "resetting bus (short bus reset) on request"); + + lynx->selfid_size = -1; + lynx->phy_reg0 = -1; + set_phy_reg(lynx, 5, phy_reg); /* set ISBR */ + break; + } else { + PRINT(KERN_INFO, lynx->id, "cannot do short bus reset, because of old phy"); + /* fall through to long bus reset */ + } + case LONG_RESET: + phy_reg = get_phy_reg(lynx, 1); + if (phy_reg == -1) { + PRINT(KERN_ERR, lynx->id, "cannot reset bus, because read phy reg failed"); + retval = -1; + break; + } + phy_reg |= 0x40; + + PRINT(KERN_INFO, lynx->id, "resetting bus (long bus reset) on request"); + + lynx->selfid_size = -1; + lynx->phy_reg0 = -1; + set_phy_reg(lynx, 1, phy_reg); /* clear RHB, set IBR */ + break; + case SHORT_RESET_NO_FORCE_ROOT: + if (lynx->phyic.reg_1394a) { + phy_reg = get_phy_reg(lynx, 1); + if (phy_reg == -1) { + PRINT(KERN_ERR, lynx->id, "cannot reset bus, because read phy reg failed"); + retval = -1; + break; + } + if (phy_reg & 0x80) { + phy_reg &= ~0x80; + set_phy_reg(lynx, 1, phy_reg); /* clear RHB */ + } + + phy_reg = get_phy_reg(lynx, 5); + if (phy_reg == -1) { + PRINT(KERN_ERR, lynx->id, "cannot reset bus, because read phy reg failed"); + retval = -1; + break; + } + phy_reg |= 0x40; + + PRINT(KERN_INFO, lynx->id, "resetting bus (short bus reset, no force_root) on request"); + + lynx->selfid_size = -1; + lynx->phy_reg0 = -1; + set_phy_reg(lynx, 5, phy_reg); /* set ISBR */ + break; + } else { + PRINT(KERN_INFO, lynx->id, "cannot do short bus reset, because of old phy"); + /* fall through to long bus reset */ + } + case LONG_RESET_NO_FORCE_ROOT: + phy_reg = get_phy_reg(lynx, 1); + if (phy_reg == -1) { + PRINT(KERN_ERR, lynx->id, "cannot reset bus, because read phy reg failed"); + retval = -1; + break; + } + phy_reg &= ~0x80; + phy_reg |= 0x40; + + PRINT(KERN_INFO, lynx->id, "resetting bus (long bus reset, no force_root) on request"); + + lynx->selfid_size = -1; + lynx->phy_reg0 = -1; + set_phy_reg(lynx, 1, phy_reg); /* clear RHB, set IBR */ + break; + case SHORT_RESET_FORCE_ROOT: + if (lynx->phyic.reg_1394a) { + phy_reg = get_phy_reg(lynx, 1); + if (phy_reg == -1) { + PRINT(KERN_ERR, lynx->id, "cannot reset bus, because read phy reg failed"); + retval = -1; + break; + } + if (!(phy_reg & 0x80)) { + phy_reg |= 0x80; + set_phy_reg(lynx, 1, phy_reg); /* set RHB */ + } + + phy_reg = get_phy_reg(lynx, 5); + if (phy_reg == -1) { + PRINT(KERN_ERR, lynx->id, "cannot reset bus, because read phy reg failed"); + retval = -1; + break; + } + phy_reg |= 0x40; + + PRINT(KERN_INFO, lynx->id, "resetting bus (short bus reset, force_root set) on request"); + + lynx->selfid_size = -1; + lynx->phy_reg0 = -1; + set_phy_reg(lynx, 5, phy_reg); /* set ISBR */ + break; + } else { + PRINT(KERN_INFO, lynx->id, "cannot do short bus reset, because of old phy"); + /* fall through to long bus reset */ + } + case LONG_RESET_FORCE_ROOT: + phy_reg = get_phy_reg(lynx, 1); + if (phy_reg == -1) { + PRINT(KERN_ERR, lynx->id, "cannot reset bus, because read phy reg failed"); + retval = -1; + break; + } + phy_reg |= 0xc0; + + PRINT(KERN_INFO, lynx->id, "resetting bus (long bus reset, force_root set) on request"); + + lynx->selfid_size = -1; + lynx->phy_reg0 = -1; + set_phy_reg(lynx, 1, phy_reg); /* set IBR and RHB */ + break; + default: + PRINT(KERN_ERR, lynx->id, "unknown argument for reset_bus command %d", arg); + retval = -1; + } - lynx->selfid_size = -1; - lynx->phy_reg0 = -1; - set_phy_reg(lynx, 1, arg); break; case GET_CYCLE_COUNTER: |
From: SVN U. <ben...@li...> - 2002-11-16 20:29:25
|
Author: bencollins Date: 2002-11-16 15:28:51 -0500 (Sat, 16 Nov 2002) New Revision: 673 Modified: trunk/highlevel.c Log: Convert hl_driver_lock to a semaphore to prevent sleep during read_lock's Modified: trunk/highlevel.c ============================================================================== --- trunk/highlevel.c (original) +++ trunk/highlevel.c 2002-11-16 15:28:51.000000000 -0500 @@ -28,7 +28,7 @@ LIST_HEAD(hl_drivers); -rwlock_t hl_drivers_lock = RW_LOCK_UNLOCKED; +static DECLARE_MUTEX(hl_drivers_lock); LIST_HEAD(addr_space); rwlock_t addr_space_lock = RW_LOCK_UNLOCKED; @@ -53,11 +53,11 @@ hl->name = name; hl->op = ops; - write_lock_irq(&hl_drivers_lock); + down(&hl_drivers_lock); list_add_tail(&hl->hl_list, &hl_drivers); - write_unlock_irq(&hl_drivers_lock); + up(&hl_drivers_lock); - hl_all_hosts(hl->op->add_host); + hl_all_hosts(hl->op->add_host); return hl; } @@ -82,9 +82,9 @@ } write_unlock_irq(&addr_space_lock); - write_lock_irq(&hl_drivers_lock); + down(&hl_drivers_lock); list_del(&hl->hl_list); - write_unlock_irq(&hl_drivers_lock); + up(&hl_drivers_lock); if (hl->op->remove_host) hl_all_hosts(hl->op->remove_host); @@ -119,10 +119,8 @@ write_lock_irq(&addr_space_lock); entry = addr_space.next; - while (list_entry(entry, struct hpsb_address_serve, as_list)->end - <= start) { - if (list_entry(entry->next, struct hpsb_address_serve, as_list) - ->start >= end) { + while (list_entry(entry, struct hpsb_address_serve, as_list)->end <= start) { + if (list_entry(entry->next, struct hpsb_address_serve, as_list)->start >= end) { list_add(&as->as_list, entry); list_add_tail(&as->addr_list, &hl->addr_list); retval = 1; @@ -198,13 +196,13 @@ struct list_head *entry; struct hpsb_highlevel *hl; - read_lock(&hl_drivers_lock); + down(&hl_drivers_lock); list_for_each(entry, &hl_drivers) { hl = list_entry(entry, struct hpsb_highlevel, hl_list); hl->op->add_host(host); } - read_unlock(&hl_drivers_lock); + up(&hl_drivers_lock); } void highlevel_remove_host(struct hpsb_host *host) @@ -212,14 +210,14 @@ struct list_head *entry; struct hpsb_highlevel *hl; - write_lock_irq(&hl_drivers_lock); + down(&hl_drivers_lock); list_for_each(entry, &hl_drivers) { hl = list_entry(entry, struct hpsb_highlevel, hl_list); if (hl->op->remove_host) hl->op->remove_host(host); } - write_unlock_irq(&hl_drivers_lock); + up(&hl_drivers_lock); } void highlevel_host_reset(struct hpsb_host *host) @@ -227,14 +225,14 @@ struct list_head *entry; struct hpsb_highlevel *hl; - read_lock(&hl_drivers_lock); + down(&hl_drivers_lock); list_for_each(entry, &hl_drivers) { hl = list_entry(entry, struct hpsb_highlevel, hl_list); if (hl->op->host_reset) hl->op->host_reset(host); } - read_unlock(&hl_drivers_lock); + up(&hl_drivers_lock); } void highlevel_iso_receive(struct hpsb_host *host, quadlet_t *data, @@ -244,7 +242,7 @@ struct hpsb_highlevel *hl; int channel = (data[0] >> 8) & 0x3f; - read_lock(&hl_drivers_lock); + down(&hl_drivers_lock); entry = hl_drivers.next; while (entry != &hl_drivers) { @@ -254,7 +252,7 @@ } entry = entry->next; } - read_unlock(&hl_drivers_lock); + up(&hl_drivers_lock); } void highlevel_fcp_request(struct hpsb_host *host, int nodeid, int direction, @@ -264,7 +262,7 @@ struct hpsb_highlevel *hl; int cts = data[0] >> 4; - read_lock(&hl_drivers_lock); + down(&hl_drivers_lock); entry = hl_drivers.next; while (entry != &hl_drivers) { @@ -275,7 +273,7 @@ } entry = entry->next; } - read_unlock(&hl_drivers_lock); + up(&hl_drivers_lock); } int highlevel_read(struct hpsb_host *host, int nodeid, quadlet_t *buffer, |
From: SVN U. <ben...@li...> - 2002-11-16 19:21:07
|
Author: bencollins Date: 2002-11-16 14:20:34 -0500 (Sat, 16 Nov 2002) New Revision: 672 Removed: branches/gasp/ Log: No gasp branch now |
From: SVN U. <ben...@li...> - 2002-11-16 19:19:18
|
Author: bencollins Date: 2002-11-16 14:18:37 -0500 (Sat, 16 Nov 2002) New Revision: 671 Modified: trunk/ trunk/csr.h trunk/ieee1394.h trunk/ieee1394_core.c trunk/ieee1394_transactions.c trunk/ieee1394_transactions.h trunk/ohci1394.c trunk/ohci1394.h trunk/raw1394.c trunk/sbp2.h Log: hpsb_lock64 added from Steve Kinneberg. Reworked hpsb_make_lockpacket and hpsb_make_lock64packet to accept data/arg and fill in the packet. packet_swab and OHCI1394_unrecoverableError changes based on Steve Kinneberg's patch. Modified: trunk/ieee1394_core.c ============================================================================== --- trunk/ieee1394_core.c (original) +++ trunk/ieee1394_core.c 2002-11-16 14:18:39.000000000 -0500 @@ -1226,15 +1226,16 @@ EXPORT_SYMBOL(hpsb_get_tlabel); EXPORT_SYMBOL(hpsb_free_tlabel); EXPORT_SYMBOL(hpsb_make_readpacket); +EXPORT_SYMBOL(hpsb_make_writepacket); EXPORT_SYMBOL(hpsb_make_lockpacket); EXPORT_SYMBOL(hpsb_make_lock64packet); EXPORT_SYMBOL(hpsb_make_phypacket); EXPORT_SYMBOL(hpsb_make_isopacket); -EXPORT_SYMBOL(hpsb_packet_success); -EXPORT_SYMBOL(hpsb_make_writepacket); EXPORT_SYMBOL(hpsb_read); EXPORT_SYMBOL(hpsb_write); EXPORT_SYMBOL(hpsb_lock); +EXPORT_SYMBOL(hpsb_lock64); +EXPORT_SYMBOL(hpsb_packet_success); /** highlevel.c **/ EXPORT_SYMBOL(hpsb_register_highlevel); Modified: trunk/ohci1394.c ============================================================================== --- trunk/ohci1394.c (original) +++ trunk/ohci1394.c 2002-11-16 14:18:39.000000000 -0500 @@ -172,12 +172,6 @@ static void ohci1394_pci_remove(struct pci_dev *pdev); #ifndef __LITTLE_ENDIAN -/* Swap a series of quads inplace. */ -static __inline__ void block_swab32(quadlet_t *data, size_t size) { - while (size--) - data[size] = swab32(data[size]); -} - static unsigned hdr_sizes[] = { 3, /* TCODE_WRITEQ */ @@ -195,16 +189,19 @@ }; /* Swap headers */ -static inline void packet_swab(quadlet_t *data, int tcode, int len) +static inline void packet_swab(quadlet_t *data, int tcode) { + size_t size = hdr_sizes[tcode]; + if (tcode > TCODE_LOCK_RESPONSE || hdr_sizes[tcode] == 0) return; - block_swab32(data, hdr_sizes[tcode]); + + while (size--) + data[size] = swab32(data[size]); } #else /* Don't waste cycles on same sex byte swaps */ -#define packet_swab(w,x,y) -#define block_swab32(x,y) +#define packet_swab(w,x) #endif /* !LITTLE_ENDIAN */ /*********************************** @@ -575,7 +572,8 @@ reg_write(ohci, OHCI1394_HCControlClear, 0x40000000); /* Enable interrupts */ - reg_write(ohci, OHCI1394_IntMaskSet, + reg_write(ohci, OHCI1394_IntMaskSet, + OHCI1394_unrecoverableError | OHCI1394_masterIntEnable | OHCI1394_busReset | OHCI1394_selfIDComplete | @@ -648,8 +646,7 @@ (packet->header[0] & 0xFFFF0000); d->prg_cpu[idx]->data[2] = packet->header[2]; d->prg_cpu[idx]->data[3] = packet->header[3]; - packet_swab(d->prg_cpu[idx]->data, packet->tcode, - packet->header_size>>2); + packet_swab(d->prg_cpu[idx]->data, packet->tcode); } if (packet->data_size) { /* block transmit */ @@ -714,7 +711,7 @@ d->prg_cpu[idx]->data[0] = packet->speed_code<<16 | (packet->header[0] & 0xFFFF); d->prg_cpu[idx]->data[1] = packet->header[0] & 0xFFFF0000; - packet_swab(d->prg_cpu[idx]->data, packet->tcode, packet->header_size>>2); + packet_swab(d->prg_cpu[idx]->data, packet->tcode); d->prg_cpu[idx]->begin.control = cpu_to_le32(DMA_CTL_OUTPUT_MORE | @@ -1768,10 +1765,52 @@ DBGMSG(ohci->id, "IntEvent: %08x", event); - /* Die right here an now */ if (event & OHCI1394_unrecoverableError) { - PRINT(KERN_ERR, ohci->id, "Unrecoverable error, shutting down card!"); - return; + int ctx; + PRINT(KERN_ERR, ohci->id, "Unrecoverable error!"); + + if (reg_read(ohci, OHCI1394_AsReqTrContextControlSet) & 0x800) + PRINT(KERN_ERR, ohci->id, "Async Req Tx Context died: " + "ctrl[%08x] cmdptr[%08x]", + reg_read(ohci, OHCI1394_AsReqTrContextControlSet), + reg_read(ohci, OHCI1394_AsReqTrCommandPtr)); + + if (reg_read(ohci, OHCI1394_AsRspTrContextControlSet) & 0x800) + PRINT(KERN_ERR, ohci->id, "Async Rsp Tx Context died: " + "ctrl[%08x] cmdptr[%08x]", + reg_read(ohci, OHCI1394_AsRspTrContextControlSet), + reg_read(ohci, OHCI1394_AsRspTrCommandPtr)); + + if (reg_read(ohci, OHCI1394_AsReqRcvContextControlSet) & 0x800) + PRINT(KERN_ERR, ohci->id, "Async Req Rcv Context died: " + "ctrl[%08x] cmdptr[%08x]", + reg_read(ohci, OHCI1394_AsReqRcvContextControlSet), + reg_read(ohci, OHCI1394_AsReqRcvCommandPtr)); + + if (reg_read(ohci, OHCI1394_AsRspRcvContextControlSet) & 0x800) + PRINT(KERN_ERR, ohci->id, "Async Rsp Rcv Context died: " + "ctrl[%08x] cmdptr[%08x]", + reg_read(ohci, OHCI1394_AsRspRcvContextControlSet), + reg_read(ohci, OHCI1394_AsRspRcvCommandPtr)); + + for (ctx = 0; ctx < ohci->nb_iso_xmit_ctx; ctx++) { + if (reg_read(ohci, OHCI1394_IsoXmitContextControlSet + (16 * ctx)) & 0x800) + PRINT(KERN_ERR, ohci->id, "Async Iso Xmit %d Context died: " + "ctrl[%08x] cmdptr[%08x]", ctx, + reg_read(ohci, OHCI1394_IsoXmitContextControlSet + (16 * ctx)), + reg_read(ohci, OHCI1394_IsoXmitCommandPtr + (16 * ctx))); + } + + for (ctx = 0; ctx < ohci->nb_iso_rcv_ctx; ctx++) { + if (reg_read(ohci, OHCI1394_IsoRcvContextControlSet + (32 * ctx)) & 0x800) + PRINT(KERN_ERR, ohci->id, "Async Iso Recv %d Context died: " + "ctrl[%08x] cmdptr[%08x] match[%08x]", ctx, + reg_read(ohci, OHCI1394_IsoRcvContextControlSet + (32 * ctx)), + reg_read(ohci, OHCI1394_IsoRcvCommandPtr + (32 * ctx)), + reg_read(ohci, OHCI1394_IsoRcvContextMatch + (32 * ctx))); + } + + event &= ~OHCI1394_unrecoverableError; } if (event & OHCI1394_cycleInconsistent) { @@ -2099,7 +2138,7 @@ * bus reset. We always ignore it. */ if (tcode != OHCI1394_TCODE_PHY) { if (!ohci->no_swap_incoming) - packet_swab(d->spb, tcode, (length - 4) >> 2); + packet_swab(d->spb, tcode); DBGMSG(ohci->id, "Packet received from node" " %d ack=0x%02X spd=%d tcode=0x%X" " length=%d ctx=%d tlabel=%d", Modified: trunk/ohci1394.h ============================================================================== --- trunk/ohci1394.h (original) +++ trunk/ohci1394.h 2002-11-16 14:18:39.000000000 -0500 @@ -294,6 +294,9 @@ #define OHCI1394_IsoRecvIntEventClear 0x0A4 #define OHCI1394_IsoRecvIntMaskSet 0x0A8 #define OHCI1394_IsoRecvIntMaskClear 0x0AC +#define OHCI1394_InitialBandwidthAvailable 0x0B0 +#define OHCI1394_InitialChannelsAvailableHi 0x0B4 +#define OHCI1394_InitialChannelsAvailableLo 0x0B8 #define OHCI1394_FairnessControl 0x0DC #define OHCI1394_LinkControlSet 0x0E0 #define OHCI1394_LinkControlClear 0x0E4 Modified: trunk/raw1394.c ============================================================================== --- trunk/raw1394.c (original) +++ trunk/raw1394.c 2002-11-16 14:18:39.000000000 -0500 @@ -708,7 +708,7 @@ } packet = hpsb_make_lockpacket(fi->host, node, addr, - req->req.misc); + req->req.misc, NULL, 0); if (!packet) return -ENOMEM; if (copy_from_user(packet->data, int2ptr(req->req.sendb), @@ -736,7 +736,7 @@ } } packet = hpsb_make_lock64packet(fi->host, node, addr, - req->req.misc); + req->req.misc, NULL, 0); if (!packet) return -ENOMEM; if (copy_from_user(packet->data, int2ptr(req->req.sendb), Modified: trunk/ieee1394_transactions.c ============================================================================== --- trunk/ieee1394_transactions.c (original) +++ trunk/ieee1394_transactions.c 2002-11-16 14:18:39.000000000 -0500 @@ -305,59 +305,81 @@ } struct hpsb_packet *hpsb_make_lockpacket(struct hpsb_host *host, nodeid_t node, - u64 addr, int extcode) + u64 addr, int extcode, quadlet_t *data, + quadlet_t arg) { - struct hpsb_packet *p; + struct hpsb_packet *p; + u32 length; - p = alloc_hpsb_packet(8); - if (!p) return NULL; + p = alloc_hpsb_packet(8); + if (!p) return NULL; - p->host = host; - p->node_id = node; + p->host = host; + p->node_id = node; if (hpsb_get_tlabel(p, in_interrupt() ? 0 : 1)) { free_hpsb_packet(p); return NULL; - } + } - switch (extcode) { - case EXTCODE_FETCH_ADD: - case EXTCODE_LITTLE_ADD: - fill_async_lock(p, addr, extcode, 4); - break; - default: - fill_async_lock(p, addr, extcode, 8); - break; - } + switch (extcode) { + case EXTCODE_FETCH_ADD: + case EXTCODE_LITTLE_ADD: + length = 4; + if (data) + p->data[0] = *data; + break; + default: + length = 8; + if (data) { + p->data[0] = arg; + p->data[1] = *data; + } + break; + } + fill_async_lock(p, addr, extcode, length); - return p; + return p; } struct hpsb_packet *hpsb_make_lock64packet(struct hpsb_host *host, nodeid_t node, - u64 addr, int extcode) + u64 addr, int extcode, octlet_t *data, + octlet_t arg) { - struct hpsb_packet *p; + struct hpsb_packet *p; + u32 length; - p = alloc_hpsb_packet(16); - if (!p) return NULL; + p = alloc_hpsb_packet(16); + if (!p) return NULL; - p->host = host; - p->node_id = node; + p->host = host; + p->node_id = node; if (hpsb_get_tlabel(p, in_interrupt() ? 0 : 1)) { free_hpsb_packet(p); return NULL; } - switch (extcode) { - case EXTCODE_FETCH_ADD: - case EXTCODE_LITTLE_ADD: - fill_async_lock(p, addr, extcode, 8); - break; - default: - fill_async_lock(p, addr, extcode, 16); - break; - } + switch (extcode) { + case EXTCODE_FETCH_ADD: + case EXTCODE_LITTLE_ADD: + length = 8; + if (data) { + p->data[0] = *data >> 32; + p->data[1] = *data & 0xffffffff; + } + break; + default: + length = 16; + if (data) { + p->data[0] = arg >> 32; + p->data[1] = arg & 0xffffffff; + p->data[2] = *data >> 32; + p->data[3] = *data & 0xffffffff; + } + break; + } + fill_async_lock(p, addr, extcode, length); - return p; + return p; } struct hpsb_packet *hpsb_make_phypacket(struct hpsb_host *host, @@ -478,40 +500,13 @@ u64 addr, int extcode, quadlet_t *data, quadlet_t arg) { struct hpsb_packet *packet; - int retval = 0, length; + int retval = 0; BUG_ON(in_interrupt()); // We can't be called in an interrupt, yet - - packet = alloc_hpsb_packet(8); - if (!packet) { - return -ENOMEM; - } - - packet->host = host; - packet->node_id = node; - if (hpsb_get_tlabel(packet, 1)) { - free_hpsb_packet(packet); - return -ENOMEM; - } - switch (extcode) { - case EXTCODE_MASK_SWAP: - case EXTCODE_COMPARE_SWAP: - case EXTCODE_BOUNDED_ADD: - case EXTCODE_WRAP_ADD: - length = 8; - packet->data[0] = arg; - packet->data[1] = *data; - break; - case EXTCODE_FETCH_ADD: - case EXTCODE_LITTLE_ADD: - length = 4; - packet->data[0] = *data; - break; - default: - return -EINVAL; - } - fill_async_lock(packet, addr, extcode, length); + packet = hpsb_make_lockpacket(host, node, addr, extcode, data, arg); + if (!packet) + return -ENOMEM; packet->generation = generation; if (!hpsb_send_packet(packet)) { @@ -532,3 +527,34 @@ return retval; } + +int hpsb_lock64(struct hpsb_host *host, nodeid_t node, unsigned int generation, + u64 addr, int extcode, octlet_t *data, octlet_t arg) +{ + struct hpsb_packet *packet; + int retval = 0; + + BUG_ON(in_interrupt()); // We can't be called in an interrupt, yet + + packet = hpsb_make_lock64packet(host, node, addr, extcode, data, arg); + if (!packet) + return -ENOMEM; + + packet->generation = generation; + if (!hpsb_send_packet(packet)) { + retval = -EINVAL; + goto hpsb_lock64_fail; + } + down(&packet->state_change); + down(&packet->state_change); + retval = hpsb_packet_success(packet); + + if (retval == 0) + *data = (u64)packet->data[1] << 32 | packet->data[0]; + +hpsb_lock64_fail: + hpsb_free_tlabel(packet); + free_hpsb_packet(packet); + + return retval; +} Modified: trunk/ieee1394_transactions.h ============================================================================== --- trunk/ieee1394_transactions.h (original) +++ trunk/ieee1394_transactions.h 2002-11-16 14:18:39.000000000 -0500 @@ -13,9 +13,11 @@ struct hpsb_packet *hpsb_make_readpacket(struct hpsb_host *host, nodeid_t node, u64 addr, size_t length); struct hpsb_packet *hpsb_make_lockpacket(struct hpsb_host *host, nodeid_t node, - u64 addr, int extcode); + u64 addr, int extcode, quadlet_t *data, + quadlet_t arg); struct hpsb_packet *hpsb_make_lock64packet(struct hpsb_host *host, nodeid_t node, - u64 addr, int extcode); + u64 addr, int extcode, octlet_t *data, + octlet_t arg); struct hpsb_packet *hpsb_make_phypacket(struct hpsb_host *host, quadlet_t data) ; struct hpsb_packet *hpsb_make_isopacket(struct hpsb_host *host, @@ -51,5 +53,7 @@ u64 addr, quadlet_t *buffer, size_t length); int hpsb_lock(struct hpsb_host *host, nodeid_t node, unsigned int generation, u64 addr, int extcode, quadlet_t *data, quadlet_t arg); +int hpsb_lock64(struct hpsb_host *host, nodeid_t node, unsigned int generation, + u64 addr, int extcode, octlet_t *data, octlet_t arg); #endif /* _IEEE1394_TRANSACTIONS_H */ Modified: trunk/sbp2.h ============================================================================== --- trunk/sbp2.h (original) +++ trunk/sbp2.h 2002-11-16 14:18:39.000000000 -0500 @@ -493,10 +493,10 @@ static int sbp2scsi_detect (Scsi_Host_Template *tpnt); static const char *sbp2scsi_info (struct Scsi_Host *host); void sbp2scsi_setup(char *str, int *ints); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,28) -static int sbp2scsi_biosparam (Scsi_Disk *disk, kdev_t dev, int geom[]); +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,44) +static int sbp2scsi_biosparam (struct scsi_device *sdev, struct block_device *dev, sector_t capacity, int geom[]); #else -static int sbp2scsi_biosparam (Scsi_Disk *disk, struct block_device *dev, int geom[]); +static int sbp2scsi_biosparam (Scsi_Disk *disk, kdev_t dev, int geom[]); #endif static int sbp2scsi_abort (Scsi_Cmnd *SCpnt); static int sbp2scsi_reset (Scsi_Cmnd *SCpnt); Modified: trunk/csr.h ============================================================================== --- trunk/csr.h (original) +++ trunk/csr.h 2002-11-16 14:18:39.000000000 -0500 @@ -16,8 +16,10 @@ #define CSR_BUSY_TIMEOUT 0x210 #define CSR_BUS_MANAGER_ID 0x21c #define CSR_BANDWIDTH_AVAILABLE 0x220 +#define CSR_CHANNELS_AVAILABLE 0x224 #define CSR_CHANNELS_AVAILABLE_HI 0x224 #define CSR_CHANNELS_AVAILABLE_LO 0x228 +#define CSR_BROADCAST_CHANNEL 0x234 #define CSR_CONFIG_ROM 0x400 #define CSR_CONFIG_ROM_END 0x800 #define CSR_FCP_COMMAND 0xB00 Modified: trunk/ieee1394.h ============================================================================== --- trunk/ieee1394.h (original) +++ trunk/ieee1394.h 2002-11-16 14:18:39.000000000 -0500 @@ -15,6 +15,7 @@ #define TCODE_CYCLE_START 0x8 #define TCODE_LOCK_REQUEST 0x9 #define TCODE_ISO_DATA 0xa +#define TCODE_STREAM_DATA 0xa #define TCODE_LOCK_RESPONSE 0xb #define RCODE_COMPLETE 0x0 |
From: SVN U. <ben...@li...> - 2002-11-16 15:33:48
|
Author: bencollins Date: 2002-11-16 10:33:14 -0500 (Sat, 16 Nov 2002) New Revision: 670 Modified: trunk/ohci1394.c Log: Fix logic a bit better in selfid interrupt handler. Modified: trunk/ohci1394.c ============================================================================== --- trunk/ohci1394.c (original) +++ trunk/ohci1394.c 2002-11-16 10:33:14.000000000 -0500 @@ -1876,26 +1876,26 @@ event &= ~OHCI1394_selfIDComplete; if (host->in_bus_reset) { - node_id = reg_read(ohci, OHCI1394_NodeID); + node_id = reg_read(ohci, OHCI1394_NodeID); - if (node_id & 0x80000000) { /* NodeID valid */ - phyid = node_id & 0x0000003f; - isroot = (node_id & 0x40000000) != 0; - - DBGMSG(ohci->id, - "SelfID interrupt received " - "(phyid %d, %s)", phyid, - (isroot ? "root" : "not root")); - - handle_selfid(ohci, host, - phyid, isroot); - } else { - PRINT(KERN_ERR, ohci->id, + if (!(node_id & 0x80000000)) { + PRINT(KERN_ERR, ohci->id, "SelfID received, but NodeID invalid " "(probably new bus reset occured): %08X", node_id); + goto selfid_not_valid; } + phyid = node_id & 0x0000003f; + isroot = (node_id & 0x40000000) != 0; + + DBGMSG(ohci->id, + "SelfID interrupt received " + "(phyid %d, %s)", phyid, + (isroot ? "root" : "not root")); + + handle_selfid(ohci, host, phyid, isroot); + /* Clear the bus reset event and re-enable the * busReset interrupt. */ spin_lock_irqsave(&ohci->event_lock, flags); @@ -1926,6 +1926,8 @@ } else PRINT(KERN_ERR, ohci->id, "SelfID received outside of bus reset sequence"); + +selfid_not_valid: } /* Make sure we handle everything, just in case we accidentally |
From: SVN U. <ben...@li...> - 2002-11-16 05:00:37
|
Author: bencollins Date: 2002-11-16 00:00:04 -0500 (Sat, 16 Nov 2002) New Revision: 669 Added: branches/gasp/ Modified: branches/gasp/ohci1394.c branches/gasp/sbp2.h Log: Create new gasp branch from trunk, r668 Copied: gasp (from rev 666, trunk) Modified: branches/gasp/ohci1394.c ============================================================================== --- trunk/ohci1394.c (original) +++ branches/gasp/ohci1394.c 2002-11-16 00:00:05.000000000 -0500 @@ -1873,16 +1873,11 @@ event &= ~OHCI1394_isochTx; } if (event & OHCI1394_selfIDComplete) { + event &= ~OHCI1394_selfIDComplete; + if (host->in_bus_reset) { node_id = reg_read(ohci, OHCI1394_NodeID); - /* If our nodeid is not valid, give a msec delay - * to let it settle in and try again. */ - if (!(node_id & 0x80000000)) { - mdelay(1); - node_id = reg_read(ohci, OHCI1394_NodeID); - } - if (node_id & 0x80000000) { /* NodeID valid */ phyid = node_id & 0x0000003f; isroot = (node_id & 0x40000000) != 0; @@ -1896,52 +1891,41 @@ phyid, isroot); } else { PRINT(KERN_ERR, ohci->id, - "SelfID interrupt received, but " - "NodeID is not valid: %08X", + "SelfID received, but NodeID invalid " + "(probably new bus reset occured): %08X", node_id); } + /* Clear the bus reset event and re-enable the + * busReset interrupt. */ + spin_lock_irqsave(&ohci->event_lock, flags); + reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset); + reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset); + spin_unlock_irqrestore(&ohci->event_lock, flags); + /* Accept Physical requests from all nodes. */ - reg_write(ohci,OHCI1394_AsReqFilterHiSet, - 0xffffffff); - reg_write(ohci,OHCI1394_AsReqFilterLoSet, - 0xffffffff); + reg_write(ohci,OHCI1394_AsReqFilterHiSet, 0xffffffff); + reg_write(ohci,OHCI1394_AsReqFilterLoSet, 0xffffffff); + + /* Turn on phys dma reception. + * + * TODO: Enable some sort of filtering management. + */ + if (phys_dma) { + reg_write(ohci,OHCI1394_PhyReqFilterHiSet, 0xffffffff); + reg_write(ohci,OHCI1394_PhyReqFilterLoSet, 0xffffffff); + reg_write(ohci,OHCI1394_PhyUpperBound, 0xffff0000); + } else { + reg_write(ohci,OHCI1394_PhyReqFilterHiSet, 0x00000000); + reg_write(ohci,OHCI1394_PhyReqFilterLoSet, 0x00000000); + } + + DBGMSG(ohci->id, "PhyReqFilter=%08x%08x\n", + reg_read(ohci,OHCI1394_PhyReqFilterHiSet), + reg_read(ohci,OHCI1394_PhyReqFilterLoSet)); } else PRINT(KERN_ERR, ohci->id, "SelfID received outside of bus reset sequence"); - - /* Finally, we clear the busReset event and reenable - * the busReset interrupt. */ - spin_lock_irqsave(&ohci->event_lock, flags); - reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset); - reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset); - spin_unlock_irqrestore(&ohci->event_lock, flags); - event &= ~OHCI1394_selfIDComplete; - - /* Turn on phys dma reception. We should - * probably manage the filtering somehow, - * instead of blindly turning it on. */ - - /* - * CAUTION! - * Some chips (TI TSB43AB22) won't take a value in - * the PhyReqFilter register until after the IntEvent - * is cleared for bus reset, and even then a short - * delay is required. - */ - if (phys_dma) { - mdelay(1); - reg_write(ohci,OHCI1394_PhyReqFilterHiSet, - 0xffffffff); - reg_write(ohci,OHCI1394_PhyReqFilterLoSet, - 0xffffffff); - reg_write(ohci,OHCI1394_PhyUpperBound, - 0xffff0000); - } - - DBGMSG(ohci->id, "PhyReqFilter=%08x%08x\n", - reg_read(ohci,OHCI1394_PhyReqFilterHiSet), - reg_read(ohci,OHCI1394_PhyReqFilterLoSet)); } /* Make sure we handle everything, just in case we accidentally Modified: branches/gasp/sbp2.h ============================================================================== --- trunk/sbp2.h (original) +++ branches/gasp/sbp2.h 2002-11-16 00:00:05.000000000 -0500 @@ -493,10 +493,10 @@ static int sbp2scsi_detect (Scsi_Host_Template *tpnt); static const char *sbp2scsi_info (struct Scsi_Host *host); void sbp2scsi_setup(char *str, int *ints); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,28) -static int sbp2scsi_biosparam (Scsi_Disk *disk, kdev_t dev, int geom[]); +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,44) +static int sbp2scsi_biosparam (struct scsi_device *sdev, struct block_device *dev, sector_t capacity, int geom[]); #else -static int sbp2scsi_biosparam (Scsi_Disk *disk, struct block_device *dev, int geom[]); +static int sbp2scsi_biosparam (Scsi_Disk *disk, kdev_t dev, int geom[]); #endif static int sbp2scsi_abort (Scsi_Cmnd *SCpnt); static int sbp2scsi_reset (Scsi_Cmnd *SCpnt); |