Lines Matching refs:conn

218 	struct iucv_connection *conn;  member
229 struct iucv_connection *conn; member
297 static char *netiucv_printuser(struct iucv_connection *conn) in netiucv_printuser() argument
303 if (memcmp(conn->userdata, iucvMagic_ebcdic, 16)) { in netiucv_printuser()
306 memcpy(tmp_uid, conn->userid, 8); in netiucv_printuser()
308 memcpy(tmp_udat, conn->userdata, 16); in netiucv_printuser()
314 return netiucv_printname(conn->userid, 8); in netiucv_printuser()
533 struct iucv_connection *conn = path->private; in netiucv_callback_rx() local
536 ev.conn = conn; in netiucv_callback_rx()
538 fsm_event(conn->fsm, CONN_EVENT_RX, &ev); in netiucv_callback_rx()
544 struct iucv_connection *conn = path->private; in netiucv_callback_txdone() local
547 ev.conn = conn; in netiucv_callback_txdone()
549 fsm_event(conn->fsm, CONN_EVENT_TXDONE, &ev); in netiucv_callback_txdone()
554 struct iucv_connection *conn = path->private; in netiucv_callback_connack() local
556 fsm_event(conn->fsm, CONN_EVENT_CONN_ACK, conn); in netiucv_callback_connack()
562 struct iucv_connection *conn = path->private; in netiucv_callback_connreq() local
573 list_for_each_entry(conn, &iucv_connection_list, list) { in netiucv_callback_connreq()
574 if (strncmp(ipvmid, conn->userid, 8) || in netiucv_callback_connreq()
575 strncmp(ipuser, conn->userdata, 16)) in netiucv_callback_connreq()
578 conn->path = path; in netiucv_callback_connreq()
579 ev.conn = conn; in netiucv_callback_connreq()
581 fsm_event(conn->fsm, CONN_EVENT_CONN_REQ, &ev); in netiucv_callback_connreq()
592 struct iucv_connection *conn = path->private; in netiucv_callback_connrej() local
594 fsm_event(conn->fsm, CONN_EVENT_CONN_REJ, conn); in netiucv_callback_connrej()
599 struct iucv_connection *conn = path->private; in netiucv_callback_connsusp() local
601 fsm_event(conn->fsm, CONN_EVENT_CONN_SUS, conn); in netiucv_callback_connsusp()
606 struct iucv_connection *conn = path->private; in netiucv_callback_connres() local
608 fsm_event(conn->fsm, CONN_EVENT_CONN_RES, conn); in netiucv_callback_connres()
630 static void netiucv_unpack_skb(struct iucv_connection *conn, in netiucv_unpack_skb() argument
633 struct net_device *dev = conn->netdev; in netiucv_unpack_skb()
688 struct iucv_connection *conn = ev->conn; in conn_action_rx() local
690 struct netiucv_priv *privptr = netdev_priv(conn->netdev); in conn_action_rx()
695 if (!conn->netdev) { in conn_action_rx()
696 iucv_message_reject(conn->path, msg); in conn_action_rx()
701 if (msg->length > conn->max_buffsize) { in conn_action_rx()
702 iucv_message_reject(conn->path, msg); in conn_action_rx()
705 msg->length, conn->max_buffsize); in conn_action_rx()
708 conn->rx_buff->data = conn->rx_buff->head; in conn_action_rx()
709 skb_reset_tail_pointer(conn->rx_buff); in conn_action_rx()
710 conn->rx_buff->len = 0; in conn_action_rx()
711 rc = iucv_message_receive(conn->path, msg, 0, conn->rx_buff->data, in conn_action_rx()
718 netiucv_unpack_skb(conn, conn->rx_buff); in conn_action_rx()
724 struct iucv_connection *conn = ev->conn; in conn_action_txdone() local
739 if (!conn || !conn->netdev) { in conn_action_txdone()
744 privptr = netdev_priv(conn->netdev); in conn_action_txdone()
745 conn->prof.tx_pending--; in conn_action_txdone()
747 if ((skb = skb_dequeue(&conn->commit_queue))) { in conn_action_txdone()
758 conn->tx_buff->data = conn->tx_buff->head; in conn_action_txdone()
759 skb_reset_tail_pointer(conn->tx_buff); in conn_action_txdone()
760 conn->tx_buff->len = 0; in conn_action_txdone()
761 spin_lock_irqsave(&conn->collect_lock, saveflags); in conn_action_txdone()
762 while ((skb = skb_dequeue(&conn->collect_queue))) { in conn_action_txdone()
763 header.next = conn->tx_buff->len + skb->len + NETIUCV_HDRLEN; in conn_action_txdone()
764 memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, in conn_action_txdone()
767 skb_put(conn->tx_buff, skb->len), in conn_action_txdone()
775 if (conn->collect_len > conn->prof.maxmulti) in conn_action_txdone()
776 conn->prof.maxmulti = conn->collect_len; in conn_action_txdone()
777 conn->collect_len = 0; in conn_action_txdone()
778 spin_unlock_irqrestore(&conn->collect_lock, saveflags); in conn_action_txdone()
779 if (conn->tx_buff->len == 0) { in conn_action_txdone()
785 memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); in conn_action_txdone()
786 conn->prof.send_stamp = jiffies; in conn_action_txdone()
789 rc = iucv_message_send(conn->path, &txmsg, 0, 0, in conn_action_txdone()
790 conn->tx_buff->data, conn->tx_buff->len); in conn_action_txdone()
791 conn->prof.doios_multi++; in conn_action_txdone()
792 conn->prof.txlen += conn->tx_buff->len; in conn_action_txdone()
793 conn->prof.tx_pending++; in conn_action_txdone()
794 if (conn->prof.tx_pending > conn->prof.tx_max_pending) in conn_action_txdone()
795 conn->prof.tx_max_pending = conn->prof.tx_pending; in conn_action_txdone()
797 conn->prof.tx_pending--; in conn_action_txdone()
807 if (stat_maxcq > conn->prof.maxcqueue) in conn_action_txdone()
808 conn->prof.maxcqueue = stat_maxcq; in conn_action_txdone()
815 struct iucv_connection *conn = ev->conn; in conn_action_connaccept() local
817 struct net_device *netdev = conn->netdev; in conn_action_connaccept()
823 conn->path = path; in conn_action_connaccept()
826 rc = iucv_path_accept(path, &netiucv_handler, conn->userdata , conn); in conn_action_connaccept()
832 netdev->tx_queue_len = conn->path->msglim; in conn_action_connaccept()
847 struct iucv_connection *conn = arg; in conn_action_connack() local
848 struct net_device *netdev = conn->netdev; in conn_action_connack()
852 fsm_deltimer(&conn->timer); in conn_action_connack()
854 netdev->tx_queue_len = conn->path->msglim; in conn_action_connack()
860 struct iucv_connection *conn = arg; in conn_action_conntimsev() local
863 fsm_deltimer(&conn->timer); in conn_action_conntimsev()
864 iucv_path_sever(conn->path, conn->userdata); in conn_action_conntimsev()
870 struct iucv_connection *conn = arg; in conn_action_connsever() local
871 struct net_device *netdev = conn->netdev; in conn_action_connsever()
876 fsm_deltimer(&conn->timer); in conn_action_connsever()
877 iucv_path_sever(conn->path, conn->userdata); in conn_action_connsever()
879 "connection\n", netiucv_printuser(conn)); in conn_action_connsever()
888 struct iucv_connection *conn = arg; in conn_action_start() local
889 struct net_device *netdev = conn->netdev; in conn_action_start()
904 conn->path = iucv_path_alloc(NETIUCV_QUEUELEN_DEFAULT, 0, GFP_KERNEL); in conn_action_start()
906 netdev->name, netiucv_printuser(conn)); in conn_action_start()
908 rc = iucv_path_connect(conn->path, &netiucv_handler, conn->userid, in conn_action_start()
909 NULL, conn->userdata, conn); in conn_action_start()
912 netdev->tx_queue_len = conn->path->msglim; in conn_action_start()
913 fsm_addtimer(&conn->timer, NETIUCV_TIMEOUT_5SEC, in conn_action_start()
914 CONN_EVENT_TIMER, conn); in conn_action_start()
919 netiucv_printname(conn->userid, 8)); in conn_action_start()
925 " guest %s\n", netiucv_printname(conn->userid, 8)); in conn_action_start()
938 netiucv_printname(conn->userid, 8)); in conn_action_start()
955 kfree(conn->path); in conn_action_start()
956 conn->path = NULL; in conn_action_start()
972 struct iucv_connection *conn = ev->conn; in conn_action_stop() local
973 struct net_device *netdev = conn->netdev; in conn_action_stop()
978 fsm_deltimer(&conn->timer); in conn_action_stop()
980 netiucv_purge_skb_queue(&conn->collect_queue); in conn_action_stop()
981 if (conn->path) { in conn_action_stop()
983 iucv_path_sever(conn->path, conn->userdata); in conn_action_stop()
984 kfree(conn->path); in conn_action_stop()
985 conn->path = NULL; in conn_action_stop()
987 netiucv_purge_skb_queue(&conn->commit_queue); in conn_action_stop()
993 struct iucv_connection *conn = arg; in conn_action_inval() local
994 struct net_device *netdev = conn->netdev; in conn_action_inval()
997 netdev->name, conn->userid); in conn_action_inval()
1055 fsm_event(privptr->conn->fsm, CONN_EVENT_START, privptr->conn); in dev_action_start()
1074 ev.conn = privptr->conn; in dev_action_stop()
1077 fsm_event(privptr->conn->fsm, CONN_EVENT_STOP, &ev); in dev_action_stop()
1102 netiucv_printuser(privptr->conn)); in dev_action_connup()
1164 static int netiucv_transmit_skb(struct iucv_connection *conn, in netiucv_transmit_skb() argument
1172 if (fsm_getstate(conn->fsm) != CONN_STATE_IDLE) { in netiucv_transmit_skb()
1175 spin_lock_irqsave(&conn->collect_lock, saveflags); in netiucv_transmit_skb()
1176 if (conn->collect_len + l > in netiucv_transmit_skb()
1177 (conn->max_buffsize - NETIUCV_HDRLEN)) { in netiucv_transmit_skb()
1183 skb_queue_tail(&conn->collect_queue, skb); in netiucv_transmit_skb()
1184 conn->collect_len += l; in netiucv_transmit_skb()
1187 spin_unlock_irqrestore(&conn->collect_lock, saveflags); in netiucv_transmit_skb()
1219 fsm_newstate(conn->fsm, CONN_STATE_TX); in netiucv_transmit_skb()
1220 conn->prof.send_stamp = jiffies; in netiucv_transmit_skb()
1224 rc = iucv_message_send(conn->path, &msg, 0, 0, in netiucv_transmit_skb()
1226 conn->prof.doios_single++; in netiucv_transmit_skb()
1227 conn->prof.txlen += skb->len; in netiucv_transmit_skb()
1228 conn->prof.tx_pending++; in netiucv_transmit_skb()
1229 if (conn->prof.tx_pending > conn->prof.tx_max_pending) in netiucv_transmit_skb()
1230 conn->prof.tx_max_pending = conn->prof.tx_pending; in netiucv_transmit_skb()
1233 fsm_newstate(conn->fsm, CONN_STATE_IDLE); in netiucv_transmit_skb()
1234 conn->prof.tx_pending--; in netiucv_transmit_skb()
1235 privptr = netdev_priv(conn->netdev); in netiucv_transmit_skb()
1253 skb_queue_tail(&conn->commit_queue, nskb); in netiucv_transmit_skb()
1321 if (priv && priv->conn) in netiucv_pm_freeze()
1322 ndev = priv->conn->netdev; in netiucv_pm_freeze()
1345 if (priv && priv->conn) in netiucv_pm_restore_thaw()
1346 ndev = priv->conn->netdev; in netiucv_pm_restore_thaw()
1412 rc = netiucv_transmit_skb(privptr->conn, skb); in netiucv_tx()
1464 return sprintf(buf, "%s\n", netiucv_printuser(priv->conn)); in user_show()
1519 struct net_device *ndev = priv->conn->netdev; in user_write()
1530 if (memcmp(username, priv->conn->userid, 9) && in user_write()
1547 memcpy(priv->conn->userid, username, 9); in user_write()
1548 memcpy(priv->conn->userdata, userdata, 17); in user_write()
1560 return sprintf(buf, "%d\n", priv->conn->max_buffsize); in buffer_show()
1567 struct net_device *ndev = priv->conn->netdev; in buffer_write()
1602 priv->conn->max_buffsize = bs1; in buffer_write()
1629 return sprintf(buf, "%s\n", fsm_getstate_str(priv->conn->fsm)); in conn_fsm_show()
1640 return sprintf(buf, "%ld\n", priv->conn->prof.maxmulti); in maxmulti_show()
1650 priv->conn->prof.maxmulti = 0; in maxmulti_write()
1662 return sprintf(buf, "%ld\n", priv->conn->prof.maxcqueue); in maxcq_show()
1671 priv->conn->prof.maxcqueue = 0; in maxcq_write()
1683 return sprintf(buf, "%ld\n", priv->conn->prof.doios_single); in sdoio_show()
1692 priv->conn->prof.doios_single = 0; in sdoio_write()
1704 return sprintf(buf, "%ld\n", priv->conn->prof.doios_multi); in mdoio_show()
1713 priv->conn->prof.doios_multi = 0; in mdoio_write()
1725 return sprintf(buf, "%ld\n", priv->conn->prof.txlen); in txlen_show()
1734 priv->conn->prof.txlen = 0; in txlen_write()
1746 return sprintf(buf, "%ld\n", priv->conn->prof.tx_time); in txtime_show()
1755 priv->conn->prof.tx_time = 0; in txtime_write()
1767 return sprintf(buf, "%ld\n", priv->conn->prof.tx_pending); in txpend_show()
1776 priv->conn->prof.tx_pending = 0; in txpend_write()
1788 return sprintf(buf, "%ld\n", priv->conn->prof.tx_max_pending); in txmpnd_show()
1797 priv->conn->prof.tx_max_pending = 0; in txmpnd_write()
1887 struct iucv_connection *conn; in netiucv_new_connection() local
1889 conn = kzalloc(sizeof(*conn), GFP_KERNEL); in netiucv_new_connection()
1890 if (!conn) in netiucv_new_connection()
1892 skb_queue_head_init(&conn->collect_queue); in netiucv_new_connection()
1893 skb_queue_head_init(&conn->commit_queue); in netiucv_new_connection()
1894 spin_lock_init(&conn->collect_lock); in netiucv_new_connection()
1895 conn->max_buffsize = NETIUCV_BUFSIZE_DEFAULT; in netiucv_new_connection()
1896 conn->netdev = dev; in netiucv_new_connection()
1898 conn->rx_buff = alloc_skb(conn->max_buffsize, GFP_KERNEL | GFP_DMA); in netiucv_new_connection()
1899 if (!conn->rx_buff) in netiucv_new_connection()
1901 conn->tx_buff = alloc_skb(conn->max_buffsize, GFP_KERNEL | GFP_DMA); in netiucv_new_connection()
1902 if (!conn->tx_buff) in netiucv_new_connection()
1904 conn->fsm = init_fsm("netiucvconn", conn_state_names, in netiucv_new_connection()
1908 if (!conn->fsm) in netiucv_new_connection()
1911 fsm_settimer(conn->fsm, &conn->timer); in netiucv_new_connection()
1912 fsm_newstate(conn->fsm, CONN_STATE_INVALID); in netiucv_new_connection()
1915 memcpy(conn->userdata, userdata, 17); in netiucv_new_connection()
1917 memcpy(conn->userid, username, 9); in netiucv_new_connection()
1918 fsm_newstate(conn->fsm, CONN_STATE_STOPPED); in netiucv_new_connection()
1922 list_add_tail(&conn->list, &iucv_connection_list); in netiucv_new_connection()
1924 return conn; in netiucv_new_connection()
1927 kfree_skb(conn->tx_buff); in netiucv_new_connection()
1929 kfree_skb(conn->rx_buff); in netiucv_new_connection()
1931 kfree(conn); in netiucv_new_connection()
1940 static void netiucv_remove_connection(struct iucv_connection *conn) in netiucv_remove_connection() argument
1945 list_del_init(&conn->list); in netiucv_remove_connection()
1947 fsm_deltimer(&conn->timer); in netiucv_remove_connection()
1948 netiucv_purge_skb_queue(&conn->collect_queue); in netiucv_remove_connection()
1949 if (conn->path) { in netiucv_remove_connection()
1950 iucv_path_sever(conn->path, conn->userdata); in netiucv_remove_connection()
1951 kfree(conn->path); in netiucv_remove_connection()
1952 conn->path = NULL; in netiucv_remove_connection()
1954 netiucv_purge_skb_queue(&conn->commit_queue); in netiucv_remove_connection()
1955 kfree_fsm(conn->fsm); in netiucv_remove_connection()
1956 kfree_skb(conn->rx_buff); in netiucv_remove_connection()
1957 kfree_skb(conn->tx_buff); in netiucv_remove_connection()
1973 if (privptr->conn) in netiucv_free_netdevice()
1974 netiucv_remove_connection(privptr->conn); in netiucv_free_netdevice()
1977 privptr->conn = NULL; privptr->fsm = NULL; in netiucv_free_netdevice()
2029 privptr->conn = netiucv_new_connection(dev, username, userdata); in netiucv_init_netdevice()
2030 if (!privptr->conn) { in netiucv_init_netdevice()
2097 netiucv_printuser(priv->conn)); in conn_write()
2145 priv->conn->userid); in remove_write()