patch-2.3.42 linux/drivers/ieee1394/raw1394.c

Next file: linux/drivers/net/Makefile
Previous file: linux/drivers/ieee1394/ohci1394.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.41/linux/drivers/ieee1394/raw1394.c linux/drivers/ieee1394/raw1394.c
@@ -495,8 +495,8 @@
 
                 if (req->req.length == 8) {
                         req->req.error = highlevel_lock(fi->host, req->data,
-                                                        addr, req->data[0],
-                                                        req->data[1],
+                                                        addr, req->data[1],
+                                                        req->data[0],
                                                         req->req.misc);
                         req->req.length = 4;
                 } else {
@@ -567,6 +567,32 @@
                 break;
 
         case RAW1394_REQ_LOCK:
+                if ((req->req.misc != EXTCODE_FETCH_ADD)
+                    && (req->req.misc != EXTCODE_LITTLE_ADD)) {
+                        if (req->req.length != 4) {
+                                req->req.error = RAW1394_ERROR_INVALID_ARG;
+                                break;
+                        }
+                } else {
+                        if (req->req.length != 8) {
+                                req->req.error = RAW1394_ERROR_INVALID_ARG;
+                                break;
+                        }
+                }
+
+                packet = hpsb_make_lockpacket(fi->host, node, addr,
+                                              req->req.misc);
+                if (!packet) return -ENOMEM;
+
+                if (copy_from_user(packet->data, req->req.sendb,
+                                   req->req.length)) {
+                        req->req.error = RAW1394_ERROR_MEMFAULT;
+                        break;
+                }
+
+                req->req.length = 4;
+                break;
+
         case RAW1394_REQ_LOCK64:
         default:
                 req->req.error = RAW1394_ERROR_STATE_ORDER;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)