[Linux1394-cvslog] rev 601 - trunk
Brought to you by:
aeb,
bencollins
From: SVN U. <ben...@li...> - 2002-10-12 21:39:47
|
Author: bencollins Date: 2002-10-12 17:39:41 -0400 (Sat, 12 Oct 2002) New Revision: 601 Modified: trunk/Makefile trunk/amdtp.c trunk/dv1394.c trunk/eth1394.c trunk/eth1394.h trunk/hosts.c trunk/hosts.h trunk/ieee1394_core.c trunk/ieee1394_core.h trunk/ieee1394_types.h trunk/ohci1394.c trunk/raw1394.c trunk/raw1394.h trunk/sbp2.c trunk/sbp2.h trunk/video1394.c Log: General: Abstract for compatiblity, the old task_queue interface. We now have compatibility between 2.4/2.5 again. Amdtp: 2.5 no longer takes a flags argument to pci_pool_create() Video1394: Remove some old compat code aswell. dv1394: Fix compilation warnings in the no-devfs case. Modified: trunk/ieee1394_core.c ============================================================================== --- trunk/ieee1394_core.c (original) +++ trunk/ieee1394_core.c 2002-10-12 17:39:43.000000000 -0400 @@ -29,7 +29,6 @@ #include <linux/interrupt.h> #include <linux/module.h> #include <linux/proc_fs.h> -#include <linux/tqueue.h> #include <asm/bitops.h> #include <asm/byteorder.h> #include <asm/semaphore.h> @@ -82,9 +81,10 @@ struct list_head *lh, *next; list_for_each_safe(lh, next, &packet->complete_tq) { - struct tq_struct *tq = list_entry(lh, struct tq_struct, list); - list_del(&tq->list); - schedule_task(tq); + struct hpsb_queue_struct *tq = + list_entry(lh, struct hpsb_queue_struct, hpsb_queue_list); + list_del(&tq->hpsb_queue_list); + hpsb_schedule_work(tq); } return; @@ -93,11 +93,11 @@ /** * hpsb_add_packet_complete_task - add a new task for when a packet completes * @packet: the packet whose completion we want the task added to - * @tq: the tq_struct describing the task to add + * @tq: the hpsb_queue_struct describing the task to add */ -void hpsb_add_packet_complete_task(struct hpsb_packet *packet, struct tq_struct *tq) +void hpsb_add_packet_complete_task(struct hpsb_packet *packet, struct hpsb_queue_struct *tq) { - list_add_tail(&tq->list, &packet->complete_tq); + list_add_tail(&tq->hpsb_queue_list, &packet->complete_tq); return; } @@ -437,7 +437,7 @@ spin_unlock_irqrestore(&host->pending_pkt_lock, flags); up(&packet->state_change); - schedule_task(&host->timeout_tq); + hpsb_schedule_work(&host->timeout_tq); } /** @@ -881,7 +881,7 @@ } if (!list_empty(&host->pending_packets)) - schedule_task(&host->timeout_tq); + hpsb_schedule_work(&host->timeout_tq); spin_unlock_irqrestore(&host->pending_pkt_lock, flags); Modified: trunk/ohci1394.c ============================================================================== --- trunk/ohci1394.c (original) +++ trunk/ohci1394.c 2002-10-12 17:39:43.000000000 -0400 @@ -91,7 +91,6 @@ #include <asm/byteorder.h> #include <asm/atomic.h> #include <asm/uaccess.h> -#include <linux/tqueue.h> #include <linux/delay.h> #include <linux/spinlock.h> Modified: trunk/ieee1394_core.h ============================================================================== --- trunk/ieee1394_core.h (original) +++ trunk/ieee1394_core.h 2002-10-12 17:39:44.000000000 -0400 @@ -2,7 +2,6 @@ #ifndef _IEEE1394_CORE_H #define _IEEE1394_CORE_H -#include <linux/tqueue.h> #include <linux/slab.h> #include <linux/devfs_fs_kernel.h> #include <linux/proc_fs.h> @@ -78,7 +77,7 @@ }; /* add a new task for when a packet completes */ -void hpsb_add_packet_complete_task(struct hpsb_packet *packet, struct tq_struct *tq); +void hpsb_add_packet_complete_task(struct hpsb_packet *packet, struct hpsb_queue_struct *tq); static inline struct hpsb_packet *driver_packet(struct list_head *l) { Modified: trunk/amdtp.c ============================================================================== --- trunk/amdtp.c (original) +++ trunk/amdtp.c 2002-10-12 17:39:44.000000000 -0400 @@ -834,7 +834,12 @@ max_packet_size = max_nevents * s->dimension * 4 + 8; s->packet_pool = pci_pool_create("packet pool", s->host->ohci->dev, - max_packet_size, 0, 0, SLAB_KERNEL); + max_packet_size, 0, 0 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,40) + ,SLAB_KERNEL); +#else + ); +#endif if (s->packet_pool == NULL) return -1; @@ -1020,7 +1025,13 @@ s->descriptor_pool = pci_pool_create("descriptor pool", host->ohci->dev, sizeof(struct descriptor_block), - 16, 0, SLAB_KERNEL); + 16, 0 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,40) + ,SLAB_KERNEL); +#else + ); +#endif + if (s->descriptor_pool == NULL) { kfree(s->input); kfree(s); Modified: trunk/raw1394.c ============================================================================== --- trunk/raw1394.c (original) +++ trunk/raw1394.c 2002-10-12 17:39:44.000000000 -0400 @@ -107,7 +107,7 @@ if (req != NULL) { memset(req, 0, sizeof(struct pending_request)); INIT_LIST_HEAD(&req->list); - INIT_TQUEUE(&req->tq, (void(*)(void*))queue_complete_cb, NULL); + HPSB_INIT_WORK(&req->tq, (void(*)(void*))queue_complete_cb, NULL); } return req; @@ -794,8 +794,7 @@ return sizeof(struct raw1394_request); } - req->tq.data = req; - req->tq.routine = (void (*)(void*))queue_complete_req; + HPSB_PREPARE_WORK(&req->tq, (void (*)(void*))queue_complete_req, req); req->req.length = 0; hpsb_add_packet_complete_task(packet, &req->tq); @@ -858,10 +857,9 @@ packet->header_size=header_length; packet->data_size=req->req.length-header_length; - req->tq.data = req; - req->tq.routine = (void (*)(void*))queue_complete_req; + HPSB_PREPARE_WORK(&req->tq, (void (*)(void*))queue_complete_req, req); req->req.length = 0; - queue_task(&req->tq, &packet->complete_tq); + hpsb_add_packet_complete_task(packet, &req->tq); spin_lock_irq(&fi->reqlists_lock); list_add_tail(&req->list, &fi->req_pending); @@ -1809,7 +1807,7 @@ req->req.length=0; req->packet=packet; req->tq.data=req; - queue_task(&req->tq, &packet->complete_tq); + hpsb_add_packet_complete_task(packet, &req->tq); spin_lock_irq(&fi->reqlists_lock); list_add_tail(&req->list, &fi->req_pending); spin_unlock_irq(&fi->reqlists_lock); Modified: trunk/raw1394.h ============================================================================== --- trunk/raw1394.h (original) +++ trunk/raw1394.h 2002-10-12 17:39:44.000000000 -0400 @@ -164,7 +164,7 @@ struct list_head list; struct file_info *file_info; struct hpsb_packet *packet; - struct tq_struct tq; + struct hpsb_queue_struct tq; struct iso_block_store *ibs; quadlet_t *data; int free_data; Modified: trunk/Makefile ============================================================================== --- trunk/Makefile (original) +++ trunk/Makefile 2002-10-12 17:39:44.000000000 -0400 @@ -2,11 +2,8 @@ # Makefile for the Linux IEEE 1394 implementation # -O_TARGET := ieee1394drv.o - export-objs := ieee1394_core.o ohci1394.o cmp.o -list-multi := ieee1394.o ieee1394-objs := ieee1394_core.o ieee1394_transactions.o hosts.o \ highlevel.o csr.o nodemgr.o Modified: trunk/hosts.c ============================================================================== --- trunk/hosts.c (original) +++ trunk/hosts.c 2002-10-12 17:39:44.000000000 -0400 @@ -138,7 +138,7 @@ atomic_set(&h->generation, 0); - INIT_TQUEUE(&h->timeout_tq, (void (*)(void*))abort_timedouts, h); + HPSB_INIT_WORK(&h->timeout_tq, (void (*)(void*))abort_timedouts, h); h->topology_map = h->csr.topology_map + 3; h->speed_map = (u8 *)(h->csr.speed_map + 2); Modified: trunk/eth1394.c ============================================================================== --- trunk/eth1394.c (original) +++ trunk/eth1394.c 2002-10-12 17:39:44.000000000 -0400 @@ -682,8 +682,8 @@ ptask->skb = skb; ptask->addr = addr; ptask->dest_node = dest_node; - INIT_TQUEUE(&ptask->tq, hpsb_write_sched, ptask); - schedule_task(&ptask->tq); + HPSB_INIT_WORK(&ptask->tq, hpsb_write_sched, ptask); + hpsb_schedule_work(&ptask->tq); return 0; fail: Modified: trunk/hosts.h ============================================================================== --- trunk/hosts.h (original) +++ trunk/hosts.h 2002-10-12 17:39:44.000000000 -0400 @@ -2,7 +2,6 @@ #define _IEEE1394_HOSTS_H #include <linux/wait.h> -#include <linux/tqueue.h> #include <linux/list.h> #include <asm/semaphore.h> @@ -31,7 +30,7 @@ struct list_head pending_packets; spinlock_t pending_pkt_lock; - struct tq_struct timeout_tq; + struct hpsb_queue_struct timeout_tq; /* A bitmask where a set bit means that this tlabel is in use. * FIXME - should be handled per node instead of per bus. */ Modified: trunk/sbp2.c ============================================================================== --- trunk/sbp2.c (original) +++ trunk/sbp2.c 2002-10-12 17:39:44.000000000 -0400 @@ -801,8 +801,9 @@ * Set up a task queue completion routine, which returns * the packet to the free list and releases the tlabel. */ - request_packet->tq.routine = (void (*)(void*))sbp2util_free_request_packet; - request_packet->tq.data = request_packet; + HPSB_PREPARE_WORK(&request_packet->tq, + (void (*)(void*))sbp2util_free_request_packet, + request_packet); request_packet->hi_context = hi; hpsb_add_packet_complete_task(packet, &request_packet->tq); Modified: trunk/eth1394.h ============================================================================== --- trunk/eth1394.h (original) +++ trunk/eth1394.h 2002-10-12 17:39:44.000000000 -0400 @@ -56,7 +56,7 @@ struct sk_buff *skb; /* Socket buffer we are sending */ nodeid_t dest_node; /* Destination of the packet */ u64 addr; /* Address */ - struct tq_struct tq; /* The task */ + struct hpsb_queue_struct tq; /* The task */ }; /* IP1394 headers */ Modified: trunk/sbp2.h ============================================================================== --- trunk/sbp2.h (original) +++ trunk/sbp2.h 2002-10-12 17:39:44.000000000 -0400 @@ -324,7 +324,7 @@ struct list_head list; struct hpsb_packet *packet; - struct tq_struct tq; + struct hpsb_queue_struct tq; void *hi_context; }; Modified: trunk/ieee1394_types.h ============================================================================== --- trunk/ieee1394_types.h (original) +++ trunk/ieee1394_types.h 2002-10-12 17:39:44.000000000 -0400 @@ -41,6 +41,27 @@ #define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif + +/* Compatibility for task/work queues */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,42) +/* Use task queue */ +#include <linux/tqueue.h> +#define hpsb_queue_struct tq_struct +#define hpsb_queue_list list +#define hpsb_schedule_work(x) schedule_task(x) +#define HPSB_INIT_WORK(x,y,z) INIT_TQUEUE(x,y,z) +#define HPSB_PREPARE_WORK(x,y,z) PREPARE_TQUEUE(x,y,z) +#else +/* Use work queue */ +#include <linux/workqueue.h> +#define hpsb_queue_struct work_struct +#define hpsb_queue_list entry +#define hpsb_schedule_work(x) schedule_work(x) +#define HPSB_INIT_WORK(x,y,z) INIT_WORK(x,y,z) +#define HPSB_PREPARE_WORK(x,y,z) PREPARE_WORK(x,y,z) +#endif + + typedef u32 quadlet_t; typedef u64 octlet_t; typedef u16 nodeid_t; Modified: trunk/video1394.c ============================================================================== --- trunk/video1394.c (original) +++ trunk/video1394.c 2002-10-12 17:39:44.000000000 -0400 @@ -35,7 +35,6 @@ #include <linux/poll.h> #include <linux/smp_lock.h> #include <linux/proc_fs.h> -#include <linux/tqueue.h> #include <linux/delay.h> #include <linux/devfs_fs_kernel.h> @@ -1455,12 +1454,7 @@ return -EIO; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) - devfs_handle = devfs_mk_dir(NULL, VIDEO1394_DRIVER_NAME, - strlen(VIDEO1394_DRIVER_NAME), NULL); -#else devfs_handle = devfs_mk_dir(NULL, VIDEO1394_DRIVER_NAME, NULL); -#endif hl_handle = hpsb_register_highlevel (VIDEO1394_DRIVER_NAME, &hl_ops); if (hl_handle == NULL) { Modified: trunk/dv1394.c ============================================================================== --- trunk/dv1394.c (original) +++ trunk/dv1394.c 2002-10-12 17:39:44.000000000 -0400 @@ -97,7 +97,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> @@ -2587,6 +2586,7 @@ return p; } +#ifdef CONFIG_DEVFS_FS static int dv1394_devfs_add_entry(struct video_card *video) { char buf[32]; @@ -2694,6 +2694,7 @@ kfree(p); } } +#endif /* CONFIG_DEVFS_FS */ /*** IEEE1394 HPSB CALLBACKS ***********************************************/ @@ -2852,7 +2853,6 @@ { struct ti_ohci *ohci; char buf[16]; - struct dv1394_devfs_entry *devfs_entry; /* We only work with the OHCI-1394 driver */ if (strcmp(host->driver->name, OHCI1394_DRIVER_NAME)) @@ -2874,13 +2874,15 @@ #endif #ifdef CONFIG_DEVFS_FS - devfs_entry = dv1394_devfs_find("dv"); +{ + struct dv1394_devfs_entry = devfs_entry = dv1394_devfs_find("dv"); if (devfs_entry != NULL) { snprintf(buf, sizeof(buf), "host%d", ohci->id); dv1394_devfs_add_dir(buf, devfs_entry, &devfs_entry); dv1394_devfs_add_dir("NTSC", devfs_entry, NULL); dv1394_devfs_add_dir("PAL", devfs_entry, NULL); } +} #endif dv1394_init(ohci, DV1394_NTSC, MODE_RECEIVE); |