• Home
  • Raw
  • Download

Lines Matching refs:cd

172 static void print_ddcb_info(struct genwqe_dev *cd, struct ddcb_queue *queue)  in print_ddcb_info()  argument
177 struct pci_dev *pci_dev = cd->pci_dev; in print_ddcb_info()
179 spin_lock_irqsave(&cd->print_lock, flags); in print_ddcb_info()
183 cd->card_idx, queue->ddcb_act, queue->ddcb_next); in print_ddcb_info()
199 spin_unlock_irqrestore(&cd->print_lock, flags); in print_ddcb_info()
250 static int ddcb_requ_finished(struct genwqe_dev *cd, struct ddcb_requ *req) in ddcb_requ_finished() argument
253 (cd->card_state != GENWQE_CARD_USED); in ddcb_requ_finished()
274 static int enqueue_ddcb(struct genwqe_dev *cd, struct ddcb_queue *queue, in enqueue_ddcb() argument
321 __genwqe_writeq(cd, queue->IO_QUEUE_OFFSET, num); /* start queue */ in enqueue_ddcb()
371 static int genwqe_check_ddcb_queue(struct genwqe_dev *cd, in genwqe_check_ddcb_queue() argument
376 struct pci_dev *pci_dev = cd->pci_dev; in genwqe_check_ddcb_queue()
416 errcnts = __genwqe_readq(cd, queue->IO_QUEUE_ERRCNTS); in genwqe_check_ddcb_queue()
417 status = __genwqe_readq(cd, queue->IO_QUEUE_STATUS); in genwqe_check_ddcb_queue()
483 int __genwqe_wait_ddcb(struct genwqe_dev *cd, struct ddcb_requ *req) in __genwqe_wait_ddcb() argument
488 struct pci_dev *pci_dev = cd->pci_dev; in __genwqe_wait_ddcb()
502 ddcb_requ_finished(cd, req), in __genwqe_wait_ddcb()
520 genwqe_check_ddcb_queue(cd, req->queue); in __genwqe_wait_ddcb()
521 if (ddcb_requ_finished(cd, req)) in __genwqe_wait_ddcb()
530 __genwqe_readq(cd, queue->IO_QUEUE_STATUS)); in __genwqe_wait_ddcb()
535 print_ddcb_info(cd, req->queue); in __genwqe_wait_ddcb()
553 if (cd->card_state != GENWQE_CARD_USED) { in __genwqe_wait_ddcb()
571 static struct ddcb *get_next_ddcb(struct genwqe_dev *cd, in get_next_ddcb() argument
624 int __genwqe_purge_ddcb(struct genwqe_dev *cd, struct ddcb_requ *req) in __genwqe_purge_ddcb() argument
630 struct pci_dev *pci_dev = cd->pci_dev; in __genwqe_purge_ddcb()
714 queue_status = __genwqe_readq(cd, queue->IO_QUEUE_STATUS); in __genwqe_purge_ddcb()
724 print_ddcb_info(cd, req->queue); in __genwqe_purge_ddcb()
729 int genwqe_init_debug_data(struct genwqe_dev *cd, struct genwqe_debug_data *d) in genwqe_init_debug_data() argument
732 struct pci_dev *pci_dev = cd->pci_dev; in genwqe_init_debug_data()
743 d->slu_unitcfg = cd->slu_unitcfg; in genwqe_init_debug_data()
744 d->app_unitcfg = cd->app_unitcfg; in genwqe_init_debug_data()
758 int __genwqe_enqueue_ddcb(struct genwqe_dev *cd, struct ddcb_requ *req, in __genwqe_enqueue_ddcb() argument
764 struct pci_dev *pci_dev = cd->pci_dev; in __genwqe_enqueue_ddcb()
768 if (cd->card_state != GENWQE_CARD_USED) { in __genwqe_enqueue_ddcb()
776 queue = req->queue = &cd->queue; in __genwqe_enqueue_ddcb()
782 genwqe_check_ddcb_queue(cd, queue); in __genwqe_enqueue_ddcb()
791 pddcb = get_next_ddcb(cd, queue, &req->num); /* get ptr and num */ in __genwqe_enqueue_ddcb()
836 if ((cd->slu_unitcfg & 0xFFFF0ull) > 0x34199ull) in __genwqe_enqueue_ddcb()
859 if (genwqe_get_slu_id(cd) <= 0x2) { in __genwqe_enqueue_ddcb()
891 genwqe_init_debug_data(cd, &req->debug_data); in __genwqe_enqueue_ddcb()
896 enqueue_ddcb(cd, queue, pddcb, req->num); in __genwqe_enqueue_ddcb()
904 wake_up_interruptible(&cd->queue_waitq); in __genwqe_enqueue_ddcb()
915 int __genwqe_execute_raw_ddcb(struct genwqe_dev *cd, in __genwqe_execute_raw_ddcb() argument
920 struct pci_dev *pci_dev = cd->pci_dev; in __genwqe_execute_raw_ddcb()
933 rc = __genwqe_enqueue_ddcb(cd, req, f_flags); in __genwqe_execute_raw_ddcb()
937 rc = __genwqe_wait_ddcb(cd, req); in __genwqe_execute_raw_ddcb()
963 __genwqe_purge_ddcb(cd, req); in __genwqe_execute_raw_ddcb()
980 static int genwqe_next_ddcb_ready(struct genwqe_dev *cd) in genwqe_next_ddcb_ready() argument
984 struct ddcb_queue *queue = &cd->queue; in genwqe_next_ddcb_ready()
1010 int genwqe_ddcbs_in_flight(struct genwqe_dev *cd) in genwqe_ddcbs_in_flight() argument
1014 struct ddcb_queue *queue = &cd->queue; in genwqe_ddcbs_in_flight()
1023 static int setup_ddcb_queue(struct genwqe_dev *cd, struct ddcb_queue *queue) in setup_ddcb_queue() argument
1029 struct pci_dev *pci_dev = cd->pci_dev; in setup_ddcb_queue()
1044 queue->ddcb_vaddr = __genwqe_alloc_consistent(cd, queue_size, in setup_ddcb_queue()
1083 __genwqe_writeq(cd, queue->IO_QUEUE_CONFIG, 0x07); /* iCRC/vCRC */ in setup_ddcb_queue()
1084 __genwqe_writeq(cd, queue->IO_QUEUE_SEGMENT, queue->ddcb_daddr); in setup_ddcb_queue()
1085 __genwqe_writeq(cd, queue->IO_QUEUE_INITSQN, queue->ddcb_seq); in setup_ddcb_queue()
1086 __genwqe_writeq(cd, queue->IO_QUEUE_WRAP, val64); in setup_ddcb_queue()
1093 __genwqe_free_consistent(cd, queue_size, queue->ddcb_vaddr, in setup_ddcb_queue()
1106 static void free_ddcb_queue(struct genwqe_dev *cd, struct ddcb_queue *queue) in free_ddcb_queue() argument
1116 __genwqe_free_consistent(cd, queue_size, queue->ddcb_vaddr, in free_ddcb_queue()
1126 struct genwqe_dev *cd = (struct genwqe_dev *)dev_id; in genwqe_pf_isr() local
1127 struct pci_dev *pci_dev = cd->pci_dev; in genwqe_pf_isr()
1133 cd->irqs_processed++; in genwqe_pf_isr()
1134 wake_up_interruptible(&cd->queue_waitq); in genwqe_pf_isr()
1140 gfir = __genwqe_readq(cd, IO_SLC_CFGREG_GFIR); in genwqe_pf_isr()
1144 if (cd->use_platform_recovery) { in genwqe_pf_isr()
1150 readq(cd->mmio + IO_SLC_CFGREG_GFIR); in genwqe_pf_isr()
1157 wake_up_interruptible(&cd->health_waitq); in genwqe_pf_isr()
1174 struct genwqe_dev *cd = (struct genwqe_dev *)dev_id; in genwqe_vf_isr() local
1176 cd->irqs_processed++; in genwqe_vf_isr()
1177 wake_up_interruptible(&cd->queue_waitq); in genwqe_vf_isr()
1193 struct genwqe_dev *cd = (struct genwqe_dev *)data; in genwqe_card_thread() local
1197 genwqe_check_ddcb_queue(cd, &cd->queue); in genwqe_card_thread()
1201 cd->queue_waitq, in genwqe_card_thread()
1202 genwqe_ddcbs_in_flight(cd) || in genwqe_card_thread()
1206 cd->queue_waitq, in genwqe_card_thread()
1207 genwqe_next_ddcb_ready(cd) || in genwqe_card_thread()
1230 int genwqe_setup_service_layer(struct genwqe_dev *cd) in genwqe_setup_service_layer() argument
1234 struct pci_dev *pci_dev = cd->pci_dev; in genwqe_setup_service_layer()
1236 if (genwqe_is_privileged(cd)) { in genwqe_setup_service_layer()
1237 rc = genwqe_card_reset(cd); in genwqe_setup_service_layer()
1243 genwqe_read_softreset(cd); in genwqe_setup_service_layer()
1246 queue = &cd->queue; in genwqe_setup_service_layer()
1257 rc = setup_ddcb_queue(cd, queue); in genwqe_setup_service_layer()
1263 init_waitqueue_head(&cd->queue_waitq); in genwqe_setup_service_layer()
1264 cd->card_thread = kthread_run(genwqe_card_thread, cd, in genwqe_setup_service_layer()
1266 cd->card_idx); in genwqe_setup_service_layer()
1267 if (IS_ERR(cd->card_thread)) { in genwqe_setup_service_layer()
1268 rc = PTR_ERR(cd->card_thread); in genwqe_setup_service_layer()
1269 cd->card_thread = NULL; in genwqe_setup_service_layer()
1273 rc = genwqe_set_interrupt_capability(cd, GENWQE_MSI_IRQS); in genwqe_setup_service_layer()
1282 init_waitqueue_head(&cd->health_waitq); in genwqe_setup_service_layer()
1284 if (genwqe_is_privileged(cd)) { in genwqe_setup_service_layer()
1286 GENWQE_DEVNAME, cd); in genwqe_setup_service_layer()
1289 GENWQE_DEVNAME, cd); in genwqe_setup_service_layer()
1296 cd->card_state = GENWQE_CARD_USED; in genwqe_setup_service_layer()
1300 genwqe_reset_interrupt_capability(cd); in genwqe_setup_service_layer()
1302 kthread_stop(cd->card_thread); in genwqe_setup_service_layer()
1303 cd->card_thread = NULL; in genwqe_setup_service_layer()
1305 free_ddcb_queue(cd, queue); in genwqe_setup_service_layer()
1317 static int queue_wake_up_all(struct genwqe_dev *cd) in queue_wake_up_all() argument
1321 struct ddcb_queue *queue = &cd->queue; in queue_wake_up_all()
1342 int genwqe_finish_queue(struct genwqe_dev *cd) in genwqe_finish_queue() argument
1346 struct pci_dev *pci_dev = cd->pci_dev; in genwqe_finish_queue()
1347 struct ddcb_queue *queue = &cd->queue; in genwqe_finish_queue()
1353 if (cd->card_state == GENWQE_CARD_USED) in genwqe_finish_queue()
1354 cd->card_state = GENWQE_CARD_UNUSED; in genwqe_finish_queue()
1358 queue_wake_up_all(cd); in genwqe_finish_queue()
1362 in_flight = genwqe_ddcbs_in_flight(cd); in genwqe_finish_queue()
1394 int genwqe_release_service_layer(struct genwqe_dev *cd) in genwqe_release_service_layer() argument
1396 struct pci_dev *pci_dev = cd->pci_dev; in genwqe_release_service_layer()
1398 if (!ddcb_queue_initialized(&cd->queue)) in genwqe_release_service_layer()
1401 free_irq(pci_dev->irq, cd); in genwqe_release_service_layer()
1402 genwqe_reset_interrupt_capability(cd); in genwqe_release_service_layer()
1404 if (cd->card_thread != NULL) { in genwqe_release_service_layer()
1405 kthread_stop(cd->card_thread); in genwqe_release_service_layer()
1406 cd->card_thread = NULL; in genwqe_release_service_layer()
1409 free_ddcb_queue(cd, &cd->queue); in genwqe_release_service_layer()