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], in chx_txdone()
311 (unsigned long)ch, 0xff, 0); in chx_txdone()
312 ch->prof.doios_multi++; in chx_txdone()
316 fsm_deltimer(&ch->timer); in chx_txdone()
317 ctcm_ccw_check_rc(ch, rc, "chained TX"); in chx_txdone()
320 spin_unlock(&ch->collect_lock); in chx_txdone()
337 struct channel *ch = arg; in ctcm_chx_txidle() local
338 struct net_device *dev = ch->netdev; in ctcm_chx_txidle()
341 CTCM_PR_DEBUG("%s(%s): %s\n", __func__, ch->id, dev->name); in ctcm_chx_txidle()
343 fsm_deltimer(&ch->timer); in ctcm_chx_txidle()
345 fsm_event(priv->fsm, DEV_EVENT_TXUP, ch->netdev); in ctcm_chx_txidle()
358 struct channel *ch = arg; in chx_rx() local
359 struct net_device *dev = ch->netdev; in chx_rx()
361 int len = ch->max_bufsize - ch->irb->scsw.cmd.count; in chx_rx()
362 struct sk_buff *skb = ch->trans_skb; in chx_rx()
367 fsm_deltimer(&ch->timer); in chx_rx()
376 if (len > ch->max_bufsize) { in chx_rx()
379 CTCM_FUNTAIL, dev->name, len, ch->max_bufsize); in chx_rx()
388 switch (ch->protocol) { in chx_rx()
411 ctcm_unpack_skb(ch, skb); in chx_rx()
414 skb->data = ch->trans_skb_data; in chx_rx()
417 if (ctcm_checkalloc_buffer(ch)) in chx_rx()
419 ch->ccw[1].count = ch->max_bufsize; in chx_rx()
420 rc = ccw_device_start(ch->cdev, &ch->ccw[0], in chx_rx()
421 (unsigned long)ch, 0xff, 0); in chx_rx()
423 ctcm_ccw_check_rc(ch, rc, "normal RX"); in chx_rx()
436 struct channel *ch = arg; in chx_firstio() local
441 CTCM_FUNTAIL, ch->id, fsmstate); in chx_firstio()
443 ch->sense_rc = 0; /* reset unit check report control */ in chx_firstio()
447 CTCM_FUNTAIL, ch->id); in chx_firstio()
448 fsm_deltimer(&ch->timer); in chx_firstio()
449 if (ctcm_checkalloc_buffer(ch)) in chx_firstio()
452 (ch->protocol == CTCM_PROTO_OS390)) { in chx_firstio()
454 if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { in chx_firstio()
455 *((__u16 *)ch->trans_skb->data) = CTCM_INITIAL_BLOCKLEN; in chx_firstio()
456 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, in chx_firstio()
457 CTC_EVENT_TIMER, ch); in chx_firstio()
460 struct net_device *dev = ch->netdev; in chx_firstio()
472 if ((CHANNEL_DIRECTION(ch->flags) == CTCM_WRITE) || in chx_firstio()
473 (ch->protocol != CTCM_PROTO_S390)) in chx_firstio()
474 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in chx_firstio()
476 *((__u16 *)ch->trans_skb->data) = CTCM_INITIAL_BLOCKLEN; in chx_firstio()
477 ch->ccw[1].count = 2; /* Transfer only length */ in chx_firstio()
479 fsm_newstate(fi, (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) in chx_firstio()
481 rc = ccw_device_start(ch->cdev, &ch->ccw[0], in chx_firstio()
482 (unsigned long)ch, 0xff, 0); in chx_firstio()
484 fsm_deltimer(&ch->timer); in chx_firstio()
486 ctcm_ccw_check_rc(ch, rc, "init IO"); in chx_firstio()
495 if ((CHANNEL_DIRECTION(ch->flags) == CTCM_READ) && in chx_firstio()
496 (ch->protocol == CTCM_PROTO_S390)) { in chx_firstio()
497 struct net_device *dev = ch->netdev; in chx_firstio()
514 struct channel *ch = arg; in chx_rxidle() local
515 struct net_device *dev = ch->netdev; in chx_rxidle()
520 fsm_deltimer(&ch->timer); in chx_rxidle()
521 buflen = *((__u16 *)ch->trans_skb->data); in chx_rxidle()
526 if (ctcm_checkalloc_buffer(ch)) in chx_rxidle()
528 ch->ccw[1].count = ch->max_bufsize; in chx_rxidle()
530 rc = ccw_device_start(ch->cdev, &ch->ccw[0], in chx_rxidle()
531 (unsigned long)ch, 0xff, 0); in chx_rxidle()
534 ctcm_ccw_check_rc(ch, rc, "initial RX"); in chx_rxidle()
554 struct channel *ch = arg; in ctcm_chx_setmode() local
559 fsm_deltimer(&ch->timer); in ctcm_chx_setmode()
560 if (IS_MPC(ch)) { in ctcm_chx_setmode()
563 __func__, smp_processor_id(), ch, ch->id); in ctcm_chx_setmode()
565 fsm_addtimer(&ch->timer, timeout, CTC_EVENT_TIMER, ch); in ctcm_chx_setmode()
567 CTCM_CCW_DUMP((char *)&ch->ccw[6], sizeof(struct ccw1) * 2); in ctcm_chx_setmode()
570 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_setmode()
574 rc = ccw_device_start(ch->cdev, &ch->ccw[6], in ctcm_chx_setmode()
575 (unsigned long)ch, 0xff, 0); in ctcm_chx_setmode()
577 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_setmode()
579 fsm_deltimer(&ch->timer); in ctcm_chx_setmode()
581 ctcm_ccw_check_rc(ch, rc, "set Mode"); in ctcm_chx_setmode()
583 ch->retry = 0; in ctcm_chx_setmode()
595 struct channel *ch = arg; in ctcm_chx_start() local
600 CTCM_FUNTAIL, ch->id, in ctcm_chx_start()
601 (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? "RX" : "TX"); in ctcm_chx_start()
603 if (ch->trans_skb != NULL) { in ctcm_chx_start()
604 clear_normalized_cda(&ch->ccw[1]); in ctcm_chx_start()
605 dev_kfree_skb(ch->trans_skb); in ctcm_chx_start()
606 ch->trans_skb = NULL; in ctcm_chx_start()
608 if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { in ctcm_chx_start()
609 ch->ccw[1].cmd_code = CCW_CMD_READ; in ctcm_chx_start()
610 ch->ccw[1].flags = CCW_FLAG_SLI; in ctcm_chx_start()
611 ch->ccw[1].count = 0; in ctcm_chx_start()
613 ch->ccw[1].cmd_code = CCW_CMD_WRITE; in ctcm_chx_start()
614 ch->ccw[1].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in ctcm_chx_start()
615 ch->ccw[1].count = 0; in ctcm_chx_start()
617 if (ctcm_checkalloc_buffer(ch)) { in ctcm_chx_start()
621 CTCM_FUNTAIL, ch->id, in ctcm_chx_start()
622 (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? in ctcm_chx_start()
625 ch->ccw[0].cmd_code = CCW_CMD_PREPARE; in ctcm_chx_start()
626 ch->ccw[0].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in ctcm_chx_start()
627 ch->ccw[0].count = 0; in ctcm_chx_start()
628 ch->ccw[0].cda = 0; in ctcm_chx_start()
629 ch->ccw[2].cmd_code = CCW_CMD_NOOP; /* jointed CE + DE */ in ctcm_chx_start()
630 ch->ccw[2].flags = CCW_FLAG_SLI; in ctcm_chx_start()
631 ch->ccw[2].count = 0; in ctcm_chx_start()
632 ch->ccw[2].cda = 0; in ctcm_chx_start()
633 memcpy(&ch->ccw[3], &ch->ccw[0], sizeof(struct ccw1) * 3); in ctcm_chx_start()
634 ch->ccw[4].cda = 0; in ctcm_chx_start()
635 ch->ccw[4].flags &= ~CCW_FLAG_IDA; in ctcm_chx_start()
638 fsm_addtimer(&ch->timer, 1000, CTC_EVENT_TIMER, ch); in ctcm_chx_start()
639 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_start()
640 rc = ccw_device_halt(ch->cdev, (unsigned long)ch); in ctcm_chx_start()
641 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_start()
644 fsm_deltimer(&ch->timer); in ctcm_chx_start()
645 ctcm_ccw_check_rc(ch, rc, "initial HaltIO"); in ctcm_chx_start()
658 struct channel *ch = arg; in ctcm_chx_haltio() local
663 fsm_deltimer(&ch->timer); in ctcm_chx_haltio()
664 if (IS_MPC(ch)) in ctcm_chx_haltio()
665 fsm_deltimer(&ch->sweep_timer); in ctcm_chx_haltio()
667 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in ctcm_chx_haltio()
670 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_haltio()
675 rc = ccw_device_halt(ch->cdev, (unsigned long)ch); in ctcm_chx_haltio()
678 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_haltio()
682 fsm_deltimer(&ch->timer); in ctcm_chx_haltio()
685 ctcm_ccw_check_rc(ch, rc, (char *)__func__); in ctcm_chx_haltio()
699 struct channel *ch) in ctcm_chx_cleanup() argument
701 struct net_device *dev = ch->netdev; in ctcm_chx_cleanup()
706 CTCM_FUNTAIL, dev->name, ch->id, state); in ctcm_chx_cleanup()
708 fsm_deltimer(&ch->timer); in ctcm_chx_cleanup()
709 if (IS_MPC(ch)) in ctcm_chx_cleanup()
710 fsm_deltimer(&ch->sweep_timer); in ctcm_chx_cleanup()
713 if (state == CTC_STATE_STOPPED && ch->trans_skb != NULL) { in ctcm_chx_cleanup()
714 clear_normalized_cda(&ch->ccw[1]); in ctcm_chx_cleanup()
715 dev_kfree_skb_any(ch->trans_skb); in ctcm_chx_cleanup()
716 ch->trans_skb = NULL; in ctcm_chx_cleanup()
719 ch->th_seg = 0x00; in ctcm_chx_cleanup()
720 ch->th_seq_num = 0x00; in ctcm_chx_cleanup()
721 if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { in ctcm_chx_cleanup()
722 skb_queue_purge(&ch->io_queue); in ctcm_chx_cleanup()
725 ctcm_purge_skb_queue(&ch->io_queue); in ctcm_chx_cleanup()
726 if (IS_MPC(ch)) in ctcm_chx_cleanup()
727 ctcm_purge_skb_queue(&ch->sweep_queue); in ctcm_chx_cleanup()
728 spin_lock(&ch->collect_lock); in ctcm_chx_cleanup()
729 ctcm_purge_skb_queue(&ch->collect_queue); in ctcm_chx_cleanup()
730 ch->collect_len = 0; in ctcm_chx_cleanup()
731 spin_unlock(&ch->collect_lock); in ctcm_chx_cleanup()
785 struct channel *ch = arg; in ctcm_chx_setuperr() local
786 struct net_device *dev = ch->netdev; in ctcm_chx_setuperr()
798 fsm_deltimer(&ch->timer); in ctcm_chx_setuperr()
799 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in ctcm_chx_setuperr()
800 if (!IS_MPC(ch) && in ctcm_chx_setuperr()
801 (CHANNEL_DIRECTION(ch->flags) == CTCM_READ)) { in ctcm_chx_setuperr()
802 int rc = ccw_device_halt(ch->cdev, (unsigned long)ch); in ctcm_chx_setuperr()
804 ctcm_ccw_check_rc(ch, rc, in ctcm_chx_setuperr()
813 (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? "RX" : "TX", in ctcm_chx_setuperr()
816 if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { in ctcm_chx_setuperr()
834 struct channel *ch = arg; in ctcm_chx_restart() local
835 struct net_device *dev = ch->netdev; in ctcm_chx_restart()
842 CTCM_FUNTAIL, ch->id, event, dev->name); in ctcm_chx_restart()
844 fsm_deltimer(&ch->timer); in ctcm_chx_restart()
846 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in ctcm_chx_restart()
850 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_restart()
854 rc = ccw_device_halt(ch->cdev, (unsigned long)ch); in ctcm_chx_restart()
856 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_restart()
859 fsm_deltimer(&ch->timer); in ctcm_chx_restart()
862 ctcm_ccw_check_rc(ch, rc, "HaltIO in ctcm_chx_restart"); in ctcm_chx_restart()
876 struct channel *ch = arg; in ctcm_chx_rxiniterr() local
877 struct net_device *dev = ch->netdev; in ctcm_chx_rxiniterr()
883 fsm_deltimer(&ch->timer); in ctcm_chx_rxiniterr()
884 if (ch->retry++ < 3) in ctcm_chx_rxiniterr()
892 "%s(%s): %s in %s", CTCM_FUNTAIL, ch->id, in ctcm_chx_rxiniterr()
911 struct channel *ch = arg; in ctcm_chx_rxinitfail() local
912 struct net_device *dev = ch->netdev; in ctcm_chx_rxinitfail()
917 CTCM_FUNTAIL, dev->name, ch->id); in ctcm_chx_rxinitfail()
931 struct channel *ch = arg; in ctcm_chx_rxdisc() local
933 struct net_device *dev = ch->netdev; in ctcm_chx_rxdisc()
939 fsm_deltimer(&ch->timer); in ctcm_chx_rxdisc()
950 ccw_device_halt(ch->cdev, (unsigned long)ch); in ctcm_chx_rxdisc()
963 struct channel *ch = arg; in ctcm_chx_txiniterr() local
964 struct net_device *dev = ch->netdev; in ctcm_chx_txiniterr()
968 fsm_deltimer(&ch->timer); in ctcm_chx_txiniterr()
969 if (ch->retry++ < 3) in ctcm_chx_txiniterr()
977 "%s(%s): %s in %s", CTCM_FUNTAIL, ch->id, in ctcm_chx_txiniterr()
995 struct channel *ch = arg; in ctcm_chx_txretry() local
996 struct net_device *dev = ch->netdev; in ctcm_chx_txretry()
1001 __func__, smp_processor_id(), ch, ch->id); in ctcm_chx_txretry()
1003 fsm_deltimer(&ch->timer); in ctcm_chx_txretry()
1004 if (ch->retry++ > 3) { in ctcm_chx_txretry()
1008 CTCM_FUNTAIL, ch->id); in ctcm_chx_txretry()
1019 CTCM_FUNTAIL, ch->id, ch->retry); in ctcm_chx_txretry()
1020 skb = skb_peek(&ch->io_queue); in ctcm_chx_txretry()
1024 clear_normalized_cda(&ch->ccw[4]); in ctcm_chx_txretry()
1025 ch->ccw[4].count = skb->len; in ctcm_chx_txretry()
1026 if (set_normalized_cda(&ch->ccw[4], skb->data)) { in ctcm_chx_txretry()
1029 CTCM_FUNTAIL, ch->id); in ctcm_chx_txretry()
1034 fsm_addtimer(&ch->timer, 1000, CTC_EVENT_TIMER, ch); in ctcm_chx_txretry()
1036 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in ctcm_chx_txretry()
1041 ctcmpc_dumpit((char *)&ch->ccw[3], in ctcm_chx_txretry()
1044 rc = ccw_device_start(ch->cdev, &ch->ccw[3], in ctcm_chx_txretry()
1045 (unsigned long)ch, 0xff, 0); in ctcm_chx_txretry()
1047 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), in ctcm_chx_txretry()
1050 fsm_deltimer(&ch->timer); in ctcm_chx_txretry()
1051 ctcm_ccw_check_rc(ch, rc, "TX in chx_txretry"); in ctcm_chx_txretry()
1052 ctcm_purge_skb_queue(&ch->io_queue); in ctcm_chx_txretry()
1068 struct channel *ch = arg; in ctcm_chx_iofatal() local
1069 struct net_device *dev = ch->netdev; in ctcm_chx_iofatal()
1071 int rd = CHANNEL_DIRECTION(ch->flags); in ctcm_chx_iofatal()
1073 fsm_deltimer(&ch->timer); in ctcm_chx_iofatal()
1076 CTCM_FUNTAIL, ch->id, rd == CTCM_READ ? "RX" : "TX"); in ctcm_chx_iofatal()
1078 if (IS_MPC(ch)) { in ctcm_chx_iofatal()
1218 struct channel *ch = arg; in ctcmpc_chx_txdone() local
1219 struct net_device *dev = ch->netdev; in ctcmpc_chx_txdone()
1236 duration = done_stamp - ch->prof.send_stamp; in ctcmpc_chx_txdone()
1237 if (duration > ch->prof.tx_time) in ctcmpc_chx_txdone()
1238 ch->prof.tx_time = duration; in ctcmpc_chx_txdone()
1240 if (ch->irb->scsw.cmd.count != 0) in ctcmpc_chx_txdone()
1243 CTCM_FUNTAIL, dev->name, ch->irb->scsw.cmd.count); in ctcmpc_chx_txdone()
1244 fsm_deltimer(&ch->timer); in ctcmpc_chx_txdone()
1245 while ((skb = skb_dequeue(&ch->io_queue))) { in ctcmpc_chx_txdone()
1255 spin_lock(&ch->collect_lock); in ctcmpc_chx_txdone()
1256 clear_normalized_cda(&ch->ccw[4]); in ctcmpc_chx_txdone()
1257 if ((ch->collect_len <= 0) || (grp->in_sweep != 0)) { in ctcmpc_chx_txdone()
1258 spin_unlock(&ch->collect_lock); in ctcmpc_chx_txdone()
1263 if (ctcm_checkalloc_buffer(ch)) { in ctcmpc_chx_txdone()
1264 spin_unlock(&ch->collect_lock); in ctcmpc_chx_txdone()
1267 ch->trans_skb->data = ch->trans_skb_data; in ctcmpc_chx_txdone()
1268 skb_reset_tail_pointer(ch->trans_skb); in ctcmpc_chx_txdone()
1269 ch->trans_skb->len = 0; in ctcmpc_chx_txdone()
1270 if (ch->prof.maxmulti < (ch->collect_len + TH_HEADER_LENGTH)) in ctcmpc_chx_txdone()
1271 ch->prof.maxmulti = ch->collect_len + TH_HEADER_LENGTH; in ctcmpc_chx_txdone()
1272 if (ch->prof.maxcqueue < skb_queue_len(&ch->collect_queue)) in ctcmpc_chx_txdone()
1273 ch->prof.maxcqueue = skb_queue_len(&ch->collect_queue); in ctcmpc_chx_txdone()
1282 while ((skb = skb_dequeue(&ch->collect_queue))) { in ctcmpc_chx_txdone()
1283 skb_put_data(ch->trans_skb, skb->data, skb->len); in ctcmpc_chx_txdone()
1285 (skb_tail_pointer(ch->trans_skb) - skb->len); in ctcmpc_chx_txdone()
1293 __func__, ch->trans_skb->len); in ctcmpc_chx_txdone()
1298 ch->collect_len -= skb->len; in ctcmpc_chx_txdone()
1304 peekskb = skb_peek(&ch->collect_queue); in ctcmpc_chx_txdone()
1314 spin_unlock(&ch->collect_lock); in ctcmpc_chx_txdone()
1319 ch->th_seq_num++; in ctcmpc_chx_txdone()
1320 header->th_seq_num = ch->th_seq_num; in ctcmpc_chx_txdone()
1323 __func__, ch->th_seq_num); in ctcmpc_chx_txdone()
1325 memcpy(skb_push(ch->trans_skb, TH_HEADER_LENGTH), header, in ctcmpc_chx_txdone()
1331 __func__, ch->trans_skb->len); in ctcmpc_chx_txdone()
1334 CTCM_D3_DUMP((char *)ch->trans_skb->data, in ctcmpc_chx_txdone()
1335 min_t(int, ch->trans_skb->len, 50)); in ctcmpc_chx_txdone()
1337 spin_unlock(&ch->collect_lock); in ctcmpc_chx_txdone()
1338 clear_normalized_cda(&ch->ccw[1]); in ctcmpc_chx_txdone()
1341 (void *)(unsigned long)ch->ccw[1].cda, in ctcmpc_chx_txdone()
1342 ch->trans_skb->data); in ctcmpc_chx_txdone()
1343 ch->ccw[1].count = ch->max_bufsize; in ctcmpc_chx_txdone()
1345 if (set_normalized_cda(&ch->ccw[1], ch->trans_skb->data)) { in ctcmpc_chx_txdone()
1346 dev_kfree_skb_any(ch->trans_skb); in ctcmpc_chx_txdone()
1347 ch->trans_skb = NULL; in ctcmpc_chx_txdone()
1350 CTCM_FUNTAIL, ch->id); in ctcmpc_chx_txdone()
1356 (void *)(unsigned long)ch->ccw[1].cda, in ctcmpc_chx_txdone()
1357 ch->trans_skb->data); in ctcmpc_chx_txdone()
1359 ch->ccw[1].count = ch->trans_skb->len; in ctcmpc_chx_txdone()
1360 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); in ctcmpc_chx_txdone()
1361 ch->prof.send_stamp = jiffies; in ctcmpc_chx_txdone()
1363 ctcmpc_dumpit((char *)&ch->ccw[0], sizeof(struct ccw1) * 3); in ctcmpc_chx_txdone()
1364 rc = ccw_device_start(ch->cdev, &ch->ccw[0], in ctcmpc_chx_txdone()
1365 (unsigned long)ch, 0xff, 0); in ctcmpc_chx_txdone()
1366 ch->prof.doios_multi++; in ctcmpc_chx_txdone()
1370 fsm_deltimer(&ch->timer); in ctcmpc_chx_txdone()
1371 ctcm_ccw_check_rc(ch, rc, "chained TX"); in ctcmpc_chx_txdone()
1388 struct channel *ch = arg; in ctcmpc_chx_rx() local
1389 struct net_device *dev = ch->netdev; in ctcmpc_chx_rx()
1392 struct sk_buff *skb = ch->trans_skb; in ctcmpc_chx_rx()
1395 int len = ch->max_bufsize - ch->irb->scsw.cmd.count; in ctcmpc_chx_rx()
1399 ch->id, ch->max_bufsize, len); in ctcmpc_chx_rx()
1400 fsm_deltimer(&ch->timer); in ctcmpc_chx_rx()
1419 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()