Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16221
b: refs/heads/master
c: 4ffd2e4
h: refs/heads/master
i:
  16219: 7234bd2
v: v3
  • Loading branch information
Adrian Bunk authored and David S. Miller committed Jan 5, 2006
1 parent 2ed31cc commit 96fabb6
Show file tree
Hide file tree
Showing 29 changed files with 1,815 additions and 1,417 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0a75c23a009ff65f651532cecc16675d05f4de37
refs/heads/master: 4ffd2e4907184813101cefa7196102927cdbe104
11 changes: 11 additions & 0 deletions trunk/Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ Who: Paul E. McKenney <paulmck@us.ibm.com>

---------------------------

What: IEEE1394 Audio and Music Data Transmission Protocol driver,
Connection Management Procedures driver
When: November 2005
Files: drivers/ieee1394/{amdtp,cmp}*
Why: These are incomplete, have never worked, and are better implemented
in userland via raw1394 (see http://freebob.sourceforge.net/ for
example.)
Who: Jody McIntyre <scjody@steamballoon.com>

---------------------------

What: raw1394: requests of type RAW1394_REQ_ISO_SEND, RAW1394_REQ_ISO_LISTEN
When: November 2005
Why: Deprecated in favour of the new ioctl-based rawiso interface, which is
Expand Down
23 changes: 23 additions & 0 deletions trunk/drivers/ieee1394/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,27 @@ config IEEE1394_RAWIO
To compile this driver as a module, say M here: the
module will be called raw1394.

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.

To compile this driver as a module, say M here: the
module will be called cmp.

config IEEE1394_AMDTP
tristate "IEC61883-6 (Audio transmission) support"
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.

The userspace interface is documented in amdtp.h.

To compile this driver as a module, say M here: the
module will be called amdtp.

endmenu
2 changes: 2 additions & 0 deletions trunk/drivers/ieee1394/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ obj-$(CONFIG_IEEE1394_RAWIO) += raw1394.o
obj-$(CONFIG_IEEE1394_SBP2) += sbp2.o
obj-$(CONFIG_IEEE1394_DV1394) += dv1394.o
obj-$(CONFIG_IEEE1394_ETH1394) += eth1394.o
obj-$(CONFIG_IEEE1394_AMDTP) += amdtp.o
obj-$(CONFIG_IEEE1394_CMP) += cmp.o

quiet_cmd_oui2c = OUI2C $@
cmd_oui2c = $(CONFIG_SHELL) $(srctree)/$(src)/oui2c.sh < $< > $@
Expand Down
21 changes: 10 additions & 11 deletions trunk/drivers/ieee1394/csr1212.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ static int csr1212_parse_bus_info_block(struct csr1212_csr *csr)
return CSR1212_EINVAL;
#endif

cr = CSR1212_MALLOC(sizeof(*cr));
cr = CSR1212_MALLOC(sizeof(struct csr1212_cache_region));
if (!cr)
return CSR1212_ENOMEM;

