Lines Matching refs:ch
107 static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb);
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()
646 struct channel *ch = priv->channel[CTCM_WRITE]; in ctcmpc_send_sweep_resp() local
660 header->sw.th_last_seq = ch->th_seq_num; in ctcmpc_send_sweep_resp()
663 skb_queue_tail(&ch->sweep_queue, sweep_skb); in ctcmpc_send_sweep_resp()
665 fsm_addtimer(&ch->sweep_timer, 100, CTC_EVENT_RSWEEP_TIMER, ch); in ctcmpc_send_sweep_resp()
682 struct channel *rch = mpcginfo->ch; in mpc_rcvd_sweep_req()
686 struct channel *ch = priv->channel[CTCM_WRITE]; in mpc_rcvd_sweep_req() local
690 " %s(): ch=0x%p id=%s\n", __func__, ch, ch->id); in mpc_rcvd_sweep_req()
702 ctcmpc_send_sweep_resp(ch); in mpc_rcvd_sweep_req()
864 struct channel *ch = NULL; in mpc_group_ready() local
880 ch = priv->channel[CTCM_READ]; in mpc_group_ready()
881 ch->pdu_seq = 0; in mpc_group_ready()
883 __func__, ch->pdu_seq); in mpc_group_ready()
885 ctcmpc_chx_rxidle(ch->fsm, CTC_EVENT_START, ch); in mpc_group_ready()
887 ch = priv->channel[CTCM_WRITE]; in mpc_group_ready()
888 if (ch->collect_len > 0) { in mpc_group_ready()
889 spin_lock(&ch->collect_lock); in mpc_group_ready()
890 ctcm_purge_skb_queue(&ch->collect_queue); in mpc_group_ready()
891 ch->collect_len = 0; in mpc_group_ready()
892 spin_unlock(&ch->collect_lock); in mpc_group_ready()
894 ctcm_chx_txidle(ch->fsm, CTC_EVENT_START, ch); in mpc_group_ready()
915 void mpc_channel_action(struct channel *ch, int direction, int action) in mpc_channel_action() argument
917 struct net_device *dev = ch->netdev; in mpc_channel_action()
928 CTCM_PR_DEBUG("enter %s: ch=0x%p id=%s\n", __func__, ch, ch->id); in mpc_channel_action()
937 if ((action == MPC_CHANNEL_ADD) && (ch->in_mpcgroup == 0)) { in mpc_channel_action()
941 ch->in_mpcgroup = 1; in mpc_channel_action()
943 if (ch->xid_skb != NULL) in mpc_channel_action()
944 dev_kfree_skb_any(ch->xid_skb); in mpc_channel_action()
946 ch->xid_skb = __dev_alloc_skb(MPC_BUFSIZE_DEFAULT, in mpc_channel_action()
948 if (ch->xid_skb == NULL) { in mpc_channel_action()
955 ch->xid_skb_data = ch->xid_skb->data; in mpc_channel_action()
956 ch->xid_th = (struct th_header *)ch->xid_skb->data; in mpc_channel_action()
957 skb_put(ch->xid_skb, TH_HEADER_LENGTH); in mpc_channel_action()
958 ch->xid = (struct xid2 *)skb_tail_pointer(ch->xid_skb); in mpc_channel_action()
959 skb_put(ch->xid_skb, XID2_LENGTH); in mpc_channel_action()
960 ch->xid_id = skb_tail_pointer(ch->xid_skb); in mpc_channel_action()
961 ch->xid_skb->data = ch->xid_skb_data; in mpc_channel_action()
962 skb_reset_tail_pointer(ch->xid_skb); in mpc_channel_action()
963 ch->xid_skb->len = 0; in mpc_channel_action()
965 skb_put_data(ch->xid_skb, grp->xid_skb->data, in mpc_channel_action()
968 ch->xid->xid2_dlc_type = in mpc_channel_action()
969 ((CHANNEL_DIRECTION(ch->flags) == CTCM_READ) in mpc_channel_action()
972 if (CHANNEL_DIRECTION(ch->flags) == CTCM_WRITE) in mpc_channel_action()
973 ch->xid->xid2_buf_len = 0x00; in mpc_channel_action()
975 ch->xid_skb->data = ch->xid_skb_data; in mpc_channel_action()
976 skb_reset_tail_pointer(ch->xid_skb); in mpc_channel_action()
977 ch->xid_skb->len = 0; in mpc_channel_action()
979 fsm_newstate(ch->fsm, CH_XID0_PENDING); in mpc_channel_action()
990 (ch->in_mpcgroup == 1)) { in mpc_channel_action()
991 ch->in_mpcgroup = 0; in mpc_channel_action()
995 if (ch->xid_skb != NULL) in mpc_channel_action()
996 dev_kfree_skb_any(ch->xid_skb); in mpc_channel_action()
997 ch->xid_skb = NULL; in mpc_channel_action()
1016 CTCM_PR_DEBUG("exit %s: ch=0x%p id=%s\n", __func__, ch, ch->id); in mpc_channel_action()
1027 static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb) in ctcmpc_unpack_skb() argument
1029 struct net_device *dev = ch->netdev; in ctcmpc_unpack_skb()
1043 __func__, dev->name, smp_processor_id(), ch->id); in ctcmpc_unpack_skb()
1064 (header->th_seq_num != ch->th_seq_num + 1) && in ctcmpc_unpack_skb()
1065 (ch->th_seq_num != 0))) { in ctcmpc_unpack_skb()
1074 skb_queue_tail(&ch->io_queue, pskb); in ctcmpc_unpack_skb()
1077 ch->th_seq_num + 1, header->th_seq_num); in ctcmpc_unpack_skb()
1082 ch->th_seq_num = header->th_seq_num; in ctcmpc_unpack_skb()
1085 __func__, ch->th_seq_num); in ctcmpc_unpack_skb()
1106 if ((pskb->len <= 0) || (pskb->len > ch->max_bufsize)) { in ctcmpc_unpack_skb()
1145 *((__u32 *) skb_push(skb, 4)) = ch->pdu_seq; in ctcmpc_unpack_skb()
1146 ch->pdu_seq++; in ctcmpc_unpack_skb()
1150 __func__, ch->pdu_seq); in ctcmpc_unpack_skb()
1170 mpcginfo->ch = ch; in ctcmpc_unpack_skb()
1211 __func__, dev->name, ch, ch->id); in ctcmpc_unpack_skb()
1224 struct channel *ch = (struct channel *)thischan; in ctcmpc_bh() local
1226 struct net_device *dev = ch->netdev; in ctcmpc_bh()
1231 dev->name, smp_processor_id(), __func__, ch->id); in ctcmpc_bh()
1234 (skb = skb_dequeue(&ch->io_queue))) { in ctcmpc_bh()
1235 ctcmpc_unpack_skb(ch, skb); in ctcmpc_bh()
1244 if (skb == skb_peek(&ch->io_queue)) in ctcmpc_bh()
1248 __func__, dev->name, ch, ch->id); in ctcmpc_bh()
1477 struct channel *ch = mpcginfo->ch; in mpc_action_discontact() local
1482 if (ch) { in mpc_action_discontact()
1483 dev = ch->netdev; in mpc_action_discontact()
1489 CTCM_FUNTAIL, dev->name, ch->id); in mpc_action_discontact()
1508 struct channel *ch = (struct channel *)thischan; in mpc_action_send_discontact() local
1511 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in mpc_action_send_discontact()
1512 rc = ccw_device_start(ch->cdev, &ch->ccw[15], 0, 0xff, 0); in mpc_action_send_discontact()
1513 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in mpc_action_send_discontact()
1516 ctcm_ccw_check_rc(ch, rc, (char *)__func__); in mpc_action_send_discontact()
1530 struct channel *ch = mpcginfo->ch; in mpc_validate_xid() local
1531 struct net_device *dev = ch->netdev; in mpc_validate_xid()
1547 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1554 if (((CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? XID2_WRITE_SIDE : in mpc_validate_xid()
1560 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1595 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1600 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1609 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1616 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1623 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1630 CTCM_FUNTAIL, ch->id); in mpc_validate_xid()
1651 struct channel *ch = arg; in mpc_action_side_xid() local
1658 __func__, smp_processor_id(), ch, ch->id); in mpc_action_side_xid()
1660 if (ctcm_checkalloc_buffer(ch)) in mpc_action_side_xid()
1666 ch->trans_skb->data = ch->trans_skb_data; in mpc_action_side_xid()
1667 skb_reset_tail_pointer(ch->trans_skb); in mpc_action_side_xid()
1668 ch->trans_skb->len = 0; in mpc_action_side_xid()
1673 memset(ch->trans_skb->data, 0, 16); in mpc_action_side_xid()
1674 ch->rcvd_xid_th = (struct th_header *)ch->trans_skb_data; in mpc_action_side_xid()
1676 skb_put(ch->trans_skb, TH_HEADER_LENGTH); in mpc_action_side_xid()
1677 ch->rcvd_xid = (struct xid2 *)skb_tail_pointer(ch->trans_skb); in mpc_action_side_xid()
1679 skb_put(ch->trans_skb, XID2_LENGTH); in mpc_action_side_xid()
1680 ch->rcvd_xid_id = skb_tail_pointer(ch->trans_skb); in mpc_action_side_xid()
1682 ch->trans_skb->data = ch->trans_skb_data; in mpc_action_side_xid()
1683 skb_reset_tail_pointer(ch->trans_skb); in mpc_action_side_xid()
1684 ch->trans_skb->len = 0; in mpc_action_side_xid()
1694 ch->ccw[8].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1695 ch->ccw[8].count = 0; in mpc_action_side_xid()
1696 ch->ccw[8].cda = 0x00; in mpc_action_side_xid()
1698 if (!(ch->xid_th && ch->xid && ch->xid_id)) in mpc_action_side_xid()
1701 CTCM_FUNTAIL, ch->id, ch->xid_th, ch->xid, ch->xid_id); in mpc_action_side_xid()
1705 if (ch->xid_th == NULL) in mpc_action_side_xid()
1707 ch->ccw[9].cmd_code = CCW_CMD_WRITE; in mpc_action_side_xid()
1708 ch->ccw[9].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1709 ch->ccw[9].count = TH_HEADER_LENGTH; in mpc_action_side_xid()
1710 ch->ccw[9].cda = virt_to_phys(ch->xid_th); in mpc_action_side_xid()
1712 if (ch->xid == NULL) in mpc_action_side_xid()
1714 ch->ccw[10].cmd_code = CCW_CMD_WRITE; in mpc_action_side_xid()
1715 ch->ccw[10].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1716 ch->ccw[10].count = XID2_LENGTH; in mpc_action_side_xid()
1717 ch->ccw[10].cda = virt_to_phys(ch->xid); in mpc_action_side_xid()
1719 ch->ccw[11].cmd_code = CCW_CMD_READ; in mpc_action_side_xid()
1720 ch->ccw[11].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1721 ch->ccw[11].count = TH_HEADER_LENGTH; in mpc_action_side_xid()
1722 ch->ccw[11].cda = virt_to_phys(ch->rcvd_xid_th); in mpc_action_side_xid()
1724 ch->ccw[12].cmd_code = CCW_CMD_READ; in mpc_action_side_xid()
1725 ch->ccw[12].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1726 ch->ccw[12].count = XID2_LENGTH; in mpc_action_side_xid()
1727 ch->ccw[12].cda = virt_to_phys(ch->rcvd_xid); in mpc_action_side_xid()
1729 ch->ccw[13].cmd_code = CCW_CMD_READ; in mpc_action_side_xid()
1730 ch->ccw[13].cda = virt_to_phys(ch->rcvd_xid_id); in mpc_action_side_xid()
1733 ch->ccw[9].cmd_code = CCW_CMD_READ; in mpc_action_side_xid()
1734 ch->ccw[9].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1735 ch->ccw[9].count = TH_HEADER_LENGTH; in mpc_action_side_xid()
1736 ch->ccw[9].cda = virt_to_phys(ch->rcvd_xid_th); in mpc_action_side_xid()
1738 ch->ccw[10].cmd_code = CCW_CMD_READ; in mpc_action_side_xid()
1739 ch->ccw[10].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1740 ch->ccw[10].count = XID2_LENGTH; in mpc_action_side_xid()
1741 ch->ccw[10].cda = virt_to_phys(ch->rcvd_xid); in mpc_action_side_xid()
1743 if (ch->xid_th == NULL) in mpc_action_side_xid()
1745 ch->ccw[11].cmd_code = CCW_CMD_WRITE; in mpc_action_side_xid()
1746 ch->ccw[11].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1747 ch->ccw[11].count = TH_HEADER_LENGTH; in mpc_action_side_xid()
1748 ch->ccw[11].cda = virt_to_phys(ch->xid_th); in mpc_action_side_xid()
1750 if (ch->xid == NULL) in mpc_action_side_xid()
1752 ch->ccw[12].cmd_code = CCW_CMD_WRITE; in mpc_action_side_xid()
1753 ch->ccw[12].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1754 ch->ccw[12].count = XID2_LENGTH; in mpc_action_side_xid()
1755 ch->ccw[12].cda = virt_to_phys(ch->xid); in mpc_action_side_xid()
1757 if (ch->xid_id == NULL) in mpc_action_side_xid()
1759 ch->ccw[13].cmd_code = CCW_CMD_WRITE; in mpc_action_side_xid()
1760 ch->ccw[13].cda = virt_to_phys(ch->xid_id); in mpc_action_side_xid()
1763 ch->ccw[13].flags = CCW_FLAG_SLI | CCW_FLAG_CC; in mpc_action_side_xid()
1764 ch->ccw[13].count = 4; in mpc_action_side_xid()
1766 ch->ccw[14].cmd_code = CCW_CMD_NOOP; in mpc_action_side_xid()
1767 ch->ccw[14].flags = CCW_FLAG_SLI; in mpc_action_side_xid()
1768 ch->ccw[14].count = 0; in mpc_action_side_xid()
1769 ch->ccw[14].cda = 0; in mpc_action_side_xid()
1771 CTCM_CCW_DUMP((char *)&ch->ccw[8], sizeof(struct ccw1) * 7); in mpc_action_side_xid()
1772 CTCM_D3_DUMP((char *)ch->xid_th, TH_HEADER_LENGTH); in mpc_action_side_xid()
1773 CTCM_D3_DUMP((char *)ch->xid, XID2_LENGTH); in mpc_action_side_xid()
1774 CTCM_D3_DUMP((char *)ch->xid_id, 4); in mpc_action_side_xid()
1780 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); in mpc_action_side_xid()
1784 fsm_addtimer(&ch->timer, 5000 , CTC_EVENT_TIMER, ch); in mpc_action_side_xid()
1785 rc = ccw_device_start(ch->cdev, &ch->ccw[8], 0, 0xff, 0); in mpc_action_side_xid()
1788 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); in mpc_action_side_xid()
1791 ctcm_ccw_check_rc(ch, rc, in mpc_action_side_xid()
1797 __func__, ch, ch->id); in mpc_action_side_xid()
1826 struct channel *ch = arg; in mpc_action_doxid0() local
1827 struct net_device *dev = ch->netdev; in mpc_action_doxid0()
1832 __func__, smp_processor_id(), ch, ch->id); in mpc_action_doxid0()
1834 if (ch->xid == NULL) { in mpc_action_doxid0()
1841 fsm_newstate(ch->fsm, CH_XID0_INPROGRESS); in mpc_action_doxid0()
1843 ch->xid->xid2_option = XID2_0; in mpc_action_doxid0()
1848 ch->ccw[8].cmd_code = CCW_CMD_SENSE_CMD; in mpc_action_doxid0()
1852 ch->ccw[8].cmd_code = CCW_CMD_WRITE_CTL; in mpc_action_doxid0()
1856 fsm_event(grp->fsm, MPCG_EVENT_DOIO, ch); in mpc_action_doxid0()
1879 struct channel *ch = priv->channel[direction]; in mpc_action_doxid7() local
1880 struct xid2 *thisxid = ch->xid; in mpc_action_doxid7()
1881 ch->xid_skb->data = ch->xid_skb_data; in mpc_action_doxid7()
1882 skb_reset_tail_pointer(ch->xid_skb); in mpc_action_doxid7()
1883 ch->xid_skb->len = 0; in mpc_action_doxid7()
1890 if (fsm_getstate(ch->fsm) == CH_XID7_PENDING1) { in mpc_action_doxid7()
1891 fsm_newstate(ch->fsm, CH_XID7_PENDING2); in mpc_action_doxid7()
1892 ch->ccw[8].cmd_code = CCW_CMD_SENSE_CMD; in mpc_action_doxid7()
1893 skb_put_data(ch->xid_skb, &thdummy, in mpc_action_doxid7()
1897 } else if (fsm_getstate(ch->fsm) < CH_XID7_PENDING2) { in mpc_action_doxid7()
1898 fsm_newstate(ch->fsm, CH_XID7_PENDING2); in mpc_action_doxid7()
1899 ch->ccw[8].cmd_code = CCW_CMD_WRITE_CTL; in mpc_action_doxid7()
1900 skb_put_data(ch->xid_skb, &thnorm, in mpc_action_doxid7()
1907 if (fsm_getstate(ch->fsm) < CH_XID7_PENDING4) { in mpc_action_doxid7()
1908 fsm_newstate(ch->fsm, CH_XID7_PENDING4); in mpc_action_doxid7()
1909 skb_put_data(ch->xid_skb, &thnorm, in mpc_action_doxid7()
1911 ch->ccw[8].cmd_code = CCW_CMD_WRITE_CTL; in mpc_action_doxid7()
1914 } else if (fsm_getstate(ch->fsm) == CH_XID7_PENDING3) { in mpc_action_doxid7()
1915 fsm_newstate(ch->fsm, CH_XID7_PENDING4); in mpc_action_doxid7()
1916 ch->ccw[8].cmd_code = CCW_CMD_SENSE_CMD; in mpc_action_doxid7()
1917 skb_put_data(ch->xid_skb, &thdummy, in mpc_action_doxid7()
1924 fsm_event(grp->fsm, MPCG_EVENT_DOIO, ch); in mpc_action_doxid7()
1938 struct channel *ch = mpcginfo->ch; in mpc_action_rcvd_xid0() local
1939 struct net_device *dev = ch->netdev; in mpc_action_rcvd_xid0()
1944 __func__, ch->id, grp->outstanding_xid2, in mpc_action_rcvd_xid0()
1947 if (fsm_getstate(ch->fsm) < CH_XID7_PENDING) in mpc_action_rcvd_xid0()
1948 fsm_newstate(ch->fsm, CH_XID7_PENDING); in mpc_action_rcvd_xid0()
1983 __func__, ch->id, grp->outstanding_xid2, in mpc_action_rcvd_xid0()
1986 __func__, ch->id, in mpc_action_rcvd_xid0()
1987 fsm_getstate_str(grp->fsm), fsm_getstate_str(ch->fsm)); in mpc_action_rcvd_xid0()
2000 struct channel *ch = mpcginfo->ch; in mpc_action_rcvd_xid7() local
2001 struct net_device *dev = ch->netdev; in mpc_action_rcvd_xid7()
2006 __func__, smp_processor_id(), ch, ch->id); in mpc_action_rcvd_xid7()
2011 ch->xid_skb->data = ch->xid_skb_data; in mpc_action_rcvd_xid7()
2012 skb_reset_tail_pointer(ch->xid_skb); in mpc_action_rcvd_xid7()
2013 ch->xid_skb->len = 0; in mpc_action_rcvd_xid7()