Lines Matching +full:data +full:- +full:path
1 // SPDX-License-Identifier: GPL-2.0
41 #define MSG_TYPE_DATA 0x10 /* Terminal data */
48 u8 data[]; /* Payload buffer */ member
50 #define MSG_SIZE(s) ((s) + offsetof(struct iucv_tty_msg, data))
69 struct iucv_path *path; /* IUCV path pointer */ member
80 u8 info_path[16]; /* IUCV path info (dev attr) */
86 size_t offset; /* data buffer offset */
87 struct iucv_tty_msg *mbuf; /* buffer to store input/output data */
125 * hvc_iucv_get_private() - Return a struct hvc_iucv_private instance.
139 * alloc_tty_buffer() - Return a new struct iucv_tty_buffer element.
140 * @size: Size of the internal buffer used to store data.
144 * allocates an internal data buffer with the specified size @size.
145 * The internal data buffer is always allocated with GFP_DMA which is
146 * required for receiving and sending data with IUCV.
161 bufp->msg.length = MSG_SIZE(size); in alloc_tty_buffer()
162 bufp->mbuf = kmalloc(bufp->msg.length, flags | GFP_DMA); in alloc_tty_buffer()
163 if (!bufp->mbuf) { in alloc_tty_buffer()
167 bufp->mbuf->version = MSG_VERSION; in alloc_tty_buffer()
168 bufp->mbuf->type = MSG_TYPE_DATA; in alloc_tty_buffer()
169 bufp->mbuf->datalen = (u16) size; in alloc_tty_buffer()
175 * destroy_tty_buffer() - destroy struct iucv_tty_buffer element.
180 kfree(bufp->mbuf); in destroy_tty_buffer()
185 * destroy_tty_buffer_list() - call destroy_tty_buffer() for each list element.
193 list_del(&ent->list); in destroy_tty_buffer_list()
199 * hvc_iucv_write() - Receive IUCV message & write data to HVC buffer.
201 * @buf: HVC buffer for writing received terminal data.
206 * the message data that is then written to the specified buffer @buf.
207 * If the buffer size @count is less than the data message size, the
209 * If all message data has been written, the message is removed from
213 * there are no pending data messages available or if there is no established
214 * IUCV path.
215 * If the IUCV path has been severed, then -EPIPE is returned to cause a
226 if (priv->iucv_state == IUCV_DISCONN) in hvc_iucv_write()
229 /* if the IUCV path has been severed, return -EPIPE to inform the in hvc_iucv_write()
231 if (priv->iucv_state == IUCV_SEVERED) in hvc_iucv_write()
232 return -EPIPE; in hvc_iucv_write()
235 if (list_empty(&priv->tty_inqueue)) in hvc_iucv_write()
238 /* receive an iucv message and flip data to the tty (ldisc) */ in hvc_iucv_write()
239 rb = list_first_entry(&priv->tty_inqueue, struct iucv_tty_buffer, list); in hvc_iucv_write()
242 if (!rb->mbuf) { /* message not yet received ... */ in hvc_iucv_write()
243 /* allocate mem to store msg data; if no memory is available in hvc_iucv_write()
244 * then leave the buffer on the list and re-try later */ in hvc_iucv_write()
245 rb->mbuf = kmalloc(rb->msg.length, GFP_ATOMIC | GFP_DMA); in hvc_iucv_write()
246 if (!rb->mbuf) in hvc_iucv_write()
247 return -ENOMEM; in hvc_iucv_write()
249 rc = __iucv_message_receive(priv->path, &rb->msg, 0, in hvc_iucv_write()
250 rb->mbuf, rb->msg.length, NULL); in hvc_iucv_write()
258 written = -EIO; in hvc_iucv_write()
260 /* remove buffer if an error has occurred or received data in hvc_iucv_write()
262 if (rc || (rb->mbuf->version != MSG_VERSION) || in hvc_iucv_write()
263 (rb->msg.length != MSG_SIZE(rb->mbuf->datalen))) in hvc_iucv_write()
267 switch (rb->mbuf->type) { in hvc_iucv_write()
269 written = min_t(int, rb->mbuf->datalen - rb->offset, count); in hvc_iucv_write()
270 memcpy(buf, rb->mbuf->data + rb->offset, written); in hvc_iucv_write()
271 if (written < (rb->mbuf->datalen - rb->offset)) { in hvc_iucv_write()
272 rb->offset += written; in hvc_iucv_write()
279 if (rb->mbuf->datalen != sizeof(struct winsize)) in hvc_iucv_write()
283 __hvc_resize(priv->hvc, *((struct winsize *) rb->mbuf->data)); in hvc_iucv_write()
293 list_del(&rb->list); in hvc_iucv_write()
295 *has_more_data = !list_empty(&priv->tty_inqueue); in hvc_iucv_write()
302 * hvc_iucv_get_chars() - HVC get_chars operation.
304 * @buf: Pointer to a buffer to store data
307 * The HVC thread calls this method to read characters from the back-end.
308 * If an IUCV communication path has been established, pending IUCV messages
309 * are received and data is copied into buffer @buf up to @count bytes.
312 * the routine locks the struct hvc_iucv_private->lock to call
325 return -ENODEV; in hvc_iucv_get_chars()
327 spin_lock(&priv->lock); in hvc_iucv_get_chars()
330 spin_unlock(&priv->lock); in hvc_iucv_get_chars()
340 * hvc_iucv_queue() - Buffer terminal data for sending.
342 * @buf: Buffer containing data to send.
343 * @count: Size of buffer and amount of data to send.
345 * The function queues data for sending. To actually send the buffered data,
347 * The function returns the number of data bytes that has been buffered.
349 * If the device is not connected, data is ignored and the function returns
352 * If an existing IUCV communicaton path has been severed, -EPIPE is returned
360 if (priv->iucv_state == IUCV_DISCONN) in hvc_iucv_queue()
361 return count; /* ignore data */ in hvc_iucv_queue()
363 if (priv->iucv_state == IUCV_SEVERED) in hvc_iucv_queue()
364 return -EPIPE; in hvc_iucv_queue()
366 len = min_t(size_t, count, SNDBUF_SIZE - priv->sndbuf_len); in hvc_iucv_queue()
370 memcpy(priv->sndbuf + priv->sndbuf_len, buf, len); in hvc_iucv_queue()
371 priv->sndbuf_len += len; in hvc_iucv_queue()
373 if (priv->iucv_state == IUCV_CONNECTED) in hvc_iucv_queue()
374 schedule_delayed_work(&priv->sndbuf_work, QUEUE_SNDBUF_DELAY); in hvc_iucv_queue()
380 * hvc_iucv_send() - Send an IUCV message containing terminal data.
383 * If an IUCV communication path has been established, the buffered output data
385 * Returns 0 if there is no established IUCV communication path or
386 * -EPIPE if an existing IUCV communicaton path has been severed.
393 if (priv->iucv_state == IUCV_SEVERED) in hvc_iucv_send()
394 return -EPIPE; in hvc_iucv_send()
396 if (priv->iucv_state == IUCV_DISCONN) in hvc_iucv_send()
397 return -EIO; in hvc_iucv_send()
399 if (!priv->sndbuf_len) in hvc_iucv_send()
402 /* allocate internal buffer to store msg data and also compute total in hvc_iucv_send()
404 sb = alloc_tty_buffer(priv->sndbuf_len, GFP_ATOMIC); in hvc_iucv_send()
406 return -ENOMEM; in hvc_iucv_send()
408 memcpy(sb->mbuf->data, priv->sndbuf, priv->sndbuf_len); in hvc_iucv_send()
409 sb->mbuf->datalen = (u16) priv->sndbuf_len; in hvc_iucv_send()
410 sb->msg.length = MSG_SIZE(sb->mbuf->datalen); in hvc_iucv_send()
412 list_add_tail(&sb->list, &priv->tty_outqueue); in hvc_iucv_send()
414 rc = __iucv_message_send(priv->path, &sb->msg, 0, 0, in hvc_iucv_send()
415 (void *) sb->mbuf, sb->msg.length); in hvc_iucv_send()
419 list_del(&sb->list); in hvc_iucv_send()
422 len = priv->sndbuf_len; in hvc_iucv_send()
423 priv->sndbuf_len = 0; in hvc_iucv_send()
429 * hvc_iucv_sndbuf_work() - Send buffered data over IUCV
432 * This work queue function sends buffered output data over IUCV and,
433 * if not all buffered data could be sent, reschedules itself.
441 spin_lock_bh(&priv->lock); in hvc_iucv_sndbuf_work()
443 spin_unlock_bh(&priv->lock); in hvc_iucv_sndbuf_work()
447 * hvc_iucv_put_chars() - HVC put_chars operation.
449 * @buf: Pointer to an buffer to read data from
452 * The HVC thread calls this method to write characters to the back-end.
453 * The function calls hvc_iucv_queue() to queue terminal data for sending.
456 * locks struct hvc_iucv_private->lock.
467 return -ENODEV; in hvc_iucv_put_chars()
469 spin_lock(&priv->lock); in hvc_iucv_put_chars()
471 spin_unlock(&priv->lock); in hvc_iucv_put_chars()
477 * hvc_iucv_notifier_add() - HVC notifier for opening a TTY for the first time.
479 * @id: Additional data (originally passed to hvc_alloc): the index of an struct
485 * Locking: struct hvc_iucv_private->lock, spin_lock_bh
495 spin_lock_bh(&priv->lock); in hvc_iucv_notifier_add()
496 priv->tty_state = TTY_OPENED; in hvc_iucv_notifier_add()
497 spin_unlock_bh(&priv->lock); in hvc_iucv_notifier_add()
503 * hvc_iucv_cleanup() - Clean up and reset a z/VM IUCV HVC instance.
508 destroy_tty_buffer_list(&priv->tty_outqueue); in hvc_iucv_cleanup()
509 destroy_tty_buffer_list(&priv->tty_inqueue); in hvc_iucv_cleanup()
511 priv->tty_state = TTY_CLOSED; in hvc_iucv_cleanup()
512 priv->iucv_state = IUCV_DISCONN; in hvc_iucv_cleanup()
514 priv->sndbuf_len = 0; in hvc_iucv_cleanup()
518 * tty_outqueue_empty() - Test if the tty outq is empty
525 spin_lock_bh(&priv->lock); in tty_outqueue_empty()
526 rc = list_empty(&priv->tty_outqueue); in tty_outqueue_empty()
527 spin_unlock_bh(&priv->lock); in tty_outqueue_empty()
533 * flush_sndbuf_sync() - Flush send buffer and wait for completion
537 * to flush any buffered terminal output data and waits for completion.
543 cancel_delayed_work_sync(&priv->sndbuf_work); in flush_sndbuf_sync()
545 spin_lock_bh(&priv->lock); in flush_sndbuf_sync()
546 hvc_iucv_send(priv); /* force sending buffered data */ in flush_sndbuf_sync()
547 sync_wait = !list_empty(&priv->tty_outqueue); /* anything queued ? */ in flush_sndbuf_sync()
548 spin_unlock_bh(&priv->lock); in flush_sndbuf_sync()
551 wait_event_timeout(priv->sndbuf_waitq, in flush_sndbuf_sync()
556 * hvc_iucv_hangup() - Sever IUCV path and schedule hvc tty hang up
559 * This routine severs an existing IUCV communication path and hangs
561 * The hang-up occurs only if an IUCV communication path is established;
564 * The IUCV HVC hang-up is separated into two steps:
565 * 1. After the IUCV path has been severed, the iucv_state is set to
568 * IUCV_SEVERED state causes the tty hang-up in the HVC layer.
571 * structure to allow re-connects.
572 * If the tty has been opened, let get_chars() return -EPIPE to signal
577 * Hang-up: 1. do_tty_hangup() replaces file ops (= hung_up_tty_fops)
578 * 2. do_tty_hangup() calls tty->ops->close() for console_filp
582 * Finally, the back-end is not being notified, thus, the tty session is
583 * kept active (TTY_OPEN) to be ready for re-connects.
585 * Locking: spin_lock(&priv->lock) w/o disabling bh
589 struct iucv_path *path; in hvc_iucv_hangup() local
591 path = NULL; in hvc_iucv_hangup()
592 spin_lock(&priv->lock); in hvc_iucv_hangup()
593 if (priv->iucv_state == IUCV_CONNECTED) { in hvc_iucv_hangup()
594 path = priv->path; in hvc_iucv_hangup()
595 priv->path = NULL; in hvc_iucv_hangup()
596 priv->iucv_state = IUCV_SEVERED; in hvc_iucv_hangup()
597 if (priv->tty_state == TTY_CLOSED) in hvc_iucv_hangup()
601 if (priv->is_console) { in hvc_iucv_hangup()
603 priv->tty_state = TTY_OPENED; in hvc_iucv_hangup()
607 spin_unlock(&priv->lock); in hvc_iucv_hangup()
609 /* finally sever path (outside of priv->lock due to lock ordering) */ in hvc_iucv_hangup()
610 if (path) { in hvc_iucv_hangup()
611 iucv_path_sever(path, NULL); in hvc_iucv_hangup()
612 iucv_path_free(path); in hvc_iucv_hangup()
617 * hvc_iucv_notifier_hangup() - HVC notifier for TTY hangups.
619 * @id: Additional data (originally passed to hvc_alloc):
622 * This routine notifies the HVC back-end that a tty hangup (carrier loss,
625 * to keep an existing IUCV communication path established.
628 * If the tty has been opened and an established IUCV path has been severed
631 * Locking: struct hvc_iucv_private->lock
643 spin_lock_bh(&priv->lock); in hvc_iucv_notifier_hangup()
648 * ignore this hangup and keep an established IUCV path open... in hvc_iucv_notifier_hangup()
651 priv->tty_state = TTY_CLOSED; in hvc_iucv_notifier_hangup()
653 if (priv->iucv_state == IUCV_SEVERED) in hvc_iucv_notifier_hangup()
655 spin_unlock_bh(&priv->lock); in hvc_iucv_notifier_hangup()
659 * hvc_iucv_dtr_rts() - HVC notifier for handling DTR/RTS
663 * This routine notifies the HVC back-end to raise or lower DTR/RTS
670 struct iucv_path *path; in hvc_iucv_dtr_rts() local
678 priv = hvc_iucv_get_private(hp->vtermno); in hvc_iucv_dtr_rts()
687 spin_lock_bh(&priv->lock); in hvc_iucv_dtr_rts()
688 path = priv->path; /* save reference to IUCV path */ in hvc_iucv_dtr_rts()
689 priv->path = NULL; in hvc_iucv_dtr_rts()
690 priv->iucv_state = IUCV_DISCONN; in hvc_iucv_dtr_rts()
691 spin_unlock_bh(&priv->lock); in hvc_iucv_dtr_rts()
693 /* Sever IUCV path outside of priv->lock due to lock ordering of: in hvc_iucv_dtr_rts()
694 * priv->lock <--> iucv_table_lock */ in hvc_iucv_dtr_rts()
695 if (path) { in hvc_iucv_dtr_rts()
696 iucv_path_sever(path, NULL); in hvc_iucv_dtr_rts()
697 iucv_path_free(path); in hvc_iucv_dtr_rts()
702 * hvc_iucv_notifier_del() - HVC notifier for closing a TTY for the last time.
704 * @id: Additional data (originally passed to hvc_alloc):
707 * This routine notifies the HVC back-end that the last tty device fd has been
708 * closed. The function cleans up tty resources. The clean-up of the IUCV
712 * Locking: struct hvc_iucv_private->lock
724 spin_lock_bh(&priv->lock); in hvc_iucv_notifier_del()
725 destroy_tty_buffer_list(&priv->tty_outqueue); in hvc_iucv_notifier_del()
726 destroy_tty_buffer_list(&priv->tty_inqueue); in hvc_iucv_notifier_del()
727 priv->tty_state = TTY_CLOSED; in hvc_iucv_notifier_del()
728 priv->sndbuf_len = 0; in hvc_iucv_notifier_del()
729 spin_unlock_bh(&priv->lock); in hvc_iucv_notifier_del()
733 * hvc_iucv_filter_connreq() - Filter connection request based on z/VM user ID
737 * connect, otherwise non-zero.
757 len = (wildcard) ? wildcard - filter_entry : 8; in hvc_iucv_filter_connreq()
765 * hvc_iucv_path_pending() - IUCV handler to process a connection request.
766 * @path: Pending path (struct iucv_path)
768 * @ipuser: User specified data for this path
771 * The function uses the @ipuser data to determine if the pending path belongs
773 * If the path belongs to this driver, ensure that the terminal is not accessed
775 * If the terminal is not yet connected, the pending path is accepted and is
778 * Returns 0 if @path belongs to a terminal managed by the this device driver;
779 * otherwise returns -ENODEV in order to dispatch this path to other handlers.
781 * Locking: struct hvc_iucv_private->lock
783 static int hvc_iucv_path_pending(struct iucv_path *path, u8 *ipvmid, in hvc_iucv_path_pending() argument
795 /* First, check if the pending path request is managed by this in hvc_iucv_path_pending()
797 * - find a disconnected device if ipuser contains the wildcard in hvc_iucv_path_pending()
798 * - find the device that matches the terminal ID in ipuser in hvc_iucv_path_pending()
807 spin_lock(&tmp->lock); in hvc_iucv_path_pending()
808 if (tmp->iucv_state == IUCV_DISCONN) in hvc_iucv_path_pending()
810 spin_unlock(&tmp->lock); in hvc_iucv_path_pending()
812 } else if (!memcmp(tmp->srv_name, ipuser, 8)) in hvc_iucv_path_pending()
818 return -ENODEV; in hvc_iucv_path_pending()
825 iucv_path_sever(path, ipuser); in hvc_iucv_path_pending()
826 iucv_path_free(path); in hvc_iucv_path_pending()
834 spin_lock(&priv->lock); in hvc_iucv_path_pending()
837 * this path to enforce that there is only ONE established communication in hvc_iucv_path_pending()
838 * path per terminal. */ in hvc_iucv_path_pending()
839 if (priv->iucv_state != IUCV_DISCONN) { in hvc_iucv_path_pending()
840 iucv_path_sever(path, ipuser); in hvc_iucv_path_pending()
841 iucv_path_free(path); in hvc_iucv_path_pending()
845 /* accept path */ in hvc_iucv_path_pending()
848 path->msglim = 0xffff; /* IUCV MSGLIMIT */ in hvc_iucv_path_pending()
849 path->flags &= ~IUCV_IPRMDATA; /* TODO: use IUCV_IPRMDATA */ in hvc_iucv_path_pending()
850 rc = iucv_path_accept(path, &hvc_iucv_handler, nuser_data, priv); in hvc_iucv_path_pending()
852 iucv_path_sever(path, ipuser); in hvc_iucv_path_pending()
853 iucv_path_free(path); in hvc_iucv_path_pending()
856 priv->path = path; in hvc_iucv_path_pending()
857 priv->iucv_state = IUCV_CONNECTED; in hvc_iucv_path_pending()
859 /* store path information */ in hvc_iucv_path_pending()
860 memcpy(priv->info_path, ipvmid, 8); in hvc_iucv_path_pending()
861 memcpy(priv->info_path + 8, ipuser + 8, 8); in hvc_iucv_path_pending()
863 /* flush buffered output data... */ in hvc_iucv_path_pending()
864 schedule_delayed_work(&priv->sndbuf_work, 5); in hvc_iucv_path_pending()
867 spin_unlock(&priv->lock); in hvc_iucv_path_pending()
872 * hvc_iucv_path_severed() - IUCV handler to process a path sever.
873 * @path: Pending path (struct iucv_path)
874 * @ipuser: User specified data for this path
880 * Locking: struct hvc_iucv_private->lock
882 static void hvc_iucv_path_severed(struct iucv_path *path, u8 *ipuser) in hvc_iucv_path_severed() argument
884 struct hvc_iucv_private *priv = path->private; in hvc_iucv_path_severed()
890 * hvc_iucv_msg_pending() - IUCV handler to process an incoming IUCV message.
891 * @path: Pending path (struct iucv_path)
898 * Locking: struct hvc_iucv_private->lock
900 static void hvc_iucv_msg_pending(struct iucv_path *path, in hvc_iucv_msg_pending() argument
903 struct hvc_iucv_private *priv = path->private; in hvc_iucv_msg_pending()
906 /* reject messages that exceed max size of iucv_tty_msg->datalen */ in hvc_iucv_msg_pending()
907 if (msg->length > MSG_SIZE(MSG_MAX_DATALEN)) { in hvc_iucv_msg_pending()
908 iucv_message_reject(path, msg); in hvc_iucv_msg_pending()
912 spin_lock(&priv->lock); in hvc_iucv_msg_pending()
915 if (priv->tty_state == TTY_CLOSED) { in hvc_iucv_msg_pending()
916 iucv_message_reject(path, msg); in hvc_iucv_msg_pending()
923 iucv_message_reject(path, msg); in hvc_iucv_msg_pending()
924 goto unlock_return; /* -ENOMEM */ in hvc_iucv_msg_pending()
926 rb->msg = *msg; in hvc_iucv_msg_pending()
928 list_add_tail(&rb->list, &priv->tty_inqueue); in hvc_iucv_msg_pending()
933 spin_unlock(&priv->lock); in hvc_iucv_msg_pending()
937 * hvc_iucv_msg_complete() - IUCV handler to process message completion
938 * @path: Pending path (struct iucv_path)
943 * msg->audit: rejected messages (0x040000 (IPADRJCT)), and
946 * Locking: struct hvc_iucv_private->lock
948 static void hvc_iucv_msg_complete(struct iucv_path *path, in hvc_iucv_msg_complete() argument
951 struct hvc_iucv_private *priv = path->private; in hvc_iucv_msg_complete()
955 spin_lock(&priv->lock); in hvc_iucv_msg_complete()
956 list_for_each_entry_safe(ent, next, &priv->tty_outqueue, list) in hvc_iucv_msg_complete()
957 if (ent->msg.id == msg->id) { in hvc_iucv_msg_complete()
958 list_move(&ent->list, &list_remove); in hvc_iucv_msg_complete()
961 wake_up(&priv->sndbuf_waitq); in hvc_iucv_msg_complete()
962 spin_unlock(&priv->lock); in hvc_iucv_msg_complete()
973 len = sizeof(priv->srv_name); in hvc_iucv_dev_termid_show()
974 memcpy(buf, priv->srv_name, len); in hvc_iucv_dev_termid_show()
985 return sprintf(buf, "%u:%u\n", priv->iucv_state, priv->tty_state); in hvc_iucv_dev_state_show()
998 spin_lock_bh(&priv->lock); in hvc_iucv_dev_peer_show()
999 if (priv->iucv_state == IUCV_CONNECTED) { in hvc_iucv_dev_peer_show()
1000 memcpy(vmid, priv->info_path, 8); in hvc_iucv_dev_peer_show()
1001 memcpy(ipuser, priv->info_path + 8, 8); in hvc_iucv_dev_peer_show()
1003 spin_unlock_bh(&priv->lock); in hvc_iucv_dev_peer_show()
1039 * hvc_iucv_alloc() - Allocates a new struct hvc_iucv_private instance
1045 * Returns 0 on success; otherwise non-zero.
1055 return -ENOMEM; in hvc_iucv_alloc()
1057 spin_lock_init(&priv->lock); in hvc_iucv_alloc()
1058 INIT_LIST_HEAD(&priv->tty_outqueue); in hvc_iucv_alloc()
1059 INIT_LIST_HEAD(&priv->tty_inqueue); in hvc_iucv_alloc()
1060 INIT_DELAYED_WORK(&priv->sndbuf_work, hvc_iucv_sndbuf_work); in hvc_iucv_alloc()
1061 init_waitqueue_head(&priv->sndbuf_waitq); in hvc_iucv_alloc()
1063 priv->sndbuf = (void *) get_zeroed_page(GFP_KERNEL); in hvc_iucv_alloc()
1064 if (!priv->sndbuf) { in hvc_iucv_alloc()
1066 return -ENOMEM; in hvc_iucv_alloc()
1070 priv->is_console = is_console; in hvc_iucv_alloc()
1073 priv->hvc = hvc_alloc(id, /* PAGE_SIZE */ in hvc_iucv_alloc()
1075 if (IS_ERR(priv->hvc)) { in hvc_iucv_alloc()
1076 rc = PTR_ERR(priv->hvc); in hvc_iucv_alloc()
1081 priv->hvc->irq_requested = 1; in hvc_iucv_alloc()
1084 snprintf(name, 9, "lnxhvc%-2d", id); in hvc_iucv_alloc()
1085 memcpy(priv->srv_name, name, 8); in hvc_iucv_alloc()
1086 ASCEBC(priv->srv_name, 8); in hvc_iucv_alloc()
1088 priv->dev = iucv_alloc_device(hvc_iucv_dev_attr_groups, NULL, in hvc_iucv_alloc()
1090 if (!priv->dev) { in hvc_iucv_alloc()
1091 rc = -ENOMEM; in hvc_iucv_alloc()
1094 rc = device_register(priv->dev); in hvc_iucv_alloc()
1096 put_device(priv->dev); in hvc_iucv_alloc()
1104 hvc_remove(priv->hvc); in hvc_iucv_alloc()
1106 free_page((unsigned long) priv->sndbuf); in hvc_iucv_alloc()
1113 * hvc_iucv_destroy() - Destroy and free hvc_iucv_private instances
1117 hvc_remove(priv->hvc); in hvc_iucv_destroy()
1118 device_unregister(priv->dev); in hvc_iucv_destroy()
1119 free_page((unsigned long) priv->sndbuf); in hvc_iucv_destroy()
1124 * hvc_iucv_parse_filter() - Parse filter for a single z/VM user ID
1125 * @filter: String containing a comma-separated list of z/VM user IDs
1135 len = nextdelim - filter; in hvc_iucv_parse_filter()
1143 return ERR_PTR(-EINVAL); in hvc_iucv_parse_filter()
1146 if (filter[len - 1] == '\n') in hvc_iucv_parse_filter()
1147 len--; in hvc_iucv_parse_filter()
1151 return ERR_PTR(-EINVAL); in hvc_iucv_parse_filter()
1154 return ERR_PTR(-EINVAL); in hvc_iucv_parse_filter()
1158 while (len--) in hvc_iucv_parse_filter()
1164 * hvc_iucv_setup_filter() - Set up z/VM user ID filter
1165 * @filter: String consisting of a comma-separated list of z/VM user IDs
1169 * Return code 0 means success, -EINVAL if the filter is syntactically
1170 * incorrect, -ENOMEM if there was not enough memory to allocate the
1171 * filter list array, or -ENOSPC if too many z/VM user IDs have been specified.
1197 return -ENOSPC; in hvc_iucv_setup_filter()
1201 return -ENOMEM; in hvc_iucv_setup_filter()
1207 array + ((size - count) * 8)); in hvc_iucv_setup_filter()
1213 count--; in hvc_iucv_setup_filter()
1230 * param_set_vmidfilter() - Set z/VM user ID filter parameter
1231 * @val: String consisting of a comma-separated list of z/VM user IDs
1234 * The function sets up the z/VM user ID filter specified as comma-separated
1244 return -ENODEV; in param_set_vmidfilter()
1247 return -EINVAL; in param_set_vmidfilter()
1258 * param_get_vmidfilter() - Get z/VM user ID filter
1263 * The function stores the filter as a comma-separated list of z/VM user IDs
1273 return -ENODEV; in param_get_vmidfilter()
1280 len = (end) ? end - start : 8; in param_get_vmidfilter()
1287 buffer[--rc] = '\0'; /* replace last comma and update rc */ in param_get_vmidfilter()
1299 * hvc_iucv_init() - z/VM IUCV HVC device driver initialization
1307 return -ENODEV; in hvc_iucv_init()
1312 rc = -ENODEV; in hvc_iucv_init()
1319 rc = -EINVAL; in hvc_iucv_init()
1329 case -ENOMEM: in hvc_iucv_init()
1333 case -EINVAL: in hvc_iucv_init()
1337 case -ENOSPC: in hvc_iucv_init()
1351 rc = -ENOMEM; in hvc_iucv_init()
1360 rc = -ENOMEM; in hvc_iucv_init()
1407 * hvc_iucv_config() - Parsing of hvc_iucv= kernel command line parameter