Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1934b8b6 authored by Ben Collins's avatar Ben Collins Committed by Linus Torvalds
Browse files

[PATCH] Sync up ieee-1394



Lots of this patch is trivial code cleanups (static vars were being
intialized to 0, etc).

There's also some fixes for ISO transmits (max buffer handling).
Aswell, we have a few fixes to disable IRM capabilites correctly.  We've
also disabled, by default some generally unused EXPORT symbols for the
sake of cleanliness in the kernel.  However, instead of removing them
completely, we felt it necessary to have a config option that allowed
them to be enabled for the many projects outside of the main kernel tree
that use our API for driver development.

The primary reason for this patch is to revert a MODE6->MODE10 RBC
conversion patch from the SCSI maintainers.  The new conversions handled
directly in the scsi layer do not seem to work for SBP2.  This patch
reverts to our old working code so that users can enjoy using Firewire
disks and dvd drives again.

We are working with the SCSI maintainers to resolve this issue outside
of the main kernel tree.  We'll merge the patch once the SCSI layer's
handling of the MODE10 conversion is working for us.

Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f179bc77
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -66,6 +66,18 @@ config IEEE1394_CONFIG_ROM_IP1394
	  with MacOSX and WinXP IP-over-1394), enable this option and the
	  eth1394 option below.

config IEEE1394_EXPORT_FULL_API
	bool "Export all symbols of ieee1394's API"
	depends on IEEE1394
	default n
	help
	  Export all symbols of ieee1394's driver programming interface, even
	  those that are not currently used by the standard IEEE 1394 drivers.

	  This option does not affect the interface to userspace applications.
	  Say Y here if you want to compile externally developed drivers that
	  make extended use of ieee1394's API. It is otherwise safe to say N.

comment "Device Drivers"
	depends on IEEE1394

+2 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include "hosts.h"
#include "ieee1394.h"
#include "highlevel.h"
#include "ieee1394_core.h"

