/* cut of header from message size (in 32-bit words) */
                size = (le32_to_cpu(msg->u.head[0]) >> 16) - 5;
 
-               evt = kmalloc(size * 4 + sizeof(*evt), GFP_ATOMIC | __GFP_ZERO);
+               evt = kmalloc(size * 4 + sizeof(*evt), GFP_ATOMIC);
                if (!evt)
                        return -ENOMEM;
+               memset(evt, 0, size * 4 + sizeof(*evt));
 
                evt->size = size;
                evt->tcntxt = le32_to_cpu(msg->u.s.tcntxt);
                evt->event_indicator = le32_to_cpu(msg->body[0]);
-               memcpy(&evt->tcntxt, &msg->u.s.tcntxt, size * 4);
+               memcpy(&evt->data, &msg->body[1], size * 4);
 
                list_for_each_entry_safe(dev, tmp, &c->devices, list)
                    if (dev->lct_data.tid == tid) {
 
 
 #include <asm/uaccess.h>
 
-#include "core.h"
-
 #define SG_TABLESIZE           30
 
-static int i2o_cfg_ioctl(struct inode *inode, struct file *fp, unsigned int cmd,
-                        unsigned long arg);
+extern int i2o_parm_issue(struct i2o_device *, int, void *, int, void *, int);
+
+static int i2o_cfg_ioctl(struct inode *, struct file *, unsigned int,
+                        unsigned long);
 
 static spinlock_t i2o_config_lock;
 
 
        sg_offset = (msg->u.head[0] >> 4) & 0x0f;
 
-       msg->u.s.icntxt = cpu_to_le32(i2o_config_driver.context);
-       msg->u.s.tcntxt = cpu_to_le32(i2o_cntxt_list_add(c, reply));
-
        memset(sg_list, 0, sizeof(sg_list[0]) * SG_TABLESIZE);
        if (sg_offset) {
                struct sg_simple_element *sg;
                                goto cleanup;
                        }
                        sg_size = sg[i].flag_count & 0xffffff;
-                       p = &(sg_list[sg_index++]);
+                       p = &(sg_list[sg_index]);
                        /* Allocate memory for the transfer */
                        if (i2o_dma_alloc
                            (&c->pdev->dev, p, sg_size,
                                rcode = -ENOMEM;
                                goto sg_list_cleanup;
                        }
+                       sg_index++;
                        /* Copy in the user's SG buffer if necessary */
                        if (sg[i].
                            flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) {
        }
 
        rcode = i2o_msg_post_wait(c, msg, 60);
-       if (rcode)
+       if (rcode) {
+               reply[4] = ((u32) rcode) << 24;
                goto sg_list_cleanup;
+       }
 
        if (sg_offset) {
                u32 msg[I2O_OUTBOUND_MSG_FRAME_SIZE];
                }
        }
 
+      sg_list_cleanup:
        /* Copy back the reply to user space */
        if (reply_size) {
                // we wrote our own values for context - now restore the user supplied ones
                }
        }
 
-      sg_list_cleanup:
        for (i = 0; i < sg_index; i++)
                i2o_dma_free(&c->pdev->dev, &sg_list[i]);
 
 
        sg_offset = (msg->u.head[0] >> 4) & 0x0f;
 
-       msg->u.s.icntxt = cpu_to_le32(i2o_config_driver.context);
-       msg->u.s.tcntxt = cpu_to_le32(i2o_cntxt_list_add(c, reply));
-
        memset(sg_list, 0, sizeof(sg_list[0]) * SG_TABLESIZE);
        if (sg_offset) {
                struct sg_simple_element *sg;
        }
 
        rcode = i2o_msg_post_wait(c, msg, 60);
-       if (rcode)
+       if (rcode) {
+               reply[4] = ((u32) rcode) << 24;
                goto sg_list_cleanup;
+       }
 
        if (sg_offset) {
                u32 msg[128];
                }
        }
 
+      sg_list_cleanup:
        /* Copy back the reply to user space */
        if (reply_size) {
                // we wrote our own values for context - now restore the user supplied ones
                }
        }
 
-      sg_list_cleanup:
        for (i = 0; i < sg_index; i++)
                kfree(sg_list[i]);
 
 
        sysfs_create_link(&i2o_dev->device.kobj, &scsi_dev->sdev_gendev.kobj,
                          "scsi");
 
-       osm_info("device added (TID: %03x) channel: %d, id: %d, lun: %d\n",
+       osm_info("device added (TID: %03x) channel: %d, id: %d, lun: %ld\n",
                 i2o_dev->lct_data.tid, channel, le32_to_cpu(id),
-                (unsigned int)le64_to_cpu(lun));
+                (long unsigned int)le64_to_cpu(lun));
 
        return 0;
 };
 
                       pci_name(pdev));
 
        c->pdev = pdev;
-       c->device.parent = get_device(&pdev->dev);
+       c->device.parent = &pdev->dev;
 
        /* Cards that fall apart if you hit them with large I/O loads... */
        if (pdev->vendor == PCI_VENDOR_ID_NCR && pdev->device == 0x0630) {
        if ((rc = i2o_iop_add(c)))
                goto uninstall;
 
-       get_device(&c->device);
-
        if (i960)
                pci_write_config_word(i960, 0x42, 0x03ff);
 
        i2o_pci_free(c);
 
       free_controller:
-       put_device(c->device.parent);
        i2o_iop_free(c);
 
       disable:
 
        printk(KERN_INFO "%s: Controller removed.\n", c->name);
 
-       put_device(c->device.parent);
        put_device(&c->device);
 };