Lines Matching refs:ch
190 void ctcm_ccw_check_rc(struct channel *ch, int rc, char *msg) in ctcm_ccw_check_rc() argument
194 CTCM_FUNTAIL, ch->id, msg, rc); in ctcm_ccw_check_rc()
198 ch->id); in ctcm_ccw_check_rc()
199 fsm_event(ch->fsm, CTC_EVENT_IO_EBUSY, ch); in ctcm_ccw_check_rc()
203 ch->id); in ctcm_ccw_check_rc()
204 fsm_event(ch->fsm, CTC_EVENT_IO_ENODEV, ch); in ctcm_ccw_check_rc()
209 fsm_event(ch->fsm, CTC_EVENT_IO_UNKNOWN, ch); in ctcm_ccw_check_rc()
247 struct channel *ch = arg; in chx_txdone() local
248 struct net_device *dev = ch->netdev; in chx_txdone()
256 CTCM_PR_DEBUG("%s(%s): %s\n", __func__, ch->id, dev->name); in chx_txdone()
258 duration = done_stamp - ch->prof.send_stamp; in chx_txdone()
259 if (duration > ch->prof.tx_time) in chx_txdone()
260 ch->prof.tx_time = duration; in chx_txdone()
262 if (ch->irb->scsw.cmd.count != 0) in chx_txdone()
265 CTCM_FUNTAIL, dev->name, ch->irb->scsw.cmd.count); in chx_txdone()
266 fsm_deltimer(&ch->timer); in chx_txdone()
267 while ((skb = skb_dequeue(&ch->io_queue))) { in chx_txdone()
277 spin_lock(&ch->collect_lock); in chx_txdone()
278 clear_normalized_cda(&ch->ccw[4]); in chx_txdone()
279 if (ch->collect_len > 0) { in chx_txdone()
282 if (ctcm_checkalloc_buffer(ch)) { in chx_txdone()
283 spin_unlock(&ch->collect_lock); in chx_txdone()
286 ch->trans_skb->data = ch->trans_skb_data; in chx_txdone()
287 skb_reset_tail_pointer(ch->trans_skb); in chx_txdone()
288 ch->trans_skb->len = 0; in chx_txdone()
289 if (ch->prof.maxmulti < (ch->collect_len + 2)) in chx_txdone()
290 ch->prof.maxmulti = ch->collect_len + 2; in chx_txdone()
291 if (ch->prof.maxcqueue < skb_queue_len(&ch->collect_queue)) in chx_txdone()
292 ch->prof.maxcqueue = skb_queue_len(&ch->collect_queue); in chx_txdone()
293 *((__u16 *)skb_put(ch->trans_skb, 2)) = ch->collect_len + 2; in chx_txdone()
295 while ((skb = skb_dequeue(&ch->collect_queue))) { in chx_txdone()
297 skb_put(ch->trans_skb, skb->len), skb->len); in chx_txdone()
304 ch->collect_len = 0; in chx_txdone()
305 spin_unlock(&ch->collect_lock); in chx_txdone()
306 ch->ccw[1].count = ch->trans_skb->len; in chx_txdone()
307 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in chx_txdone()
308 ch->prof.send_stamp = jiffies; in chx_txdone()
309 rc = ccw_device_start(ch->cdev, &ch->ccw[0], in chx_txdone()
310 (unsigned long)ch, 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], in chx_rx()
420 (unsigned long)ch, 0xff, 0); in chx_rx()
422 ctcm_ccw_check_rc(ch, rc, "normal RX"); in chx_rx()
435 struct channel *ch = arg; in chx_firstio() local
440 CTCM_FUNTAIL, ch->id, fsmstate); in chx_firstio()
442 ch->sense_rc = 0; /* reset unit check report control */ in chx_firstio()
446 CTCM_FUNTAIL, ch->id); in chx_firstio()
447 fsm_deltimer(&ch->timer); in chx_firstio()
448 if (ctcm_checkalloc_buffer(ch)) in chx_firstio()
451 (ch->protocol == CTCM_PROTO_OS390)) { in chx_firstio()
453 if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { in chx_firstio()
454 *((__u16 *)ch->trans_skb->data) = CTCM_INITIAL_BLOCKLEN; in chx_firstio()
455 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, in chx_firstio()
456 CTC_EVENT_TIMER, ch); in chx_firstio()
459 struct net_device *dev = ch->netdev; in chx_firstio()
471 if ((CHANNEL_DIRECTION(ch->flags) == CTCM_WRITE) || in chx_firstio()
472 (ch->protocol != CTCM_PROTO_S390)) in chx_firstio()
473 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in chx_firstio()
475 *((__u16 *)ch->trans_skb->data) = CTCM_INITIAL_BLOCKLEN; in chx_firstio()
476 ch->ccw[1].count = 2; /* Transfer only length */ in chx_firstio()
478 fsm_newstate(fi, (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) in chx_firstio()
480 rc = ccw_device_start(ch->cdev, &ch->ccw[0], in chx_firstio()
481 (unsigned long)ch, 0xff, 0); in chx_firstio()
483 fsm_deltimer(&ch->timer); in chx_firstio()
485 ctcm_ccw_check_rc(ch, rc, "init IO"); in chx_firstio()
494 if ((CHANNEL_DIRECTION(ch->flags) == CTCM_READ) && in chx_firstio()
495 (ch->protocol == CTCM_PROTO_S390)) { in chx_firstio()
496 struct net_device *dev = ch->netdev; in chx_firstio()
513 struct channel *ch = arg; in chx_rxidle() local
514 struct net_device *dev = ch->netdev; in chx_rxidle()
519 fsm_deltimer(&ch->timer); in chx_rxidle()
520 buflen = *((__u16 *)ch->trans_skb->data); in chx_rxidle()
525 if (ctcm_checkalloc_buffer(ch)) in chx_rxidle()
527 ch->ccw[1].count = ch->max_bufsize; in chx_rxidle()
529 rc = ccw_device_start(ch->cdev, &ch->ccw[0], in chx_rxidle()
530 (unsigned long)ch, 0xff, 0); in chx_rxidle()
533 ctcm_ccw_check_rc(ch, rc, "initial RX"); in chx_rxidle()
553 struct channel *ch = arg; in ctcm_chx_setmode() local
558 fsm_deltimer(&ch->timer); in ctcm_chx_setmode()
559 if (IS_MPC(ch)) { in ctcm_chx_setmode()
562 __func__, smp_processor_id(), ch, ch->id); in ctcm_chx_setmode()
564 fsm_addtimer(&ch->timer, timeout, CTC_EVENT_TIMER, ch); in ctcm_chx_setmode()
566 CTCM_CCW_DUMP((char *)&ch->ccw[6], sizeof(struct ccw1) * 2); in ctcm_chx_setmode()
569 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_setmode()
573 rc = ccw_device_start(ch->cdev, &ch->ccw[6], in ctcm_chx_setmode()
574 (unsigned long)ch, 0xff, 0); in ctcm_chx_setmode()
576 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_setmode()
578 fsm_deltimer(&ch->timer); in ctcm_chx_setmode()
580 ctcm_ccw_check_rc(ch, rc, "set Mode"); in ctcm_chx_setmode()
582 ch->retry = 0; in ctcm_chx_setmode()
594 struct channel *ch = arg; in ctcm_chx_start() local
599 CTCM_FUNTAIL, ch->id, in ctcm_chx_start()
600 (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? "RX" : "TX"); in ctcm_chx_start()
602 if (ch->trans_skb != NULL) { in ctcm_chx_start()
603 clear_normalized_cda(&ch->ccw[1]); in ctcm_chx_start()
604 dev_kfree_skb(ch->trans_skb); in ctcm_chx_start()
605 ch->trans_skb = NULL; in ctcm_chx_start()
607 if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { in ctcm_chx_start()
608 ch->ccw[1].cmd_code = CCW_CMD_READ; in ctcm_chx_start()
609 ch->ccw[1].flags = CCW_FLAG_SLI; in ctcm_chx_start()
610 ch->ccw[1].count = 0; in ctcm_chx_start()
612 ch->ccw[1].cmd_code = CCW_CMD_WRITE; in ctcm_chx_start()
613 ch->ccw[1].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in ctcm_chx_start()
614 ch->ccw[1].count = 0; in ctcm_chx_start()
616 if (ctcm_checkalloc_buffer(ch)) { in ctcm_chx_start()
620 CTCM_FUNTAIL, ch->id, in ctcm_chx_start()
621 (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? in ctcm_chx_start()
624 ch->ccw[0].cmd_code = CCW_CMD_PREPARE; in ctcm_chx_start()
625 ch->ccw[0].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in ctcm_chx_start()
626 ch->ccw[0].count = 0; in ctcm_chx_start()
627 ch->ccw[0].cda = 0; in ctcm_chx_start()
628 ch->ccw[2].cmd_code = CCW_CMD_NOOP; /* jointed CE + DE */ in ctcm_chx_start()
629 ch->ccw[2].flags = CCW_FLAG_SLI; in ctcm_chx_start()
630 ch->ccw[2].count = 0; in ctcm_chx_start()
631 ch->ccw[2].cda = 0; in ctcm_chx_start()
632 memcpy(&ch->ccw[3], &ch->ccw[0], sizeof(struct ccw1) * 3); in ctcm_chx_start()
633 ch->ccw[4].cda = 0; in ctcm_chx_start()
634 ch->ccw[4].flags &= ~CCW_FLAG_IDA; in ctcm_chx_start()
637 fsm_addtimer(&ch->timer, 1000, CTC_EVENT_TIMER, ch); in ctcm_chx_start()
638 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_start()
639 rc = ccw_device_halt(ch->cdev, (unsigned long)ch); in ctcm_chx_start()
640 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_start()
643 fsm_deltimer(&ch->timer); in ctcm_chx_start()
644 ctcm_ccw_check_rc(ch, rc, "initial HaltIO"); in ctcm_chx_start()
657 struct channel *ch = arg; in ctcm_chx_haltio() local
662 fsm_deltimer(&ch->timer); in ctcm_chx_haltio()
663 if (IS_MPC(ch)) in ctcm_chx_haltio()
664 fsm_deltimer(&ch->sweep_timer); in ctcm_chx_haltio()
666 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in ctcm_chx_haltio()
669 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_haltio()
674 rc = ccw_device_halt(ch->cdev, (unsigned long)ch); in ctcm_chx_haltio()
677 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_haltio()
681 fsm_deltimer(&ch->timer); in ctcm_chx_haltio()
684 ctcm_ccw_check_rc(ch, rc, (char *)__func__); in ctcm_chx_haltio()
698 struct channel *ch) in ctcm_chx_cleanup() argument
700 struct net_device *dev = ch->netdev; in ctcm_chx_cleanup()
705 CTCM_FUNTAIL, dev->name, ch->id, state); in ctcm_chx_cleanup()
707 fsm_deltimer(&ch->timer); in ctcm_chx_cleanup()
708 if (IS_MPC(ch)) in ctcm_chx_cleanup()
709 fsm_deltimer(&ch->sweep_timer); in ctcm_chx_cleanup()
712 if (state == CTC_STATE_STOPPED && ch->trans_skb != NULL) { in ctcm_chx_cleanup()
713 clear_normalized_cda(&ch->ccw[1]); in ctcm_chx_cleanup()
714 dev_kfree_skb_any(ch->trans_skb); in ctcm_chx_cleanup()
715 ch->trans_skb = NULL; in ctcm_chx_cleanup()
718 ch->th_seg = 0x00; in ctcm_chx_cleanup()
719 ch->th_seq_num = 0x00; in ctcm_chx_cleanup()
720 if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { in ctcm_chx_cleanup()
721 skb_queue_purge(&ch->io_queue); in ctcm_chx_cleanup()
724 ctcm_purge_skb_queue(&ch->io_queue); in ctcm_chx_cleanup()
725 if (IS_MPC(ch)) in ctcm_chx_cleanup()
726 ctcm_purge_skb_queue(&ch->sweep_queue); in ctcm_chx_cleanup()
727 spin_lock(&ch->collect_lock); in ctcm_chx_cleanup()
728 ctcm_purge_skb_queue(&ch->collect_queue); in ctcm_chx_cleanup()
729 ch->collect_len = 0; in ctcm_chx_cleanup()
730 spin_unlock(&ch->collect_lock); in ctcm_chx_cleanup()
784 struct channel *ch = arg; in ctcm_chx_setuperr() local
785 struct net_device *dev = ch->netdev; in ctcm_chx_setuperr()
797 fsm_deltimer(&ch->timer); in ctcm_chx_setuperr()
798 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in ctcm_chx_setuperr()
799 if (!IS_MPC(ch) && in ctcm_chx_setuperr()
800 (CHANNEL_DIRECTION(ch->flags) == CTCM_READ)) { in ctcm_chx_setuperr()
801 int rc = ccw_device_halt(ch->cdev, (unsigned long)ch); in ctcm_chx_setuperr()
803 ctcm_ccw_check_rc(ch, rc, in ctcm_chx_setuperr()
812 (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? "RX" : "TX", in ctcm_chx_setuperr()
815 if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { in ctcm_chx_setuperr()
833 struct channel *ch = arg; in ctcm_chx_restart() local
834 struct net_device *dev = ch->netdev; in ctcm_chx_restart()
841 CTCM_FUNTAIL, ch->id, event, dev->name); in ctcm_chx_restart()
843 fsm_deltimer(&ch->timer); in ctcm_chx_restart()
845 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in ctcm_chx_restart()
849 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_restart()
853 rc = ccw_device_halt(ch->cdev, (unsigned long)ch); in ctcm_chx_restart()
855 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_restart()
858 fsm_deltimer(&ch->timer); in ctcm_chx_restart()
861 ctcm_ccw_check_rc(ch, rc, "HaltIO in ctcm_chx_restart"); in ctcm_chx_restart()
875 struct channel *ch = arg; in ctcm_chx_rxiniterr() local
876 struct net_device *dev = ch->netdev; in ctcm_chx_rxiniterr()
882 fsm_deltimer(&ch->timer); in ctcm_chx_rxiniterr()
883 if (ch->retry++ < 3) in ctcm_chx_rxiniterr()
891 "%s(%s): %s in %s", CTCM_FUNTAIL, ch->id, in ctcm_chx_rxiniterr()
910 struct channel *ch = arg; in ctcm_chx_rxinitfail() local
911 struct net_device *dev = ch->netdev; in ctcm_chx_rxinitfail()
916 CTCM_FUNTAIL, dev->name, ch->id); in ctcm_chx_rxinitfail()
930 struct channel *ch = arg; in ctcm_chx_rxdisc() local
932 struct net_device *dev = ch->netdev; in ctcm_chx_rxdisc()
938 fsm_deltimer(&ch->timer); in ctcm_chx_rxdisc()
949 ccw_device_halt(ch->cdev, (unsigned long)ch); in ctcm_chx_rxdisc()
962 struct channel *ch = arg; in ctcm_chx_txiniterr() local
963 struct net_device *dev = ch->netdev; in ctcm_chx_txiniterr()
967 fsm_deltimer(&ch->timer); in ctcm_chx_txiniterr()
968 if (ch->retry++ < 3) in ctcm_chx_txiniterr()
976 "%s(%s): %s in %s", CTCM_FUNTAIL, ch->id, in ctcm_chx_txiniterr()
994 struct channel *ch = arg; in ctcm_chx_txretry() local
995 struct net_device *dev = ch->netdev; in ctcm_chx_txretry()
1000 __func__, smp_processor_id(), ch, ch->id); in ctcm_chx_txretry()
1002 fsm_deltimer(&ch->timer); in ctcm_chx_txretry()
1003 if (ch->retry++ > 3) { in ctcm_chx_txretry()
1007 CTCM_FUNTAIL, ch->id); in ctcm_chx_txretry()
1018 CTCM_FUNTAIL, ch->id, ch->retry); in ctcm_chx_txretry()
1019 skb = skb_peek(&ch->io_queue); in ctcm_chx_txretry()
1023 clear_normalized_cda(&ch->ccw[4]); in ctcm_chx_txretry()
1024 ch->ccw[4].count = skb->len; in ctcm_chx_txretry()
1025 if (set_normalized_cda(&ch->ccw[4], skb->data)) { in ctcm_chx_txretry()
1028 CTCM_FUNTAIL, ch->id); in ctcm_chx_txretry()
1033 fsm_addtimer(&ch->timer, 1000, CTC_EVENT_TIMER, ch); in ctcm_chx_txretry()
1035 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_txretry()
1040 ctcmpc_dumpit((char *)&ch->ccw[3], in ctcm_chx_txretry()
1043 rc = ccw_device_start(ch->cdev, &ch->ccw[3], in ctcm_chx_txretry()
1044 (unsigned long)ch, 0xff, 0); in ctcm_chx_txretry()
1046 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), in ctcm_chx_txretry()
1049 fsm_deltimer(&ch->timer); in ctcm_chx_txretry()
1050 ctcm_ccw_check_rc(ch, rc, "TX in chx_txretry"); in ctcm_chx_txretry()
1051 ctcm_purge_skb_queue(&ch->io_queue); in ctcm_chx_txretry()
1067 struct channel *ch = arg; in ctcm_chx_iofatal() local
1068 struct net_device *dev = ch->netdev; in ctcm_chx_iofatal()
1070 int rd = CHANNEL_DIRECTION(ch->flags); in ctcm_chx_iofatal()
1072 fsm_deltimer(&ch->timer); in ctcm_chx_iofatal()
1075 CTCM_FUNTAIL, ch->id, rd == CTCM_READ ? "RX" : "TX"); in ctcm_chx_iofatal()
1077 if (IS_MPC(ch)) { in ctcm_chx_iofatal()
1217 struct channel *ch = arg; in ctcmpc_chx_txdone() local
1218 struct net_device *dev = ch->netdev; in ctcmpc_chx_txdone()
1235 duration = done_stamp - ch->prof.send_stamp; in ctcmpc_chx_txdone()
1236 if (duration > ch->prof.tx_time) in ctcmpc_chx_txdone()
1237 ch->prof.tx_time = duration; in ctcmpc_chx_txdone()
1239 if (ch->irb->scsw.cmd.count != 0) in ctcmpc_chx_txdone()
1242 CTCM_FUNTAIL, dev->name, ch->irb->scsw.cmd.count); in ctcmpc_chx_txdone()
1243 fsm_deltimer(&ch->timer); in ctcmpc_chx_txdone()
1244 while ((skb = skb_dequeue(&ch->io_queue))) { in ctcmpc_chx_txdone()
1254 spin_lock(&ch->collect_lock); in ctcmpc_chx_txdone()
1255 clear_normalized_cda(&ch->ccw[4]); in ctcmpc_chx_txdone()
1256 if ((ch->collect_len <= 0) || (grp->in_sweep != 0)) { in ctcmpc_chx_txdone()
1257 spin_unlock(&ch->collect_lock); in ctcmpc_chx_txdone()
1262 if (ctcm_checkalloc_buffer(ch)) { in ctcmpc_chx_txdone()
1263 spin_unlock(&ch->collect_lock); in ctcmpc_chx_txdone()
1266 ch->trans_skb->data = ch->trans_skb_data; in ctcmpc_chx_txdone()
1267 skb_reset_tail_pointer(ch->trans_skb); in ctcmpc_chx_txdone()
1268 ch->trans_skb->len = 0; in ctcmpc_chx_txdone()
1269 if (ch->prof.maxmulti < (ch->collect_len + TH_HEADER_LENGTH)) in ctcmpc_chx_txdone()
1270 ch->prof.maxmulti = ch->collect_len + TH_HEADER_LENGTH; in ctcmpc_chx_txdone()
1271 if (ch->prof.maxcqueue < skb_queue_len(&ch->collect_queue)) in ctcmpc_chx_txdone()
1272 ch->prof.maxcqueue = skb_queue_len(&ch->collect_queue); in ctcmpc_chx_txdone()
1281 while ((skb = skb_dequeue(&ch->collect_queue))) { in ctcmpc_chx_txdone()
1282 memcpy(skb_put(ch->trans_skb, skb->len), skb->data, skb->len); in ctcmpc_chx_txdone()
1284 (skb_tail_pointer(ch->trans_skb) - skb->len); in ctcmpc_chx_txdone()
1292 __func__, ch->trans_skb->len); in ctcmpc_chx_txdone()
1297 ch->collect_len -= skb->len; in ctcmpc_chx_txdone()
1303 peekskb = skb_peek(&ch->collect_queue); in ctcmpc_chx_txdone()
1313 spin_unlock(&ch->collect_lock); in ctcmpc_chx_txdone()
1318 ch->th_seq_num++; in ctcmpc_chx_txdone()
1319 header->th_seq_num = ch->th_seq_num; in ctcmpc_chx_txdone()
1322 __func__, ch->th_seq_num); in ctcmpc_chx_txdone()
1324 memcpy(skb_push(ch->trans_skb, TH_HEADER_LENGTH), header, in ctcmpc_chx_txdone()
1330 __func__, ch->trans_skb->len); in ctcmpc_chx_txdone()
1333 CTCM_D3_DUMP((char *)ch->trans_skb->data, in ctcmpc_chx_txdone()
1334 min_t(int, ch->trans_skb->len, 50)); in ctcmpc_chx_txdone()
1336 spin_unlock(&ch->collect_lock); in ctcmpc_chx_txdone()
1337 clear_normalized_cda(&ch->ccw[1]); in ctcmpc_chx_txdone()
1340 (void *)(unsigned long)ch->ccw[1].cda, in ctcmpc_chx_txdone()
1341 ch->trans_skb->data); in ctcmpc_chx_txdone()
1342 ch->ccw[1].count = ch->max_bufsize; in ctcmpc_chx_txdone()
1344 if (set_normalized_cda(&ch->ccw[1], ch->trans_skb->data)) { in ctcmpc_chx_txdone()
1345 dev_kfree_skb_any(ch->trans_skb); in ctcmpc_chx_txdone()
1346 ch->trans_skb = NULL; in ctcmpc_chx_txdone()
1349 CTCM_FUNTAIL, ch->id); in ctcmpc_chx_txdone()
1355 (void *)(unsigned long)ch->ccw[1].cda, in ctcmpc_chx_txdone()
1356 ch->trans_skb->data); in ctcmpc_chx_txdone()
1358 ch->ccw[1].count = ch->trans_skb->len; in ctcmpc_chx_txdone()
1359 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in ctcmpc_chx_txdone()
1360 ch->prof.send_stamp = jiffies; in ctcmpc_chx_txdone()
1362 ctcmpc_dumpit((char *)&ch->ccw[0], sizeof(struct ccw1) * 3); in ctcmpc_chx_txdone()
1363 rc = ccw_device_start(ch->cdev, &ch->ccw[0], in ctcmpc_chx_txdone()
1364 (unsigned long)ch, 0xff, 0); in ctcmpc_chx_txdone()
1365 ch->prof.doios_multi++; in ctcmpc_chx_txdone()
1369 fsm_deltimer(&ch->timer); in ctcmpc_chx_txdone()
1370 ctcm_ccw_check_rc(ch, rc, "chained TX"); in ctcmpc_chx_txdone()
1387 struct channel *ch = arg; in ctcmpc_chx_rx() local
1388 struct net_device *dev = ch->netdev; in ctcmpc_chx_rx()
1391 struct sk_buff *skb = ch->trans_skb; in ctcmpc_chx_rx()
1394 int len = ch->max_bufsize - ch->irb->scsw.cmd.count; in ctcmpc_chx_rx()
1398 ch->id, ch->max_bufsize, len); in ctcmpc_chx_rx()
1399 fsm_deltimer(&ch->timer); in ctcmpc_chx_rx()
1418 new_skb = __dev_alloc_skb(ch->max_bufsize, GFP_ATOMIC); in ctcmpc_chx_rx()
1436 skb_queue_tail(&ch->io_queue, new_skb); in ctcmpc_chx_rx()
1437 tasklet_schedule(&ch->ch_tasklet); in ctcmpc_chx_rx()
1441 skb_queue_tail(&ch->io_queue, new_skb); in ctcmpc_chx_rx()
1442 tasklet_hi_schedule(&ch->ch_tasklet); in ctcmpc_chx_rx()
1452 if (ctcm_checkalloc_buffer(ch)) in ctcmpc_chx_rx()
1454 ch->trans_skb->data = ch->trans_skb_data; in ctcmpc_chx_rx()
1455 skb_reset_tail_pointer(ch->trans_skb); in ctcmpc_chx_rx()
1456 ch->trans_skb->len = 0; in ctcmpc_chx_rx()
1457 ch->ccw[1].count = ch->max_bufsize; in ctcmpc_chx_rx()
1459 ctcmpc_dumpit((char *)&ch->ccw[0], in ctcmpc_chx_rx()
1464 get_ccwdev_lock(ch->cdev), saveflags); in ctcmpc_chx_rx()
1465 rc = ccw_device_start(ch->cdev, &ch->ccw[0], in ctcmpc_chx_rx()
1466 (unsigned long)ch, 0xff, 0); in ctcmpc_chx_rx()
1469 get_ccwdev_lock(ch->cdev), saveflags); in ctcmpc_chx_rx()
1471 ctcm_ccw_check_rc(ch, rc, "normal RX"); in ctcmpc_chx_rx()
1477 __func__, dev->name, ch, ch->id); in ctcmpc_chx_rx()
1490 struct channel *ch = arg; in ctcmpc_chx_firstio() local
1491 struct net_device *dev = ch->netdev; in ctcmpc_chx_firstio()
1496 __func__, ch->id, ch); in ctcmpc_chx_firstio()
1500 CTCM_FUNTAIL, ch->id, fsm_getstate(fi), in ctcmpc_chx_firstio()
1501 fsm_getstate(gptr->fsm), ch->protocol); in ctcmpc_chx_firstio()
1506 fsm_deltimer(&ch->timer); in ctcmpc_chx_firstio()
1507 if (ctcm_checkalloc_buffer(ch)) in ctcmpc_chx_firstio()
1513 if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { in ctcmpc_chx_firstio()
1524 fsm_newstate(fi, (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) in ctcmpc_chx_firstio()
1529 __func__, ch->id, ch); in ctcmpc_chx_firstio()
1544 struct channel *ch = arg; in ctcmpc_chx_rxidle() local
1545 struct net_device *dev = ch->netdev; in ctcmpc_chx_rxidle()
1551 fsm_deltimer(&ch->timer); in ctcmpc_chx_rxidle()
1553 __func__, ch->id, dev->name, smp_processor_id(), in ctcmpc_chx_rxidle()
1562 if (ctcm_checkalloc_buffer(ch)) in ctcmpc_chx_rxidle()
1564 ch->trans_skb->data = ch->trans_skb_data; in ctcmpc_chx_rxidle()
1565 skb_reset_tail_pointer(ch->trans_skb); in ctcmpc_chx_rxidle()
1566 ch->trans_skb->len = 0; in ctcmpc_chx_rxidle()
1567 ch->ccw[1].count = ch->max_bufsize; in ctcmpc_chx_rxidle()
1568 CTCM_CCW_DUMP((char *)&ch->ccw[0], sizeof(struct ccw1) * 3); in ctcmpc_chx_rxidle()
1571 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcmpc_chx_rxidle()
1572 rc = ccw_device_start(ch->cdev, &ch->ccw[0], in ctcmpc_chx_rxidle()
1573 (unsigned long)ch, 0xff, 0); in ctcmpc_chx_rxidle()
1576 get_ccwdev_lock(ch->cdev), saveflags); in ctcmpc_chx_rxidle()
1579 ctcm_ccw_check_rc(ch, rc, "initial RX"); in ctcmpc_chx_rxidle()
1599 struct channel *ch = arg; in ctcmpc_chx_attn() local
1600 struct net_device *dev = ch->netdev; in ctcmpc_chx_attn()
1605 __func__, dev->name, ch->id, ch, smp_processor_id(), in ctcmpc_chx_attn()
1606 fsm_getstate_str(ch->fsm), fsm_getstate_str(grp->fsm)); in ctcmpc_chx_attn()
1611 if (!ch->in_mpcgroup) in ctcmpc_chx_attn()
1613 if (fsm_getstate(ch->fsm) == CH_XID0_PENDING) { in ctcmpc_chx_attn()
1618 fsm_event(grp->fsm, MPCG_EVENT_XID0DO, ch); in ctcmpc_chx_attn()
1620 } else if (fsm_getstate(ch->fsm) < CH_XID7_PENDING1) in ctcmpc_chx_attn()
1622 fsm_newstate(ch->fsm, CH_XID7_PENDING1); in ctcmpc_chx_attn()
1629 if (fsm_getstate(ch->fsm) < CH_XID7_PENDING1) in ctcmpc_chx_attn()
1630 fsm_newstate(ch->fsm, CH_XID7_PENDING1); in ctcmpc_chx_attn()
1636 switch (fsm_getstate(ch->fsm)) { in ctcmpc_chx_attn()
1638 fsm_newstate(ch->fsm, CH_XID7_PENDING1); in ctcmpc_chx_attn()
1641 fsm_newstate(ch->fsm, CH_XID7_PENDING3); in ctcmpc_chx_attn()
1658 struct channel *ch = arg; in ctcmpc_chx_attnbusy() local
1659 struct net_device *dev = ch->netdev; in ctcmpc_chx_attnbusy()
1664 __func__, dev->name, ch->id, in ctcmpc_chx_attnbusy()
1665 fsm_getstate_str(ch->fsm), fsm_getstate_str(grp->fsm)); in ctcmpc_chx_attnbusy()
1667 fsm_deltimer(&ch->timer); in ctcmpc_chx_attnbusy()
1692 if (fsm_getstate(ch->fsm) == CH_XID0_INPROGRESS) { in ctcmpc_chx_attnbusy()
1693 fsm_newstate(ch->fsm, CH_XID0_PENDING) ; in ctcmpc_chx_attnbusy()
1725 if (ch->in_mpcgroup) in ctcmpc_chx_attnbusy()
1726 fsm_event(grp->fsm, MPCG_EVENT_XID0DO, ch); in ctcmpc_chx_attnbusy()
1730 CTCM_FUNTAIL, dev->name, ch->id); in ctcmpc_chx_attnbusy()
1743 struct channel *ch = arg; in ctcmpc_chx_resend() local
1744 struct net_device *dev = ch->netdev; in ctcmpc_chx_resend()
1748 fsm_event(grp->fsm, MPCG_EVENT_XID0DO, ch); in ctcmpc_chx_resend()
2081 struct channel *ch = priv->channel[direction]; in dev_action_start() local
2082 fsm_event(ch->fsm, CTC_EVENT_START, ch); in dev_action_start()
2103 struct channel *ch = priv->channel[direction]; in dev_action_stop() local
2104 fsm_event(ch->fsm, CTC_EVENT_STOP, ch); in dev_action_stop()
2105 ch->th_seq_num = 0x00; in dev_action_stop()
2107 __func__, ch->th_seq_num); in dev_action_stop()