Author: dmaas
Date: 2002-12-16 00:13:38 -0500 (Mon, 16 Dec 2002)
New Revision: 698
Modified:
trunk/raw1394.c
trunk/raw1394.h
Log:
rawiso update:
- add a raw1394 ioctl RAW1394_ISO_QUEUE_ACTIVITY to force a RAWISO_ACTIVITY
event into the queue. Needed for libraw1394 to wake itself up.
Modified: trunk/raw1394.c
==============================================================================
--- trunk/raw1394.c (original)
+++ trunk/raw1394.c 2002-12-16 16:49:21.000000000 -0500
@@ -2015,43 +2015,48 @@
return 0;
}
+/* put a RAWISO_ACTIVITY event in the queue, if one isn't there already */
+static void queue_rawiso_event(struct file_info *fi)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&fi->reqlists_lock, flags);
+
+ /* only one ISO activity event may be in the queue */
+ if(!__rawiso_event_in_queue(fi)) {
+ struct pending_request *req = __alloc_pending_request(SLAB_ATOMIC);
+
+ if(req) {
+ req->file_info = fi;
+ req->req.type = RAW1394_REQ_RAWISO_ACTIVITY;
+ req->req.generation = get_hpsb_generation(fi->host);
+ __queue_complete_req(req);
+ } else {
+ /* on allocation failure, signal an overflow */
+ if(fi->iso_handle) {
+ atomic_inc(&fi->iso_handle->overflows);
+ }
+ }
+ }
+ spin_unlock_irqrestore(&fi->reqlists_lock, flags);
+}
+
static void rawiso_activity_cb(struct hpsb_iso *iso)
{
- unsigned long host_flags;
+ unsigned long flags;
struct list_head *lh;
struct host_info *hi;
- spin_lock_irqsave(&host_info_lock, host_flags);
+ spin_lock_irqsave(&host_info_lock, flags);
hi = find_host_info(iso->host);
if (hi != NULL) {
list_for_each(lh, &hi->file_info_list) {
- unsigned long reqlist_flags;
- struct file_info *fi = list_entry(lh, struct file_info, list);
-
- spin_lock_irqsave(&fi->reqlists_lock, reqlist_flags);
-
- /* only one ISO activity event may be in the queue */
- if(!__rawiso_event_in_queue(fi)) {
- struct pending_request *req = __alloc_pending_request(SLAB_ATOMIC);
-
- if(req) {
- req->file_info = fi;
- req->req.type = RAW1394_REQ_RAWISO_ACTIVITY;
- req->req.generation = get_hpsb_generation(iso->host);
- __queue_complete_req(req);
- } else {
- /* on allocation failure, signal an overflow */
- if(fi->iso_handle) {
- atomic_inc(&fi->iso_handle->overflows);
- }
- }
- }
- spin_unlock_irqrestore(&fi->reqlists_lock, reqlist_flags);
+ queue_rawiso_event(list_entry(lh, struct file_info, list));
}
}
- spin_unlock_irqrestore(&host_info_lock, host_flags);
+ spin_unlock_irqrestore(&host_info_lock, flags);
}
/* helper function - gather all the kernel iso status bits for returning to user-space */
@@ -2191,6 +2196,10 @@
case RAW1394_ISO_SHUTDOWN:
raw1394_iso_shutdown(fi);
return 0;
+
+ case RAW1394_ISO_QUEUE_ACTIVITY:
+ queue_rawiso_event(fi);
+ return 0;
}
break;
case RAW1394_ISO_XMIT:
@@ -2215,6 +2224,10 @@
case RAW1394_ISO_SHUTDOWN:
raw1394_iso_shutdown(fi);
return 0;
+
+ case RAW1394_ISO_QUEUE_ACTIVITY:
+ queue_rawiso_event(fi);
+ return 0;
}
break;
default:
Modified: trunk/raw1394.h
==============================================================================
--- trunk/raw1394.h (original)
+++ trunk/raw1394.h 2002-12-16 16:49:21.000000000 -0500
@@ -127,6 +127,7 @@
#define RAW1394_ISO_GET_STATUS 5 /* arg: raw1394_iso_status* */
#define RAW1394_ISO_PRODUCE_CONSUME 6 /* arg: int, # of packets */
#define RAW1394_ISO_SHUTDOWN 7
+#define RAW1394_ISO_QUEUE_ACTIVITY 9
/* per-packet metadata embedded in the ringbuffer */
/* must be identical to hpsb_iso_packet_info in iso.h! */
|