/* Module Parameters */
/* this module parameter can be used to disable mapping of the FCP registers */
@@ -232,7 +233,7 @@ static void add_host(struct hpsb_host *host)
	host->csr.generation = 2;

	bus_info[1] = __constant_cpu_to_be32(0x31333934);
	bus_info[2] = cpu_to_be32((1 << CSR_IRMC_SHIFT) |
	bus_info[2] = cpu_to_be32((hpsb_disable_irm ? 0 : 1 << CSR_IRMC_SHIFT) |
				  (1 << CSR_CMC_SHIFT) |
				  (1 << CSR_ISC_SHIFT) |
				  (0 << CSR_BMC_SHIFT) |
+27 −10
Original line number Diff line number Diff line
@@ -209,7 +209,15 @@ void csr1212_init_local_csr(struct csr1212_csr *csr,
{
	static const int mr_map[] = { 4, 64, 1024, 0 };

#ifdef __KERNEL__
	BUG_ON(max_rom & ~0x3);
	csr->max_rom = mr_map[max_rom];
#else
	if (max_rom & ~0x3) /* caller supplied invalid argument */
		csr->max_rom = 0;
	else
		csr->max_rom = mr_map[max_rom];
#endif
	memcpy(csr->bus_info_data, bus_info_data, csr->bus_info_len);
}

@@ -533,12 +541,15 @@ struct csr1212_keyval *csr1212_new_icon_descriptor_leaf(u_int32_t version,
	static const int pd[4] = { 0, 4, 16, 256 };
	static const int cs[16] = { 4, 2 };
	struct csr1212_keyval *kv;
	int palette_size = pd[palette_depth] * cs[color_space];
	int palette_size;
	int pixel_size = (hscan * vscan + 3) & ~0x3;

	if ((palette_depth && !palette) || !pixels)
	if (!pixels || (!palette && palette_depth) ||
	    (palette_depth & ~0x3) || (color_space & ~0xf))
		return NULL;

	palette_size = pd[palette_depth] * cs[color_space];

	kv = csr1212_new_descriptor_leaf(1, 0, NULL,
					 palette_size + pixel_size +
					 CSR1212_ICON_DESCRIPTOR_LEAF_OVERHEAD);
@@ -760,9 +771,9 @@ static int csr1212_append_new_cache(struct csr1212_csr *csr, size_t romsize)
	struct csr1212_csr_rom_cache *cache;
	u_int64_t csr_addr;

	if (!csr || !csr->ops->allocate_addr_range ||
	    !csr->ops->release_addr)
		return CSR1212_ENOMEM;
	if (!csr || !csr->ops || !csr->ops->allocate_addr_range ||
	    !csr->ops->release_addr || csr->max_rom < 1)
		return CSR1212_EINVAL;

	/* ROM size must be a multiple of csr->max_rom */
	romsize = (romsize + (csr->max_rom - 1)) & ~(csr->max_rom - 1);
@@ -1145,6 +1156,8 @@ int csr1212_generate_csr_image(struct csr1212_csr *csr)

			/* Make sure the Extended ROM leaf is a multiple of
			 * max_rom in size. */
			if (csr->max_rom < 1)
				return CSR1212_EINVAL;
			leaf_size = (cache->len + (csr->max_rom - 1)) &
				~(csr->max_rom - 1);

@@ -1409,7 +1422,7 @@ int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv)
	u_int32_t *cache_ptr;
	u_int16_t kv_len = 0;

	if (!csr || !kv)
	if (!csr || !kv || csr->max_rom < 1)
		return CSR1212_EINVAL;

	/* First find which cache the data should be in (or go in if not read
@@ -1572,7 +1585,7 @@ int csr1212_parse_csr(struct csr1212_csr *csr)
	struct csr1212_dentry *dentry;
	int ret;

	if (!csr || !csr->ops->bus_read)
	if (!csr || !csr->ops || !csr->ops->bus_read)
		return CSR1212_EINVAL;

	ret = csr1212_parse_bus_info_block(csr);
@@ -1581,9 +1594,13 @@ int csr1212_parse_csr(struct csr1212_csr *csr)

	if (!csr->ops->get_max_rom)
		csr->max_rom = mr_map[0];	/* default value */
	else
		csr->max_rom = mr_map[csr->ops->get_max_rom(csr->bus_info_data,
							    csr->private)];
	else {
		int i = csr->ops->get_max_rom(csr->bus_info_data,
					      csr->private);
		if (i & ~0x3)
			return CSR1212_EINVAL;
		csr->max_rom = mr_map[i];
	}

	csr->cache_head->layout_head = csr->root_kv;
	csr->cache_head->layout_tail = csr->root_kv;
+1 −1
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ static inline int dma_region_find(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;
	unsigned long rem = 0;

	struct scatterlist *sg = &dma->sglist[dma_region_find(dma, offset, &rem)];
	return sg_dma_address(sg) + rem;
+3 −3
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@
#define TRACE() printk(KERN_ERR "%s:%s[%d] ---- TRACE\n", driver_name, __FUNCTION__, __LINE__)

static char version[] __devinitdata =
	"$Rev: 1247 $ Ben Collins <bcollins@debian.org>";
	"$Rev: 1264 $ Ben Collins <bcollins@debian.org>";

struct fragment_info {
	struct list_head list;
@@ -706,7 +706,7 @@ static void ether1394_host_reset (struct hpsb_host *host)
		return;

	dev = hi->dev;
	priv = netdev_priv(dev);
	priv = (struct eth1394_priv *)netdev_priv(dev);

	/* Reset our private host data, but not our mtu */
	netif_stop_queue (dev);
@@ -1770,7 +1770,7 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev)
static void ether1394_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{
	strcpy (info->driver, driver_name);
	strcpy (info->version, "$Rev: 1247 $");
	strcpy (info->version, "$Rev: 1264 $");
	/* FIXME XXX provide sane businfo */
	strcpy (info->bus_info, "ieee1394");
}
Loading