• Home
  • Raw
  • Download

Lines Matching full:conn

186 	struct iucv_connection *conn;  member
197 struct iucv_connection *conn; member
264 static char *netiucv_printuser(struct iucv_connection *conn) in netiucv_printuser() argument
270 if (memcmp(conn->userdata, iucvMagic_ebcdic, 16)) { in netiucv_printuser()
273 memcpy(tmp_uid, netiucv_printname(conn->userid, 8), 8); in netiucv_printuser()
274 memcpy(tmp_udat, conn->userdata, 16); in netiucv_printuser()
280 return netiucv_printname(conn->userid, 8); in netiucv_printuser()
499 struct iucv_connection *conn = path->private; in netiucv_callback_rx() local
502 ev.conn = conn; in netiucv_callback_rx()
504 fsm_event(conn->fsm, CONN_EVENT_RX, &ev); in netiucv_callback_rx()
510 struct iucv_connection *conn = path->private; in netiucv_callback_txdone() local
513 ev.conn = conn; in netiucv_callback_txdone()
515 fsm_event(conn->fsm, CONN_EVENT_TXDONE, &ev); in netiucv_callback_txdone()
520 struct iucv_connection *conn = path->private; in netiucv_callback_connack() local
522 fsm_event(conn->fsm, CONN_EVENT_CONN_ACK, conn); in netiucv_callback_connack()
528 struct iucv_connection *conn = path->private; in netiucv_callback_connreq() local
539 list_for_each_entry(conn, &iucv_connection_list, list) { in netiucv_callback_connreq()
540 if (strncmp(ipvmid, conn->userid, 8) || in netiucv_callback_connreq()
541 strncmp(ipuser, conn->userdata, 16)) in netiucv_callback_connreq()
544 conn->path = path; in netiucv_callback_connreq()
545 ev.conn = conn; in netiucv_callback_connreq()
547 fsm_event(conn->fsm, CONN_EVENT_CONN_REQ, &ev); in netiucv_callback_connreq()
558 struct iucv_connection *conn = path->private; in netiucv_callback_connrej() local
560 fsm_event(conn->fsm, CONN_EVENT_CONN_REJ, conn); in netiucv_callback_connrej()
565 struct iucv_connection *conn = path->private; in netiucv_callback_connsusp() local
567 fsm_event(conn->fsm, CONN_EVENT_CONN_SUS, conn); in netiucv_callback_connsusp()
572 struct iucv_connection *conn = path->private; in netiucv_callback_connres() local
574 fsm_event(conn->fsm, CONN_EVENT_CONN_RES, conn); in netiucv_callback_connres()
590 * @conn: The connection where this skb has been received.
596 static void netiucv_unpack_skb(struct iucv_connection *conn, in netiucv_unpack_skb() argument
599 struct net_device *dev = conn->netdev; in netiucv_unpack_skb()
654 struct iucv_connection *conn = ev->conn; in conn_action_rx() local
656 struct netiucv_priv *privptr = netdev_priv(conn->netdev); in conn_action_rx()
661 if (!conn->netdev) { in conn_action_rx()
662 iucv_message_reject(conn->path, msg); in conn_action_rx()
667 if (msg->length > conn->max_buffsize) { in conn_action_rx()
668 iucv_message_reject(conn->path, msg); in conn_action_rx()
671 msg->length, conn->max_buffsize); in conn_action_rx()
674 conn->rx_buff->data = conn->rx_buff->head; in conn_action_rx()
675 skb_reset_tail_pointer(conn->rx_buff); in conn_action_rx()
676 conn->rx_buff->len = 0; in conn_action_rx()
677 rc = iucv_message_receive(conn->path, msg, 0, conn->rx_buff->data, in conn_action_rx()
684 netiucv_unpack_skb(conn, conn->rx_buff); in conn_action_rx()
690 struct iucv_connection *conn = ev->conn; in conn_action_txdone() local
705 if (!conn || !conn->netdev) { in conn_action_txdone()
710 privptr = netdev_priv(conn->netdev); in conn_action_txdone()
711 conn->prof.tx_pending--; in conn_action_txdone()
713 if ((skb = skb_dequeue(&conn->commit_queue))) { in conn_action_txdone()
724 conn->tx_buff->data = conn->tx_buff->head; in conn_action_txdone()
725 skb_reset_tail_pointer(conn->tx_buff); in conn_action_txdone()
726 conn->tx_buff->len = 0; in conn_action_txdone()
727 spin_lock_irqsave(&conn->collect_lock, saveflags); in conn_action_txdone()
728 while ((skb = skb_dequeue(&conn->collect_queue))) { in conn_action_txdone()
729 header.next = conn->tx_buff->len + skb->len + NETIUCV_HDRLEN; in conn_action_txdone()
730 skb_put_data(conn->tx_buff, &header, NETIUCV_HDRLEN); in conn_action_txdone()
732 skb_put(conn->tx_buff, skb->len), in conn_action_txdone()
740 if (conn->collect_len > conn->prof.maxmulti) in conn_action_txdone()
741 conn->prof.maxmulti = conn->collect_len; in conn_action_txdone()
742 conn->collect_len = 0; in conn_action_txdone()
743 spin_unlock_irqrestore(&conn->collect_lock, saveflags); in conn_action_txdone()
744 if (conn->tx_buff->len == 0) { in conn_action_txdone()
750 skb_put_data(conn->tx_buff, &header, NETIUCV_HDRLEN); in conn_action_txdone()
751 conn->prof.send_stamp = jiffies; in conn_action_txdone()
754 rc = iucv_message_send(conn->path, &txmsg, 0, 0, in conn_action_txdone()
755 conn->tx_buff->data, conn->tx_buff->len); in conn_action_txdone()
756 conn->prof.doios_multi++; in conn_action_txdone()
757 conn->prof.txlen += conn->tx_buff->len; in conn_action_txdone()
758 conn->prof.tx_pending++; in conn_action_txdone()
759 if (conn->prof.tx_pending > conn->prof.tx_max_pending) in conn_action_txdone()
760 conn->prof.tx_max_pending = conn->prof.tx_pending; in conn_action_txdone()
762 conn->prof.tx_pending--; in conn_action_txdone()
772 if (stat_maxcq > conn->prof.maxcqueue) in conn_action_txdone()
773 conn->prof.maxcqueue = stat_maxcq; in conn_action_txdone()
780 struct iucv_connection *conn = ev->conn; in conn_action_connaccept() local
782 struct net_device *netdev = conn->netdev; in conn_action_connaccept()
788 conn->path = path; in conn_action_connaccept()
791 rc = iucv_path_accept(path, &netiucv_handler, conn->userdata , conn); in conn_action_connaccept()
797 netdev->tx_queue_len = conn->path->msglim; in conn_action_connaccept()
812 struct iucv_connection *conn = arg; in conn_action_connack() local
813 struct net_device *netdev = conn->netdev; in conn_action_connack()
817 fsm_deltimer(&conn->timer); in conn_action_connack()
819 netdev->tx_queue_len = conn->path->msglim; in conn_action_connack()
825 struct iucv_connection *conn = arg; in conn_action_conntimsev() local
828 fsm_deltimer(&conn->timer); in conn_action_conntimsev()
829 iucv_path_sever(conn->path, conn->userdata); in conn_action_conntimsev()
835 struct iucv_connection *conn = arg; in conn_action_connsever() local
836 struct net_device *netdev = conn->netdev; in conn_action_connsever()
841 fsm_deltimer(&conn->timer); in conn_action_connsever()
842 iucv_path_sever(conn->path, conn->userdata); in conn_action_connsever()
844 "connection\n", netiucv_printuser(conn)); in conn_action_connsever()
853 struct iucv_connection *conn = arg; in conn_action_start() local
854 struct net_device *netdev = conn->netdev; in conn_action_start()
869 conn->path = iucv_path_alloc(NETIUCV_QUEUELEN_DEFAULT, 0, GFP_KERNEL); in conn_action_start()
871 netdev->name, netiucv_printuser(conn)); in conn_action_start()
873 rc = iucv_path_connect(conn->path, &netiucv_handler, conn->userid, in conn_action_start()
874 NULL, conn->userdata, conn); in conn_action_start()
877 netdev->tx_queue_len = conn->path->msglim; in conn_action_start()
878 fsm_addtimer(&conn->timer, NETIUCV_TIMEOUT_5SEC, in conn_action_start()
879 CONN_EVENT_TIMER, conn); in conn_action_start()
884 netiucv_printname(conn->userid, 8)); in conn_action_start()
890 " guest %s\n", netiucv_printname(conn->userid, 8)); in conn_action_start()
903 netiucv_printname(conn->userid, 8)); in conn_action_start()
920 kfree(conn->path); in conn_action_start()
921 conn->path = NULL; in conn_action_start()
937 struct iucv_connection *conn = ev->conn; in conn_action_stop() local
938 struct net_device *netdev = conn->netdev; in conn_action_stop()
943 fsm_deltimer(&conn->timer); in conn_action_stop()
945 netiucv_purge_skb_queue(&conn->collect_queue); in conn_action_stop()
946 if (conn->path) { in conn_action_stop()
948 iucv_path_sever(conn->path, conn->userdata); in conn_action_stop()
949 kfree(conn->path); in conn_action_stop()
950 conn->path = NULL; in conn_action_stop()
952 netiucv_purge_skb_queue(&conn->commit_queue); in conn_action_stop()
958 struct iucv_connection *conn = arg; in conn_action_inval() local
959 struct net_device *netdev = conn->netdev; in conn_action_inval()
962 netdev->name, conn->userid); in conn_action_inval()
1020 fsm_event(privptr->conn->fsm, CONN_EVENT_START, privptr->conn); in dev_action_start()
1039 ev.conn = privptr->conn; in dev_action_stop()
1042 fsm_event(privptr->conn->fsm, CONN_EVENT_STOP, &ev); in dev_action_stop()
1067 netiucv_printuser(privptr->conn)); in dev_action_connup()
1122 * @param conn Connection to be used for sending.
1129 static int netiucv_transmit_skb(struct iucv_connection *conn, in netiucv_transmit_skb() argument
1137 if (fsm_getstate(conn->fsm) != CONN_STATE_IDLE) { in netiucv_transmit_skb()
1140 spin_lock_irqsave(&conn->collect_lock, saveflags); in netiucv_transmit_skb()
1141 if (conn->collect_len + l > in netiucv_transmit_skb()
1142 (conn->max_buffsize - NETIUCV_HDRLEN)) { in netiucv_transmit_skb()
1148 skb_queue_tail(&conn->collect_queue, skb); in netiucv_transmit_skb()
1149 conn->collect_len += l; in netiucv_transmit_skb()
1152 spin_unlock_irqrestore(&conn->collect_lock, saveflags); in netiucv_transmit_skb()
1183 fsm_newstate(conn->fsm, CONN_STATE_TX); in netiucv_transmit_skb()
1184 conn->prof.send_stamp = jiffies; in netiucv_transmit_skb()
1188 rc = iucv_message_send(conn->path, &msg, 0, 0, in netiucv_transmit_skb()
1190 conn->prof.doios_single++; in netiucv_transmit_skb()
1191 conn->prof.txlen += skb->len; in netiucv_transmit_skb()
1192 conn->prof.tx_pending++; in netiucv_transmit_skb()
1193 if (conn->prof.tx_pending > conn->prof.tx_max_pending) in netiucv_transmit_skb()
1194 conn->prof.tx_max_pending = conn->prof.tx_pending; in netiucv_transmit_skb()
1197 fsm_newstate(conn->fsm, CONN_STATE_IDLE); in netiucv_transmit_skb()
1198 conn->prof.tx_pending--; in netiucv_transmit_skb()
1199 privptr = netdev_priv(conn->netdev); in netiucv_transmit_skb()
1217 skb_queue_tail(&conn->commit_queue, nskb); in netiucv_transmit_skb()
1303 rc = netiucv_transmit_skb(privptr->conn, skb); in netiucv_tx()
1334 return sprintf(buf, "%s\n", netiucv_printuser(priv->conn)); in user_show()
1389 struct net_device *ndev = priv->conn->netdev; in user_write()
1400 if (memcmp(username, priv->conn->userid, 9) && in user_write()
1417 memcpy(priv->conn->userid, username, 9); in user_write()
1418 memcpy(priv->conn->userdata, userdata, 17); in user_write()
1430 return sprintf(buf, "%d\n", priv->conn->max_buffsize); in buffer_show()
1437 struct net_device *ndev = priv->conn->netdev; in buffer_write()
1472 priv->conn->max_buffsize = bs1; in buffer_write()
1499 return sprintf(buf, "%s\n", fsm_getstate_str(priv->conn->fsm)); in conn_fsm_show()
1510 return sprintf(buf, "%ld\n", priv->conn->prof.maxmulti); in maxmulti_show()
1520 priv->conn->prof.maxmulti = 0; in maxmulti_write()
1532 return sprintf(buf, "%ld\n", priv->conn->prof.maxcqueue); in maxcq_show()
1541 priv->conn->prof.maxcqueue = 0; in maxcq_write()
1553 return sprintf(buf, "%ld\n", priv->conn->prof.doios_single); in sdoio_show()
1562 priv->conn->prof.doios_single = 0; in sdoio_write()
1574 return sprintf(buf, "%ld\n", priv->conn->prof.doios_multi); in mdoio_show()
1583 priv->conn->prof.doios_multi = 0; in mdoio_write()
1595 return sprintf(buf, "%ld\n", priv->conn->prof.txlen); in txlen_show()
1604 priv->conn->prof.txlen = 0; in txlen_write()
1616 return sprintf(buf, "%ld\n", priv->conn->prof.tx_time); in txtime_show()
1625 priv->conn->prof.tx_time = 0; in txtime_write()
1637 return sprintf(buf, "%ld\n", priv->conn->prof.tx_pending); in txpend_show()
1646 priv->conn->prof.tx_pending = 0; in txpend_write()
1658 return sprintf(buf, "%ld\n", priv->conn->prof.tx_max_pending); in txmpnd_show()
1667 priv->conn->prof.tx_max_pending = 0; in txmpnd_write()
1757 struct iucv_connection *conn; in netiucv_new_connection() local
1759 conn = kzalloc(sizeof(*conn), GFP_KERNEL); in netiucv_new_connection()
1760 if (!conn) in netiucv_new_connection()
1762 skb_queue_head_init(&conn->collect_queue); in netiucv_new_connection()
1763 skb_queue_head_init(&conn->commit_queue); in netiucv_new_connection()
1764 spin_lock_init(&conn->collect_lock); in netiucv_new_connection()
1765 conn->max_buffsize = NETIUCV_BUFSIZE_DEFAULT; in netiucv_new_connection()
1766 conn->netdev = dev; in netiucv_new_connection()
1768 conn->rx_buff = alloc_skb(conn->max_buffsize, GFP_KERNEL | GFP_DMA); in netiucv_new_connection()
1769 if (!conn->rx_buff) in netiucv_new_connection()
1771 conn->tx_buff = alloc_skb(conn->max_buffsize, GFP_KERNEL | GFP_DMA); in netiucv_new_connection()
1772 if (!conn->tx_buff) in netiucv_new_connection()
1774 conn->fsm = init_fsm("netiucvconn", conn_state_names, in netiucv_new_connection()
1778 if (!conn->fsm) in netiucv_new_connection()
1781 fsm_settimer(conn->fsm, &conn->timer); in netiucv_new_connection()
1782 fsm_newstate(conn->fsm, CONN_STATE_INVALID); in netiucv_new_connection()
1785 memcpy(conn->userdata, userdata, 17); in netiucv_new_connection()
1787 memcpy(conn->userid, username, 9); in netiucv_new_connection()
1788 fsm_newstate(conn->fsm, CONN_STATE_STOPPED); in netiucv_new_connection()
1792 list_add_tail(&conn->list, &iucv_connection_list); in netiucv_new_connection()
1794 return conn; in netiucv_new_connection()
1797 kfree_skb(conn->tx_buff); in netiucv_new_connection()
1799 kfree_skb(conn->rx_buff); in netiucv_new_connection()
1801 kfree(conn); in netiucv_new_connection()
1810 static void netiucv_remove_connection(struct iucv_connection *conn) in netiucv_remove_connection() argument
1815 list_del_init(&conn->list); in netiucv_remove_connection()
1817 fsm_deltimer(&conn->timer); in netiucv_remove_connection()
1818 netiucv_purge_skb_queue(&conn->collect_queue); in netiucv_remove_connection()
1819 if (conn->path) { in netiucv_remove_connection()
1820 iucv_path_sever(conn->path, conn->userdata); in netiucv_remove_connection()
1821 kfree(conn->path); in netiucv_remove_connection()
1822 conn->path = NULL; in netiucv_remove_connection()
1824 netiucv_purge_skb_queue(&conn->commit_queue); in netiucv_remove_connection()
1825 kfree_fsm(conn->fsm); in netiucv_remove_connection()
1826 kfree_skb(conn->rx_buff); in netiucv_remove_connection()
1827 kfree_skb(conn->tx_buff); in netiucv_remove_connection()
1843 if (privptr->conn) in netiucv_free_netdevice()
1844 netiucv_remove_connection(privptr->conn); in netiucv_free_netdevice()
1847 privptr->conn = NULL; privptr->fsm = NULL; in netiucv_free_netdevice()
1900 privptr->conn = netiucv_new_connection(dev, username, userdata); in netiucv_init_netdevice()
1901 if (!privptr->conn) { in netiucv_init_netdevice()
1968 netiucv_printuser(priv->conn)); in connection_store()
2015 priv->conn->userid); in remove_store()