Lines Matching defs:vio

21 #include <asm/vio.h>
57 struct vio_driver_state vio;
95 static inline struct vdc_port *to_vdc_port(struct vio_driver_state *vio)
97 return container_of(vio, struct vdc_port, vio);
110 return port->vio.ver.major == major && port->vio.ver.minor >= minor;
181 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING];
191 static void vdc_finish(struct vio_driver_state *vio, int err, int waiting_for)
193 if (vio->cmp &&
195 vio->cmp->waiting_for == waiting_for)) {
196 vio->cmp->err = err;
197 complete(&vio->cmp->com);
198 vio->cmp = NULL;
202 static void vdc_handshake_complete(struct vio_driver_state *vio)
204 struct vdc_port *port = to_vdc_port(vio);
207 vdc_finish(vio, 0, WAITING_FOR_LINK_UP);
219 ldc_disconnect(port->vio.lp);
224 static int vdc_send_attr(struct vio_driver_state *vio)
226 struct vdc_port *port = to_vdc_port(vio);
234 pkt.tag.sid = vio_send_sid(vio);
243 return vio_ldc_send(&port->vio, &pkt, sizeof(pkt));
246 static int vdc_handle_attr(struct vio_driver_state *vio, void *arg)
248 struct vdc_port *port = to_vdc_port(vio);
266 vio->name, pkt->vdisk_type);
273 vio->name,
294 printk(KERN_ERR PFX "%s: Attribute NACK\n", vio->name);
304 vdc_finish(&port->vio, -err, WAITING_FOR_GEN_CMD);
317 ldc_unmap(port->vio.lp, desc->cookies, desc->ncookies);
336 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING];
358 struct vio_driver_state *vio = &port->vio;
362 spin_lock_irqsave(&vio->lock, flags);
365 vio_link_state_change(vio, event);
371 vio_link_state_change(vio, event);
387 err = ldc_read(vio->lp, &msgbuf, sizeof(msgbuf));
390 vio_conn_reset(vio);
400 err = vio_validate_sid(vio, &msgbuf.tag);
412 err = vio_control_pkt_engine(vio, &msgbuf);
420 vdc_finish(&port->vio, err, WAITING_FOR_ANY);
422 spin_unlock_irqrestore(&vio->lock, flags);
427 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING];
433 .sid = vio_send_sid(&port->vio),
445 err = vio_ldc_send(&port->vio, &hdr, sizeof(hdr));
465 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING];
496 err = ldc_map_sg(port->vio.lp, sg, nsg,
544 dr = &port->vio.drings[VIO_DRIVER_TX_RING];
548 spin_lock_irqsave(&port->vio.lock, flags);
554 spin_unlock_irqrestore(&port->vio.lock, flags);
559 spin_unlock_irqrestore(&port->vio.lock, flags);
565 spin_unlock_irqrestore(&port->vio.lock, flags);
569 spin_unlock_irqrestore(&port->vio.lock, flags);
655 spin_lock_irqsave(&port->vio.lock, flags);
657 dr = &port->vio.drings[VIO_DRIVER_TX_RING];
664 err = ldc_map_single(port->vio.lp, req_buf, op_len,
668 spin_unlock_irqrestore(&port->vio.lock, flags);
675 port->vio.cmp = &comp;
696 spin_unlock_irqrestore(&port->vio.lock, flags);
701 port->vio.cmp = NULL;
702 spin_unlock_irqrestore(&port->vio.lock, flags);
715 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING];
725 dring = ldc_alloc_exp_dring(port->vio.lp, len,
745 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING];
748 ldc_free_exp_dring(port->vio.lp, dr->base,
766 port->vio.cmp = &comp;
768 vio_port_up(&port->vio);
775 ldc_disconnect(port->vio.lp);
776 ldc_unbind(port->vio.lp);
778 vio_ldc_free(&port->vio);
838 port->vio.name);
847 g->first_minor = port->vio.vdev->dev_no << PARTITION_SHIFT;
880 port->vio.ver.major, port->vio.ver.minor);
882 err = device_add_disk(&port->vio.vdev->dev, g, NULL);
1018 err = vio_driver_init(&port->vio, vdev, VDEV_DISK,
1028 err = vio_ldc_alloc(&port->vio, &vdc_ldc_cfg, port);
1053 vio_ldc_free(&port->vio);
1072 del_timer_sync(&port->vio.timer);
1079 vio_ldc_free(&port->vio);
1089 struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING];
1097 ldc_unmap(port->vio.lp, desc->cookies, desc->ncookies);
1121 spin_unlock_irq(&port->vio.lock);
1126 spin_lock_irq(&port->vio.lock);
1135 struct vio_driver_state *vio;
1138 vio = &port->vio;
1140 spin_lock_irq(&vio->lock);
1141 if (!(port->vio.hs_state & VIO_HS_COMPLETE)) {
1147 spin_unlock_irq(&vio->lock);
1153 struct vio_driver_state *vio;
1157 vio = &port->vio;
1159 spin_lock_irqsave(&vio->lock, flags);
1161 spin_unlock_irqrestore(&vio->lock, flags);
1168 assert_spin_locked(&port->vio.lock);
1175 err = vio_ldc_alloc(&port->vio, &vdc_ldc_cfg, port);
1190 mod_timer(&port->vio.timer, round_jiffies(jiffies + HZ));
1194 vio_ldc_free(&port->vio);
1203 MODULE_DEVICE_TABLE(vio, vdc_port_match);