rpms/kernel/devel linux-2.6-firewire-git-update.patch, 1.15, 1.16 kernel.spec, 1.844, 1.845

Jarod Wilson (jwilson) fedora-extras-commits at redhat.com
Mon Aug 4 22:39:15 UTC 2008


Author: jwilson

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv2086

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-firewire-git-update.patch 
Log Message:
* Mon Aug 04 2008 Jarod Wilson <jwilson at redhat.com>
- add latest firewire goodies: actual iso timestamps ftw

Also, commented out the 'disable acpi video display switching by default'
patch, since it seems someone forgot to cvs add it. :)


linux-2.6-firewire-git-update.patch:

Index: linux-2.6-firewire-git-update.patch
===================================================================
RCS file: linux-2.6-firewire-git-update.patch
diff -N linux-2.6-firewire-git-update.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-firewire-git-update.patch	4 Aug 2008 22:38:45 -0000	1.16
@@ -0,0 +1,587 @@
+Diff between linux-2.6-git at version 2.6.27-rc1-git4 and the linux1394-2.6-git
+tree at commit 2d2da062fae0d87c5a6ad241662040ad9895e5be on 2008-08-04.
+
+Not done via straight git, since the linux1394-2.6-git tree hasn't been rebased
+since 2.6.26, which makes things a touch messy right now...
+
+---
+
+diff -Naurp linux-2.6-git/drivers/firewire/fw-card.c firewire-git/drivers/firewire/fw-card.c
+--- linux-2.6-git/drivers/firewire/fw-card.c	2008-08-04 18:04:26.000000000 -0400
++++ firewire-git/drivers/firewire/fw-card.c	2008-08-04 16:39:51.000000000 -0400
+@@ -189,39 +189,16 @@ static const char gap_count_table[] = {
+ 	63, 5, 7, 8, 10, 13, 16, 18, 21, 24, 26, 29, 32, 35, 37, 40
+ };
+ 
+-struct bm_data {
+-	struct fw_transaction t;
+-	struct {
+-		__be32 arg;
+-		__be32 data;
+-	} lock;
+-	u32 old;
+-	int rcode;
+-	struct completion done;
+-};
+-
+-static void
+-complete_bm_lock(struct fw_card *card, int rcode,
+-		 void *payload, size_t length, void *data)
+-{
+-	struct bm_data *bmd = data;
+-
+-	if (rcode == RCODE_COMPLETE)
+-		bmd->old = be32_to_cpu(*(__be32 *) payload);
+-	bmd->rcode = rcode;
+-	complete(&bmd->done);
+-}
+-
+ static void
+ fw_card_bm_work(struct work_struct *work)
+ {
+ 	struct fw_card *card = container_of(work, struct fw_card, work.work);
+ 	struct fw_device *root_device;
+ 	struct fw_node *root_node, *local_node;
+-	struct bm_data bmd;
+ 	unsigned long flags;
+-	int root_id, new_root_id, irm_id, gap_count, generation, grace;
++	int root_id, new_root_id, irm_id, gap_count, generation, grace, rcode;
+ 	bool do_reset = false;
++	__be32 lock_data[2];
+ 
+ 	spin_lock_irqsave(&card->lock, flags);
+ 	local_node = card->local_node;
+@@ -241,7 +218,7 @@ fw_card_bm_work(struct work_struct *work
+ 	root_id = root_node->node_id;
+ 	grace = time_after(jiffies, card->reset_jiffies + DIV_ROUND_UP(HZ, 10));
+ 
+-	if (card->bm_generation + 1 == generation ||
++	if (is_next_generation(generation, card->bm_generation) ||
+ 	    (card->bm_generation != generation && grace)) {
+ 		/*
+ 		 * This first step is to figure out who is IRM and
+@@ -263,33 +240,28 @@ fw_card_bm_work(struct work_struct *work
+ 			goto pick_me;
+ 		}
+ 
+-		bmd.lock.arg = cpu_to_be32(0x3f);
+-		bmd.lock.data = cpu_to_be32(local_node->node_id);
++		lock_data[0] = cpu_to_be32(0x3f);
++		lock_data[1] = cpu_to_be32(local_node->node_id);
+ 
+ 		spin_unlock_irqrestore(&card->lock, flags);
+ 
+-		init_completion(&bmd.done);
+-		fw_send_request(card, &bmd.t, TCODE_LOCK_COMPARE_SWAP,
+-				irm_id, generation,
+-				SCODE_100, CSR_REGISTER_BASE + CSR_BUS_MANAGER_ID,
+-				&bmd.lock, sizeof(bmd.lock),
+-				complete_bm_lock, &bmd);
+-		wait_for_completion(&bmd.done);
++		rcode = fw_run_transaction(card, TCODE_LOCK_COMPARE_SWAP,
++				irm_id, generation, SCODE_100,
++				CSR_REGISTER_BASE + CSR_BUS_MANAGER_ID,
++				lock_data, sizeof(lock_data));
+ 
+-		if (bmd.rcode == RCODE_GENERATION) {
+-			/*
+-			 * Another bus reset happened. Just return,
+-			 * the BM work has been rescheduled.
+-			 */
++		if (rcode == RCODE_GENERATION)
++			/* Another bus reset, BM work has been rescheduled. */
+ 			goto out;
+-		}
+ 
+-		if (bmd.rcode == RCODE_COMPLETE && bmd.old != 0x3f)
++		if (rcode == RCODE_COMPLETE &&
++		    lock_data[0] != cpu_to_be32(0x3f))
+ 			/* Somebody else is BM, let them do the work. */
+ 			goto out;
+ 
+ 		spin_lock_irqsave(&card->lock, flags);
+-		if (bmd.rcode != RCODE_COMPLETE) {
++
++		if (rcode != RCODE_COMPLETE) {
+ 			/*
+ 			 * The lock request failed, maybe the IRM
+ 			 * isn't really IRM capable after all. Let's
+diff -Naurp linux-2.6-git/drivers/firewire/fw-cdev.c firewire-git/drivers/firewire/fw-cdev.c
+--- linux-2.6-git/drivers/firewire/fw-cdev.c	2008-08-04 18:04:26.000000000 -0400
++++ firewire-git/drivers/firewire/fw-cdev.c	2008-08-04 16:39:51.000000000 -0400
+@@ -369,22 +369,33 @@ complete_transaction(struct fw_card *car
+ 	struct response *response = data;
+ 	struct client *client = response->client;
+ 	unsigned long flags;
++	struct fw_cdev_event_response *r = &response->response;
+ 
+-	if (length < response->response.length)
+-		response->response.length = length;
++	if (length < r->length)
++		r->length = length;
+ 	if (rcode == RCODE_COMPLETE)
+-		memcpy(response->response.data, payload,
+-		       response->response.length);
++		memcpy(r->data, payload, r->length);
+ 
+ 	spin_lock_irqsave(&client->lock, flags);
+ 	list_del(&response->resource.link);
+ 	spin_unlock_irqrestore(&client->lock, flags);
+ 
+-	response->response.type   = FW_CDEV_EVENT_RESPONSE;
+-	response->response.rcode  = rcode;
+-	queue_event(client, &response->event, &response->response,
+-		    sizeof(response->response) + response->response.length,
+-		    NULL, 0);
++	r->type   = FW_CDEV_EVENT_RESPONSE;
++	r->rcode  = rcode;
++
++	/*
++	 * In the case that sizeof(*r) doesn't align with the position of the
++	 * data, and the read is short, preserve an extra copy of the data
++	 * to stay compatible with a pre-2.6.27 bug.  Since the bug is harmless
++	 * for short reads and some apps depended on it, this is both safe
++	 * and prudent for compatibility.
++	 */
++	if (r->length <= sizeof(*r) - offsetof(typeof(*r), data))
++		queue_event(client, &response->event, r, sizeof(*r),
++			    r->data, r->length);
++	else
++		queue_event(client, &response->event, r, sizeof(*r) + r->length,
++			    NULL, 0);
+ }
+ 
+ static int ioctl_send_request(struct client *client, void *buffer)
+diff -Naurp linux-2.6-git/drivers/firewire/fw-device.c firewire-git/drivers/firewire/fw-device.c
+--- linux-2.6-git/drivers/firewire/fw-device.c	2008-07-23 15:03:03.000000000 -0400
++++ firewire-git/drivers/firewire/fw-device.c	2008-08-04 16:39:51.000000000 -0400
+@@ -381,46 +381,21 @@ static struct device_attribute fw_device
+ 	__ATTR_NULL,
+ };
+ 
+-struct read_quadlet_callback_data {
+-	struct completion done;
+-	int rcode;
+-	u32 data;
+-};
+-
+-static void
+-complete_transaction(struct fw_card *card, int rcode,
+-		     void *payload, size_t length, void *data)
+-{
+-	struct read_quadlet_callback_data *callback_data = data;
+-
+-	if (rcode == RCODE_COMPLETE)
+-		callback_data->data = be32_to_cpu(*(__be32 *)payload);
+-	callback_data->rcode = rcode;
+-	complete(&callback_data->done);
+-}
+-
+ static int
+ read_rom(struct fw_device *device, int generation, int index, u32 *data)
+ {
+-	struct read_quadlet_callback_data callback_data;
+-	struct fw_transaction t;
+-	u64 offset;
++	int rcode;
+ 
+ 	/* device->node_id, accessed below, must not be older than generation */
+ 	smp_rmb();
+ 
+-	init_completion(&callback_data.done);
+-
+-	offset = (CSR_REGISTER_BASE | CSR_CONFIG_ROM) + index * 4;
+-	fw_send_request(device->card, &t, TCODE_READ_QUADLET_REQUEST,
++	rcode = fw_run_transaction(device->card, TCODE_READ_QUADLET_REQUEST,
+ 			device->node_id, generation, device->max_speed,
+-			offset, NULL, 4, complete_transaction, &callback_data);
+-
+-	wait_for_completion(&callback_data.done);
+-
+-	*data = callback_data.data;
++			(CSR_REGISTER_BASE | CSR_CONFIG_ROM) + index * 4,
++			data, 4);
++	be32_to_cpus(data);
+ 
+-	return callback_data.rcode;
++	return rcode;
+ }
+ 
+ #define READ_BIB_ROM_SIZE	256
+diff -Naurp linux-2.6-git/drivers/firewire/fw-ohci.c firewire-git/drivers/firewire/fw-ohci.c
+--- linux-2.6-git/drivers/firewire/fw-ohci.c	2008-08-04 18:04:26.000000000 -0400
++++ firewire-git/drivers/firewire/fw-ohci.c	2008-08-04 16:39:51.000000000 -0400
+@@ -1746,6 +1746,28 @@ ohci_get_bus_time(struct fw_card *card)
+ 	return bus_time;
+ }
+ 
++static void copy_iso_headers(struct iso_context *ctx, void *p)
++{
++	int i = ctx->header_length;
++
++	if (i + ctx->base.header_size > PAGE_SIZE)
++		return;
++
++	/*
++	 * The iso header is byteswapped to little endian by
++	 * the controller, but the remaining header quadlets
++	 * are big endian.  We want to present all the headers
++	 * as big endian, so we have to swap the first quadlet.
++	 */
++	if (ctx->base.header_size > 0)
++		*(u32 *) (ctx->header + i) = __swab32(*(u32 *) (p + 4));
++	if (ctx->base.header_size > 4)
++		*(u32 *) (ctx->header + i + 4) = __swab32(*(u32 *) p);
++	if (ctx->base.header_size > 8)
++		memcpy(ctx->header + i + 8, p + 8, ctx->base.header_size - 8);
++	ctx->header_length += ctx->base.header_size;
++}
++
+ static int handle_ir_dualbuffer_packet(struct context *context,
+ 				       struct descriptor *d,
+ 				       struct descriptor *last)
+@@ -1756,7 +1778,6 @@ static int handle_ir_dualbuffer_packet(s
+ 	__le32 *ir_header;
+ 	size_t header_length;
+ 	void *p, *end;
+-	int i;
+ 
+ 	if (db->first_res_count != 0 && db->second_res_count != 0) {
+ 		if (ctx->excess_bytes <= le16_to_cpu(db->second_req_count)) {
+@@ -1769,25 +1790,14 @@ static int handle_ir_dualbuffer_packet(s
+ 	header_length = le16_to_cpu(db->first_req_count) -
+ 		le16_to_cpu(db->first_res_count);
+ 
+-	i = ctx->header_length;
+ 	p = db + 1;
+ 	end = p + header_length;
+-	while (p < end && i + ctx->base.header_size <= PAGE_SIZE) {
+-		/*
+-		 * The iso header is byteswapped to little endian by
+-		 * the controller, but the remaining header quadlets
+-		 * are big endian.  We want to present all the headers
+-		 * as big endian, so we have to swap the first
+-		 * quadlet.
+-		 */
+-		*(u32 *) (ctx->header + i) = __swab32(*(u32 *) (p + 4));
+-		memcpy(ctx->header + i + 4, p + 8, ctx->base.header_size - 4);
+-		i += ctx->base.header_size;
++	while (p < end) {
++		copy_iso_headers(ctx, p);
+ 		ctx->excess_bytes +=
+ 			(le32_to_cpu(*(__le32 *)(p + 4)) >> 16) & 0xffff;
+-		p += ctx->base.header_size + 4;
++		p += max(ctx->base.header_size, (size_t)8);
+ 	}
+-	ctx->header_length = i;
+ 
+ 	ctx->excess_bytes -= le16_to_cpu(db->second_req_count) -
+ 		le16_to_cpu(db->second_res_count);
+@@ -1813,7 +1823,6 @@ static int handle_ir_packet_per_buffer(s
+ 	struct descriptor *pd;
+ 	__le32 *ir_header;
+ 	void *p;
+-	int i;
+ 
+ 	for (pd = d; pd <= last; pd++) {
+ 		if (pd->transfer_status)
+@@ -1823,21 +1832,8 @@ static int handle_ir_packet_per_buffer(s
+ 		/* Descriptor(s) not done yet, stop iteration */
+ 		return 0;
+ 
+-	i   = ctx->header_length;
+-	p   = last + 1;
+-
+-	if (ctx->base.header_size > 0 &&
+-			i + ctx->base.header_size <= PAGE_SIZE) {
+-		/*
+-		 * The iso header is byteswapped to little endian by
+-		 * the controller, but the remaining header quadlets
+-		 * are big endian.  We want to present all the headers
+-		 * as big endian, so we have to swap the first quadlet.
+-		 */
+-		*(u32 *) (ctx->header + i) = __swab32(*(u32 *) (p + 4));
+-		memcpy(ctx->header + i + 4, p + 8, ctx->base.header_size - 4);
+-		ctx->header_length += ctx->base.header_size;
+-	}
++	p = last + 1;
++	copy_iso_headers(ctx, p);
+ 
+ 	if (le16_to_cpu(last->control) & DESCRIPTOR_IRQ_ALWAYS) {
+ 		ir_header = (__le32 *) p;
+@@ -2132,11 +2128,11 @@ ohci_queue_iso_receive_dualbuffer(struct
+ 	z = 2;
+ 
+ 	/*
+-	 * The OHCI controller puts the status word in the header
+-	 * buffer too, so we need 4 extra bytes per packet.
++	 * The OHCI controller puts the isochronous header and trailer in the
++	 * buffer, so we need at least 8 bytes.
+ 	 */
+ 	packet_count = p->header_length / ctx->base.header_size;
+-	header_size = packet_count * (ctx->base.header_size + 4);
++	header_size = packet_count * max(ctx->base.header_size, (size_t)8);
+ 
+ 	/* Get header size in number of descriptors. */
+ 	header_z = DIV_ROUND_UP(header_size, sizeof(*d));
+@@ -2154,7 +2150,8 @@ ohci_queue_iso_receive_dualbuffer(struct
+ 		db = (struct db_descriptor *) d;
+ 		db->control = cpu_to_le16(DESCRIPTOR_STATUS |
+ 					  DESCRIPTOR_BRANCH_ALWAYS);
+-		db->first_size = cpu_to_le16(ctx->base.header_size + 4);
++		db->first_size =
++		    cpu_to_le16(max(ctx->base.header_size, (size_t)8));
+ 		if (p->skip && rest == p->payload_length) {
+ 			db->control |= cpu_to_le16(DESCRIPTOR_WAIT);
+ 			db->first_req_count = db->first_size;
+@@ -2204,11 +2201,11 @@ ohci_queue_iso_receive_packet_per_buffer
+ 	int page, offset, packet_count, header_size, payload_per_buffer;
+ 
+ 	/*
+-	 * The OHCI controller puts the status word in the
+-	 * buffer too, so we need 4 extra bytes per packet.
++	 * The OHCI controller puts the isochronous header and trailer in the
++	 * buffer, so we need at least 8 bytes.
+ 	 */
+ 	packet_count = p->header_length / ctx->base.header_size;
+-	header_size  = ctx->base.header_size + 4;
++	header_size  = max(ctx->base.header_size, (size_t)8);
+ 
+ 	/* Get header size in number of descriptors. */
+ 	header_z = DIV_ROUND_UP(header_size, sizeof(*d));
+diff -Naurp linux-2.6-git/drivers/firewire/fw-sbp2.c firewire-git/drivers/firewire/fw-sbp2.c
+--- linux-2.6-git/drivers/firewire/fw-sbp2.c	2008-08-04 18:04:26.000000000 -0400
++++ firewire-git/drivers/firewire/fw-sbp2.c	2008-08-04 16:39:51.000000000 -0400
+@@ -621,25 +621,15 @@ sbp2_send_management_orb(struct sbp2_log
+ 	return retval;
+ }
+ 
+-static void
+-complete_agent_reset_write(struct fw_card *card, int rcode,
+-			   void *payload, size_t length, void *done)
+-{
+-	complete(done);
+-}
+-
+ static void sbp2_agent_reset(struct sbp2_logical_unit *lu)
+ {
+ 	struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
+-	DECLARE_COMPLETION_ONSTACK(done);
+-	struct fw_transaction t;
+-	static u32 z;
++	__be32 d = 0;
+ 
+-	fw_send_request(device->card, &t, TCODE_WRITE_QUADLET_REQUEST,
+-			lu->tgt->node_id, lu->generation, device->max_speed,
+-			lu->command_block_agent_address + SBP2_AGENT_RESET,
+-			&z, sizeof(z), complete_agent_reset_write, &done);
+-	wait_for_completion(&done);
++	fw_run_transaction(device->card, TCODE_WRITE_QUADLET_REQUEST,
++			   lu->tgt->node_id, lu->generation, device->max_speed,
++			   lu->command_block_agent_address + SBP2_AGENT_RESET,
++			   &d, sizeof(d));
+ }
+ 
+ static void
+@@ -653,7 +643,7 @@ static void sbp2_agent_reset_no_wait(str
+ {
+ 	struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
+ 	struct fw_transaction *t;
+-	static u32 z;
++	static __be32 d;
+ 
+ 	t = kmalloc(sizeof(*t), GFP_ATOMIC);
+ 	if (t == NULL)
+@@ -662,7 +652,7 @@ static void sbp2_agent_reset_no_wait(str
+ 	fw_send_request(device->card, t, TCODE_WRITE_QUADLET_REQUEST,
+ 			lu->tgt->node_id, lu->generation, device->max_speed,
+ 			lu->command_block_agent_address + SBP2_AGENT_RESET,
+-			&z, sizeof(z), complete_agent_reset_write_no_wait, t);
++			&d, sizeof(d), complete_agent_reset_write_no_wait, t);
+ }
+ 
+ static void sbp2_set_generation(struct sbp2_logical_unit *lu, int generation)
+@@ -823,13 +813,6 @@ static void sbp2_target_put(struct sbp2_
+ 	kref_put(&tgt->kref, sbp2_release_target);
+ }
+ 
+-static void
+-complete_set_busy_timeout(struct fw_card *card, int rcode,
+-			  void *payload, size_t length, void *done)
+-{
+-	complete(done);
+-}
+-
+ /*
+  * Write retransmit retry values into the BUSY_TIMEOUT register.
+  * - The single-phase retry protocol is supported by all SBP-2 devices, but the
+@@ -849,17 +832,12 @@ complete_set_busy_timeout(struct fw_card
+ static void sbp2_set_busy_timeout(struct sbp2_logical_unit *lu)
+ {
+ 	struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
+-	DECLARE_COMPLETION_ONSTACK(done);
+-	struct fw_transaction t;
+-	static __be32 busy_timeout;
+-
+-	busy_timeout = cpu_to_be32(SBP2_CYCLE_LIMIT | SBP2_RETRY_LIMIT);
++	__be32 d = cpu_to_be32(SBP2_CYCLE_LIMIT | SBP2_RETRY_LIMIT);
+ 
+-	fw_send_request(device->card, &t, TCODE_WRITE_QUADLET_REQUEST,
+-			lu->tgt->node_id, lu->generation, device->max_speed,
+-			CSR_REGISTER_BASE + CSR_BUSY_TIMEOUT, &busy_timeout,
+-			sizeof(busy_timeout), complete_set_busy_timeout, &done);
+-	wait_for_completion(&done);
++	fw_run_transaction(device->card, TCODE_WRITE_QUADLET_REQUEST,
++			   lu->tgt->node_id, lu->generation, device->max_speed,
++			   CSR_REGISTER_BASE + CSR_BUSY_TIMEOUT,
++			   &d, sizeof(d));
+ }
+ 
+ static void sbp2_reconnect(struct work_struct *work);
+diff -Naurp linux-2.6-git/drivers/firewire/fw-topology.c firewire-git/drivers/firewire/fw-topology.c
+--- linux-2.6-git/drivers/firewire/fw-topology.c	2008-08-04 18:04:26.000000000 -0400
++++ firewire-git/drivers/firewire/fw-topology.c	2008-07-14 11:09:44.000000000 -0400
+@@ -510,6 +510,30 @@ fw_core_handle_bus_reset(struct fw_card 
+ 	struct fw_node *local_node;
+ 	unsigned long flags;
+ 
++	/*
++	 * If the selfID buffer is not the immediate successor of the
++	 * previously processed one, we cannot reliably compare the
++	 * old and new topologies.
++	 */
++	if (!is_next_generation(generation, card->generation) &&
++	    card->local_node != NULL) {
++		fw_notify("skipped bus generations, destroying all nodes\n");
++		fw_destroy_nodes(card);
++		card->bm_retries = 0;
++	}
++
++	/*
++	 * If the selfID buffer is not the immediate successor of the
++	 * previously processed one, we cannot reliably compare the
++	 * old and new topologies.
++	 */
++	if (!is_next_generation(generation, card->generation) &&
++	    card->local_node != NULL) {
++		fw_notify("skipped bus generations, destroying all nodes\n");
++		fw_destroy_nodes(card);
++		card->bm_retries = 0;
++	}
++
+ 	spin_lock_irqsave(&card->lock, flags);
+ 
+ 	/*
+diff -Naurp linux-2.6-git/drivers/firewire/fw-transaction.c firewire-git/drivers/firewire/fw-transaction.c
+--- linux-2.6-git/drivers/firewire/fw-transaction.c	2008-08-04 18:04:26.000000000 -0400
++++ firewire-git/drivers/firewire/fw-transaction.c	2008-08-04 16:39:51.000000000 -0400
+@@ -247,7 +247,7 @@ fw_fill_request(struct fw_packet *packet
+  */
+ void
+ fw_send_request(struct fw_card *card, struct fw_transaction *t,
+-		int tcode, int node_id, int generation, int speed,
++		int tcode, int destination_id, int generation, int speed,
+ 		unsigned long long offset,
+ 		void *payload, size_t length,
+ 		fw_transaction_callback_t callback, void *callback_data)
+@@ -279,13 +279,14 @@ fw_send_request(struct fw_card *card, st
+ 	card->current_tlabel = (card->current_tlabel + 1) & 0x1f;
+ 	card->tlabel_mask |= (1 << tlabel);
+ 
+-	t->node_id = node_id;
++	t->node_id = destination_id;
+ 	t->tlabel = tlabel;
+ 	t->callback = callback;
+ 	t->callback_data = callback_data;
+ 
+-	fw_fill_request(&t->packet, tcode, t->tlabel, node_id, card->node_id,
+-			generation, speed, offset, payload, length);
++	fw_fill_request(&t->packet, tcode, t->tlabel,
++			destination_id, card->node_id, generation,
++			speed, offset, payload, length);
+ 	t->packet.callback = transmit_complete_callback;
+ 
+ 	list_add_tail(&t->link, &card->transaction_list);
+@@ -296,6 +297,45 @@ fw_send_request(struct fw_card *card, st
+ }
+ EXPORT_SYMBOL(fw_send_request);
+ 
++struct transaction_callback_data {
++	struct completion done;
++	void *payload;
++	int rcode;
++};
++
++static void transaction_callback(struct fw_card *card, int rcode,
++				 void *payload, size_t length, void *data)
++{
++	struct transaction_callback_data *d = data;
++
++	if (rcode == RCODE_COMPLETE)
++		memcpy(d->payload, payload, length);
++	d->rcode = rcode;
++	complete(&d->done);
++}
++
++/**
++ * fw_run_transaction - send request and sleep until transaction is completed
++ *
++ * Returns the RCODE.
++ */
++int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
++		int generation, int speed, unsigned long long offset,
++		void *data, size_t length)
++{
++	struct transaction_callback_data d;
++	struct fw_transaction t;
++
++	init_completion(&d.done);
++	d.payload = data;
++	fw_send_request(card, &t, tcode, destination_id, generation, speed,
++			offset, data, length, transaction_callback, &d);
++	wait_for_completion(&d.done);
++
++	return d.rcode;
++}
++EXPORT_SYMBOL(fw_run_transaction);
++
+ static DEFINE_MUTEX(phy_config_mutex);
+ static DECLARE_COMPLETION(phy_config_done);
+ 
+diff -Naurp linux-2.6-git/drivers/firewire/fw-transaction.h firewire-git/drivers/firewire/fw-transaction.h
+--- linux-2.6-git/drivers/firewire/fw-transaction.h	2008-07-23 15:03:03.000000000 -0400
++++ firewire-git/drivers/firewire/fw-transaction.h	2008-08-04 16:39:51.000000000 -0400
+@@ -277,6 +277,15 @@ static inline void fw_card_put(struct fw
+ }
+ 
+ /*
++ * Check whether new_generation is the immediate successor of old_generation.
++ * Take counter roll-over at 255 (as per to OHCI) into account.
++ */
++static inline bool is_next_generation(int new_generation, int old_generation)
++{
++	return (new_generation & 0xff) == ((old_generation + 1) & 0xff);
++}
++
++/*
+  * The iso packet format allows for an immediate header/payload part
+  * stored in 'header' immediately after the packet info plus an
+  * indirect payload part that is pointer to by the 'payload' field.
+@@ -426,11 +435,14 @@ fw_core_initiate_bus_reset(struct fw_car
+ 
+ void
+ fw_send_request(struct fw_card *card, struct fw_transaction *t,
+-		int tcode, int node_id, int generation, int speed,
+-		unsigned long long offset,
+-		void *data, size_t length,
++		int tcode, int destination_id, int generation, int speed,
++		unsigned long long offset, void *data, size_t length,
+ 		fw_transaction_callback_t callback, void *callback_data);
+ 
++int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
++		       int generation, int speed, unsigned long long offset,
++		       void *data, size_t length);
++
+ int fw_cancel_transaction(struct fw_card *card,
+ 			  struct fw_transaction *transaction);
+ 


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.844
retrieving revision 1.845
diff -u -r1.844 -r1.845
--- kernel.spec	4 Aug 2008 19:55:58 -0000	1.844
+++ kernel.spec	4 Aug 2008 22:38:45 -0000	1.845
@@ -567,7 +567,7 @@
 Patch370: linux-2.6-crash-driver.patch
 Patch380: linux-2.6-defaults-pci_no_msi.patch
 Patch390: linux-2.6-defaults-acpi-video.patch
-Patch391: linux-2.6-defaults-acpi-video-dos.patch
+#Patch391: linux-2.6-defaults-acpi-video-dos.patch
 Patch400: linux-2.6-scsi-cpqarray-set-master.patch
 Patch402: linux-2.6-scsi-mpt-vmware-fix.patch
 Patch420: linux-2.6-squashfs.patch
@@ -616,6 +616,9 @@
 # atl2 network driver
 Patch2020: linux-2.6-netdev-atl2.patch
 
+# linux1394 git patches
+Patch2300: linux-2.6-firewire-git-update.patch
+
 # make USB EHCI driver respect "nousb" parameter
 Patch2300: linux-2.6-usb-ehci-hcd-respect-nousb.patch
 # Fix HID usage descriptor on MS wireless desktop receiver
@@ -1037,7 +1040,7 @@
 # ACPI
 
 ApplyPatch linux-2.6-defaults-acpi-video.patch 
-ApplyPatch linux-2.6-acpi-video-dos.patch
+#ApplyPatch linux-2.6-acpi-video-dos.patch
 
 # Various low-impact patches to aid debugging.
 ApplyPatch linux-2.6-debug-sizeof-structs.patch
@@ -1143,6 +1146,7 @@
 #ApplyPatch linux-2.6-drm-fix-master-perm.patch
 
 # linux1394 git patches
+ApplyPatch linux-2.6-firewire-git-update.patch
 #C=$(wc -l $RPM_SOURCE_DIR/linux-2.6-firewire-git-pending.patch | awk '{print $1}')
 #if [ "$C" -gt 10 ]; then
 #ApplyPatch linux-2.6-firewire-git-pending.patch
@@ -1728,6 +1732,9 @@
 * Mon Aug 04 2008 Matthew Garrett <mjg at redhat.com>
 - disable ACPI video display switching by default
 
+* Mon Aug 04 2008 Jarod Wilson <jwilson at redhat.com>
+- add latest firewire goodies: actual iso timestamps ftw
+
 * Mon Aug 04 2008 Dave Jones <davej at redhat.com>
 - 2.6.27-rc1-git5
 




More information about the fedora-extras-commits mailing list