Lines Matching refs:ch
106 static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb);
607 struct channel *rch = mpcginfo->ch; in mpc_rcvd_sweep_resp()
611 struct channel *ch = priv->channel[CTCM_WRITE]; in mpc_rcvd_sweep_resp() local
613 CTCM_PR_DEBUG("%s: ch=0x%p id=%s\n", __func__, ch, ch->id); in mpc_rcvd_sweep_resp()
620 fsm_deltimer(&ch->sweep_timer); in mpc_rcvd_sweep_resp()
623 ch->th_seq_num = 0x00; in mpc_rcvd_sweep_resp()
644 struct channel *ch = priv->channel[CTCM_WRITE]; in ctcmpc_send_sweep_resp() local
668 header->sw.th_last_seq = ch->th_seq_num; in ctcmpc_send_sweep_resp()
675 skb_queue_tail(&ch->sweep_queue, sweep_skb); in ctcmpc_send_sweep_resp()
677 fsm_addtimer(&ch->sweep_timer, 100, CTC_EVENT_RSWEEP_TIMER, ch); in ctcmpc_send_sweep_resp()
694 struct channel *rch = mpcginfo->ch; in mpc_rcvd_sweep_req()
698 struct channel *ch = priv->channel[CTCM_WRITE]; in mpc_rcvd_sweep_req() local
702 " %s(): ch=0x%p id=%s\n", __func__, ch, ch->id); in mpc_rcvd_sweep_req()
714 ctcmpc_send_sweep_resp(ch); in mpc_rcvd_sweep_req()
876 struct channel *ch = NULL; in mpc_group_ready() local
892 ch = priv->channel[CTCM_READ]; in mpc_group_ready()
893 ch->pdu_seq = 0; in mpc_group_ready()
895 __func__, ch->pdu_seq); in mpc_group_ready()
897 ctcmpc_chx_rxidle(ch->fsm, CTC_EVENT_START, ch); in mpc_group_ready()
899 ch = priv->channel[CTCM_WRITE]; in mpc_group_ready()
900 if (ch->collect_len > 0) { in mpc_group_ready()
901 spin_lock(&ch->collect_lock); in mpc_group_ready()
902 ctcm_purge_skb_queue(&ch->collect_queue); in mpc_group_ready()
903 ch->collect_len = 0; in mpc_group_ready()
904 spin_unlock(&ch->collect_lock); in mpc_group_ready()
906 ctcm_chx_txidle(ch->fsm, CTC_EVENT_START, ch); in mpc_group_ready()
927 void mpc_channel_action(struct channel *ch, int direction, int action) in mpc_channel_action() argument
929 struct net_device *dev = ch->netdev; in mpc_channel_action()
940 CTCM_PR_DEBUG("enter %s: ch=0x%p id=%s\n", __func__, ch, ch->id); in mpc_channel_action()
949 if ((action == MPC_CHANNEL_ADD) && (ch->in_mpcgroup == 0)) { in mpc_channel_action()
953 ch->in_mpcgroup = 1; in mpc_channel_action()
955 if (ch->xid_skb != NULL) in mpc_channel_action()
956 dev_kfree_skb_any(ch->xid_skb); in mpc_channel_action()
958 ch->xid_skb = __dev_alloc_skb(MPC_BUFSIZE_DEFAULT, in mpc_channel_action()
960 if (ch->xid_skb == NULL) { in mpc_channel_action()
967 ch->xid_skb_data = ch->xid_skb->data; in mpc_channel_action()
968 ch->xid_th = (struct th_header *)ch->xid_skb->data; in mpc_channel_action()
969 skb_put(ch->xid_skb, TH_HEADER_LENGTH); in mpc_channel_action()
970 ch->xid = (struct xid2 *)skb_tail_pointer(ch->xid_skb); in mpc_channel_action()
971 skb_put(ch->xid_skb, XID2_LENGTH); in mpc_channel_action()
972 ch->xid_id = skb_tail_pointer(ch->xid_skb); 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 memcpy(skb_put(ch->xid_skb, grp->xid_skb->len), in mpc_channel_action()
981 ch->xid->xid2_dlc_type = in mpc_channel_action()
982 ((CHANNEL_DIRECTION(ch->flags) == CTCM_READ) in mpc_channel_action()
985 if (CHANNEL_DIRECTION(ch->flags) == CTCM_WRITE) in mpc_channel_action()
986 ch->xid->xid2_buf_len = 0x00; in mpc_channel_action()
988 ch->xid_skb->data = ch->xid_skb_data; in mpc_channel_action()
989 skb_reset_tail_pointer(ch->xid_skb); in mpc_channel_action()
990 ch->xid_skb->len = 0; in mpc_channel_action()
992 fsm_newstate(ch->fsm, CH_XID0_PENDING); in mpc_channel_action()
1003 (ch->in_mpcgroup == 1)) { in mpc_channel_action()
1004 ch->in_mpcgroup = 0; in mpc_channel_action()
1008 if (ch->xid_skb != NULL) in mpc_channel_action()
1009 dev_kfree_skb_any(ch->xid_skb); in mpc_channel_action()
1010 ch->xid_skb = NULL; in mpc_channel_action()
1029 CTCM_PR_DEBUG("exit %s: ch=0x%p id=%s\n", __func__, ch, ch->id); in mpc_channel_action()
1040 static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb) in ctcmpc_unpack_skb() argument
1042 struct net_device *dev = ch->netdev; in ctcmpc_unpack_skb()
1056 __func__, dev->name, smp_processor_id(), ch->id); in ctcmpc_unpack_skb()
1077 (header->th_seq_num != ch->th_seq_num + 1) && in ctcmpc_unpack_skb()
1078 (ch->th_seq_num != 0))) { in ctcmpc_unpack_skb()
1087 skb_queue_tail(&ch->io_queue, pskb); in ctcmpc_unpack_skb()
1090 ch->th_seq_num + 1, header->th_seq_num); in ctcmpc_unpack_skb()
1095 ch->th_seq_num = header->th_seq_num; in ctcmpc_unpack_skb()
1098 __func__, ch->th_seq_num); in ctcmpc_unpack_skb()
1119 if ((pskb->len <= 0) || (pskb->len > ch->max_bufsize)) { in ctcmpc_unpack_skb()
1158 *((__u32 *) skb_push(skb, 4)) = ch->pdu_seq; in ctcmpc_unpack_skb()
1159 ch->pdu_seq++; in ctcmpc_unpack_skb()
1163 __func__, ch->pdu_seq); in ctcmpc_unpack_skb()
1183 mpcginfo->ch = ch; in ctcmpc_unpack_skb()
1224 __func__, dev->name, ch, ch->id); in ctcmpc_unpack_skb()
1237 struct channel *ch = (struct channel *)thischan; in ctcmpc_bh() local
1239 struct net_device *dev = ch->netdev; in ctcmpc_bh()
1244 dev->name, smp_processor_id(), __func__, ch->id); in ctcmpc_bh()
1247 (skb = skb_dequeue(&ch->io_queue))) { in ctcmpc_bh()
1248 ctcmpc_unpack_skb(ch, skb); in ctcmpc_bh()
1257 if (skb == skb_peek(&ch->io_queue)) in ctcmpc_bh()
1261 __func__, dev->name, ch, ch->id); in ctcmpc_bh()
1492 struct channel *ch = mpcginfo->ch; in mpc_action_discontact() local
1497 if (ch) { in mpc_action_discontact()
1498 dev = ch->netdev; in mpc_action_discontact()
1504 CTCM_FUNTAIL, dev->name, ch->id); in mpc_action_discontact()
1523 struct channel *ch = (struct channel *)thischan; in mpc_action_send_discontact() local
1526 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in mpc_action_send_discontact()
1527 rc = ccw_device_start(ch->cdev, &ch->ccw[15], in mpc_action_send_discontact()
1528 (unsigned long)ch, 0xff, 0); in mpc_action_send_discontact()
1529 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in mpc_action_send_discontact()
1532 ctcm_ccw_check_rc(ch, rc, (char *)__func__); in mpc_action_send_discontact()
1546 struct channel *ch = mpcginfo->ch; in mpc_validate_xid() local
1547 struct net_device *dev = ch->netdev; in mpc_validate_xid()
1563 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1570 if (((CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? XID2_WRITE_SIDE : in mpc_validate_xid()
1576 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1612 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1617 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1626 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1633 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1640 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1647 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1668 struct channel *ch = arg; in mpc_action_side_xid() local
1675 __func__, smp_processor_id(), ch, ch->id); in mpc_action_side_xid()
1677 if (ctcm_checkalloc_buffer(ch)) in mpc_action_side_xid()
1683 ch->trans_skb->data = ch->trans_skb_data; in mpc_action_side_xid()
1684 skb_reset_tail_pointer(ch->trans_skb); in mpc_action_side_xid()
1685 ch->trans_skb->len = 0; in mpc_action_side_xid()
1690 memset(ch->trans_skb->data, 0, 16); in mpc_action_side_xid()
1691 ch->rcvd_xid_th = (struct th_header *)ch->trans_skb_data; in mpc_action_side_xid()
1693 skb_put(ch->trans_skb, TH_HEADER_LENGTH); in mpc_action_side_xid()
1694 ch->rcvd_xid = (struct xid2 *)skb_tail_pointer(ch->trans_skb); in mpc_action_side_xid()
1696 skb_put(ch->trans_skb, XID2_LENGTH); in mpc_action_side_xid()
1697 ch->rcvd_xid_id = skb_tail_pointer(ch->trans_skb); in mpc_action_side_xid()
1699 ch->trans_skb->data = ch->trans_skb_data; in mpc_action_side_xid()
1700 skb_reset_tail_pointer(ch->trans_skb); in mpc_action_side_xid()
1701 ch->trans_skb->len = 0; in mpc_action_side_xid()
1711 ch->ccw[8].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1712 ch->ccw[8].count = 0; in mpc_action_side_xid()
1713 ch->ccw[8].cda = 0x00; in mpc_action_side_xid()
1715 if (!(ch->xid_th && ch->xid && ch->xid_id)) in mpc_action_side_xid()
1718 CTCM_FUNTAIL, ch->id, ch->xid_th, ch->xid, ch->xid_id); in mpc_action_side_xid()
1722 if (ch->xid_th == NULL) in mpc_action_side_xid()
1724 ch->ccw[9].cmd_code = CCW_CMD_WRITE; in mpc_action_side_xid()
1725 ch->ccw[9].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1726 ch->ccw[9].count = TH_HEADER_LENGTH; in mpc_action_side_xid()
1727 ch->ccw[9].cda = virt_to_phys(ch->xid_th); in mpc_action_side_xid()
1729 if (ch->xid == NULL) in mpc_action_side_xid()
1731 ch->ccw[10].cmd_code = CCW_CMD_WRITE; in mpc_action_side_xid()
1732 ch->ccw[10].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1733 ch->ccw[10].count = XID2_LENGTH; in mpc_action_side_xid()
1734 ch->ccw[10].cda = virt_to_phys(ch->xid); in mpc_action_side_xid()
1736 ch->ccw[11].cmd_code = CCW_CMD_READ; in mpc_action_side_xid()
1737 ch->ccw[11].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1738 ch->ccw[11].count = TH_HEADER_LENGTH; in mpc_action_side_xid()
1739 ch->ccw[11].cda = virt_to_phys(ch->rcvd_xid_th); in mpc_action_side_xid()
1741 ch->ccw[12].cmd_code = CCW_CMD_READ; in mpc_action_side_xid()
1742 ch->ccw[12].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1743 ch->ccw[12].count = XID2_LENGTH; in mpc_action_side_xid()
1744 ch->ccw[12].cda = virt_to_phys(ch->rcvd_xid); in mpc_action_side_xid()
1746 ch->ccw[13].cmd_code = CCW_CMD_READ; in mpc_action_side_xid()
1747 ch->ccw[13].cda = virt_to_phys(ch->rcvd_xid_id); in mpc_action_side_xid()
1750 ch->ccw[9].cmd_code = CCW_CMD_READ; in mpc_action_side_xid()
1751 ch->ccw[9].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1752 ch->ccw[9].count = TH_HEADER_LENGTH; in mpc_action_side_xid()
1753 ch->ccw[9].cda = virt_to_phys(ch->rcvd_xid_th); in mpc_action_side_xid()
1755 ch->ccw[10].cmd_code = CCW_CMD_READ; in mpc_action_side_xid()
1756 ch->ccw[10].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1757 ch->ccw[10].count = XID2_LENGTH; in mpc_action_side_xid()
1758 ch->ccw[10].cda = virt_to_phys(ch->rcvd_xid); in mpc_action_side_xid()
1760 if (ch->xid_th == NULL) in mpc_action_side_xid()
1762 ch->ccw[11].cmd_code = CCW_CMD_WRITE; in mpc_action_side_xid()
1763 ch->ccw[11].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1764 ch->ccw[11].count = TH_HEADER_LENGTH; in mpc_action_side_xid()
1765 ch->ccw[11].cda = virt_to_phys(ch->xid_th); in mpc_action_side_xid()
1767 if (ch->xid == NULL) in mpc_action_side_xid()
1769 ch->ccw[12].cmd_code = CCW_CMD_WRITE; in mpc_action_side_xid()
1770 ch->ccw[12].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1771 ch->ccw[12].count = XID2_LENGTH; in mpc_action_side_xid()
1772 ch->ccw[12].cda = virt_to_phys(ch->xid); in mpc_action_side_xid()
1774 if (ch->xid_id == NULL) in mpc_action_side_xid()
1776 ch->ccw[13].cmd_code = CCW_CMD_WRITE; in mpc_action_side_xid()
1777 ch->ccw[13].cda = virt_to_phys(ch->xid_id); in mpc_action_side_xid()
1780 ch->ccw[13].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1781 ch->ccw[13].count = 4; in mpc_action_side_xid()
1783 ch->ccw[14].cmd_code = CCW_CMD_NOOP; in mpc_action_side_xid()
1784 ch->ccw[14].flags = CCW_FLAG_SLI; in mpc_action_side_xid()
1785 ch->ccw[14].count = 0; in mpc_action_side_xid()
1786 ch->ccw[14].cda = 0; in mpc_action_side_xid()
1788 CTCM_CCW_DUMP((char *)&ch->ccw[8], sizeof(struct ccw1) * 7); in mpc_action_side_xid()
1789 CTCM_D3_DUMP((char *)ch->xid_th, TH_HEADER_LENGTH); in mpc_action_side_xid()
1790 CTCM_D3_DUMP((char *)ch->xid, XID2_LENGTH); in mpc_action_side_xid()
1791 CTCM_D3_DUMP((char *)ch->xid_id, 4); in mpc_action_side_xid()
1797 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in mpc_action_side_xid()
1801 fsm_addtimer(&ch->timer, 5000 , CTC_EVENT_TIMER, ch); in mpc_action_side_xid()
1802 rc = ccw_device_start(ch->cdev, &ch->ccw[8], in mpc_action_side_xid()
1803 (unsigned long)ch, 0xff, 0); in mpc_action_side_xid()
1806 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in mpc_action_side_xid()
1809 ctcm_ccw_check_rc(ch, rc, in mpc_action_side_xid()
1815 __func__, ch, ch->id); in mpc_action_side_xid()
1844 struct channel *ch = arg; in mpc_action_doxid0() local
1845 struct net_device *dev = ch->netdev; in mpc_action_doxid0()
1850 __func__, smp_processor_id(), ch, ch->id); in mpc_action_doxid0()
1852 if (ch->xid == NULL) { in mpc_action_doxid0()
1859 fsm_newstate(ch->fsm, CH_XID0_INPROGRESS); in mpc_action_doxid0()
1861 ch->xid->xid2_option = XID2_0; in mpc_action_doxid0()
1866 ch->ccw[8].cmd_code = CCW_CMD_SENSE_CMD; in mpc_action_doxid0()
1870 ch->ccw[8].cmd_code = CCW_CMD_WRITE_CTL; in mpc_action_doxid0()
1874 fsm_event(grp->fsm, MPCG_EVENT_DOIO, ch); in mpc_action_doxid0()
1897 struct channel *ch = priv->channel[direction]; in mpc_action_doxid7() local
1898 struct xid2 *thisxid = ch->xid; in mpc_action_doxid7()
1899 ch->xid_skb->data = ch->xid_skb_data; in mpc_action_doxid7()
1900 skb_reset_tail_pointer(ch->xid_skb); in mpc_action_doxid7()
1901 ch->xid_skb->len = 0; in mpc_action_doxid7()
1908 if (fsm_getstate(ch->fsm) == CH_XID7_PENDING1) { in mpc_action_doxid7()
1909 fsm_newstate(ch->fsm, CH_XID7_PENDING2); in mpc_action_doxid7()
1910 ch->ccw[8].cmd_code = CCW_CMD_SENSE_CMD; in mpc_action_doxid7()
1911 memcpy(skb_put(ch->xid_skb, in mpc_action_doxid7()
1916 } else if (fsm_getstate(ch->fsm) < CH_XID7_PENDING2) { in mpc_action_doxid7()
1917 fsm_newstate(ch->fsm, CH_XID7_PENDING2); in mpc_action_doxid7()
1918 ch->ccw[8].cmd_code = CCW_CMD_WRITE_CTL; in mpc_action_doxid7()
1919 memcpy(skb_put(ch->xid_skb, in mpc_action_doxid7()
1927 if (fsm_getstate(ch->fsm) < CH_XID7_PENDING4) { in mpc_action_doxid7()
1928 fsm_newstate(ch->fsm, CH_XID7_PENDING4); in mpc_action_doxid7()
1929 memcpy(skb_put(ch->xid_skb, in mpc_action_doxid7()
1932 ch->ccw[8].cmd_code = CCW_CMD_WRITE_CTL; in mpc_action_doxid7()
1935 } else if (fsm_getstate(ch->fsm) == CH_XID7_PENDING3) { in mpc_action_doxid7()
1936 fsm_newstate(ch->fsm, CH_XID7_PENDING4); in mpc_action_doxid7()
1937 ch->ccw[8].cmd_code = CCW_CMD_SENSE_CMD; in mpc_action_doxid7()
1938 memcpy(skb_put(ch->xid_skb, TH_HEADER_LENGTH), in mpc_action_doxid7()
1945 fsm_event(grp->fsm, MPCG_EVENT_DOIO, ch); in mpc_action_doxid7()
1959 struct channel *ch = mpcginfo->ch; in mpc_action_rcvd_xid0() local
1960 struct net_device *dev = ch->netdev; in mpc_action_rcvd_xid0()
1965 __func__, ch->id, grp->outstanding_xid2, in mpc_action_rcvd_xid0()
1968 if (fsm_getstate(ch->fsm) < CH_XID7_PENDING) in mpc_action_rcvd_xid0()
1969 fsm_newstate(ch->fsm, CH_XID7_PENDING); in mpc_action_rcvd_xid0()
2004 __func__, ch->id, grp->outstanding_xid2, in mpc_action_rcvd_xid0()
2007 __func__, ch->id, in mpc_action_rcvd_xid0()
2008 fsm_getstate_str(grp->fsm), fsm_getstate_str(ch->fsm)); in mpc_action_rcvd_xid0()
2021 struct channel *ch = mpcginfo->ch; in mpc_action_rcvd_xid7() local
2022 struct net_device *dev = ch->netdev; in mpc_action_rcvd_xid7()
2027 __func__, smp_processor_id(), ch, ch->id); in mpc_action_rcvd_xid7()
2032 ch->xid_skb->data = ch->xid_skb_data; in mpc_action_rcvd_xid7()
2033 skb_reset_tail_pointer(ch->xid_skb); in mpc_action_rcvd_xid7()
2034 ch->xid_skb->len = 0; in mpc_action_rcvd_xid7()