Lines Matching defs:vio

22 #include <asm/vio.h>
58 struct vio_driver_state vio;
96 static inline struct vdc_port *to_vdc_port(struct vio_driver_state *vio)
98 return container_of(vio, struct vdc_port, vio);
111 return port->vio.ver.major == major && port->vio.ver.minor >= minor;
179 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING];
189 static void vdc_finish(struct vio_driver_state *vio, int err, int waiting_for)
191 if (vio->cmp &&
193 vio->cmp->waiting_for == waiting_for)) {
194 vio->cmp->err = err;
195 complete(&vio->cmp->com);
196 vio->cmp = NULL;
200 static void vdc_handshake_complete(struct vio_driver_state *vio)
202 struct vdc_port *port = to_vdc_port(vio);
205 vdc_finish(vio, 0, WAITING_FOR_LINK_UP);
217 ldc_disconnect(port->vio.lp);
222 static int vdc_send_attr(struct vio_driver_state *vio)
224 struct vdc_port *port = to_vdc_port(vio);
232 pkt.tag.sid = vio_send_sid(vio);
241 return vio_ldc_send(&port->vio, &pkt, sizeof(pkt));
244 static int vdc_handle_attr(struct vio_driver_state *vio, void *arg)
246 struct vdc_port *port = to_vdc_port(vio);
264 vio->name, pkt->vdisk_type);
271 vio->name,
292 printk(KERN_ERR PFX "%s: Attribute NACK\n", vio->name);
302 vdc_finish(&port->vio, -err, WAITING_FOR_GEN_CMD);
315 ldc_unmap(port->vio.lp, desc->cookies, desc->ncookies);
334 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING];
356 struct vio_driver_state *vio = &port->vio;
360 spin_lock_irqsave(&vio->lock, flags);
363 vio_link_state_change(vio, event);
369 vio_link_state_change(vio, event);
385 err = ldc_read(vio->lp, &msgbuf, sizeof(msgbuf));
388 vio_conn_reset(vio);
398 err = vio_validate_sid(vio, &msgbuf.tag);
410 err = vio_control_pkt_engine(vio, &msgbuf);
418 vdc_finish(&port->vio, err, WAITING_FOR_ANY);
420 spin_unlock_irqrestore(&vio->lock, flags);
425 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING];
431 .sid = vio_send_sid(&port->vio),
443 err = vio_ldc_send(&port->vio, &hdr, sizeof(hdr));
463 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING];
494 err = ldc_map_sg(port->vio.lp, sg, nsg,
542 dr = &port->vio.drings[VIO_DRIVER_TX_RING];
546 spin_lock_irqsave(&port->vio.lock, flags);
552 spin_unlock_irqrestore(&port->vio.lock, flags);
557 spin_unlock_irqrestore(&port->vio.lock, flags);
563 spin_unlock_irqrestore(&port->vio.lock, flags);
567 spin_unlock_irqrestore(&port->vio.lock, flags);
653 spin_lock_irqsave(&port->vio.lock, flags);
655 dr = &port->vio.drings[VIO_DRIVER_TX_RING];
662 err = ldc_map_single(port->vio.lp, req_buf, op_len,
666 spin_unlock_irqrestore(&port->vio.lock, flags);
673 port->vio.cmp = &comp;
694 spin_unlock_irqrestore(&port->vio.lock, flags);
699 port->vio.cmp = NULL;
700 spin_unlock_irqrestore(&port->vio.lock, flags);
713 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING];
723 dring = ldc_alloc_exp_dring(port->vio.lp, len,
743 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING];
746 ldc_free_exp_dring(port->vio.lp, dr->base,
764 port->vio.cmp = &comp;
766 vio_port_up(&port->vio);
773 ldc_disconnect(port->vio.lp);
774 ldc_unbind(port->vio.lp);
776 vio_ldc_free(&port->vio);
844 port->vio.name);
850 port->vio.name);
864 g->first_minor = port->vio.vdev->dev_no << PARTITION_SHIFT;
900 port->vio.ver.major, port->vio.ver.minor);
902 device_add_disk(&port->vio.vdev->dev, g, NULL);
1031 err = vio_driver_init(&port->vio, vdev, VDEV_DISK,
1041 err = vio_ldc_alloc(&port->vio, &vdc_ldc_cfg, port);
1066 vio_ldc_free(&port->vio);
1085 del_timer_sync(&port->vio.timer);
1093 vio_ldc_free(&port->vio);
1104 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING];
1112 ldc_unmap(port->vio.lp, desc->cookies, desc->ncookies);
1136 spin_unlock_irq(&port->vio.lock);
1141 spin_lock_irq(&port->vio.lock);
1150 struct vio_driver_state *vio;
1153 vio = &port->vio;
1155 spin_lock_irq(&vio->lock);
1156 if (!(port->vio.hs_state & VIO_HS_COMPLETE)) {
1162 spin_unlock_irq(&vio->lock);
1168 struct vio_driver_state *vio;
1172 vio = &port->vio;
1174 spin_lock_irqsave(&vio->lock, flags);
1176 spin_unlock_irqrestore(&vio->lock, flags);
1183 assert_spin_locked(&port->vio.lock);
1190 err = vio_ldc_alloc(&port->vio, &vdc_ldc_cfg, port);
1205 mod_timer(&port->vio.timer, round_jiffies(jiffies + HZ));
1209 vio_ldc_free(&port->vio);
1218 MODULE_DEVICE_TABLE(vio, vdc_port_match);