Example #1
0
static void
ofw_cnputc(struct consdev *cp, int c)
{
	char cbuf;

	if (c == '\n') {
		cbuf = '\r';
		OF_write(stdout, &cbuf, 1);
	}

	cbuf = c;
	OF_write(stdout, &cbuf, 1);
}
Example #2
0
static void
ofw_cons_putc(dev_t dev, int c)
{
	char cbuf;

	if (c == '\n') {
		cbuf = '\r';
		OF_write(stdout, &cbuf, 1);
	}

	cbuf = c;
	OF_write(stdout, &cbuf, 1);
}
void
ofw_cons_putchar(int c)
{
	char cbuf;

	if (c == '\n') {
		cbuf = '\r';
		OF_write(stdout, &cbuf, 1);
	}

	cbuf = c;
	OF_write(stdout, &cbuf, 1);
}
Example #4
0
static void
ofwbootcons_cnputc(dev_t dev, int c)
{
	char ch = c;

	OF_write(stdout, &ch, 1);
}
Example #5
0
void
putchar(int c)
{
	char ch = c;

	if (c == '\n')
		putchar('\r');
	OF_write(stdout, &ch, 1);
}
Example #6
0
static void
openfirmware_putchar(int c)
{
    char ch = c;

    if (c == '\n')
        putchar('\r');
    OF_write(prom_stdout(), &ch, 1);
}
Example #7
0
void ofprint(const char *blah, ...)
{
	va_list va;
	char buf[256];
	int len;

	va_start(va, blah);
	len = vsnprintf(buf, sizeof(buf), blah, va);
	OF_write(console_instance, buf, len);
}
Example #8
0
static void
ofwtty_outwakeup(struct tty *tp)
{
	int len;
	u_char buf[OFBURSTLEN];

	for (;;) {
		len = ttydisc_getc(tp, buf, sizeof buf);
		if (len == 0)
			break;
		OF_write(stdout, buf, len);
	}
}
Example #9
0
/*
 * PROM console output putchar.
 */
void
prom_cnputc(dev_t dev, int c)
{
	int s;
	char c0 = (c & 0x7f);

#if 0
	if (!stdout) stdout = OF_stdout();
#endif
	s = splhigh();
	OF_write(stdout, &c0, 1);
	splx(s);
}
Example #10
0
/*
 * Send a packet.  The ether header is already there.
 * Return the length sent (or -1 on error).
 */
ssize_t
netif_put(struct iodesc *desc, void *pkt, size_t len)
{
    struct of_dev *op;
    ssize_t rv;
    size_t sendlen;

    op = desc->io_netif->nif_devdata;

#ifdef	NETIF_DEBUG
    {
        struct ether_header *eh;

        printf("netif_put: desc=0x%x pkt=0x%x len=%d\n",
               desc, pkt, len);
        eh = pkt;
        printf("dst: %s ", ether_sprintf(eh->ether_dhost));
        printf("src: %s ", ether_sprintf(eh->ether_shost));
        printf("type: 0x%x\n", eh->ether_type & 0xFFFF);
    }
#endif

    sendlen = len;
    if (sendlen < 60) {
        sendlen = 60;
#ifdef	NETIF_DEBUG
        printf("netif_put: length padded to %d\n", sendlen);
#endif
    }

    if (op->dmabuf) {
        bcopy(pkt, op->dmabuf, sendlen);
        pkt = op->dmabuf;
    }
    rv = OF_write(op->handle, pkt, sendlen);

#ifdef	NETIF_DEBUG
    printf("netif_put: xmit returned %d\n", rv);
#endif

    return rv;
}
Example #11
0
static int
ofwn_put(struct iodesc *desc, void *pkt, size_t len)
{
	struct ether_header	*eh;
	size_t			sendlen;
	ssize_t			rv;

#if defined(NETIF_DEBUG)
	printf("netif_put: desc=0x%x pkt=0x%x len=%d\n", desc, pkt, len);
	eh = pkt;
	printf("dst: %s ", ether_sprintf(eh->ether_dhost));
	printf("src: %s ", ether_sprintf(eh->ether_shost));
	printf("type: 0x%x\n", eh->ether_type & 0xffff);
#endif

	sendlen = len;
	if (sendlen < 60) {
		sendlen = 60;
#if defined(NETIF_DEBUG)
		printf("netif_put: length padded to %d\n", sendlen);
#endif
	}

	if (dmabuf) {
		bcopy(pkt, dmabuf, sendlen);
		pkt = dmabuf;
	}

	rv = OF_write(netinstance, pkt, len);

#if defined(NETIF_DEBUG)
	printf("netif_put: OF_write returned %d\n", rv);
#endif

	return rv;
}