Lines Matching defs:cdev
59 struct ccw_device *cdev;
311 spin_lock_irqsave(get_ccwdev_lock(vcdev->cdev), flags);
316 spin_unlock_irqrestore(get_ccwdev_lock(vcdev->cdev), flags);
329 spin_lock_irqsave(get_ccwdev_lock(vcdev->cdev), flags);
330 ret = ccw_device_start(vcdev->cdev, ccw, intparm, 0, 0);
336 spin_unlock_irqrestore(get_ccwdev_lock(vcdev->cdev), flags);
354 thinint_area = ccw_device_dma_zalloc(vcdev->cdev,
366 indicatorp = ccw_device_dma_zalloc(vcdev->cdev,
383 dev_info(&vcdev->cdev->dev,
387 ccw_device_dma_free(vcdev->cdev, indicatorp, sizeof(indicators(vcdev)));
388 ccw_device_dma_free(vcdev->cdev, thinint_area, sizeof(*thinint_area));
423 ccw_device_get_schid(vcdev->cdev, &schid);
488 ccw_device_dma_free(vcdev->cdev, info->info_block,
499 ccw = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*ccw));
508 ccw_device_dma_free(vcdev->cdev, ccw, sizeof(*ccw));
527 dev_warn(&vcdev->cdev->dev, "no info\n");
531 info->info_block = ccw_device_dma_zalloc(vcdev->cdev,
534 dev_warn(&vcdev->cdev->dev, "no info block\n");
550 dev_warn(&vcdev->cdev->dev, "no vq\n");
578 dev_warn(&vcdev->cdev->dev, "SET_VQ failed\n");
596 ccw_device_dma_free(vcdev->cdev, info->info_block,
611 thinint_area = ccw_device_dma_zalloc(vcdev->cdev,
643 dev_warn(&vcdev->cdev->dev,
648 ccw_device_dma_free(vcdev->cdev, thinint_area, sizeof(*thinint_area));
664 ccw = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*ccw));
688 indicatorp = ccw_device_dma_zalloc(vcdev->cdev,
722 ccw_device_dma_free(vcdev->cdev, indicatorp,
724 ccw_device_dma_free(vcdev->cdev, ccw, sizeof(*ccw));
728 ccw_device_dma_free(vcdev->cdev, indicatorp,
730 ccw_device_dma_free(vcdev->cdev, ccw, sizeof(*ccw));
740 ccw = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*ccw));
753 ccw_device_dma_free(vcdev->cdev, ccw, sizeof(*ccw));
764 ccw = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*ccw));
768 features = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*features));
801 ccw_device_dma_free(vcdev->cdev, features, sizeof(*features));
802 ccw_device_dma_free(vcdev->cdev, ccw, sizeof(*ccw));
827 ccw = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*ccw));
831 features = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*features));
866 ccw_device_dma_free(vcdev->cdev, features, sizeof(*features));
867 ccw_device_dma_free(vcdev->cdev, ccw, sizeof(*ccw));
881 ccw = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*ccw));
885 config_area = ccw_device_dma_zalloc(vcdev->cdev,
908 ccw_device_dma_free(vcdev->cdev, config_area, VIRTIO_CCW_CONFIG_SIZE);
909 ccw_device_dma_free(vcdev->cdev, ccw, sizeof(*ccw));
921 ccw = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*ccw));
925 config_area = ccw_device_dma_zalloc(vcdev->cdev,
945 ccw_device_dma_free(vcdev->cdev, config_area, VIRTIO_CCW_CONFIG_SIZE);
946 ccw_device_dma_free(vcdev->cdev, ccw, sizeof(*ccw));
958 ccw = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*ccw));
973 ccw_device_dma_free(vcdev->cdev, ccw, sizeof(*ccw));
985 ccw = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*ccw));
999 ccw_device_dma_free(vcdev->cdev, ccw, sizeof(*ccw));
1006 return dev_name(&vcdev->cdev->dev);
1032 ccw_device_dma_free(vcdev->cdev, vcdev->dma_area,
1090 dev_warn(&vcdev->cdev->dev,
1098 static void virtio_ccw_int_handler(struct ccw_device *cdev,
1103 struct virtio_ccw_device *vcdev = dev_get_drvdata(&cdev->dev);
1158 static int virtio_ccw_check_autoonline(struct ccw_device *cdev)
1162 ccw_device_get_id(cdev, &id);
1170 struct ccw_device *cdev = data;
1173 ret = ccw_device_set_online(cdev);
1175 dev_warn(&cdev->dev, "Failed to set online: %d\n", ret);
1178 static int virtio_ccw_probe(struct ccw_device *cdev)
1180 cdev->handler = virtio_ccw_int_handler;
1182 if (virtio_ccw_check_autoonline(cdev))
1183 async_schedule(virtio_ccw_auto_online, cdev);
1187 static struct virtio_ccw_device *virtio_grab_drvdata(struct ccw_device *cdev)
1192 spin_lock_irqsave(get_ccwdev_lock(cdev), flags);
1193 vcdev = dev_get_drvdata(&cdev->dev);
1195 spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
1199 spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
1203 static void virtio_ccw_remove(struct ccw_device *cdev)
1206 struct virtio_ccw_device *vcdev = virtio_grab_drvdata(cdev);
1208 if (vcdev && cdev->online) {
1212 spin_lock_irqsave(get_ccwdev_lock(cdev), flags);
1213 dev_set_drvdata(&cdev->dev, NULL);
1214 spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
1216 cdev->handler = NULL;
1219 static int virtio_ccw_offline(struct ccw_device *cdev)
1222 struct virtio_ccw_device *vcdev = virtio_grab_drvdata(cdev);
1229 spin_lock_irqsave(get_ccwdev_lock(cdev), flags);
1230 dev_set_drvdata(&cdev->dev, NULL);
1231 spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
1241 ccw = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*ccw));
1244 rev = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*rev));
1246 ccw_device_dma_free(vcdev->cdev, ccw, sizeof(*ccw));
1276 ccw_device_dma_free(vcdev->cdev, ccw, sizeof(*ccw));
1277 ccw_device_dma_free(vcdev->cdev, rev, sizeof(*rev));
1281 static int virtio_ccw_online(struct ccw_device *cdev)
1289 dev_warn(&cdev->dev, "Could not get memory for virtio\n");
1293 vcdev->vdev.dev.parent = &cdev->dev;
1294 vcdev->cdev = cdev;
1295 vcdev->dma_area = ccw_device_dma_zalloc(vcdev->cdev,
1311 spin_lock_irqsave(get_ccwdev_lock(cdev), flags);
1312 dev_set_drvdata(&cdev->dev, vcdev);
1313 spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
1314 vcdev->vdev.id.vendor = cdev->id.cu_type;
1315 vcdev->vdev.id.device = cdev->id.cu_model;
1323 dev_warn(&cdev->dev, "Failed to register virtio device: %d\n",
1329 spin_lock_irqsave(get_ccwdev_lock(cdev), flags);
1330 dev_set_drvdata(&cdev->dev, NULL);
1331 spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
1336 ccw_device_dma_free(vcdev->cdev, vcdev->dma_area,
1343 static int virtio_ccw_cio_notify(struct ccw_device *cdev, int event)
1346 struct virtio_ccw_device *vcdev = dev_get_drvdata(&cdev->dev);