Expand Down Expand Up @@ -1393,7 +1393,8 @@ int csr1212_parse_keyval(struct csr1212_keyval *kv,
case CSR1212_KV_TYPE_LEAF:
if (kv->key.id != CSR1212_KV_ID_EXTENDED_ROM) {
kv->value.leaf.data = CSR1212_MALLOC(quads_to_bytes(kvi_len));
if (!kv->value.leaf.data) {
if (!kv->value.leaf.data)
{
ret = CSR1212_ENOMEM;
goto fail;
}
Expand Down Expand Up @@ -1461,7 +1462,7 @@ int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv)
cache->next = NULL;
csr->cache_tail = cache;
cache->filled_head =
CSR1212_MALLOC(sizeof(*cache->filled_head));
CSR1212_MALLOC(sizeof(struct csr1212_cache_region));
if (!cache->filled_head) {
return CSR1212_ENOMEM;
}
Expand All @@ -1483,7 +1484,7 @@ int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv)
/* Now seach read portions of the cache to see if it is there. */
for (cr = cache->filled_head; cr; cr = cr->next) {
if (cache_index < cr->offset_start) {
newcr = CSR1212_MALLOC(sizeof(*newcr));
newcr = CSR1212_MALLOC(sizeof(struct csr1212_cache_region));
if (!newcr)
return CSR1212_ENOMEM;

Expand All @@ -1507,7 +1508,7 @@ int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv)

if (!cr) {
cr = cache->filled_tail;
newcr = CSR1212_MALLOC(sizeof(*newcr));
newcr = CSR1212_MALLOC(sizeof(struct csr1212_cache_region));
if (!newcr)
return CSR1212_ENOMEM;

Expand Down Expand Up @@ -1610,17 +1611,15 @@ int csr1212_parse_csr(struct csr1212_csr *csr)
csr->root_kv->valid = 0;
csr->root_kv->next = csr->root_kv;
csr->root_kv->prev = csr->root_kv;
ret = _csr1212_read_keyval(csr, csr->root_kv);
if (ret != CSR1212_SUCCESS)
return ret;
csr1212_get_keyval(csr, csr->root_kv);

/* Scan through the Root directory finding all extended ROM regions
* and make cache regions for them */
for (dentry = csr->root_kv->value.directory.dentries_head;
dentry; dentry = dentry->next) {
if (dentry->kv->key.id == CSR1212_KV_ID_EXTENDED_ROM &&
!dentry->kv->valid) {
ret = _csr1212_read_keyval(csr, dentry->kv);
if (dentry->kv->key.id == CSR1212_KV_ID_EXTENDED_ROM) {
csr1212_get_keyval(csr, dentry->kv);

if (ret != CSR1212_SUCCESS)
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ieee1394/csr1212.h
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ static inline struct csr1212_csr_rom_cache *csr1212_rom_cache_malloc(u_int32_t o
{
struct csr1212_csr_rom_cache *cache;

cache = CSR1212_MALLOC(sizeof(*cache) + size);
cache = CSR1212_MALLOC(sizeof(struct csr1212_csr_rom_cache) + size);
if (!cache)
return NULL;

Expand Down
73 changes: 28 additions & 45 deletions trunk/drivers/ieee1394/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ void dma_prog_region_init(struct dma_prog_region *prog)
prog->bus_addr = 0;
}

int dma_prog_region_alloc(struct dma_prog_region *prog, unsigned long n_bytes,
struct pci_dev *dev)
int dma_prog_region_alloc(struct dma_prog_region *prog, unsigned long n_bytes, struct pci_dev *dev)
{
/* round up to page size */
n_bytes = PAGE_ALIGN(n_bytes);
Expand All @@ -33,8 +32,7 @@ int dma_prog_region_alloc(struct dma_prog_region *prog, unsigned long n_bytes,

prog->kvirt = pci_alloc_consistent(dev, n_bytes, &prog->bus_addr);
if (!prog->kvirt) {
printk(KERN_ERR
"dma_prog_region_alloc: pci_alloc_consistent() failed\n");
printk(KERN_ERR "dma_prog_region_alloc: pci_alloc_consistent() failed\n");
dma_prog_region_free(prog);
return -ENOMEM;
}
Expand All @@ -47,8 +45,7 @@ int dma_prog_region_alloc(struct dma_prog_region *prog, unsigned long n_bytes,
void dma_prog_region_free(struct dma_prog_region *prog)
{
if (prog->kvirt) {
pci_free_consistent(prog->dev, prog->n_pages << PAGE_SHIFT,
prog->kvirt, prog->bus_addr);
pci_free_consistent(prog->dev, prog->n_pages << PAGE_SHIFT, prog->kvirt, prog->bus_addr);
}

prog->kvirt = NULL;
Expand All @@ -68,8 +65,7 @@ void dma_region_init(struct dma_region *dma)
dma->sglist = NULL;
}

int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes,
struct pci_dev *dev, int direction)
int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes, struct pci_dev *dev, int direction)
{
unsigned int i;

Expand Down Expand Up @@ -99,16 +95,14 @@ int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes,

/* fill scatter/gather list with pages */
for (i = 0; i < dma->n_pages; i++) {
unsigned long va =
(unsigned long)dma->kvirt + (i << PAGE_SHIFT);
unsigned long va = (unsigned long) dma->kvirt + (i << PAGE_SHIFT);

dma->sglist[i].page = vmalloc_to_page((void *)va);
dma->sglist[i].length = PAGE_SIZE;
}

/* map sglist to the IOMMU */
dma->n_dma_pages =
pci_map_sg(dev, dma->sglist, dma->n_pages, direction);
dma->n_dma_pages = pci_map_sg(dev, dma->sglist, dma->n_pages, direction);

if (dma->n_dma_pages == 0) {
printk(KERN_ERR "dma_region_alloc: pci_map_sg() failed\n");
Expand All @@ -120,16 +114,15 @@ int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes,

return 0;

err:
err:
dma_region_free(dma);
return -ENOMEM;
}

void dma_region_free(struct dma_region *dma)
{
if (dma->n_dma_pages) {
pci_unmap_sg(dma->dev, dma->sglist, dma->n_pages,
dma->direction);
pci_unmap_sg(dma->dev, dma->sglist, dma->n_pages, dma->direction);
dma->n_dma_pages = 0;
dma->dev = NULL;
}
Expand All @@ -144,8 +137,7 @@ void dma_region_free(struct dma_region *dma)

/* find the scatterlist index and remaining offset corresponding to a
given offset from the beginning of the buffer */
static inline int dma_region_find(struct dma_region *dma, unsigned long offset,
unsigned long *rem)
static inline int dma_region_find(struct dma_region *dma, unsigned long offset, unsigned long *rem)
{
int i;
unsigned long off = offset;
Expand All @@ -164,18 +156,15 @@ static inline int dma_region_find(struct dma_region *dma, unsigned long offset,
return i;
}

dma_addr_t dma_region_offset_to_bus(struct dma_region * dma,
unsigned long offset)
dma_addr_t dma_region_offset_to_bus(struct dma_region *dma, unsigned long offset)
{
unsigned long rem = 0;

struct scatterlist *sg =
&dma->sglist[dma_region_find(dma, offset, &rem)];
struct scatterlist *sg = &dma->sglist[dma_region_find(dma, offset, &rem)];
return sg_dma_address(sg) + rem;
}

void dma_region_sync_for_cpu(struct dma_region *dma, unsigned long offset,
unsigned long len)
void dma_region_sync_for_cpu(struct dma_region *dma, unsigned long offset, unsigned long len)
{
int first, last;
unsigned long rem;
Expand All @@ -186,12 +175,10 @@ void dma_region_sync_for_cpu(struct dma_region *dma, unsigned long offset,
first = dma_region_find(dma, offset, &rem);
last = dma_region_find(dma, offset + len - 1, &rem);

pci_dma_sync_sg_for_cpu(dma->dev, &dma->sglist[first], last - first + 1,
dma->direction);
pci_dma_sync_sg_for_cpu(dma->dev, &dma->sglist[first], last - first + 1, dma->direction);
}

void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset,
unsigned long len)
void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset, unsigned long len)
{
int first, last;
unsigned long rem;
Expand All @@ -202,47 +189,44 @@ void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset,
first = dma_region_find(dma, offset, &rem);
last = dma_region_find(dma, offset + len - 1, &rem);

pci_dma_sync_sg_for_device(dma->dev, &dma->sglist[first],
last - first + 1, dma->direction);
pci_dma_sync_sg_for_device(dma->dev, &dma->sglist[first], last - first + 1, dma->direction);
}

#ifdef CONFIG_MMU

/* nopage() handler for mmap access */

static struct page *dma_region_pagefault(struct vm_area_struct *area,
unsigned long address, int *type)
static struct page*
dma_region_pagefault(struct vm_area_struct *area, unsigned long address, int *type)
{
unsigned long offset;
unsigned long kernel_virt_addr;
struct page *ret = NOPAGE_SIGBUS;

struct dma_region *dma = (struct dma_region *)area->vm_private_data;
struct dma_region *dma = (struct dma_region*) area->vm_private_data;

if (!dma->kvirt)
goto out;

if ((address < (unsigned long)area->vm_start) ||
(address >
(unsigned long)area->vm_start + (dma->n_pages << PAGE_SHIFT)))
if ( (address < (unsigned long) area->vm_start) ||
(address > (unsigned long) area->vm_start + (dma->n_pages << PAGE_SHIFT)) )
goto out;

if (type)
*type = VM_FAULT_MINOR;
offset = address - area->vm_start;
kernel_virt_addr = (unsigned long)dma->kvirt + offset;
ret = vmalloc_to_page((void *)kernel_virt_addr);
kernel_virt_addr = (unsigned long) dma->kvirt + offset;
ret = vmalloc_to_page((void*) kernel_virt_addr);
get_page(ret);
out:
out:
return ret;
}

static struct vm_operations_struct dma_region_vm_ops = {
.nopage = dma_region_pagefault,
.nopage = dma_region_pagefault,
};

int dma_region_mmap(struct dma_region *dma, struct file *file,
struct vm_area_struct *vma)
int dma_region_mmap(struct dma_region *dma, struct file *file, struct vm_area_struct *vma)
{
unsigned long size;

Expand All @@ -266,12 +250,11 @@ int dma_region_mmap(struct dma_region *dma, struct file *file,
return 0;
}

#else /* CONFIG_MMU */
#else /* CONFIG_MMU */

int dma_region_mmap(struct dma_region *dma, struct file *file,
struct vm_area_struct *vma)
int dma_region_mmap(struct dma_region *dma, struct file *file, struct vm_area_struct *vma)
{
return -EINVAL;
}

#endif /* CONFIG_MMU */
#endif /* CONFIG_MMU */
13 changes: 12 additions & 1 deletion trunk/drivers/ieee1394/dv1394.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@

#include "ohci1394.h"

#ifndef virt_to_page
#define virt_to_page(x) MAP_NR(x)
#endif

#ifndef vmalloc_32
#define vmalloc_32(x) vmalloc(x)
#endif


/* DEBUG LEVELS:
0 - no debugging messages
1 - some debugging messages, but none during DMA frame transmission
Expand Down Expand Up @@ -2209,12 +2218,14 @@ static int dv1394_init(struct ti_ohci *ohci, enum pal_or_ntsc format, enum modes
unsigned long flags;
int i;

video = kzalloc(sizeof(*video), GFP_KERNEL);
video = kmalloc(sizeof(struct video_card), GFP_KERNEL);
if (!video) {
printk(KERN_ERR "dv1394: cannot allocate video_card\n");
goto err;
}

memset(video, 0, sizeof(struct video_card));

video->ohci = ohci;
/* lower 2 bits of id indicate which of four "plugs"
per host */
Expand Down
Loading

0 comments on commit 96fabb6

Please sign in to comment.