1 /* $Id: parport_ieee1284.c,v 1.4 1997/10/19 21:37:21 philip Exp $
2 * IEEE-1284 implementation for parport.
4 * Authors: Phil Blundell <philb@gnu.org>
5 * Carsten Gross <carsten@sol.wohnheim.uni-ulm.de>
6 * Jose Renau <renau@acm.org>
7 * Tim Waugh <tim@cyberelk.demon.co.uk> (largely rewritten)
9 * This file is responsible for IEEE 1284 negotiation, and for handing
10 * read/write requests to low-level drivers.
12 * Any part of this program may be used in documents licensed under
13 * the GNU Free Documentation License, Version 1.1 or any later version
14 * published by the Free Software Foundation.
16 * Various hacks, Fred Barnes <frmb2@ukc.ac.uk>, 04/2000
19 #include <linux/config.h>
20 #include <linux/threads.h>
21 #include <linux/parport.h>
22 #include <linux/delay.h>
23 #include <linux/kernel.h>
24 #include <linux/interrupt.h>
26 #undef DEBUG /* undef me for production */
28 #ifdef CONFIG_LP_CONSOLE
29 #undef DEBUG /* Don't want a garbled console */
33 #define DPRINTK(stuff...) printk (stuff)
35 #define DPRINTK(stuff...)
38 /* Make parport_wait_peripheral wake up.
39 * It will be useful to call this from an interrupt handler. */
40 void parport_ieee1284_wakeup (struct parport *port)
42 up (&port->physport->ieee1284.irq);
45 static struct parport *port_from_cookie[PARPORT_MAX];
46 static void timeout_waiting_on_port (unsigned long cookie)
48 parport_ieee1284_wakeup (port_from_cookie[cookie % PARPORT_MAX]);
52 * parport_wait_event - wait for an event on a parallel port
53 * @port: port to wait on
54 * @timeout: time to wait (in jiffies)
56 * This function waits for up to @timeout jiffies for an
57 * interrupt to occur on a parallel port. If the port timeout is
58 * set to zero, it returns immediately.
60 * If an interrupt occurs before the timeout period elapses, this
61 * function returns one immediately. If it times out, it returns
62 * a value greater than zero. An error code less than zero
63 * indicates an error (most likely a pending signal), and the
64 * calling code should finish what it's doing as soon as it can.
67 int parport_wait_event (struct parport *port, signed long timeout)
70 struct timer_list timer;
72 if (!port->physport->cad->timeout)
73 /* Zero timeout is special, and we can't down() the
78 timer.expires = jiffies + timeout;
79 timer.function = timeout_waiting_on_port;
80 port_from_cookie[port->number % PARPORT_MAX] = port;
81 timer.data = port->number;
84 ret = down_interruptible (&port->physport->ieee1284.irq);
85 if (!del_timer (&timer) && !ret)
93 * parport_poll_peripheral - poll status lines
94 * @port: port to watch
95 * @mask: status lines to watch
96 * @result: desired values of chosen status lines
99 * This function busy-waits until the masked status lines have
100 * the desired values, or until the timeout period elapses. The
101 * @mask and @result parameters are bitmasks, with the bits
102 * defined by the constants in parport.h: %PARPORT_STATUS_BUSY,
105 * This function does not call schedule(); instead it busy-waits
106 * using udelay(). It currently has a resolution of 5usec.
108 * If the status lines take on the desired values before the
109 * timeout period elapses, parport_poll_peripheral() returns zero
110 * immediately. A zero return value greater than zero indicates
111 * a timeout. An error code (less than zero) indicates an error,
112 * most likely a signal that arrived, and the caller should
113 * finish what it is doing as soon as possible.
116 int parport_poll_peripheral(struct parport *port,
118 unsigned char result,
121 /* Zero return code is success, >0 is timeout. */
122 int count = usec / 5 + 2;
124 unsigned char status;
125 for (i = 0; i < count; i++) {
126 status = parport_read_status (port);
127 if ((status & mask) == result)
129 if (signal_pending (current))
131 if (current->need_resched)
141 * parport_wait_peripheral - wait for status lines to change in 35ms
142 * @port: port to watch
143 * @mask: status lines to watch
144 * @result: desired values of chosen status lines
146 * This function waits until the masked status lines have the
147 * desired values, or until 35ms have elapsed (see IEEE 1284-1994
148 * page 24 to 25 for why this value in particular is hardcoded).
149 * The @mask and @result parameters are bitmasks, with the bits
150 * defined by the constants in parport.h: %PARPORT_STATUS_BUSY,
153 * The port is polled quickly to start off with, in anticipation
154 * of a fast response from the peripheral. This fast polling
155 * time is configurable (using /proc), and defaults to 500usec.
156 * If the timeout for this port (see parport_set_timeout()) is
157 * zero, the fast polling time is 35ms, and this function does
158 * not call schedule().
160 * If the timeout for this port is non-zero, after the fast
161 * polling fails it uses parport_wait_event() to wait for up to
162 * 10ms, waking up if an interrupt occurs.
165 int parport_wait_peripheral(struct parport *port,
167 unsigned char result)
172 unsigned char status;
174 usec = port->physport->spintime; /* usecs of fast polling */
175 if (!port->physport->cad->timeout)
176 /* A zero timeout is "special": busy wait for the
182 * This should be adjustable.
183 * How about making a note (in the device structure) of how long
184 * it takes, so we know for next time?
186 ret = parport_poll_peripheral (port, mask, result, usec);
190 if (!port->physport->cad->timeout)
191 /* We may be in an interrupt handler, so we can't poll
195 /* 40ms of slow polling. */
196 deadline = jiffies + (HZ + 24) / 25;
197 while (time_before (jiffies, deadline)) {
200 if (signal_pending (current))
203 /* Wait for 10ms (or until an interrupt occurs if
204 * the handler is set) */
205 if ((ret = parport_wait_event (port, (HZ + 99) / 100)) < 0)
208 status = parport_read_status (port);
209 if ((status & mask) == result)
213 /* parport_wait_event didn't time out, but the
214 * peripheral wasn't actually ready either.
215 * Wait for another 10ms. */
216 __set_current_state (TASK_INTERRUPTIBLE);
217 schedule_timeout ((HZ+ 99) / 100);
224 #ifdef CONFIG_PARPORT_1284
225 /* Terminate a negotiated mode. */
226 static void parport_ieee1284_terminate (struct parport *port)
229 port = port->physport;
231 /* EPP terminates differently. */
232 switch (port->ieee1284.mode) {
233 case IEEE1284_MODE_EPP:
234 case IEEE1284_MODE_EPPSL:
235 case IEEE1284_MODE_EPPSWE:
236 /* Terminate from EPP mode. */
238 /* Event 68: Set nInit low */
239 parport_frob_control (port, PARPORT_CONTROL_INIT, 0);
242 /* Event 69: Set nInit high, nSelectIn low */
243 parport_frob_control (port,
244 PARPORT_CONTROL_SELECT
245 | PARPORT_CONTROL_INIT,
246 PARPORT_CONTROL_SELECT
247 | PARPORT_CONTROL_INIT);
250 case IEEE1284_MODE_ECP:
251 case IEEE1284_MODE_ECPRLE:
252 case IEEE1284_MODE_ECPSWE:
253 /* In ECP we can only terminate from fwd idle phase. */
254 if (port->ieee1284.phase != IEEE1284_PH_FWD_IDLE) {
255 /* Event 47: Set nInit high */
256 parport_frob_control (port,
258 | PARPORT_CONTROL_AUTOFD,
260 | PARPORT_CONTROL_AUTOFD);
262 /* Event 49: PError goes high */
263 r = parport_wait_peripheral (port,
264 PARPORT_STATUS_PAPEROUT,
265 PARPORT_STATUS_PAPEROUT);
267 DPRINTK (KERN_INFO "%s: Timeout at event 49\n",
270 parport_data_forward (port);
271 DPRINTK (KERN_DEBUG "%s: ECP direction: forward\n",
273 port->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
279 /* Terminate from all other modes. */
281 /* Event 22: Set nSelectIn low, nAutoFd high */
282 parport_frob_control (port,
283 PARPORT_CONTROL_SELECT
284 | PARPORT_CONTROL_AUTOFD,
285 PARPORT_CONTROL_SELECT);
287 /* Event 24: nAck goes low */
288 r = parport_wait_peripheral (port, PARPORT_STATUS_ACK, 0);
290 DPRINTK (KERN_INFO "%s: Timeout at event 24\n",
293 /* Event 25: Set nAutoFd low */
294 parport_frob_control (port,
295 PARPORT_CONTROL_AUTOFD,
296 PARPORT_CONTROL_AUTOFD);
298 /* Event 27: nAck goes high */
299 r = parport_wait_peripheral (port,
303 DPRINTK (KERN_INFO "%s: Timeout at event 27\n",
306 /* Event 29: Set nAutoFd high */
307 parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
310 port->ieee1284.mode = IEEE1284_MODE_COMPAT;
311 port->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
313 DPRINTK (KERN_DEBUG "%s: In compatibility (forward idle) mode\n",
316 #endif /* IEEE1284 support */
319 * parport_negotiate - negotiate an IEEE 1284 mode
321 * @mode: mode to negotiate to
323 * Use this to negotiate to a particular IEEE 1284 transfer mode.
324 * The @mode parameter should be one of the constants in
325 * parport.h starting %IEEE1284_MODE_xxx.
327 * The return value is 0 if the peripheral has accepted the
328 * negotiation to the mode specified, -1 if the peripheral is not
329 * IEEE 1284 compliant (or not present), or 1 if the peripheral
330 * has rejected the negotiation.
333 int parport_negotiate (struct parport *port, int mode)
335 #ifndef CONFIG_PARPORT_1284
336 if (mode == IEEE1284_MODE_COMPAT)
338 printk (KERN_ERR "parport: IEEE1284 not supported in this kernel\n");
341 int m = mode & ~IEEE1284_ADDR;
345 port = port->physport;
347 /* Is there anything to do? */
348 if (port->ieee1284.mode == mode)
351 /* Is the difference just an address-or-not bit? */
352 if ((port->ieee1284.mode & ~IEEE1284_ADDR) == (mode & ~IEEE1284_ADDR)){
353 port->ieee1284.mode = mode;
357 /* Go to compability forward idle mode */
358 if (port->ieee1284.mode != IEEE1284_MODE_COMPAT)
359 parport_ieee1284_terminate (port);
361 if (mode == IEEE1284_MODE_COMPAT)
362 /* Compatibility mode: no negotiation. */
366 case IEEE1284_MODE_ECPSWE:
367 m = IEEE1284_MODE_ECP;
369 case IEEE1284_MODE_EPPSL:
370 case IEEE1284_MODE_EPPSWE:
371 m = IEEE1284_MODE_EPP;
373 case IEEE1284_MODE_BECP:
374 return -ENOSYS; /* FIXME (implement BECP) */
377 if (mode & IEEE1284_EXT_LINK)
378 m = 1<<7; /* request extensibility link */
380 port->ieee1284.phase = IEEE1284_PH_NEGOTIATION;
382 /* Start off with nStrobe and nAutoFd high, and nSelectIn low */
383 parport_frob_control (port,
384 PARPORT_CONTROL_STROBE
385 | PARPORT_CONTROL_AUTOFD
386 | PARPORT_CONTROL_SELECT,
387 PARPORT_CONTROL_SELECT);
390 /* Event 0: Set data */
391 parport_data_forward (port);
392 parport_write_data (port, m);
393 udelay (400); /* Shouldn't need to wait this long. */
395 /* Event 1: Set nSelectIn high, nAutoFd low */
396 parport_frob_control (port,
397 PARPORT_CONTROL_SELECT
398 | PARPORT_CONTROL_AUTOFD,
399 PARPORT_CONTROL_AUTOFD);
401 /* Event 2: PError, Select, nFault go high, nAck goes low */
402 if (parport_wait_peripheral (port,
404 | PARPORT_STATUS_SELECT
405 | PARPORT_STATUS_PAPEROUT
406 | PARPORT_STATUS_ACK,
408 | PARPORT_STATUS_SELECT
409 | PARPORT_STATUS_PAPEROUT)) {
411 parport_frob_control (port,
412 PARPORT_CONTROL_SELECT
413 | PARPORT_CONTROL_AUTOFD,
414 PARPORT_CONTROL_SELECT);
416 "%s: Peripheral not IEEE1284 compliant (0x%02X)\n",
417 port->name, parport_read_status (port));
418 port->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
419 return -1; /* Not IEEE1284 compliant */
422 /* Event 3: Set nStrobe low */
423 parport_frob_control (port,
424 PARPORT_CONTROL_STROBE,
425 PARPORT_CONTROL_STROBE);
427 /* Event 4: Set nStrobe and nAutoFd high */
429 parport_frob_control (port,
430 PARPORT_CONTROL_STROBE
431 | PARPORT_CONTROL_AUTOFD,
434 /* Event 6: nAck goes high */
435 if (parport_wait_peripheral (port,
437 PARPORT_STATUS_ACK)) {
438 /* This shouldn't really happen with a compliant device. */
440 "%s: Mode 0x%02x not supported? (0x%02x)\n",
441 port->name, mode, port->ops->read_status (port));
442 parport_ieee1284_terminate (port);
446 xflag = parport_read_status (port) & PARPORT_STATUS_SELECT;
448 /* xflag should be high for all modes other than nibble (0). */
449 if (mode && !xflag) {
450 /* Mode not supported. */
451 DPRINTK (KERN_DEBUG "%s: Mode 0x%02x rejected by peripheral\n",
453 parport_ieee1284_terminate (port);
457 /* More to do if we've requested extensibility link. */
458 if (mode & IEEE1284_EXT_LINK) {
461 parport_write_data (port, m);
464 /* Event 51: Set nStrobe low */
465 parport_frob_control (port,
466 PARPORT_CONTROL_STROBE,
467 PARPORT_CONTROL_STROBE);
469 /* Event 52: nAck goes low */
470 if (parport_wait_peripheral (port, PARPORT_STATUS_ACK, 0)) {
471 /* This peripheral is _very_ slow. */
473 "%s: Event 52 didn't happen\n",
475 parport_ieee1284_terminate (port);
479 /* Event 53: Set nStrobe high */
480 parport_frob_control (port,
481 PARPORT_CONTROL_STROBE,
484 /* Event 55: nAck goes high */
485 if (parport_wait_peripheral (port,
487 PARPORT_STATUS_ACK)) {
488 /* This shouldn't really happen with a compliant
491 "%s: Mode 0x%02x not supported? (0x%02x)\n",
493 port->ops->read_status (port));
494 parport_ieee1284_terminate (port);
498 /* Event 54: Peripheral sets XFlag to reflect support */
499 xflag = parport_read_status (port) & PARPORT_STATUS_SELECT;
501 /* xflag should be high. */
503 /* Extended mode not supported. */
504 DPRINTK (KERN_DEBUG "%s: Extended mode 0x%02x not "
505 "supported\n", port->name, mode);
506 parport_ieee1284_terminate (port);
510 /* Any further setup is left to the caller. */
513 /* Mode is supported */
514 DPRINTK (KERN_DEBUG "%s: In mode 0x%02x\n", port->name, mode);
515 port->ieee1284.mode = mode;
517 /* But ECP is special */
518 if (!(mode & IEEE1284_EXT_LINK) && (m & IEEE1284_MODE_ECP)) {
519 port->ieee1284.phase = IEEE1284_PH_ECP_SETUP;
521 /* Event 30: Set nAutoFd low */
522 parport_frob_control (port,
523 PARPORT_CONTROL_AUTOFD,
524 PARPORT_CONTROL_AUTOFD);
526 /* Event 31: PError goes high. */
527 r = parport_wait_peripheral (port,
528 PARPORT_STATUS_PAPEROUT,
529 PARPORT_STATUS_PAPEROUT);
531 DPRINTK (KERN_INFO "%s: Timeout at event 31\n",
535 port->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
536 DPRINTK (KERN_DEBUG "%s: ECP direction: forward\n",
538 } else switch (mode) {
539 case IEEE1284_MODE_NIBBLE:
540 case IEEE1284_MODE_BYTE:
541 port->ieee1284.phase = IEEE1284_PH_REV_IDLE;
544 port->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
549 #endif /* IEEE1284 support */
552 /* Acknowledge that the peripheral has data available.
553 * Events 18-20, in order to get from Reverse Idle phase
554 * to Host Busy Data Available.
555 * This will most likely be called from an interrupt.
556 * Returns zero if data was available.
558 #ifdef CONFIG_PARPORT_1284
559 static int parport_ieee1284_ack_data_avail (struct parport *port)
561 if (parport_read_status (port) & PARPORT_STATUS_ERROR)
562 /* Event 18 didn't happen. */
565 /* Event 20: nAutoFd goes high. */
566 port->ops->frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
567 port->ieee1284.phase = IEEE1284_PH_HBUSY_DAVAIL;
570 #endif /* IEEE1284 support */
572 /* Handle an interrupt. */
573 void parport_ieee1284_interrupt (int which, void *handle, struct pt_regs *regs)
575 struct parport *port = handle;
576 parport_ieee1284_wakeup (port);
578 #ifdef CONFIG_PARPORT_1284
579 if (port->ieee1284.phase == IEEE1284_PH_REV_IDLE) {
580 /* An interrupt in this phase means that data
581 * is now available. */
582 DPRINTK (KERN_DEBUG "%s: Data available\n", port->name);
583 parport_ieee1284_ack_data_avail (port);
585 #endif /* IEEE1284 support */
589 * parport_write - write a block of data to a parallel port
590 * @port: port to write to
591 * @buffer: data buffer (in kernel space)
592 * @len: number of bytes of data to transfer
594 * This will write up to @len bytes of @buffer to the port
595 * specified, using the IEEE 1284 transfer mode most recently
596 * negotiated to (using parport_negotiate()), as long as that
597 * mode supports forward transfers (host to peripheral).
599 * It is the caller's responsibility to ensure that the first
600 * @len bytes of @buffer are valid.
602 * This function returns the number of bytes transferred (if zero
603 * or positive), or else an error code.
606 ssize_t parport_write (struct parport *port, const void *buffer, size_t len)
608 #ifndef CONFIG_PARPORT_1284
609 return port->ops->compat_write_data (port, buffer, len, 0);
612 int mode = port->ieee1284.mode;
613 int addr = mode & IEEE1284_ADDR;
614 size_t (*fn) (struct parport *, const void *, size_t, int);
616 /* Ignore the device-ID-request bit and the address bit. */
617 mode &= ~(IEEE1284_DEVICEID | IEEE1284_ADDR);
619 /* Use the mode we're in. */
621 case IEEE1284_MODE_NIBBLE:
622 case IEEE1284_MODE_BYTE:
623 parport_negotiate (port, IEEE1284_MODE_COMPAT);
624 case IEEE1284_MODE_COMPAT:
625 DPRINTK (KERN_DEBUG "%s: Using compatibility mode\n",
627 fn = port->ops->compat_write_data;
630 case IEEE1284_MODE_EPP:
631 DPRINTK (KERN_DEBUG "%s: Using EPP mode\n", port->name);
633 fn = port->ops->epp_write_addr;
635 fn = port->ops->epp_write_data;
638 case IEEE1284_MODE_EPPSWE:
639 DPRINTK (KERN_DEBUG "%s: Using software-emulated EPP mode\n",
642 fn = parport_ieee1284_epp_write_addr;
644 fn = parport_ieee1284_epp_write_data;
647 case IEEE1284_MODE_ECP:
648 case IEEE1284_MODE_ECPRLE:
649 DPRINTK (KERN_DEBUG "%s: Using ECP mode\n", port->name);
651 fn = port->ops->ecp_write_addr;
653 fn = port->ops->ecp_write_data;
657 case IEEE1284_MODE_ECPSWE:
658 DPRINTK (KERN_DEBUG "%s: Using software-emulated ECP mode\n",
660 /* The caller has specified that it must be emulated,
661 * even if we have ECP hardware! */
663 fn = parport_ieee1284_ecp_write_addr;
665 fn = parport_ieee1284_ecp_write_data;
670 DPRINTK (KERN_DEBUG "%s: Unknown mode 0x%02x\n", port->name,
671 port->ieee1284.mode);
675 retval = (*fn) (port, buffer, len, 0);
676 DPRINTK (KERN_DEBUG "%s: wrote %d/%d bytes\n", port->name, retval, len);
678 #endif /* IEEE1284 support */
682 * parport_read - read a block of data from a parallel port
683 * @port: port to read from
684 * @buffer: data buffer (in kernel space)
685 * @len: number of bytes of data to transfer
687 * This will read up to @len bytes of @buffer to the port
688 * specified, using the IEEE 1284 transfer mode most recently
689 * negotiated to (using parport_negotiate()), as long as that
690 * mode supports reverse transfers (peripheral to host).
692 * It is the caller's responsibility to ensure that the first
693 * @len bytes of @buffer are available to write to.
695 * This function returns the number of bytes transferred (if zero
696 * or positive), or else an error code.
699 ssize_t parport_read (struct parport *port, void *buffer, size_t len)
701 #ifndef CONFIG_PARPORT_1284
702 printk (KERN_ERR "parport: IEEE1284 not supported in this kernel\n");
705 int mode = port->physport->ieee1284.mode;
706 int addr = mode & IEEE1284_ADDR;
707 size_t (*fn) (struct parport *, void *, size_t, int);
709 /* Ignore the device-ID-request bit and the address bit. */
710 mode &= ~(IEEE1284_DEVICEID | IEEE1284_ADDR);
712 /* Use the mode we're in. */
714 case IEEE1284_MODE_COMPAT:
715 /* if we can tri-state use BYTE mode instead of NIBBLE mode,
716 * if that fails, revert to NIBBLE mode -- ought to store somewhere
717 * the device's ability to do BYTE mode reverse transfers, so we don't
718 * end up needlessly calling negotiate(BYTE) repeately.. (fb)
720 if ((port->physport->modes & PARPORT_MODE_TRISTATE) &&
721 !parport_negotiate (port, IEEE1284_MODE_BYTE)) {
722 /* got into BYTE mode OK */
723 DPRINTK (KERN_DEBUG "%s: Using byte mode\n", port->name);
724 fn = port->ops->byte_read_data;
727 if (parport_negotiate (port, IEEE1284_MODE_NIBBLE)) {
730 /* fall through to NIBBLE */
731 case IEEE1284_MODE_NIBBLE:
732 DPRINTK (KERN_DEBUG "%s: Using nibble mode\n", port->name);
733 fn = port->ops->nibble_read_data;
736 case IEEE1284_MODE_BYTE:
737 DPRINTK (KERN_DEBUG "%s: Using byte mode\n", port->name);
738 fn = port->ops->byte_read_data;
741 case IEEE1284_MODE_EPP:
742 DPRINTK (KERN_DEBUG "%s: Using EPP mode\n", port->name);
744 fn = port->ops->epp_read_addr;
746 fn = port->ops->epp_read_data;
749 case IEEE1284_MODE_EPPSWE:
750 DPRINTK (KERN_DEBUG "%s: Using software-emulated EPP mode\n",
753 fn = parport_ieee1284_epp_read_addr;
755 fn = parport_ieee1284_epp_read_data;
758 case IEEE1284_MODE_ECP:
759 case IEEE1284_MODE_ECPRLE:
760 DPRINTK (KERN_DEBUG "%s: Using ECP mode\n", port->name);
761 fn = port->ops->ecp_read_data;
764 case IEEE1284_MODE_ECPSWE:
765 DPRINTK (KERN_DEBUG "%s: Using software-emulated ECP mode\n",
767 fn = parport_ieee1284_ecp_read_data;
771 DPRINTK (KERN_DEBUG "%s: Unknown mode 0x%02x\n", port->name,
772 port->physport->ieee1284.mode);
776 return (*fn) (port, buffer, len, 0);
777 #endif /* IEEE1284 support */
781 * parport_set_timeout - set the inactivity timeout for a device
782 * @dev: device on a port
783 * @inactivity: inactivity timeout (in jiffies)
785 * This sets the inactivity timeout for a particular device on a
786 * port. This affects functions like parport_wait_peripheral().
787 * The special value 0 means not to call schedule() while dealing
790 * The return value is the previous inactivity timeout.
792 * Any callers of parport_wait_event() for this device are woken
796 long parport_set_timeout (struct pardevice *dev, long inactivity)
798 long int old = dev->timeout;
800 dev->timeout = inactivity;
802 if (dev->port->physport->cad == dev)
803 parport_ieee1284_wakeup (dev->port);