Lines Matching full:ch
107 static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb);
271 ctcm_pr_debug("th->ch : %02x\n", header->th_ch_flag); in ctcmpc_dump_skb()
609 struct channel *rch = mpcginfo->ch; in mpc_rcvd_sweep_resp()
613 struct channel *ch = priv->channel[CTCM_WRITE]; in mpc_rcvd_sweep_resp() local
615 CTCM_PR_DEBUG("%s: ch=0x%p id=%s\n", __func__, ch, ch->id); in mpc_rcvd_sweep_resp()
622 fsm_deltimer(&ch->sweep_timer); in mpc_rcvd_sweep_resp()
625 ch->th_seq_num = 0x00; in mpc_rcvd_sweep_resp()
644 struct channel *ch = priv->channel[CTCM_WRITE]; in ctcmpc_send_sweep_resp() local
646 CTCM_PR_DEBUG("%s: ch=0x%p id=%s\n", __func__, rch, rch->id); in ctcmpc_send_sweep_resp()
658 header->sw.th_last_seq = ch->th_seq_num; in ctcmpc_send_sweep_resp()
661 skb_queue_tail(&ch->sweep_queue, sweep_skb); in ctcmpc_send_sweep_resp()
663 fsm_addtimer(&ch->sweep_timer, 100, CTC_EVENT_RSWEEP_TIMER, ch); in ctcmpc_send_sweep_resp()
680 struct channel *rch = mpcginfo->ch; in mpc_rcvd_sweep_req()
684 struct channel *ch = priv->channel[CTCM_WRITE]; in mpc_rcvd_sweep_req() local
688 " %s(): ch=0x%p id=%s\n", __func__, ch, ch->id); in mpc_rcvd_sweep_req()
700 ctcmpc_send_sweep_resp(ch); in mpc_rcvd_sweep_req()
862 struct channel *ch = NULL; in mpc_group_ready() local
878 ch = priv->channel[CTCM_READ]; in mpc_group_ready()
879 ch->pdu_seq = 0; in mpc_group_ready()
881 __func__, ch->pdu_seq); in mpc_group_ready()
883 ctcmpc_chx_rxidle(ch->fsm, CTC_EVENT_START, ch); in mpc_group_ready()
885 ch = priv->channel[CTCM_WRITE]; in mpc_group_ready()
886 if (ch->collect_len > 0) { in mpc_group_ready()
887 spin_lock(&ch->collect_lock); in mpc_group_ready()
888 ctcm_purge_skb_queue(&ch->collect_queue); in mpc_group_ready()
889 ch->collect_len = 0; in mpc_group_ready()
890 spin_unlock(&ch->collect_lock); in mpc_group_ready()
892 ctcm_chx_txidle(ch->fsm, CTC_EVENT_START, ch); in mpc_group_ready()
913 void mpc_channel_action(struct channel *ch, int direction, int action) in mpc_channel_action() argument
915 struct net_device *dev = ch->netdev; in mpc_channel_action()
926 CTCM_PR_DEBUG("enter %s: ch=0x%p id=%s\n", __func__, ch, ch->id); in mpc_channel_action()
935 if ((action == MPC_CHANNEL_ADD) && (ch->in_mpcgroup == 0)) { in mpc_channel_action()
939 ch->in_mpcgroup = 1; in mpc_channel_action()
941 if (ch->xid_skb != NULL) in mpc_channel_action()
942 dev_kfree_skb_any(ch->xid_skb); in mpc_channel_action()
944 ch->xid_skb = __dev_alloc_skb(MPC_BUFSIZE_DEFAULT, in mpc_channel_action()
946 if (ch->xid_skb == NULL) { in mpc_channel_action()
948 "%s(%s): Couldn't alloc ch xid_skb\n", in mpc_channel_action()
953 ch->xid_skb_data = ch->xid_skb->data; in mpc_channel_action()
954 ch->xid_th = (struct th_header *)ch->xid_skb->data; in mpc_channel_action()
955 skb_put(ch->xid_skb, TH_HEADER_LENGTH); in mpc_channel_action()
956 ch->xid = (struct xid2 *)skb_tail_pointer(ch->xid_skb); in mpc_channel_action()
957 skb_put(ch->xid_skb, XID2_LENGTH); in mpc_channel_action()
958 ch->xid_id = skb_tail_pointer(ch->xid_skb); in mpc_channel_action()
959 ch->xid_skb->data = ch->xid_skb_data; in mpc_channel_action()
960 skb_reset_tail_pointer(ch->xid_skb); in mpc_channel_action()
961 ch->xid_skb->len = 0; in mpc_channel_action()
963 skb_put_data(ch->xid_skb, grp->xid_skb->data, in mpc_channel_action()
966 ch->xid->xid2_dlc_type = in mpc_channel_action()
967 ((CHANNEL_DIRECTION(ch->flags) == CTCM_READ) in mpc_channel_action()
970 if (CHANNEL_DIRECTION(ch->flags) == CTCM_WRITE) in mpc_channel_action()
971 ch->xid->xid2_buf_len = 0x00; in mpc_channel_action()
973 ch->xid_skb->data = ch->xid_skb_data; in mpc_channel_action()
974 skb_reset_tail_pointer(ch->xid_skb); in mpc_channel_action()
975 ch->xid_skb->len = 0; in mpc_channel_action()
977 fsm_newstate(ch->fsm, CH_XID0_PENDING); in mpc_channel_action()
988 (ch->in_mpcgroup == 1)) { in mpc_channel_action()
989 ch->in_mpcgroup = 0; in mpc_channel_action()
993 if (ch->xid_skb != NULL) in mpc_channel_action()
994 dev_kfree_skb_any(ch->xid_skb); in mpc_channel_action()
995 ch->xid_skb = NULL; in mpc_channel_action()
1014 CTCM_PR_DEBUG("exit %s: ch=0x%p id=%s\n", __func__, ch, ch->id); in mpc_channel_action()
1022 * ch The channel where this skb has been received.
1025 static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb) in ctcmpc_unpack_skb() argument
1027 struct net_device *dev = ch->netdev; in ctcmpc_unpack_skb()
1040 CTCM_PR_DEBUG("ctcmpc enter: %s() %s cp:%i ch:%s\n", in ctcmpc_unpack_skb()
1041 __func__, dev->name, smp_processor_id(), ch->id); in ctcmpc_unpack_skb()
1062 (header->th_seq_num != ch->th_seq_num + 1) && in ctcmpc_unpack_skb()
1063 (ch->th_seq_num != 0))) { in ctcmpc_unpack_skb()
1072 skb_queue_tail(&ch->io_queue, pskb); in ctcmpc_unpack_skb()
1075 ch->th_seq_num + 1, header->th_seq_num); in ctcmpc_unpack_skb()
1080 ch->th_seq_num = header->th_seq_num; in ctcmpc_unpack_skb()
1083 __func__, ch->th_seq_num); in ctcmpc_unpack_skb()
1104 if ((pskb->len <= 0) || (pskb->len > ch->max_bufsize)) { in ctcmpc_unpack_skb()
1143 *((__u32 *) skb_push(skb, 4)) = ch->pdu_seq; in ctcmpc_unpack_skb()
1144 ch->pdu_seq++; in ctcmpc_unpack_skb()
1148 __func__, ch->pdu_seq); in ctcmpc_unpack_skb()
1168 mpcginfo->ch = ch; in ctcmpc_unpack_skb()
1208 CTCM_PR_DEBUG("exit %s: %s: ch=0x%p id=%s\n", in ctcmpc_unpack_skb()
1209 __func__, dev->name, ch, ch->id); in ctcmpc_unpack_skb()
1215 * ch The channel to work on.
1222 struct channel *ch = (struct channel *)thischan; in ctcmpc_bh() local
1224 struct net_device *dev = ch->netdev; in ctcmpc_bh()
1229 dev->name, smp_processor_id(), __func__, ch->id); in ctcmpc_bh()
1232 (skb = skb_dequeue(&ch->io_queue))) { in ctcmpc_bh()
1233 ctcmpc_unpack_skb(ch, skb); in ctcmpc_bh()
1242 if (skb == skb_peek(&ch->io_queue)) in ctcmpc_bh()
1245 CTCM_PR_DEBUG("exit %s: %s: ch=0x%p id=%s\n", in ctcmpc_bh()
1246 __func__, dev->name, ch, ch->id); in ctcmpc_bh()
1475 struct channel *ch = mpcginfo->ch; in mpc_action_discontact() local
1480 if (ch) { in mpc_action_discontact()
1481 dev = ch->netdev; in mpc_action_discontact()
1487 CTCM_FUNTAIL, dev->name, ch->id); in mpc_action_discontact()
1506 struct channel *ch = (struct channel *)thischan; in mpc_action_send_discontact() local
1509 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in mpc_action_send_discontact()
1510 rc = ccw_device_start(ch->cdev, &ch->ccw[15], 0, 0xff, 0); in mpc_action_send_discontact()
1511 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in mpc_action_send_discontact()
1514 ctcm_ccw_check_rc(ch, rc, (char *)__func__); in mpc_action_send_discontact()
1528 struct channel *ch = mpcginfo->ch; in mpc_validate_xid() local
1529 struct net_device *dev = ch->netdev; in mpc_validate_xid()
1545 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1552 if (((CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? XID2_WRITE_SIDE : in mpc_validate_xid()
1558 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1593 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1598 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1607 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1614 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1621 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1628 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1649 struct channel *ch = arg; in mpc_action_side_xid() local
1655 CTCM_PR_DEBUG("Enter %s: cp=%i ch=0x%p id=%s\n", in mpc_action_side_xid()
1656 __func__, smp_processor_id(), ch, ch->id); in mpc_action_side_xid()
1658 if (ctcm_checkalloc_buffer(ch)) in mpc_action_side_xid()
1664 ch->trans_skb->data = ch->trans_skb_data; in mpc_action_side_xid()
1665 skb_reset_tail_pointer(ch->trans_skb); in mpc_action_side_xid()
1666 ch->trans_skb->len = 0; in mpc_action_side_xid()
1671 memset(ch->trans_skb->data, 0, 16); in mpc_action_side_xid()
1672 ch->rcvd_xid_th = (struct th_header *)ch->trans_skb_data; in mpc_action_side_xid()
1674 skb_put(ch->trans_skb, TH_HEADER_LENGTH); in mpc_action_side_xid()
1675 ch->rcvd_xid = (struct xid2 *)skb_tail_pointer(ch->trans_skb); in mpc_action_side_xid()
1677 skb_put(ch->trans_skb, XID2_LENGTH); in mpc_action_side_xid()
1678 ch->rcvd_xid_id = skb_tail_pointer(ch->trans_skb); in mpc_action_side_xid()
1680 ch->trans_skb->data = ch->trans_skb_data; in mpc_action_side_xid()
1681 skb_reset_tail_pointer(ch->trans_skb); in mpc_action_side_xid()
1682 ch->trans_skb->len = 0; in mpc_action_side_xid()
1686 memset(ch->trans_skb->data, 0, 16); in mpc_action_side_xid()
1687 ch->rcvd_xid_th = (struct th_header *)ch->trans_skb_data; in mpc_action_side_xid()
1688 ch->rcvd_xid = (struct xid2 *)(ch->trans_skb_data + TH_HEADER_LENGTH); in mpc_action_side_xid()
1689 ch->rcvd_xid_id = ch->trans_skb_data + TH_HEADER_LENGTH + XID2_LENGTH; in mpc_action_side_xid()
1692 ch->ccw[8].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1693 ch->ccw[8].count = 0; in mpc_action_side_xid()
1694 ch->ccw[8].cda = 0x00; in mpc_action_side_xid()
1696 if (!(ch->xid_th && ch->xid && ch->xid_id)) in mpc_action_side_xid()
1699 CTCM_FUNTAIL, ch->id, ch->xid_th, ch->xid, ch->xid_id); in mpc_action_side_xid()
1703 if (ch->xid_th == NULL) in mpc_action_side_xid()
1705 ch->ccw[9].cmd_code = CCW_CMD_WRITE; in mpc_action_side_xid()
1706 ch->ccw[9].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1707 ch->ccw[9].count = TH_HEADER_LENGTH; in mpc_action_side_xid()
1708 ch->ccw[9].cda = virt_to_phys(ch->xid_th); in mpc_action_side_xid()
1710 if (ch->xid == NULL) in mpc_action_side_xid()
1712 ch->ccw[10].cmd_code = CCW_CMD_WRITE; in mpc_action_side_xid()
1713 ch->ccw[10].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1714 ch->ccw[10].count = XID2_LENGTH; in mpc_action_side_xid()
1715 ch->ccw[10].cda = virt_to_phys(ch->xid); in mpc_action_side_xid()
1717 ch->ccw[11].cmd_code = CCW_CMD_READ; in mpc_action_side_xid()
1718 ch->ccw[11].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1719 ch->ccw[11].count = TH_HEADER_LENGTH; in mpc_action_side_xid()
1720 ch->ccw[11].cda = virt_to_phys(ch->rcvd_xid_th); in mpc_action_side_xid()
1722 ch->ccw[12].cmd_code = CCW_CMD_READ; in mpc_action_side_xid()
1723 ch->ccw[12].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1724 ch->ccw[12].count = XID2_LENGTH; in mpc_action_side_xid()
1725 ch->ccw[12].cda = virt_to_phys(ch->rcvd_xid); in mpc_action_side_xid()
1727 ch->ccw[13].cmd_code = CCW_CMD_READ; in mpc_action_side_xid()
1728 ch->ccw[13].cda = virt_to_phys(ch->rcvd_xid_id); in mpc_action_side_xid()
1731 ch->ccw[9].cmd_code = CCW_CMD_READ; in mpc_action_side_xid()
1732 ch->ccw[9].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1733 ch->ccw[9].count = TH_HEADER_LENGTH; in mpc_action_side_xid()
1734 ch->ccw[9].cda = virt_to_phys(ch->rcvd_xid_th); in mpc_action_side_xid()
1736 ch->ccw[10].cmd_code = CCW_CMD_READ; in mpc_action_side_xid()
1737 ch->ccw[10].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1738 ch->ccw[10].count = XID2_LENGTH; in mpc_action_side_xid()
1739 ch->ccw[10].cda = virt_to_phys(ch->rcvd_xid); in mpc_action_side_xid()
1741 if (ch->xid_th == NULL) in mpc_action_side_xid()
1743 ch->ccw[11].cmd_code = CCW_CMD_WRITE; in mpc_action_side_xid()
1744 ch->ccw[11].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1745 ch->ccw[11].count = TH_HEADER_LENGTH; in mpc_action_side_xid()
1746 ch->ccw[11].cda = virt_to_phys(ch->xid_th); in mpc_action_side_xid()
1748 if (ch->xid == NULL) in mpc_action_side_xid()
1750 ch->ccw[12].cmd_code = CCW_CMD_WRITE; in mpc_action_side_xid()
1751 ch->ccw[12].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1752 ch->ccw[12].count = XID2_LENGTH; in mpc_action_side_xid()
1753 ch->ccw[12].cda = virt_to_phys(ch->xid); in mpc_action_side_xid()
1755 if (ch->xid_id == NULL) in mpc_action_side_xid()
1757 ch->ccw[13].cmd_code = CCW_CMD_WRITE; in mpc_action_side_xid()
1758 ch->ccw[13].cda = virt_to_phys(ch->xid_id); in mpc_action_side_xid()
1761 ch->ccw[13].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1762 ch->ccw[13].count = 4; in mpc_action_side_xid()
1764 ch->ccw[14].cmd_code = CCW_CMD_NOOP; in mpc_action_side_xid()
1765 ch->ccw[14].flags = CCW_FLAG_SLI; in mpc_action_side_xid()
1766 ch->ccw[14].count = 0; in mpc_action_side_xid()
1767 ch->ccw[14].cda = 0; in mpc_action_side_xid()
1769 CTCM_CCW_DUMP((char *)&ch->ccw[8], sizeof(struct ccw1) * 7); in mpc_action_side_xid()
1770 CTCM_D3_DUMP((char *)ch->xid_th, TH_HEADER_LENGTH); in mpc_action_side_xid()
1771 CTCM_D3_DUMP((char *)ch->xid, XID2_LENGTH); in mpc_action_side_xid()
1772 CTCM_D3_DUMP((char *)ch->xid_id, 4); in mpc_action_side_xid()
1778 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in mpc_action_side_xid()
1782 fsm_addtimer(&ch->timer, 5000 , CTC_EVENT_TIMER, ch); in mpc_action_side_xid()
1783 rc = ccw_device_start(ch->cdev, &ch->ccw[8], 0, 0xff, 0); in mpc_action_side_xid()
1786 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in mpc_action_side_xid()
1789 ctcm_ccw_check_rc(ch, rc, in mpc_action_side_xid()
1794 CTCM_PR_DEBUG("Exit %s: ch=0x%p id=%s\n", in mpc_action_side_xid()
1795 __func__, ch, ch->id); in mpc_action_side_xid()
1824 struct channel *ch = arg; in mpc_action_doxid0() local
1825 struct net_device *dev = ch->netdev; in mpc_action_doxid0()
1829 CTCM_PR_DEBUG("Enter %s: cp=%i ch=0x%p id=%s\n", in mpc_action_doxid0()
1830 __func__, smp_processor_id(), ch, ch->id); in mpc_action_doxid0()
1832 if (ch->xid == NULL) { in mpc_action_doxid0()
1834 "%s(%s): ch->xid == NULL", in mpc_action_doxid0()
1839 fsm_newstate(ch->fsm, CH_XID0_INPROGRESS); in mpc_action_doxid0()
1841 ch->xid->xid2_option = XID2_0; in mpc_action_doxid0()
1846 ch->ccw[8].cmd_code = CCW_CMD_SENSE_CMD; in mpc_action_doxid0()
1850 ch->ccw[8].cmd_code = CCW_CMD_WRITE_CTL; in mpc_action_doxid0()
1854 fsm_event(grp->fsm, MPCG_EVENT_DOIO, ch); in mpc_action_doxid0()
1877 struct channel *ch = priv->channel[direction]; in mpc_action_doxid7() local
1878 struct xid2 *thisxid = ch->xid; in mpc_action_doxid7()
1879 ch->xid_skb->data = ch->xid_skb_data; in mpc_action_doxid7()
1880 skb_reset_tail_pointer(ch->xid_skb); in mpc_action_doxid7()
1881 ch->xid_skb->len = 0; in mpc_action_doxid7()
1888 if (fsm_getstate(ch->fsm) == CH_XID7_PENDING1) { in mpc_action_doxid7()
1889 fsm_newstate(ch->fsm, CH_XID7_PENDING2); in mpc_action_doxid7()
1890 ch->ccw[8].cmd_code = CCW_CMD_SENSE_CMD; in mpc_action_doxid7()
1891 skb_put_data(ch->xid_skb, &thdummy, in mpc_action_doxid7()
1895 } else if (fsm_getstate(ch->fsm) < CH_XID7_PENDING2) { in mpc_action_doxid7()
1896 fsm_newstate(ch->fsm, CH_XID7_PENDING2); in mpc_action_doxid7()
1897 ch->ccw[8].cmd_code = CCW_CMD_WRITE_CTL; in mpc_action_doxid7()
1898 skb_put_data(ch->xid_skb, &thnorm, in mpc_action_doxid7()
1905 if (fsm_getstate(ch->fsm) < CH_XID7_PENDING4) { in mpc_action_doxid7()
1906 fsm_newstate(ch->fsm, CH_XID7_PENDING4); in mpc_action_doxid7()
1907 skb_put_data(ch->xid_skb, &thnorm, in mpc_action_doxid7()
1909 ch->ccw[8].cmd_code = CCW_CMD_WRITE_CTL; in mpc_action_doxid7()
1912 } else if (fsm_getstate(ch->fsm) == CH_XID7_PENDING3) { in mpc_action_doxid7()
1913 fsm_newstate(ch->fsm, CH_XID7_PENDING4); in mpc_action_doxid7()
1914 ch->ccw[8].cmd_code = CCW_CMD_SENSE_CMD; in mpc_action_doxid7()
1915 skb_put_data(ch->xid_skb, &thdummy, in mpc_action_doxid7()
1922 fsm_event(grp->fsm, MPCG_EVENT_DOIO, ch); in mpc_action_doxid7()
1936 struct channel *ch = mpcginfo->ch; in mpc_action_rcvd_xid0() local
1937 struct net_device *dev = ch->netdev; in mpc_action_rcvd_xid0()
1941 CTCM_PR_DEBUG("%s: ch-id:%s xid2:%i xid7:%i xidt_p2:%i \n", in mpc_action_rcvd_xid0()
1942 __func__, ch->id, grp->outstanding_xid2, in mpc_action_rcvd_xid0()
1945 if (fsm_getstate(ch->fsm) < CH_XID7_PENDING) in mpc_action_rcvd_xid0()
1946 fsm_newstate(ch->fsm, CH_XID7_PENDING); in mpc_action_rcvd_xid0()
1980 __func__, ch->id, grp->outstanding_xid2, in mpc_action_rcvd_xid0()
1983 __func__, ch->id, in mpc_action_rcvd_xid0()
1984 fsm_getstate_str(grp->fsm), fsm_getstate_str(ch->fsm)); in mpc_action_rcvd_xid0()
1997 struct channel *ch = mpcginfo->ch; in mpc_action_rcvd_xid7() local
1998 struct net_device *dev = ch->netdev; in mpc_action_rcvd_xid7()
2002 CTCM_PR_DEBUG("Enter %s: cp=%i ch=0x%p id=%s\n", in mpc_action_rcvd_xid7()
2003 __func__, smp_processor_id(), ch, ch->id); in mpc_action_rcvd_xid7()
2008 ch->xid_skb->data = ch->xid_skb_data; in mpc_action_rcvd_xid7()
2009 skb_reset_tail_pointer(ch->xid_skb); in mpc_action_rcvd_xid7()
2010 ch->xid_skb->len = 0; in mpc_action_rcvd_xid7()