Lines Matching refs:conn
217 struct iucv_connection *conn; member
228 struct iucv_connection *conn; member
296 static char *netiucv_printuser(struct iucv_connection *conn) in netiucv_printuser() argument
302 if (memcmp(conn->userdata, iucvMagic_ebcdic, 16)) { in netiucv_printuser()
305 memcpy(tmp_uid, conn->userid, 8); in netiucv_printuser()
307 memcpy(tmp_udat, conn->userdata, 16); in netiucv_printuser()
313 return netiucv_printname(conn->userid, 8); in netiucv_printuser()
532 struct iucv_connection *conn = path->private; in netiucv_callback_rx() local
535 ev.conn = conn; in netiucv_callback_rx()
537 fsm_event(conn->fsm, CONN_EVENT_RX, &ev); in netiucv_callback_rx()
543 struct iucv_connection *conn = path->private; in netiucv_callback_txdone() local
546 ev.conn = conn; in netiucv_callback_txdone()
548 fsm_event(conn->fsm, CONN_EVENT_TXDONE, &ev); in netiucv_callback_txdone()
553 struct iucv_connection *conn = path->private; in netiucv_callback_connack() local
555 fsm_event(conn->fsm, CONN_EVENT_CONN_ACK, conn); in netiucv_callback_connack()
561 struct iucv_connection *conn = path->private; in netiucv_callback_connreq() local
572 list_for_each_entry(conn, &iucv_connection_list, list) { in netiucv_callback_connreq()
573 if (strncmp(ipvmid, conn->userid, 8) || in netiucv_callback_connreq()
574 strncmp(ipuser, conn->userdata, 16)) in netiucv_callback_connreq()
577 conn->path = path; in netiucv_callback_connreq()
578 ev.conn = conn; in netiucv_callback_connreq()
580 fsm_event(conn->fsm, CONN_EVENT_CONN_REQ, &ev); in netiucv_callback_connreq()
591 struct iucv_connection *conn = path->private; in netiucv_callback_connrej() local
593 fsm_event(conn->fsm, CONN_EVENT_CONN_REJ, conn); in netiucv_callback_connrej()
598 struct iucv_connection *conn = path->private; in netiucv_callback_connsusp() local
600 fsm_event(conn->fsm, CONN_EVENT_CONN_SUS, conn); in netiucv_callback_connsusp()
605 struct iucv_connection *conn = path->private; in netiucv_callback_connres() local
607 fsm_event(conn->fsm, CONN_EVENT_CONN_RES, conn); in netiucv_callback_connres()
629 static void netiucv_unpack_skb(struct iucv_connection *conn, in netiucv_unpack_skb() argument
632 struct net_device *dev = conn->netdev; in netiucv_unpack_skb()
687 struct iucv_connection *conn = ev->conn; in conn_action_rx() local
689 struct netiucv_priv *privptr = netdev_priv(conn->netdev); in conn_action_rx()
694 if (!conn->netdev) { in conn_action_rx()
695 iucv_message_reject(conn->path, msg); in conn_action_rx()
700 if (msg->length > conn->max_buffsize) { in conn_action_rx()
701 iucv_message_reject(conn->path, msg); in conn_action_rx()
704 msg->length, conn->max_buffsize); in conn_action_rx()
707 conn->rx_buff->data = conn->rx_buff->head; in conn_action_rx()
708 skb_reset_tail_pointer(conn->rx_buff); in conn_action_rx()
709 conn->rx_buff->len = 0; in conn_action_rx()
710 rc = iucv_message_receive(conn->path, msg, 0, conn->rx_buff->data, in conn_action_rx()
717 netiucv_unpack_skb(conn, conn->rx_buff); in conn_action_rx()
723 struct iucv_connection *conn = ev->conn; in conn_action_txdone() local
738 if (!conn || !conn->netdev) { in conn_action_txdone()
743 privptr = netdev_priv(conn->netdev); in conn_action_txdone()
744 conn->prof.tx_pending--; in conn_action_txdone()
746 if ((skb = skb_dequeue(&conn->commit_queue))) { in conn_action_txdone()
757 conn->tx_buff->data = conn->tx_buff->head; in conn_action_txdone()
758 skb_reset_tail_pointer(conn->tx_buff); in conn_action_txdone()
759 conn->tx_buff->len = 0; in conn_action_txdone()
760 spin_lock_irqsave(&conn->collect_lock, saveflags); in conn_action_txdone()
761 while ((skb = skb_dequeue(&conn->collect_queue))) { in conn_action_txdone()
762 header.next = conn->tx_buff->len + skb->len + NETIUCV_HDRLEN; in conn_action_txdone()
763 memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, in conn_action_txdone()
766 skb_put(conn->tx_buff, skb->len), in conn_action_txdone()
774 if (conn->collect_len > conn->prof.maxmulti) in conn_action_txdone()
775 conn->prof.maxmulti = conn->collect_len; in conn_action_txdone()
776 conn->collect_len = 0; in conn_action_txdone()
777 spin_unlock_irqrestore(&conn->collect_lock, saveflags); in conn_action_txdone()
778 if (conn->tx_buff->len == 0) { in conn_action_txdone()
784 memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); in conn_action_txdone()
785 conn->prof.send_stamp = jiffies; in conn_action_txdone()
788 rc = iucv_message_send(conn->path, &txmsg, 0, 0, in conn_action_txdone()
789 conn->tx_buff->data, conn->tx_buff->len); in conn_action_txdone()
790 conn->prof.doios_multi++; in conn_action_txdone()
791 conn->prof.txlen += conn->tx_buff->len; in conn_action_txdone()
792 conn->prof.tx_pending++; in conn_action_txdone()
793 if (conn->prof.tx_pending > conn->prof.tx_max_pending) in conn_action_txdone()
794 conn->prof.tx_max_pending = conn->prof.tx_pending; in conn_action_txdone()
796 conn->prof.tx_pending--; in conn_action_txdone()
806 if (stat_maxcq > conn->prof.maxcqueue) in conn_action_txdone()
807 conn->prof.maxcqueue = stat_maxcq; in conn_action_txdone()
814 struct iucv_connection *conn = ev->conn; in conn_action_connaccept() local
816 struct net_device *netdev = conn->netdev; in conn_action_connaccept()
822 conn->path = path; in conn_action_connaccept()
825 rc = iucv_path_accept(path, &netiucv_handler, conn->userdata , conn); in conn_action_connaccept()
831 netdev->tx_queue_len = conn->path->msglim; in conn_action_connaccept()
846 struct iucv_connection *conn = arg; in conn_action_connack() local
847 struct net_device *netdev = conn->netdev; in conn_action_connack()
851 fsm_deltimer(&conn->timer); in conn_action_connack()
853 netdev->tx_queue_len = conn->path->msglim; in conn_action_connack()
859 struct iucv_connection *conn = arg; in conn_action_conntimsev() local
862 fsm_deltimer(&conn->timer); in conn_action_conntimsev()
863 iucv_path_sever(conn->path, conn->userdata); in conn_action_conntimsev()
869 struct iucv_connection *conn = arg; in conn_action_connsever() local
870 struct net_device *netdev = conn->netdev; in conn_action_connsever()
875 fsm_deltimer(&conn->timer); in conn_action_connsever()
876 iucv_path_sever(conn->path, conn->userdata); in conn_action_connsever()
878 "connection\n", netiucv_printuser(conn)); in conn_action_connsever()
887 struct iucv_connection *conn = arg; in conn_action_start() local
888 struct net_device *netdev = conn->netdev; in conn_action_start()
903 conn->path = iucv_path_alloc(NETIUCV_QUEUELEN_DEFAULT, 0, GFP_KERNEL); in conn_action_start()
905 netdev->name, netiucv_printuser(conn)); in conn_action_start()
907 rc = iucv_path_connect(conn->path, &netiucv_handler, conn->userid, in conn_action_start()
908 NULL, conn->userdata, conn); in conn_action_start()
911 netdev->tx_queue_len = conn->path->msglim; in conn_action_start()
912 fsm_addtimer(&conn->timer, NETIUCV_TIMEOUT_5SEC, in conn_action_start()
913 CONN_EVENT_TIMER, conn); in conn_action_start()
918 netiucv_printname(conn->userid, 8)); in conn_action_start()
924 " guest %s\n", netiucv_printname(conn->userid, 8)); in conn_action_start()
937 netiucv_printname(conn->userid, 8)); in conn_action_start()
954 kfree(conn->path); in conn_action_start()
955 conn->path = NULL; in conn_action_start()
971 struct iucv_connection *conn = ev->conn; in conn_action_stop() local
972 struct net_device *netdev = conn->netdev; in conn_action_stop()
977 fsm_deltimer(&conn->timer); in conn_action_stop()
979 netiucv_purge_skb_queue(&conn->collect_queue); in conn_action_stop()
980 if (conn->path) { in conn_action_stop()
982 iucv_path_sever(conn->path, conn->userdata); in conn_action_stop()
983 kfree(conn->path); in conn_action_stop()
984 conn->path = NULL; in conn_action_stop()
986 netiucv_purge_skb_queue(&conn->commit_queue); in conn_action_stop()
992 struct iucv_connection *conn = arg; in conn_action_inval() local
993 struct net_device *netdev = conn->netdev; in conn_action_inval()
996 netdev->name, conn->userid); in conn_action_inval()
1054 fsm_event(privptr->conn->fsm, CONN_EVENT_START, privptr->conn); in dev_action_start()
1073 ev.conn = privptr->conn; in dev_action_stop()
1076 fsm_event(privptr->conn->fsm, CONN_EVENT_STOP, &ev); in dev_action_stop()
1101 netiucv_printuser(privptr->conn)); in dev_action_connup()
1163 static int netiucv_transmit_skb(struct iucv_connection *conn, in netiucv_transmit_skb() argument
1171 if (fsm_getstate(conn->fsm) != CONN_STATE_IDLE) { in netiucv_transmit_skb()
1174 spin_lock_irqsave(&conn->collect_lock, saveflags); in netiucv_transmit_skb()
1175 if (conn->collect_len + l > in netiucv_transmit_skb()
1176 (conn->max_buffsize - NETIUCV_HDRLEN)) { in netiucv_transmit_skb()
1182 skb_queue_tail(&conn->collect_queue, skb); in netiucv_transmit_skb()
1183 conn->collect_len += l; in netiucv_transmit_skb()
1186 spin_unlock_irqrestore(&conn->collect_lock, saveflags); in netiucv_transmit_skb()
1218 fsm_newstate(conn->fsm, CONN_STATE_TX); in netiucv_transmit_skb()
1219 conn->prof.send_stamp = jiffies; in netiucv_transmit_skb()
1223 rc = iucv_message_send(conn->path, &msg, 0, 0, in netiucv_transmit_skb()
1225 conn->prof.doios_single++; in netiucv_transmit_skb()
1226 conn->prof.txlen += skb->len; in netiucv_transmit_skb()
1227 conn->prof.tx_pending++; in netiucv_transmit_skb()
1228 if (conn->prof.tx_pending > conn->prof.tx_max_pending) in netiucv_transmit_skb()
1229 conn->prof.tx_max_pending = conn->prof.tx_pending; in netiucv_transmit_skb()
1232 fsm_newstate(conn->fsm, CONN_STATE_IDLE); in netiucv_transmit_skb()
1233 conn->prof.tx_pending--; in netiucv_transmit_skb()
1234 privptr = netdev_priv(conn->netdev); in netiucv_transmit_skb()
1252 skb_queue_tail(&conn->commit_queue, nskb); in netiucv_transmit_skb()
1320 if (priv && priv->conn) in netiucv_pm_freeze()
1321 ndev = priv->conn->netdev; in netiucv_pm_freeze()
1344 if (priv && priv->conn) in netiucv_pm_restore_thaw()
1345 ndev = priv->conn->netdev; in netiucv_pm_restore_thaw()
1411 rc = netiucv_transmit_skb(privptr->conn, skb); in netiucv_tx()
1463 return sprintf(buf, "%s\n", netiucv_printuser(priv->conn)); in user_show()
1518 struct net_device *ndev = priv->conn->netdev; in user_write()
1529 if (memcmp(username, priv->conn->userid, 9) && in user_write()
1546 memcpy(priv->conn->userid, username, 9); in user_write()
1547 memcpy(priv->conn->userdata, userdata, 17); in user_write()
1559 return sprintf(buf, "%d\n", priv->conn->max_buffsize); in buffer_show()
1566 struct net_device *ndev = priv->conn->netdev; in buffer_write()
1601 priv->conn->max_buffsize = bs1; in buffer_write()
1628 return sprintf(buf, "%s\n", fsm_getstate_str(priv->conn->fsm)); in conn_fsm_show()
1639 return sprintf(buf, "%ld\n", priv->conn->prof.maxmulti); in maxmulti_show()
1649 priv->conn->prof.maxmulti = 0; in maxmulti_write()
1661 return sprintf(buf, "%ld\n", priv->conn->prof.maxcqueue); in maxcq_show()
1670 priv->conn->prof.maxcqueue = 0; in maxcq_write()
1682 return sprintf(buf, "%ld\n", priv->conn->prof.doios_single); in sdoio_show()
1691 priv->conn->prof.doios_single = 0; in sdoio_write()
1703 return sprintf(buf, "%ld\n", priv->conn->prof.doios_multi); in mdoio_show()
1712 priv->conn->prof.doios_multi = 0; in mdoio_write()
1724 return sprintf(buf, "%ld\n", priv->conn->prof.txlen); in txlen_show()
1733 priv->conn->prof.txlen = 0; in txlen_write()
1745 return sprintf(buf, "%ld\n", priv->conn->prof.tx_time); in txtime_show()
1754 priv->conn->prof.tx_time = 0; in txtime_write()
1766 return sprintf(buf, "%ld\n", priv->conn->prof.tx_pending); in txpend_show()
1775 priv->conn->prof.tx_pending = 0; in txpend_write()
1787 return sprintf(buf, "%ld\n", priv->conn->prof.tx_max_pending); in txmpnd_show()
1796 priv->conn->prof.tx_max_pending = 0; in txmpnd_write()
1886 struct iucv_connection *conn; in netiucv_new_connection() local
1888 conn = kzalloc(sizeof(*conn), GFP_KERNEL); in netiucv_new_connection()
1889 if (!conn) in netiucv_new_connection()
1891 skb_queue_head_init(&conn->collect_queue); in netiucv_new_connection()
1892 skb_queue_head_init(&conn->commit_queue); in netiucv_new_connection()
1893 spin_lock_init(&conn->collect_lock); in netiucv_new_connection()
1894 conn->max_buffsize = NETIUCV_BUFSIZE_DEFAULT; in netiucv_new_connection()
1895 conn->netdev = dev; in netiucv_new_connection()
1897 conn->rx_buff = alloc_skb(conn->max_buffsize, GFP_KERNEL | GFP_DMA); in netiucv_new_connection()
1898 if (!conn->rx_buff) in netiucv_new_connection()
1900 conn->tx_buff = alloc_skb(conn->max_buffsize, GFP_KERNEL | GFP_DMA); in netiucv_new_connection()
1901 if (!conn->tx_buff) in netiucv_new_connection()
1903 conn->fsm = init_fsm("netiucvconn", conn_state_names, in netiucv_new_connection()
1907 if (!conn->fsm) in netiucv_new_connection()
1910 fsm_settimer(conn->fsm, &conn->timer); in netiucv_new_connection()
1911 fsm_newstate(conn->fsm, CONN_STATE_INVALID); in netiucv_new_connection()
1914 memcpy(conn->userdata, userdata, 17); in netiucv_new_connection()
1916 memcpy(conn->userid, username, 9); in netiucv_new_connection()
1917 fsm_newstate(conn->fsm, CONN_STATE_STOPPED); in netiucv_new_connection()
1921 list_add_tail(&conn->list, &iucv_connection_list); in netiucv_new_connection()
1923 return conn; in netiucv_new_connection()
1926 kfree_skb(conn->tx_buff); in netiucv_new_connection()
1928 kfree_skb(conn->rx_buff); in netiucv_new_connection()
1930 kfree(conn); in netiucv_new_connection()
1939 static void netiucv_remove_connection(struct iucv_connection *conn) in netiucv_remove_connection() argument
1944 list_del_init(&conn->list); in netiucv_remove_connection()
1946 fsm_deltimer(&conn->timer); in netiucv_remove_connection()
1947 netiucv_purge_skb_queue(&conn->collect_queue); in netiucv_remove_connection()
1948 if (conn->path) { in netiucv_remove_connection()
1949 iucv_path_sever(conn->path, conn->userdata); in netiucv_remove_connection()
1950 kfree(conn->path); in netiucv_remove_connection()
1951 conn->path = NULL; in netiucv_remove_connection()
1953 netiucv_purge_skb_queue(&conn->commit_queue); in netiucv_remove_connection()
1954 kfree_fsm(conn->fsm); in netiucv_remove_connection()
1955 kfree_skb(conn->rx_buff); in netiucv_remove_connection()
1956 kfree_skb(conn->tx_buff); in netiucv_remove_connection()
1972 if (privptr->conn) in netiucv_free_netdevice()
1973 netiucv_remove_connection(privptr->conn); in netiucv_free_netdevice()
1976 privptr->conn = NULL; privptr->fsm = NULL; in netiucv_free_netdevice()
2028 privptr->conn = netiucv_new_connection(dev, username, userdata); in netiucv_init_netdevice()
2029 if (!privptr->conn) { in netiucv_init_netdevice()
2096 netiucv_printuser(priv->conn)); in conn_write()
2144 priv->conn->userid); in remove_write()