monpriv 151 drivers/s390/char/monreader.c struct mon_private *monpriv) monpriv 155 drivers/s390/char/monreader.c rc = iucv_message_reply(monpriv->path, &monmsg->msg, monpriv 157 drivers/s390/char/monreader.c atomic_dec(&monpriv->msglim_count); monpriv 161 drivers/s390/char/monreader.c monpriv->read_index = (monpriv->read_index + 1) % monpriv 163 drivers/s390/char/monreader.c atomic_dec(&monpriv->read_ready); monpriv 173 drivers/s390/char/monreader.c static void mon_free_mem(struct mon_private *monpriv) monpriv 178 drivers/s390/char/monreader.c kfree(monpriv->msg_array[i]); monpriv 179 drivers/s390/char/monreader.c kfree(monpriv); monpriv 185 drivers/s390/char/monreader.c struct mon_private *monpriv; monpriv 187 drivers/s390/char/monreader.c monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL); monpriv 188 drivers/s390/char/monreader.c if (!monpriv) monpriv 191 drivers/s390/char/monreader.c monpriv->msg_array[i] = kzalloc(sizeof(struct mon_msg), monpriv 193 drivers/s390/char/monreader.c if (!monpriv->msg_array[i]) { monpriv 194 drivers/s390/char/monreader.c mon_free_mem(monpriv); monpriv 198 drivers/s390/char/monreader.c return monpriv; monpriv 209 drivers/s390/char/monreader.c static struct mon_msg *mon_next_message(struct mon_private *monpriv) monpriv 213 drivers/s390/char/monreader.c if (!atomic_read(&monpriv->read_ready)) monpriv 215 drivers/s390/char/monreader.c monmsg = monpriv->msg_array[monpriv->read_index]; monpriv 221 drivers/s390/char/monreader.c monpriv->read_index = (monpriv->read_index + 1) % monpriv 223 drivers/s390/char/monreader.c atomic_dec(&monpriv->read_ready); monpriv 235 drivers/s390/char/monreader.c struct mon_private *monpriv = path->private; monpriv 237 drivers/s390/char/monreader.c atomic_set(&monpriv->iucv_connected, 1); monpriv 243 drivers/s390/char/monreader.c struct mon_private *monpriv = path->private; monpriv 248 drivers/s390/char/monreader.c atomic_set(&monpriv->iucv_severed, 1); monpriv 256 drivers/s390/char/monreader.c struct mon_private *monpriv = path->private; monpriv 258 drivers/s390/char/monreader.c memcpy(&monpriv->msg_array[monpriv->write_index]->msg, monpriv 260 drivers/s390/char/monreader.c if (atomic_inc_return(&monpriv->msglim_count) == MON_MSGLIM) { monpriv 262 drivers/s390/char/monreader.c monpriv->msg_array[monpriv->write_index]->msglim_reached = 1; monpriv 264 drivers/s390/char/monreader.c monpriv->write_index = (monpriv->write_index + 1) % MON_MSGLIM; monpriv 265 drivers/s390/char/monreader.c atomic_inc(&monpriv->read_ready); monpriv 280 drivers/s390/char/monreader.c struct mon_private *monpriv; monpriv 291 drivers/s390/char/monreader.c monpriv = mon_alloc_mem(); monpriv 292 drivers/s390/char/monreader.c if (!monpriv) monpriv 298 drivers/s390/char/monreader.c monpriv->path = iucv_path_alloc(MON_MSGLIM, IUCV_IPRMDATA, GFP_KERNEL); monpriv 299 drivers/s390/char/monreader.c if (!monpriv->path) monpriv 301 drivers/s390/char/monreader.c rc = iucv_path_connect(monpriv->path, &monreader_iucv_handler, monpriv 302 drivers/s390/char/monreader.c MON_SERVICE, NULL, user_data_connect, monpriv); monpriv 313 drivers/s390/char/monreader.c atomic_read(&monpriv->iucv_connected) || monpriv 314 drivers/s390/char/monreader.c atomic_read(&monpriv->iucv_severed)); monpriv 315 drivers/s390/char/monreader.c if (atomic_read(&monpriv->iucv_severed)) { monpriv 316 drivers/s390/char/monreader.c atomic_set(&monpriv->iucv_severed, 0); monpriv 317 drivers/s390/char/monreader.c atomic_set(&monpriv->iucv_connected, 0); monpriv 321 drivers/s390/char/monreader.c filp->private_data = monpriv; monpriv 322 drivers/s390/char/monreader.c dev_set_drvdata(monreader_device, monpriv); monpriv 326 drivers/s390/char/monreader.c iucv_path_free(monpriv->path); monpriv 328 drivers/s390/char/monreader.c mon_free_mem(monpriv); monpriv 338 drivers/s390/char/monreader.c struct mon_private *monpriv = filp->private_data; monpriv 343 drivers/s390/char/monreader.c if (monpriv->path) { monpriv 344 drivers/s390/char/monreader.c rc = iucv_path_sever(monpriv->path, user_data_sever); monpriv 348 drivers/s390/char/monreader.c iucv_path_free(monpriv->path); monpriv 351 drivers/s390/char/monreader.c atomic_set(&monpriv->iucv_severed, 0); monpriv 352 drivers/s390/char/monreader.c atomic_set(&monpriv->iucv_connected, 0); monpriv 353 drivers/s390/char/monreader.c atomic_set(&monpriv->read_ready, 0); monpriv 354 drivers/s390/char/monreader.c atomic_set(&monpriv->msglim_count, 0); monpriv 355 drivers/s390/char/monreader.c monpriv->write_index = 0; monpriv 356 drivers/s390/char/monreader.c monpriv->read_index = 0; monpriv 360 drivers/s390/char/monreader.c kfree(monpriv->msg_array[i]); monpriv 361 drivers/s390/char/monreader.c kfree(monpriv); monpriv 369 drivers/s390/char/monreader.c struct mon_private *monpriv = filp->private_data; monpriv 374 drivers/s390/char/monreader.c monmsg = mon_next_message(monpriv); monpriv 382 drivers/s390/char/monreader.c atomic_read(&monpriv->read_ready) || monpriv 383 drivers/s390/char/monreader.c atomic_read(&monpriv->iucv_severed)); monpriv 386 drivers/s390/char/monreader.c if (unlikely(atomic_read(&monpriv->iucv_severed))) monpriv 388 drivers/s390/char/monreader.c monmsg = monpriv->msg_array[monpriv->read_index]; monpriv 424 drivers/s390/char/monreader.c ret = mon_send_reply(monmsg, monpriv); monpriv 434 drivers/s390/char/monreader.c struct mon_private *monpriv = filp->private_data; monpriv 437 drivers/s390/char/monreader.c if (unlikely(atomic_read(&monpriv->iucv_severed))) monpriv 439 drivers/s390/char/monreader.c if (atomic_read(&monpriv->read_ready)) monpriv 465 drivers/s390/char/monreader.c struct mon_private *monpriv = dev_get_drvdata(dev); monpriv 468 drivers/s390/char/monreader.c if (!monpriv) monpriv 470 drivers/s390/char/monreader.c if (monpriv->path) { monpriv 471 drivers/s390/char/monreader.c rc = iucv_path_sever(monpriv->path, user_data_sever); monpriv 475 drivers/s390/char/monreader.c iucv_path_free(monpriv->path); monpriv 477 drivers/s390/char/monreader.c atomic_set(&monpriv->iucv_severed, 0); monpriv 478 drivers/s390/char/monreader.c atomic_set(&monpriv->iucv_connected, 0); monpriv 479 drivers/s390/char/monreader.c atomic_set(&monpriv->read_ready, 0); monpriv 480 drivers/s390/char/monreader.c atomic_set(&monpriv->msglim_count, 0); monpriv 481 drivers/s390/char/monreader.c monpriv->write_index = 0; monpriv 482 drivers/s390/char/monreader.c monpriv->read_index = 0; monpriv 483 drivers/s390/char/monreader.c monpriv->path = NULL; monpriv 489 drivers/s390/char/monreader.c struct mon_private *monpriv = dev_get_drvdata(dev); monpriv 492 drivers/s390/char/monreader.c if (!monpriv) monpriv 495 drivers/s390/char/monreader.c monpriv->path = iucv_path_alloc(MON_MSGLIM, IUCV_IPRMDATA, GFP_KERNEL); monpriv 496 drivers/s390/char/monreader.c if (!monpriv->path) monpriv 498 drivers/s390/char/monreader.c rc = iucv_path_connect(monpriv->path, &monreader_iucv_handler, monpriv 499 drivers/s390/char/monreader.c MON_SERVICE, NULL, user_data_connect, monpriv); monpriv 506 drivers/s390/char/monreader.c atomic_read(&monpriv->iucv_connected) || monpriv 507 drivers/s390/char/monreader.c atomic_read(&monpriv->iucv_severed)); monpriv 508 drivers/s390/char/monreader.c if (atomic_read(&monpriv->iucv_severed)) monpriv 513 drivers/s390/char/monreader.c iucv_path_free(monpriv->path); monpriv 514 drivers/s390/char/monreader.c monpriv->path = NULL; monpriv 516 drivers/s390/char/monreader.c atomic_set(&monpriv->iucv_severed, 1); monpriv 88 drivers/s390/char/monwriter.c static struct mon_buf *monwrite_find_hdr(struct mon_private *monpriv, monpriv 93 drivers/s390/char/monwriter.c list_for_each_entry_safe(entry, next, &monpriv->list, list) monpriv 106 drivers/s390/char/monwriter.c static int monwrite_new_hdr(struct mon_private *monpriv) monpriv 108 drivers/s390/char/monwriter.c struct monwrite_hdr *monhdr = &monpriv->hdr; monpriv 118 drivers/s390/char/monwriter.c monbuf = monwrite_find_hdr(monpriv, monhdr); monpriv 143 drivers/s390/char/monwriter.c list_add_tail(&monbuf->list, &monpriv->list); monpriv 147 drivers/s390/char/monwriter.c monpriv->current_buf = monbuf; monpriv 151 drivers/s390/char/monwriter.c static int monwrite_new_data(struct mon_private *monpriv) monpriv 153 drivers/s390/char/monwriter.c struct monwrite_hdr *monhdr = &monpriv->hdr; monpriv 154 drivers/s390/char/monwriter.c struct mon_buf *monbuf = monpriv->current_buf; monpriv 175 drivers/s390/char/monwriter.c list_del(&monpriv->current_buf->list); monpriv 176 drivers/s390/char/monwriter.c kfree(monpriv->current_buf->data); monpriv 177 drivers/s390/char/monwriter.c kfree(monpriv->current_buf); monpriv 178 drivers/s390/char/monwriter.c monpriv->current_buf = NULL; monpriv 193 drivers/s390/char/monwriter.c struct mon_private *monpriv; monpriv 195 drivers/s390/char/monwriter.c monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL); monpriv 196 drivers/s390/char/monwriter.c if (!monpriv) monpriv 198 drivers/s390/char/monwriter.c INIT_LIST_HEAD(&monpriv->list); monpriv 199 drivers/s390/char/monwriter.c monpriv->hdr_to_read = sizeof(monpriv->hdr); monpriv 200 drivers/s390/char/monwriter.c mutex_init(&monpriv->thread_mutex); monpriv 201 drivers/s390/char/monwriter.c filp->private_data = monpriv; monpriv 202 drivers/s390/char/monwriter.c list_add_tail(&monpriv->priv_list, &mon_priv_list); monpriv 208 drivers/s390/char/monwriter.c struct mon_private *monpriv = filp->private_data; monpriv 211 drivers/s390/char/monwriter.c list_for_each_entry_safe(entry, next, &monpriv->list, list) { monpriv 220 drivers/s390/char/monwriter.c list_del(&monpriv->priv_list); monpriv 221 drivers/s390/char/monwriter.c kfree(monpriv); monpriv 228 drivers/s390/char/monwriter.c struct mon_private *monpriv = filp->private_data; monpriv 233 drivers/s390/char/monwriter.c mutex_lock(&monpriv->thread_mutex); monpriv 235 drivers/s390/char/monwriter.c if (monpriv->hdr_to_read) { monpriv 236 drivers/s390/char/monwriter.c len = min(count - written, monpriv->hdr_to_read); monpriv 237 drivers/s390/char/monwriter.c to = (char *) &monpriv->hdr + monpriv 238 drivers/s390/char/monwriter.c sizeof(monpriv->hdr) - monpriv->hdr_to_read; monpriv 243 drivers/s390/char/monwriter.c monpriv->hdr_to_read -= len; monpriv 245 drivers/s390/char/monwriter.c if (monpriv->hdr_to_read > 0) monpriv 247 drivers/s390/char/monwriter.c rc = monwrite_new_hdr(monpriv); monpriv 250 drivers/s390/char/monwriter.c monpriv->data_to_read = monpriv->current_buf ? monpriv 251 drivers/s390/char/monwriter.c monpriv->current_buf->hdr.datalen : 0; monpriv 254 drivers/s390/char/monwriter.c if (monpriv->data_to_read) { monpriv 255 drivers/s390/char/monwriter.c len = min(count - written, monpriv->data_to_read); monpriv 256 drivers/s390/char/monwriter.c to = monpriv->current_buf->data + monpriv 257 drivers/s390/char/monwriter.c monpriv->hdr.datalen - monpriv->data_to_read; monpriv 262 drivers/s390/char/monwriter.c monpriv->data_to_read -= len; monpriv 264 drivers/s390/char/monwriter.c if (monpriv->data_to_read > 0) monpriv 266 drivers/s390/char/monwriter.c rc = monwrite_new_data(monpriv); monpriv 270 drivers/s390/char/monwriter.c monpriv->hdr_to_read = sizeof(monpriv->hdr); monpriv 272 drivers/s390/char/monwriter.c mutex_unlock(&monpriv->thread_mutex); monpriv 276 drivers/s390/char/monwriter.c monpriv->data_to_read = 0; monpriv 277 drivers/s390/char/monwriter.c monpriv->hdr_to_read = sizeof(struct monwrite_hdr); monpriv 278 drivers/s390/char/monwriter.c mutex_unlock(&monpriv->thread_mutex); monpriv 302 drivers/s390/char/monwriter.c struct mon_private *monpriv; monpriv 305 drivers/s390/char/monwriter.c list_for_each_entry(monpriv, &mon_priv_list, priv_list) { monpriv 306 drivers/s390/char/monwriter.c list_for_each_entry(monbuf, &monpriv->list, list) { monpriv 317 drivers/s390/char/monwriter.c struct mon_private *monpriv; monpriv 320 drivers/s390/char/monwriter.c list_for_each_entry(monpriv, &mon_priv_list, priv_list) { monpriv 321 drivers/s390/char/monwriter.c list_for_each_entry(monbuf, &monpriv->list, list) {