• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/drivers/s390/crypto/

Lines Matching refs:ap_dev

349 	struct ap_device *ap_dev = to_ap_dev(dev);
350 return snprintf(buf, PAGE_SIZE, "%d\n", ap_dev->device_type);
357 struct ap_device *ap_dev = to_ap_dev(dev);
358 return snprintf(buf, PAGE_SIZE, "%d\n", ap_dev->queue_depth);
366 struct ap_device *ap_dev = to_ap_dev(dev);
369 spin_lock_bh(&ap_dev->lock);
370 rc = snprintf(buf, PAGE_SIZE, "%d\n", ap_dev->total_request_count);
371 spin_unlock_bh(&ap_dev->lock);
401 struct ap_device *ap_dev = to_ap_dev(dev);
411 (id->dev_type != ap_dev->device_type))
425 struct ap_device *ap_dev = to_ap_dev(dev);
428 if (!ap_dev)
434 "DEV_TYPE=%04X", ap_dev->device_type);
441 "MODALIAS=ap:t%02X", ap_dev->device_type);
455 struct ap_device *ap_dev = to_ap_dev(dev);
459 ap_dev->drv = ap_drv;
461 list_add(&ap_dev->list, &ap_device_list);
463 rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV;
469 * @ap_dev: pointer to the AP device.
471 static void __ap_flush_queue(struct ap_device *ap_dev)
475 list_for_each_entry_safe(ap_msg, next, &ap_dev->pendingq, list) {
477 ap_dev->pendingq_count--;
478 ap_dev->drv->receive(ap_dev, ap_msg, ERR_PTR(-ENODEV));
480 list_for_each_entry_safe(ap_msg, next, &ap_dev->requestq, list) {
482 ap_dev->requestq_count--;
483 ap_dev->drv->receive(ap_dev, ap_msg, ERR_PTR(-ENODEV));
487 void ap_flush_queue(struct ap_device *ap_dev)
489 spin_lock_bh(&ap_dev->lock);
490 __ap_flush_queue(ap_dev);
491 spin_unlock_bh(&ap_dev->lock);
497 struct ap_device *ap_dev = to_ap_dev(dev);
498 struct ap_driver *ap_drv = ap_dev->drv;
500 ap_flush_queue(ap_dev);
502 ap_drv->remove(ap_dev);
504 list_del_init(&ap_dev->list);
506 spin_lock_bh(&ap_dev->lock);
507 atomic_sub(ap_dev->queue_count, &ap_poll_requests);
508 spin_unlock_bh(&ap_dev->lock);
637 * @ap_dev: pointer to the AP device.
639 static int ap_probe_device_type(struct ap_device *ap_dev)
699 status = __ap_send(ap_dev->qid, 0x0102030405060708ULL,
709 status = __ap_recv(ap_dev->qid, &psmid, reply, 4096);
717 ap_dev->device_type = AP_DEVICE_TYPE_PCICC;
719 ap_dev->device_type = AP_DEVICE_TYPE_PCICA;
740 struct ap_device *ap_dev = to_ap_dev(dev);
742 kfree(ap_dev);
747 struct ap_device *ap_dev;
762 ap_dev = to_ap_dev(dev);
763 spin_lock_bh(&ap_dev->lock);
764 if (rc || ap_dev->unregistered) {
765 spin_unlock_bh(&ap_dev->lock);
770 spin_unlock_bh(&ap_dev->lock);
781 ap_dev = kzalloc(sizeof(*ap_dev), GFP_KERNEL);
782 if (!ap_dev)
784 ap_dev->qid = qid;
785 ap_dev->queue_depth = queue_depth;
786 ap_dev->unregistered = 1;
787 spin_lock_init(&ap_dev->lock);
788 INIT_LIST_HEAD(&ap_dev->pendingq);
789 INIT_LIST_HEAD(&ap_dev->requestq);
790 INIT_LIST_HEAD(&ap_dev->list);
792 ap_probe_device_type(ap_dev);
794 ap_dev->device_type = device_type;
796 ap_dev->device.bus = &ap_bus_type;
797 ap_dev->device.parent = ap_root_device;
798 snprintf(ap_dev->device.bus_id, BUS_ID_SIZE, "card%02x",
799 AP_QID_DEVICE(ap_dev->qid));
800 ap_dev->device.release = ap_device_release;
801 rc = device_register(&ap_dev->device);
803 kfree(ap_dev);
807 rc = sysfs_create_group(&ap_dev->device.kobj,
810 spin_lock_bh(&ap_dev->lock);
811 ap_dev->unregistered = 0;
812 spin_unlock_bh(&ap_dev->lock);
815 device_unregister(&ap_dev->device);
839 * @ap_dev: pointer to the AP device
844 static int ap_poll_read(struct ap_device *ap_dev, unsigned long *flags)
849 if (ap_dev->queue_count <= 0)
851 status = __ap_recv(ap_dev->qid, &ap_dev->reply->psmid,
852 ap_dev->reply->message, ap_dev->reply->length);
856 ap_dev->queue_count--;
857 list_for_each_entry(ap_msg, &ap_dev->pendingq, list) {
858 if (ap_msg->psmid != ap_dev->reply->psmid)
861 ap_dev->pendingq_count--;
862 ap_dev->drv->receive(ap_dev, ap_msg, ap_dev->reply);
865 if (ap_dev->queue_count > 0)
871 atomic_sub(ap_dev->queue_count, &ap_poll_requests);
872 ap_dev->queue_count = 0;
873 list_splice_init(&ap_dev->pendingq, &ap_dev->requestq);
874 ap_dev->requestq_count += ap_dev->pendingq_count;
875 ap_dev->pendingq_count = 0;
887 * @ap_dev: pointer to the AP device
892 static int ap_poll_write(struct ap_device *ap_dev, unsigned long *flags)
897 if (ap_dev->requestq_count <= 0 ||
898 ap_dev->queue_count >= ap_dev->queue_depth)
901 ap_msg = list_entry(ap_dev->requestq.next, struct ap_message, list);
902 status = __ap_send(ap_dev->qid, ap_msg->psmid,
907 ap_dev->queue_count++;
908 list_move_tail(&ap_msg->list, &ap_dev->pendingq);
909 ap_dev->requestq_count--;
910 ap_dev->pendingq_count++;
911 if (ap_dev->queue_count < ap_dev->queue_depth &&
912 ap_dev->requestq_count > 0)
930 * @ap_dev: pointer to the bus device
935 static inline int ap_poll_queue(struct ap_device *ap_dev, unsigned long *flags)
939 rc = ap_poll_read(ap_dev, flags);
942 return ap_poll_write(ap_dev, flags);
947 * @ap_dev: pointer to the AP device
950 static int __ap_queue_message(struct ap_device *ap_dev, struct ap_message *ap_msg)
954 if (list_empty(&ap_dev->requestq) &&
955 ap_dev->queue_count < ap_dev->queue_depth) {
956 status = __ap_send(ap_dev->qid, ap_msg->psmid,
960 list_add_tail(&ap_msg->list, &ap_dev->pendingq);
962 ap_dev->pendingq_count++;
963 ap_dev->queue_count++;
964 ap_dev->total_request_count++;
967 list_add_tail(&ap_msg->list, &ap_dev->requestq);
968 ap_dev->requestq_count++;
969 ap_dev->total_request_count++;
972 ap_dev->drv->receive(ap_dev, ap_msg, ERR_PTR(-EINVAL));
975 ap_dev->drv->receive(ap_dev, ap_msg, ERR_PTR(-ENODEV));
979 list_add_tail(&ap_msg->list, &ap_dev->requestq);
980 ap_dev->requestq_count++;
981 ap_dev->total_request_count++;
988 void ap_queue_message(struct ap_device *ap_dev, struct ap_message *ap_msg)
993 spin_lock_bh(&ap_dev->lock);
994 if (!ap_dev->unregistered) {
996 rc = ap_poll_queue(ap_dev, &flags);
998 rc = __ap_queue_message(ap_dev, ap_msg);
1002 ap_dev->unregistered = 1;
1004 ap_dev->drv->receive(ap_dev, ap_msg, ERR_PTR(-ENODEV));
1007 spin_unlock_bh(&ap_dev->lock);
1009 device_unregister(&ap_dev->device);
1018 * @ap_dev: AP device that has the message queued
1021 void ap_cancel_message(struct ap_device *ap_dev, struct ap_message *ap_msg)
1025 spin_lock_bh(&ap_dev->lock);
1027 list_for_each_entry(tmp, &ap_dev->pendingq, list)
1029 ap_dev->pendingq_count--;
1032 ap_dev->requestq_count--;
1036 spin_unlock_bh(&ap_dev->lock);
1053 static int __ap_poll_all(struct ap_device *ap_dev, unsigned long *flags)
1055 spin_lock(&ap_dev->lock);
1056 if (!ap_dev->unregistered) {
1057 if (ap_poll_queue(ap_dev, flags))
1058 ap_dev->unregistered = 1;
1060 spin_unlock(&ap_dev->lock);
1067 struct ap_device *ap_dev;
1072 list_for_each_entry(ap_dev, &ap_device_list, list) {
1073 __ap_poll_all(ap_dev, &flags);
1093 struct ap_device *ap_dev;
1113 list_for_each_entry(ap_dev, &ap_device_list, list) {
1114 __ap_poll_all(ap_dev, &flags);