ap_dev
rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV;
struct ap_device *ap_dev = to_ap_dev(dev);
ap_drv->remove(ap_dev);
get_device(&aq->ap_dev.device);
device_unregister(&ac->ap_dev.device);
dev = &aq->ap_dev.device;
dev->parent = &ac->ap_dev.device;
ap_send_config_uevent(&aq->ap_dev, aq->config);
ap_send_config_uevent(&aq->ap_dev, aq->config);
ap_send_config_uevent(&ac->ap_dev, ac->config);
ap_send_config_uevent(&ac->ap_dev, ac->config);
dev = &ac->ap_dev.device;
put_device(&ac->ap_dev.device);
const struct ap_device *ap_dev = to_ap_dev(dev);
struct ap_card *ac = to_ap_card(&ap_dev->device);
rc = add_uevent_var(env, "DEV_TYPE=%04X", ap_dev->device_type);
rc = add_uevent_var(env, "MODALIAS=ap:t%02X", ap_dev->device_type);
struct ap_queue *aq = to_ap_queue(&ap_dev->device);
void ap_send_config_uevent(struct ap_device *ap_dev, bool cfg)
kobject_uevent_env(&ap_dev->device.kobj, KOBJ_CHANGE, envp);
void ap_send_online_uevent(struct ap_device *ap_dev, int online)
kobject_uevent_env(&ap_dev->device.kobj, KOBJ_CHANGE, envp);
struct ap_device *ap_dev = &aq->ap_dev;
if (ap_dev->driver_override) {
if (strcmp(ap_dev->driver_override,
const struct device_driver *drv = aq->ap_dev.device.driver;
bool override = !!aq->ap_dev.driver_override;
put_device(&aq->ap_dev.device);
struct ap_device *ap_dev = to_ap_dev(dev);
if (ap_dev->driver_override) {
if (strcmp(ap_dev->driver_override,
struct ap_device ap_dev;
#define to_ap_card(x) container_of((x), struct ap_card, ap_dev.device)
struct ap_device ap_dev;
#define to_ap_queue(x) container_of((x), struct ap_queue, ap_dev.device)
ap_send_config_uevent(&ac->ap_dev, ac->config);
ac->ap_dev.device.release = ap_card_device_release;
ac->ap_dev.device.type = &ap_card_type;
ac->ap_dev.device_type = comp_type;
return sysfs_emit(buf, "%d\n", ac->ap_dev.device_type);
aq->ap_dev.device.release = ap_queue_device_release;
aq->ap_dev.device.type = &ap_queue_type;
aq->ap_dev.device_type = ac->ap_dev.device_type;
aq->ap_dev.device.groups = ap_queue_dev_sb_attr_groups;
struct ap_device *ap_dev = &aq->ap_dev;
if (ap_dev->driver_override)
rc = sysfs_emit(buf, "%s\n", ap_dev->driver_override);
struct ap_device *ap_dev = &aq->ap_dev;
old_value = ap_dev->driver_override ? true : false;
rc = driver_set_override(dev, &ap_dev->driver_override, buf, count);
if (old_value && !ap_dev->driver_override)
else if (!old_value && ap_dev->driver_override)
if (queue->ap_dev.device.driver == &matrix_dev->vfio_ap_drv->driver)
q = dev_get_drvdata(&queue->ap_dev.device);
put_device(&queue->ap_dev.device);
stat->hwtype = zc->card->ap_dev.device_type;
stat->hwtype = zc->card->ap_dev.device_type;
devstat->hwtype = zc->card->ap_dev.device_type;
if (!zq || !try_module_get(zq->queue->ap_dev.device.driver->owner))
get_device(&zq->queue->ap_dev.device);
*pmod = zq->queue->ap_dev.device.driver->owner;
put_device(&zq->queue->ap_dev.device);
ap_send_online_uevent(&zq->queue->ap_dev, online);
rc = sysfs_create_group(&zc->card->ap_dev.device.kobj,
sysfs_remove_group(&zc->card->ap_dev.device.kobj,
ap_send_online_uevent(&ac->ap_dev, online);
static int zcrypt_cex4_card_probe(struct ap_device *ap_dev)
struct ap_card *ac = to_ap_card(&ap_dev->device);
dev_set_drvdata(&ap_dev->device, zc);
if (ac->ap_dev.device_type == AP_DEVICE_TYPE_CEX4) {
} else if (ac->ap_dev.device_type == AP_DEVICE_TYPE_CEX5) {
} else if (ac->ap_dev.device_type == AP_DEVICE_TYPE_CEX6) {
} else if (ac->ap_dev.device_type == AP_DEVICE_TYPE_CEX7) {
if (ac->ap_dev.device_type == AP_DEVICE_TYPE_CEX4) {
} else if (ac->ap_dev.device_type == AP_DEVICE_TYPE_CEX5) {
} else if (ac->ap_dev.device_type == AP_DEVICE_TYPE_CEX6) {
} else if (ac->ap_dev.device_type == AP_DEVICE_TYPE_CEX7) {
if (ac->ap_dev.device_type == AP_DEVICE_TYPE_CEX4) {
} else if (ac->ap_dev.device_type == AP_DEVICE_TYPE_CEX5) {
} else if (ac->ap_dev.device_type == AP_DEVICE_TYPE_CEX6) {
} else if (ac->ap_dev.device_type == AP_DEVICE_TYPE_CEX7) {
rc = sysfs_create_group(&ap_dev->device.kobj,
rc = sysfs_create_group(&ap_dev->device.kobj,
static void zcrypt_cex4_card_remove(struct ap_device *ap_dev)
struct zcrypt_card *zc = dev_get_drvdata(&ap_dev->device);
struct ap_card *ac = to_ap_card(&ap_dev->device);
sysfs_remove_group(&ap_dev->device.kobj, &cca_card_attr_grp);
sysfs_remove_group(&ap_dev->device.kobj, &ep11_card_attr_grp);
static int zcrypt_cex4_queue_probe(struct ap_device *ap_dev)
struct ap_queue *aq = to_ap_queue(&ap_dev->device);
dev_set_drvdata(&ap_dev->device, zq);
rc = sysfs_create_group(&ap_dev->device.kobj,
rc = sysfs_create_group(&ap_dev->device.kobj,
static void zcrypt_cex4_queue_remove(struct ap_device *ap_dev)
struct zcrypt_queue *zq = dev_get_drvdata(&ap_dev->device);
struct ap_queue *aq = to_ap_queue(&ap_dev->device);
sysfs_remove_group(&ap_dev->device.kobj, &cca_queue_attr_grp);
sysfs_remove_group(&ap_dev->device.kobj, &ep11_queue_attr_grp);
ap_send_online_uevent(&zq->queue->ap_dev, zq->online);
ap_send_online_uevent(&zq->queue->ap_dev, zq->online);
ap_send_online_uevent(&zq->queue->ap_dev, zq->online);
ap_send_online_uevent(&zq->queue->ap_dev, zq->online);
ap_send_online_uevent(&zq->queue->ap_dev, zq->online);
ap_send_online_uevent(&zq->queue->ap_dev, zq->online);
ap_send_online_uevent(&zq->queue->ap_dev, zq->online);
zc = dev_get_drvdata(&zq->queue->card->ap_dev.device);
rc = sysfs_create_group(&zq->queue->ap_dev.device.kobj,
sysfs_remove_group(&zq->queue->ap_dev.device.kobj,
sysfs_remove_group(&zq->queue->ap_dev.device.kobj,
ap_send_online_uevent(&aq->ap_dev, online);