Lines Matching refs:ch
191 void ctcm_ccw_check_rc(struct channel *ch, int rc, char *msg) in ctcm_ccw_check_rc() argument
195 CTCM_FUNTAIL, ch->id, msg, rc); in ctcm_ccw_check_rc()
199 ch->id); in ctcm_ccw_check_rc()
200 fsm_event(ch->fsm, CTC_EVENT_IO_EBUSY, ch); in ctcm_ccw_check_rc()
204 ch->id); in ctcm_ccw_check_rc()
205 fsm_event(ch->fsm, CTC_EVENT_IO_ENODEV, ch); in ctcm_ccw_check_rc()
210 fsm_event(ch->fsm, CTC_EVENT_IO_UNKNOWN, ch); in ctcm_ccw_check_rc()
248 struct channel *ch = arg; in chx_txdone() local
249 struct net_device *dev = ch->netdev; in chx_txdone()
257 CTCM_PR_DEBUG("%s(%s): %s\n", __func__, ch->id, dev->name); in chx_txdone()
259 duration = done_stamp - ch->prof.send_stamp; in chx_txdone()
260 if (duration > ch->prof.tx_time) in chx_txdone()
261 ch->prof.tx_time = duration; in chx_txdone()
263 if (ch->irb->scsw.cmd.count != 0) in chx_txdone()
266 CTCM_FUNTAIL, dev->name, ch->irb->scsw.cmd.count); in chx_txdone()
267 fsm_deltimer(&ch->timer); in chx_txdone()
268 while ((skb = skb_dequeue(&ch->io_queue))) { in chx_txdone()
278 spin_lock(&ch->collect_lock); in chx_txdone()
279 clear_normalized_cda(&ch->ccw[4]); in chx_txdone()
280 if (ch->collect_len > 0) { in chx_txdone()
283 if (ctcm_checkalloc_buffer(ch)) { in chx_txdone()
284 spin_unlock(&ch->collect_lock); in chx_txdone()
287 ch->trans_skb->data = ch->trans_skb_data; in chx_txdone()
288 skb_reset_tail_pointer(ch->trans_skb); in chx_txdone()
289 ch->trans_skb->len = 0; in chx_txdone()
290 if (ch->prof.maxmulti < (ch->collect_len + 2)) in chx_txdone()
291 ch->prof.maxmulti = ch->collect_len + 2; in chx_txdone()
292 if (ch->prof.maxcqueue < skb_queue_len(&ch->collect_queue)) in chx_txdone()
293 ch->prof.maxcqueue = skb_queue_len(&ch->collect_queue); in chx_txdone()
294 *((__u16 *)skb_put(ch->trans_skb, 2)) = ch->collect_len + 2; in chx_txdone()
296 while ((skb = skb_dequeue(&ch->collect_queue))) { in chx_txdone()
298 skb_put(ch->trans_skb, skb->len), skb->len); in chx_txdone()
305 ch->collect_len = 0; in chx_txdone()
306 spin_unlock(&ch->collect_lock); in chx_txdone()
307 ch->ccw[1].count = ch->trans_skb->len; in chx_txdone()
308 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in chx_txdone()
309 ch->prof.send_stamp = jiffies; in chx_txdone()
310 rc = ccw_device_start(ch->cdev, &ch->ccw[0], 0, 0xff, 0); in chx_txdone()
311 ch->prof.doios_multi++; in chx_txdone()
315 fsm_deltimer(&ch->timer); in chx_txdone()
316 ctcm_ccw_check_rc(ch, rc, "chained TX"); in chx_txdone()
319 spin_unlock(&ch->collect_lock); in chx_txdone()
336 struct channel *ch = arg; in ctcm_chx_txidle() local
337 struct net_device *dev = ch->netdev; in ctcm_chx_txidle()
340 CTCM_PR_DEBUG("%s(%s): %s\n", __func__, ch->id, dev->name); in ctcm_chx_txidle()
342 fsm_deltimer(&ch->timer); in ctcm_chx_txidle()
344 fsm_event(priv->fsm, DEV_EVENT_TXUP, ch->netdev); in ctcm_chx_txidle()
357 struct channel *ch = arg; in chx_rx() local
358 struct net_device *dev = ch->netdev; in chx_rx()
360 int len = ch->max_bufsize - ch->irb->scsw.cmd.count; in chx_rx()
361 struct sk_buff *skb = ch->trans_skb; in chx_rx()
366 fsm_deltimer(&ch->timer); in chx_rx()
375 if (len > ch->max_bufsize) { in chx_rx()
378 CTCM_FUNTAIL, dev->name, len, ch->max_bufsize); in chx_rx()
387 switch (ch->protocol) { in chx_rx()
410 ctcm_unpack_skb(ch, skb); in chx_rx()
413 skb->data = ch->trans_skb_data; in chx_rx()
416 if (ctcm_checkalloc_buffer(ch)) in chx_rx()
418 ch->ccw[1].count = ch->max_bufsize; in chx_rx()
419 rc = ccw_device_start(ch->cdev, &ch->ccw[0], 0, 0xff, 0); in chx_rx()
421 ctcm_ccw_check_rc(ch, rc, "normal RX"); in chx_rx()
434 struct channel *ch = arg; in chx_firstio() local
439 CTCM_FUNTAIL, ch->id, fsmstate); in chx_firstio()
441 ch->sense_rc = 0; /* reset unit check report control */ in chx_firstio()
445 CTCM_FUNTAIL, ch->id); in chx_firstio()
446 fsm_deltimer(&ch->timer); in chx_firstio()
447 if (ctcm_checkalloc_buffer(ch)) in chx_firstio()
450 (ch->protocol == CTCM_PROTO_OS390)) { in chx_firstio()
452 if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { in chx_firstio()
453 *((__u16 *)ch->trans_skb->data) = CTCM_INITIAL_BLOCKLEN; in chx_firstio()
454 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, in chx_firstio()
455 CTC_EVENT_TIMER, ch); in chx_firstio()
458 struct net_device *dev = ch->netdev; in chx_firstio()
470 if ((CHANNEL_DIRECTION(ch->flags) == CTCM_WRITE) || in chx_firstio()
471 (ch->protocol != CTCM_PROTO_S390)) in chx_firstio()
472 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in chx_firstio()
474 *((__u16 *)ch->trans_skb->data) = CTCM_INITIAL_BLOCKLEN; in chx_firstio()
475 ch->ccw[1].count = 2; /* Transfer only length */ in chx_firstio()
477 fsm_newstate(fi, (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) in chx_firstio()
479 rc = ccw_device_start(ch->cdev, &ch->ccw[0], 0, 0xff, 0); in chx_firstio()
481 fsm_deltimer(&ch->timer); in chx_firstio()
483 ctcm_ccw_check_rc(ch, rc, "init IO"); in chx_firstio()
492 if ((CHANNEL_DIRECTION(ch->flags) == CTCM_READ) && in chx_firstio()
493 (ch->protocol == CTCM_PROTO_S390)) { in chx_firstio()
494 struct net_device *dev = ch->netdev; in chx_firstio()
511 struct channel *ch = arg; in chx_rxidle() local
512 struct net_device *dev = ch->netdev; in chx_rxidle()
517 fsm_deltimer(&ch->timer); in chx_rxidle()
518 buflen = *((__u16 *)ch->trans_skb->data); in chx_rxidle()
523 if (ctcm_checkalloc_buffer(ch)) in chx_rxidle()
525 ch->ccw[1].count = ch->max_bufsize; in chx_rxidle()
527 rc = ccw_device_start(ch->cdev, &ch->ccw[0], 0, 0xff, 0); in chx_rxidle()
530 ctcm_ccw_check_rc(ch, rc, "initial RX"); in chx_rxidle()
550 struct channel *ch = arg; in ctcm_chx_setmode() local
555 fsm_deltimer(&ch->timer); in ctcm_chx_setmode()
556 if (IS_MPC(ch)) { in ctcm_chx_setmode()
559 __func__, smp_processor_id(), ch, ch->id); in ctcm_chx_setmode()
561 fsm_addtimer(&ch->timer, timeout, CTC_EVENT_TIMER, ch); in ctcm_chx_setmode()
563 CTCM_CCW_DUMP((char *)&ch->ccw[6], sizeof(struct ccw1) * 2); in ctcm_chx_setmode()
566 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_setmode()
570 rc = ccw_device_start(ch->cdev, &ch->ccw[6], 0, 0xff, 0); in ctcm_chx_setmode()
572 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_setmode()
574 fsm_deltimer(&ch->timer); in ctcm_chx_setmode()
576 ctcm_ccw_check_rc(ch, rc, "set Mode"); in ctcm_chx_setmode()
578 ch->retry = 0; in ctcm_chx_setmode()
590 struct channel *ch = arg; in ctcm_chx_start() local
595 CTCM_FUNTAIL, ch->id, in ctcm_chx_start()
596 (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? "RX" : "TX"); in ctcm_chx_start()
598 if (ch->trans_skb != NULL) { in ctcm_chx_start()
599 clear_normalized_cda(&ch->ccw[1]); in ctcm_chx_start()
600 dev_kfree_skb(ch->trans_skb); in ctcm_chx_start()
601 ch->trans_skb = NULL; in ctcm_chx_start()
603 if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { in ctcm_chx_start()
604 ch->ccw[1].cmd_code = CCW_CMD_READ; in ctcm_chx_start()
605 ch->ccw[1].flags = CCW_FLAG_SLI; in ctcm_chx_start()
606 ch->ccw[1].count = 0; in ctcm_chx_start()
608 ch->ccw[1].cmd_code = CCW_CMD_WRITE; in ctcm_chx_start()
609 ch->ccw[1].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in ctcm_chx_start()
610 ch->ccw[1].count = 0; in ctcm_chx_start()
612 if (ctcm_checkalloc_buffer(ch)) { in ctcm_chx_start()
616 CTCM_FUNTAIL, ch->id, in ctcm_chx_start()
617 (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? in ctcm_chx_start()
620 ch->ccw[0].cmd_code = CCW_CMD_PREPARE; in ctcm_chx_start()
621 ch->ccw[0].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in ctcm_chx_start()
622 ch->ccw[0].count = 0; in ctcm_chx_start()
623 ch->ccw[0].cda = 0; in ctcm_chx_start()
624 ch->ccw[2].cmd_code = CCW_CMD_NOOP; /* jointed CE + DE */ in ctcm_chx_start()
625 ch->ccw[2].flags = CCW_FLAG_SLI; in ctcm_chx_start()
626 ch->ccw[2].count = 0; in ctcm_chx_start()
627 ch->ccw[2].cda = 0; in ctcm_chx_start()
628 memcpy(&ch->ccw[3], &ch->ccw[0], sizeof(struct ccw1) * 3); in ctcm_chx_start()
629 ch->ccw[4].cda = 0; in ctcm_chx_start()
630 ch->ccw[4].flags &= ~CCW_FLAG_IDA; in ctcm_chx_start()
633 fsm_addtimer(&ch->timer, 1000, CTC_EVENT_TIMER, ch); in ctcm_chx_start()
634 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_start()
635 rc = ccw_device_halt(ch->cdev, 0); in ctcm_chx_start()
636 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_start()
639 fsm_deltimer(&ch->timer); in ctcm_chx_start()
640 ctcm_ccw_check_rc(ch, rc, "initial HaltIO"); in ctcm_chx_start()
653 struct channel *ch = arg; in ctcm_chx_haltio() local
658 fsm_deltimer(&ch->timer); in ctcm_chx_haltio()
659 if (IS_MPC(ch)) in ctcm_chx_haltio()
660 fsm_deltimer(&ch->sweep_timer); in ctcm_chx_haltio()
662 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in ctcm_chx_haltio()
665 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_haltio()
670 rc = ccw_device_halt(ch->cdev, 0); in ctcm_chx_haltio()
673 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_haltio()
677 fsm_deltimer(&ch->timer); in ctcm_chx_haltio()
680 ctcm_ccw_check_rc(ch, rc, (char *)__func__); in ctcm_chx_haltio()
694 struct channel *ch) in ctcm_chx_cleanup() argument
696 struct net_device *dev = ch->netdev; in ctcm_chx_cleanup()
701 CTCM_FUNTAIL, dev->name, ch->id, state); in ctcm_chx_cleanup()
703 fsm_deltimer(&ch->timer); in ctcm_chx_cleanup()
704 if (IS_MPC(ch)) in ctcm_chx_cleanup()
705 fsm_deltimer(&ch->sweep_timer); in ctcm_chx_cleanup()
708 if (state == CTC_STATE_STOPPED && ch->trans_skb != NULL) { in ctcm_chx_cleanup()
709 clear_normalized_cda(&ch->ccw[1]); in ctcm_chx_cleanup()
710 dev_kfree_skb_any(ch->trans_skb); in ctcm_chx_cleanup()
711 ch->trans_skb = NULL; in ctcm_chx_cleanup()
714 ch->th_seg = 0x00; in ctcm_chx_cleanup()
715 ch->th_seq_num = 0x00; in ctcm_chx_cleanup()
716 if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { in ctcm_chx_cleanup()
717 skb_queue_purge(&ch->io_queue); in ctcm_chx_cleanup()
720 ctcm_purge_skb_queue(&ch->io_queue); in ctcm_chx_cleanup()
721 if (IS_MPC(ch)) in ctcm_chx_cleanup()
722 ctcm_purge_skb_queue(&ch->sweep_queue); in ctcm_chx_cleanup()
723 spin_lock(&ch->collect_lock); in ctcm_chx_cleanup()
724 ctcm_purge_skb_queue(&ch->collect_queue); in ctcm_chx_cleanup()
725 ch->collect_len = 0; in ctcm_chx_cleanup()
726 spin_unlock(&ch->collect_lock); in ctcm_chx_cleanup()
780 struct channel *ch = arg; in ctcm_chx_setuperr() local
781 struct net_device *dev = ch->netdev; in ctcm_chx_setuperr()
793 fsm_deltimer(&ch->timer); in ctcm_chx_setuperr()
794 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in ctcm_chx_setuperr()
795 if (!IS_MPC(ch) && in ctcm_chx_setuperr()
796 (CHANNEL_DIRECTION(ch->flags) == CTCM_READ)) { in ctcm_chx_setuperr()
797 int rc = ccw_device_halt(ch->cdev, 0); in ctcm_chx_setuperr()
799 ctcm_ccw_check_rc(ch, rc, in ctcm_chx_setuperr()
808 (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? "RX" : "TX", in ctcm_chx_setuperr()
811 if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { in ctcm_chx_setuperr()
829 struct channel *ch = arg; in ctcm_chx_restart() local
830 struct net_device *dev = ch->netdev; in ctcm_chx_restart()
837 CTCM_FUNTAIL, ch->id, event, dev->name); in ctcm_chx_restart()
839 fsm_deltimer(&ch->timer); in ctcm_chx_restart()
841 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in ctcm_chx_restart()
845 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_restart()
849 rc = ccw_device_halt(ch->cdev, 0); in ctcm_chx_restart()
851 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_restart()
854 fsm_deltimer(&ch->timer); in ctcm_chx_restart()
857 ctcm_ccw_check_rc(ch, rc, "HaltIO in ctcm_chx_restart"); in ctcm_chx_restart()
871 struct channel *ch = arg; in ctcm_chx_rxiniterr() local
872 struct net_device *dev = ch->netdev; in ctcm_chx_rxiniterr()
878 fsm_deltimer(&ch->timer); in ctcm_chx_rxiniterr()
879 if (ch->retry++ < 3) in ctcm_chx_rxiniterr()
887 "%s(%s): %s in %s", CTCM_FUNTAIL, ch->id, in ctcm_chx_rxiniterr()
906 struct channel *ch = arg; in ctcm_chx_rxinitfail() local
907 struct net_device *dev = ch->netdev; in ctcm_chx_rxinitfail()
912 CTCM_FUNTAIL, dev->name, ch->id); in ctcm_chx_rxinitfail()
926 struct channel *ch = arg; in ctcm_chx_rxdisc() local
928 struct net_device *dev = ch->netdev; in ctcm_chx_rxdisc()
934 fsm_deltimer(&ch->timer); in ctcm_chx_rxdisc()
945 ccw_device_halt(ch->cdev, 0); in ctcm_chx_rxdisc()
958 struct channel *ch = arg; in ctcm_chx_txiniterr() local
959 struct net_device *dev = ch->netdev; in ctcm_chx_txiniterr()
963 fsm_deltimer(&ch->timer); in ctcm_chx_txiniterr()
964 if (ch->retry++ < 3) in ctcm_chx_txiniterr()
972 "%s(%s): %s in %s", CTCM_FUNTAIL, ch->id, in ctcm_chx_txiniterr()
990 struct channel *ch = arg; in ctcm_chx_txretry() local
991 struct net_device *dev = ch->netdev; in ctcm_chx_txretry()
996 __func__, smp_processor_id(), ch, ch->id); in ctcm_chx_txretry()
998 fsm_deltimer(&ch->timer); in ctcm_chx_txretry()
999 if (ch->retry++ > 3) { in ctcm_chx_txretry()
1003 CTCM_FUNTAIL, ch->id); in ctcm_chx_txretry()
1014 CTCM_FUNTAIL, ch->id, ch->retry); in ctcm_chx_txretry()
1015 skb = skb_peek(&ch->io_queue); in ctcm_chx_txretry()
1019 clear_normalized_cda(&ch->ccw[4]); in ctcm_chx_txretry()
1020 ch->ccw[4].count = skb->len; in ctcm_chx_txretry()
1021 if (set_normalized_cda(&ch->ccw[4], skb->data)) { in ctcm_chx_txretry()
1024 CTCM_FUNTAIL, ch->id); in ctcm_chx_txretry()
1029 fsm_addtimer(&ch->timer, 1000, CTC_EVENT_TIMER, ch); in ctcm_chx_txretry()
1031 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_txretry()
1036 ctcmpc_dumpit((char *)&ch->ccw[3], in ctcm_chx_txretry()
1039 rc = ccw_device_start(ch->cdev, &ch->ccw[3], 0, 0xff, 0); in ctcm_chx_txretry()
1041 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), in ctcm_chx_txretry()
1044 fsm_deltimer(&ch->timer); in ctcm_chx_txretry()
1045 ctcm_ccw_check_rc(ch, rc, "TX in chx_txretry"); in ctcm_chx_txretry()
1046 ctcm_purge_skb_queue(&ch->io_queue); in ctcm_chx_txretry()
1062 struct channel *ch = arg; in ctcm_chx_iofatal() local
1063 struct net_device *dev = ch->netdev; in ctcm_chx_iofatal()
1065 int rd = CHANNEL_DIRECTION(ch->flags); in ctcm_chx_iofatal()
1067 fsm_deltimer(&ch->timer); in ctcm_chx_iofatal()
1070 CTCM_FUNTAIL, ch->id, rd == CTCM_READ ? "RX" : "TX"); in ctcm_chx_iofatal()
1072 if (IS_MPC(ch)) { in ctcm_chx_iofatal()
1212 struct channel *ch = arg; in ctcmpc_chx_txdone() local
1213 struct net_device *dev = ch->netdev; in ctcmpc_chx_txdone()
1230 duration = done_stamp - ch->prof.send_stamp; in ctcmpc_chx_txdone()
1231 if (duration > ch->prof.tx_time) in ctcmpc_chx_txdone()
1232 ch->prof.tx_time = duration; in ctcmpc_chx_txdone()
1234 if (ch->irb->scsw.cmd.count != 0) in ctcmpc_chx_txdone()
1237 CTCM_FUNTAIL, dev->name, ch->irb->scsw.cmd.count); in ctcmpc_chx_txdone()
1238 fsm_deltimer(&ch->timer); in ctcmpc_chx_txdone()
1239 while ((skb = skb_dequeue(&ch->io_queue))) { in ctcmpc_chx_txdone()
1249 spin_lock(&ch->collect_lock); in ctcmpc_chx_txdone()
1250 clear_normalized_cda(&ch->ccw[4]); in ctcmpc_chx_txdone()
1251 if ((ch->collect_len <= 0) || (grp->in_sweep != 0)) { in ctcmpc_chx_txdone()
1252 spin_unlock(&ch->collect_lock); in ctcmpc_chx_txdone()
1257 if (ctcm_checkalloc_buffer(ch)) { in ctcmpc_chx_txdone()
1258 spin_unlock(&ch->collect_lock); in ctcmpc_chx_txdone()
1261 ch->trans_skb->data = ch->trans_skb_data; in ctcmpc_chx_txdone()
1262 skb_reset_tail_pointer(ch->trans_skb); in ctcmpc_chx_txdone()
1263 ch->trans_skb->len = 0; in ctcmpc_chx_txdone()
1264 if (ch->prof.maxmulti < (ch->collect_len + TH_HEADER_LENGTH)) in ctcmpc_chx_txdone()
1265 ch->prof.maxmulti = ch->collect_len + TH_HEADER_LENGTH; in ctcmpc_chx_txdone()
1266 if (ch->prof.maxcqueue < skb_queue_len(&ch->collect_queue)) in ctcmpc_chx_txdone()
1267 ch->prof.maxcqueue = skb_queue_len(&ch->collect_queue); in ctcmpc_chx_txdone()
1276 while ((skb = skb_dequeue(&ch->collect_queue))) { in ctcmpc_chx_txdone()
1277 skb_put_data(ch->trans_skb, skb->data, skb->len); in ctcmpc_chx_txdone()
1279 (skb_tail_pointer(ch->trans_skb) - skb->len); in ctcmpc_chx_txdone()
1287 __func__, ch->trans_skb->len); in ctcmpc_chx_txdone()
1292 ch->collect_len -= skb->len; in ctcmpc_chx_txdone()
1298 peekskb = skb_peek(&ch->collect_queue); in ctcmpc_chx_txdone()
1307 header = skb_push(ch->trans_skb, TH_HEADER_LENGTH); in ctcmpc_chx_txdone()
1311 ch->th_seq_num++; in ctcmpc_chx_txdone()
1312 header->th_seq_num = ch->th_seq_num; in ctcmpc_chx_txdone()
1315 __func__, ch->th_seq_num); in ctcmpc_chx_txdone()
1318 __func__, ch->trans_skb->len); in ctcmpc_chx_txdone()
1321 CTCM_D3_DUMP((char *)ch->trans_skb->data, in ctcmpc_chx_txdone()
1322 min_t(int, ch->trans_skb->len, 50)); in ctcmpc_chx_txdone()
1324 spin_unlock(&ch->collect_lock); in ctcmpc_chx_txdone()
1325 clear_normalized_cda(&ch->ccw[1]); in ctcmpc_chx_txdone()
1328 (void *)(u64)dma32_to_u32(ch->ccw[1].cda), in ctcmpc_chx_txdone()
1329 ch->trans_skb->data); in ctcmpc_chx_txdone()
1330 ch->ccw[1].count = ch->max_bufsize; in ctcmpc_chx_txdone()
1332 if (set_normalized_cda(&ch->ccw[1], ch->trans_skb->data)) { in ctcmpc_chx_txdone()
1333 dev_kfree_skb_any(ch->trans_skb); in ctcmpc_chx_txdone()
1334 ch->trans_skb = NULL; in ctcmpc_chx_txdone()
1337 CTCM_FUNTAIL, ch->id); in ctcmpc_chx_txdone()
1343 (void *)(u64)dma32_to_u32(ch->ccw[1].cda), in ctcmpc_chx_txdone()
1344 ch->trans_skb->data); in ctcmpc_chx_txdone()
1346 ch->ccw[1].count = ch->trans_skb->len; in ctcmpc_chx_txdone()
1347 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in ctcmpc_chx_txdone()
1348 ch->prof.send_stamp = jiffies; in ctcmpc_chx_txdone()
1350 ctcmpc_dumpit((char *)&ch->ccw[0], sizeof(struct ccw1) * 3); in ctcmpc_chx_txdone()
1351 rc = ccw_device_start(ch->cdev, &ch->ccw[0], 0, 0xff, 0); in ctcmpc_chx_txdone()
1352 ch->prof.doios_multi++; in ctcmpc_chx_txdone()
1356 fsm_deltimer(&ch->timer); in ctcmpc_chx_txdone()
1357 ctcm_ccw_check_rc(ch, rc, "chained TX"); in ctcmpc_chx_txdone()
1374 struct channel *ch = arg; in ctcmpc_chx_rx() local
1375 struct net_device *dev = ch->netdev; in ctcmpc_chx_rx()
1378 struct sk_buff *skb = ch->trans_skb; in ctcmpc_chx_rx()
1381 int len = ch->max_bufsize - ch->irb->scsw.cmd.count; in ctcmpc_chx_rx()
1385 ch->id, ch->max_bufsize, len); in ctcmpc_chx_rx()
1386 fsm_deltimer(&ch->timer); in ctcmpc_chx_rx()
1405 new_skb = __dev_alloc_skb(ch->max_bufsize, GFP_ATOMIC); in ctcmpc_chx_rx()
1422 skb_queue_tail(&ch->io_queue, new_skb); in ctcmpc_chx_rx()
1423 tasklet_schedule(&ch->ch_tasklet); in ctcmpc_chx_rx()
1427 skb_queue_tail(&ch->io_queue, new_skb); in ctcmpc_chx_rx()
1428 tasklet_hi_schedule(&ch->ch_tasklet); in ctcmpc_chx_rx()
1438 if (ctcm_checkalloc_buffer(ch)) in ctcmpc_chx_rx()
1440 ch->trans_skb->data = ch->trans_skb_data; in ctcmpc_chx_rx()
1441 skb_reset_tail_pointer(ch->trans_skb); in ctcmpc_chx_rx()
1442 ch->trans_skb->len = 0; in ctcmpc_chx_rx()
1443 ch->ccw[1].count = ch->max_bufsize; in ctcmpc_chx_rx()
1445 ctcmpc_dumpit((char *)&ch->ccw[0], in ctcmpc_chx_rx()
1450 get_ccwdev_lock(ch->cdev), saveflags); in ctcmpc_chx_rx()
1451 rc = ccw_device_start(ch->cdev, &ch->ccw[0], 0, 0xff, 0); in ctcmpc_chx_rx()
1454 get_ccwdev_lock(ch->cdev), saveflags); in ctcmpc_chx_rx()
1456 ctcm_ccw_check_rc(ch, rc, "normal RX"); in ctcmpc_chx_rx()
1463 __func__, dev->name, ch, ch->id); in ctcmpc_chx_rx()
1476 struct channel *ch = arg; in ctcmpc_chx_firstio() local
1477 struct net_device *dev = ch->netdev; in ctcmpc_chx_firstio()
1482 __func__, ch->id, ch); in ctcmpc_chx_firstio()
1486 CTCM_FUNTAIL, ch->id, fsm_getstate(fi), in ctcmpc_chx_firstio()
1487 fsm_getstate(gptr->fsm), ch->protocol); in ctcmpc_chx_firstio()
1492 fsm_deltimer(&ch->timer); in ctcmpc_chx_firstio()
1493 if (ctcm_checkalloc_buffer(ch)) in ctcmpc_chx_firstio()
1499 if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { in ctcmpc_chx_firstio()
1510 fsm_newstate(fi, (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) in ctcmpc_chx_firstio()
1515 __func__, ch->id, ch); in ctcmpc_chx_firstio()
1530 struct channel *ch = arg; in ctcmpc_chx_rxidle() local
1531 struct net_device *dev = ch->netdev; in ctcmpc_chx_rxidle()
1537 fsm_deltimer(&ch->timer); in ctcmpc_chx_rxidle()
1539 __func__, ch->id, dev->name, smp_processor_id(), in ctcmpc_chx_rxidle()
1548 if (ctcm_checkalloc_buffer(ch)) in ctcmpc_chx_rxidle()
1550 ch->trans_skb->data = ch->trans_skb_data; in ctcmpc_chx_rxidle()
1551 skb_reset_tail_pointer(ch->trans_skb); in ctcmpc_chx_rxidle()
1552 ch->trans_skb->len = 0; in ctcmpc_chx_rxidle()
1553 ch->ccw[1].count = ch->max_bufsize; in ctcmpc_chx_rxidle()
1554 CTCM_CCW_DUMP((char *)&ch->ccw[0], sizeof(struct ccw1) * 3); in ctcmpc_chx_rxidle()
1557 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcmpc_chx_rxidle()
1558 rc = ccw_device_start(ch->cdev, &ch->ccw[0], 0, 0xff, 0); in ctcmpc_chx_rxidle()
1561 get_ccwdev_lock(ch->cdev), saveflags); in ctcmpc_chx_rxidle()
1564 ctcm_ccw_check_rc(ch, rc, "initial RX"); in ctcmpc_chx_rxidle()
1584 struct channel *ch = arg; in ctcmpc_chx_attn() local
1585 struct net_device *dev = ch->netdev; in ctcmpc_chx_attn()
1590 __func__, dev->name, ch->id, ch, smp_processor_id(), in ctcmpc_chx_attn()
1591 fsm_getstate_str(ch->fsm), fsm_getstate_str(grp->fsm)); in ctcmpc_chx_attn()
1596 if (!ch->in_mpcgroup) in ctcmpc_chx_attn()
1598 if (fsm_getstate(ch->fsm) == CH_XID0_PENDING) { in ctcmpc_chx_attn()
1603 fsm_event(grp->fsm, MPCG_EVENT_XID0DO, ch); in ctcmpc_chx_attn()
1605 } else if (fsm_getstate(ch->fsm) < CH_XID7_PENDING1) in ctcmpc_chx_attn()
1607 fsm_newstate(ch->fsm, CH_XID7_PENDING1); in ctcmpc_chx_attn()
1614 if (fsm_getstate(ch->fsm) < CH_XID7_PENDING1) in ctcmpc_chx_attn()
1615 fsm_newstate(ch->fsm, CH_XID7_PENDING1); in ctcmpc_chx_attn()
1621 switch (fsm_getstate(ch->fsm)) { in ctcmpc_chx_attn()
1623 fsm_newstate(ch->fsm, CH_XID7_PENDING1); in ctcmpc_chx_attn()
1626 fsm_newstate(ch->fsm, CH_XID7_PENDING3); in ctcmpc_chx_attn()
1643 struct channel *ch = arg; in ctcmpc_chx_attnbusy() local
1644 struct net_device *dev = ch->netdev; in ctcmpc_chx_attnbusy()
1649 __func__, dev->name, ch->id, in ctcmpc_chx_attnbusy()
1650 fsm_getstate_str(ch->fsm), fsm_getstate_str(grp->fsm)); in ctcmpc_chx_attnbusy()
1652 fsm_deltimer(&ch->timer); in ctcmpc_chx_attnbusy()
1677 if (fsm_getstate(ch->fsm) == CH_XID0_INPROGRESS) { in ctcmpc_chx_attnbusy()
1678 fsm_newstate(ch->fsm, CH_XID0_PENDING) ; in ctcmpc_chx_attnbusy()
1711 if (ch->in_mpcgroup) in ctcmpc_chx_attnbusy()
1712 fsm_event(grp->fsm, MPCG_EVENT_XID0DO, ch); in ctcmpc_chx_attnbusy()
1716 CTCM_FUNTAIL, dev->name, ch->id); in ctcmpc_chx_attnbusy()
1729 struct channel *ch = arg; in ctcmpc_chx_resend() local
1730 struct net_device *dev = ch->netdev; in ctcmpc_chx_resend()
1734 fsm_event(grp->fsm, MPCG_EVENT_XID0DO, ch); in ctcmpc_chx_resend()
2066 struct channel *ch = priv->channel[direction]; in dev_action_start() local
2067 fsm_event(ch->fsm, CTC_EVENT_START, ch); in dev_action_start()
2088 struct channel *ch = priv->channel[direction]; in dev_action_stop() local
2089 fsm_event(ch->fsm, CTC_EVENT_STOP, ch); in dev_action_stop()
2090 ch->th_seq_num = 0x00; in dev_action_stop()
2092 __func__, ch->th_seq_num); in dev_action_stop()