Home | History | Annotate | Line # | Download | only in tc
px.c revision 1.9
      1  1.9        ad /* 	$NetBSD: px.c,v 1.9 2001/09/18 19:51:23 ad Exp $	*/
      2  1.1  jonathan 
      3  1.4        ad /*-
      4  1.5        ad  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
      5  1.1  jonathan  * All rights reserved.
      6  1.1  jonathan  *
      7  1.4        ad  * This code is derived from software contributed to The NetBSD Foundation
      8  1.4        ad  * by Andrew Doran.
      9  1.4        ad  *
     10  1.1  jonathan  * Redistribution and use in source and binary forms, with or without
     11  1.1  jonathan  * modification, are permitted provided that the following conditions
     12  1.1  jonathan  * are met:
     13  1.1  jonathan  * 1. Redistributions of source code must retain the above copyright
     14  1.1  jonathan  *    notice, this list of conditions and the following disclaimer.
     15  1.1  jonathan  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1  jonathan  *    notice, this list of conditions and the following disclaimer in the
     17  1.1  jonathan  *    documentation and/or other materials provided with the distribution.
     18  1.1  jonathan  * 3. All advertising materials mentioning features or use of this software
     19  1.1  jonathan  *    must display the following acknowledgement:
     20  1.4        ad  *	This product includes software developed by the NetBSD
     21  1.4        ad  *	Foundation, Inc. and its contributors.
     22  1.4        ad  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.4        ad  *    contributors may be used to endorse or promote products derived
     24  1.4        ad  *    from this software without specific prior written permission.
     25  1.1  jonathan  *
     26  1.4        ad  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.4        ad  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.4        ad  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.4        ad  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.4        ad  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.4        ad  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.4        ad  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.4        ad  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.4        ad  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.4        ad  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.4        ad  * POSSIBILITY OF SUCH DAMAGE.
     37  1.1  jonathan  */
     38  1.1  jonathan 
     39  1.1  jonathan /*
     40  1.4        ad  * Driver for DEC PixelStamp graphics adapters (PMAG-C).
     41  1.1  jonathan  */
     42  1.1  jonathan 
     43  1.1  jonathan #include <sys/param.h>
     44  1.4        ad #include <sys/types.h>
     45  1.1  jonathan #include <sys/systm.h>
     46  1.1  jonathan #include <sys/device.h>
     47  1.4        ad #include <sys/malloc.h>
     48  1.4        ad #include <sys/callout.h>
     49  1.1  jonathan 
     50  1.4        ad #include <uvm/uvm_extern.h>
     51  1.4        ad 
     52  1.4        ad #if defined(pmax)
     53  1.4        ad #include <mips/cpuregs.h>
     54  1.4        ad #elif defined(alpha)
     55  1.4        ad #include <alpha/alpha_cpu.h>
     56  1.4        ad #endif
     57  1.1  jonathan 
     58  1.1  jonathan #include <machine/autoconf.h>
     59  1.1  jonathan #include <machine/cpu.h>
     60  1.1  jonathan #include <machine/bus.h>
     61  1.1  jonathan 
     62  1.4        ad #include <dev/cons.h>
     63  1.4        ad 
     64  1.4        ad #include <dev/wscons/wsconsio.h>
     65  1.4        ad #include <dev/wscons/wsdisplayvar.h>
     66  1.4        ad 
     67  1.4        ad #include <dev/ic/bt459reg.h>
     68  1.4        ad 
     69  1.4        ad #include <dev/tc/tcvar.h>
     70  1.4        ad #include <dev/tc/sticreg.h>
     71  1.9        ad #include <dev/tc/sticio.h>
     72  1.4        ad #include <dev/tc/sticvar.h>
     73  1.4        ad 
     74  1.4        ad #define	PX_STIC_POLL_OFFSET	0x000000	/* STIC DMA poll space */
     75  1.4        ad #define	PX_STAMP_OFFSET		0x0c0000	/* pixelstamp space on STIC */
     76  1.4        ad #define	PX_STIC_OFFSET		0x180000	/* STIC registers */
     77  1.4        ad #define	PX_VDAC_OFFSET		0x200000	/* VDAC registers (bt459) */
     78  1.4        ad #define	PX_VDAC_RESET_OFFSET	0x300000	/* VDAC reset register */
     79  1.4        ad #define	PX_ROM_OFFSET		0x300000	/* ROM code */
     80  1.4        ad 
     81  1.9        ad #define	PX_BUF_COUNT		16
     82  1.9        ad #define	PX_BUF_INC(x)		((x + 1) & (PX_BUF_COUNT - 1))
     83  1.9        ad 
     84  1.9        ad /*
     85  1.9        ad  * We need enough aligned memory to hold:
     86  1.9        ad  *
     87  1.9        ad  * - Xserver communication area (4096 bytes)
     88  1.9        ad  * - 16 packet buffers (4096 bytes each)
     89  1.9        ad  * - 2 image buffers (5120 bytes each)
     90  1.9        ad  *
     91  1.9        ad  */
     92  1.9        ad #define	PX_BUF_SIZE		\
     93  1.9        ad     (STIC_PACKET_SIZE * PX_BUF_COUNT + STIC_IMGBUF_SIZE*2 + STIC_XCOMM_SIZE)
     94  1.4        ad #define	PX_BUF_ALIGN		32768
     95  1.4        ad 
     96  1.9        ad #define	PXF_QUEUE	0x01
     97  1.9        ad 
     98  1.9        ad void	px_attach(struct device *, struct device *, void *);
     99  1.9        ad void	px_init(struct stic_info *, int);
    100  1.9        ad int	px_ioctl(struct stic_info *, u_long, caddr_t, int, struct proc *);
    101  1.9        ad int	px_match(struct device *, struct cfdata *, void *);
    102  1.9        ad 
    103  1.9        ad int	px_intr(void *);
    104  1.9        ad u_int32_t	*px_pbuf_get(struct stic_info *);
    105  1.9        ad int	px_pbuf_post(struct stic_info *, u_int32_t *);
    106  1.1  jonathan 
    107  1.4        ad void	px_cnattach(tc_addr_t);
    108  1.1  jonathan 
    109  1.1  jonathan struct px_softc {
    110  1.4        ad 	struct	device px_dv;
    111  1.4        ad 	struct	stic_info *px_si;
    112  1.9        ad 	volatile u_int32_t	*px_qpoll[PX_BUF_COUNT];
    113  1.1  jonathan };
    114  1.1  jonathan 
    115  1.1  jonathan struct cfattach px_ca = {
    116  1.4        ad 	sizeof(struct px_softc), px_match, px_attach
    117  1.1  jonathan };
    118  1.1  jonathan 
    119  1.9        ad int
    120  1.4        ad px_match(struct device *parent, struct cfdata *match, void *aux)
    121  1.4        ad {
    122  1.4        ad 	struct tc_attach_args *ta;
    123  1.4        ad 
    124  1.4        ad 	ta = aux;
    125  1.1  jonathan 
    126  1.4        ad 	return (strncmp("PMAG-CA ", ta->ta_modname, TC_ROM_LLEN) == 0);
    127  1.1  jonathan }
    128  1.1  jonathan 
    129  1.9        ad void
    130  1.4        ad px_attach(struct device *parent, struct device *self, void *aux)
    131  1.4        ad {
    132  1.4        ad 	struct stic_info *si;
    133  1.4        ad 	struct tc_attach_args *ta;
    134  1.4        ad 	struct px_softc *px;
    135  1.9        ad 	int console, i;
    136  1.9        ad 	u_long v;
    137  1.4        ad 
    138  1.4        ad 	px = (struct px_softc *)self;
    139  1.4        ad 	ta = (struct tc_attach_args *)aux;
    140  1.4        ad 
    141  1.4        ad 	if (ta->ta_addr == stic_consinfo.si_slotbase) {
    142  1.4        ad 		si = &stic_consinfo;
    143  1.4        ad 		console = 1;
    144  1.4        ad 	} else {
    145  1.4        ad 		if (stic_consinfo.si_slotbase == NULL)
    146  1.4        ad 			si = &stic_consinfo;
    147  1.4        ad 		else {
    148  1.4        ad 			si = malloc(sizeof(*si), M_DEVBUF, M_NOWAIT);
    149  1.4        ad 			memset(si, 0, sizeof(*si));
    150  1.4        ad 		}
    151  1.4        ad 		si->si_slotbase = ta->ta_addr;
    152  1.4        ad 		px_init(si, 0);
    153  1.4        ad 		console = 0;
    154  1.4        ad 	}
    155  1.4        ad 
    156  1.4        ad 	px->px_si = si;
    157  1.9        ad 	si->si_dv = self;
    158  1.4        ad 	tc_intr_establish(parent, ta->ta_cookie, IPL_TTY, px_intr, si);
    159  1.1  jonathan 
    160  1.7        ad 	printf(": 8 plane, %dx%d stamp\n", si->si_stampw, si->si_stamph);
    161  1.1  jonathan 
    162  1.9        ad 	for (i = 0; i < PX_BUF_COUNT; i++) {
    163  1.9        ad 		v = i * STIC_PACKET_SIZE +
    164  1.9        ad 		    si->si_buf_phys + STIC_XCOMM_SIZE;
    165  1.9        ad 		v = ((v & 0xffff8000) << 3) | (v & 0x7fff);
    166  1.9        ad 		px->px_qpoll[i] = (volatile u_int32_t *)
    167  1.9        ad 		    ((caddr_t)si->si_slotbase + (v >> 9));
    168  1.9        ad 	}
    169  1.9        ad 
    170  1.4        ad 	stic_attach(self, si, console);
    171  1.4        ad }
    172  1.1  jonathan 
    173  1.4        ad void
    174  1.4        ad px_cnattach(tc_addr_t addr)
    175  1.4        ad {
    176  1.4        ad 	struct stic_info *si;
    177  1.1  jonathan 
    178  1.4        ad 	si = &stic_consinfo;
    179  1.4        ad 	si->si_slotbase = addr;
    180  1.4        ad 	px_init(si, 1);
    181  1.4        ad 	stic_cnattach(si);
    182  1.1  jonathan }
    183  1.4        ad 
    184  1.9        ad void
    185  1.4        ad px_init(struct stic_info *si, int bootstrap)
    186  1.1  jonathan {
    187  1.4        ad 	struct pglist pglist;
    188  1.9        ad 	caddr_t kva, bva;
    189  1.4        ad 	paddr_t bpa;
    190  1.4        ad 
    191  1.4        ad 	/*
    192  1.4        ad 	 * Allocate memory for the packet buffers.  It must be located below
    193  1.4        ad 	 * 8MB, since the STIC can't access outside that region.  Also, due
    194  1.4        ad 	 * to the holes in STIC address space, each buffer mustn't cross a
    195  1.4        ad 	 * 32kB boundary.
    196  1.4        ad 	 */
    197  1.4        ad 	if (bootstrap) {
    198  1.4        ad 		/*
    199  1.8       wiz 		 * UVM won't be initialised at this point, so grab memory
    200  1.4        ad 		 * directly from vm_physmem[].
    201  1.4        ad 		 */
    202  1.9        ad 		bva = (caddr_t)uvm_pageboot_alloc(PX_BUF_SIZE + PX_BUF_ALIGN);
    203  1.4        ad 		bpa = (STIC_KSEG_TO_PHYS(kva) + PX_BUF_ALIGN - 1) &
    204  1.4        ad 		    ~(PX_BUF_ALIGN - 1);
    205  1.4        ad 		if (bpa + PX_BUF_SIZE > 8192*1024)
    206  1.4        ad 			panic("px_init: allocation out of bounds");
    207  1.4        ad 	} else {
    208  1.4        ad 		TAILQ_INIT(&pglist);
    209  1.9        ad 		if (uvm_pglistalloc(PX_BUF_SIZE, 0, 8192*1024, PX_BUF_ALIGN,
    210  1.9        ad 		    0, &pglist, 1, 0) != 0)
    211  1.4        ad 			panic("px_init: allocation failure");
    212  1.4        ad 		bpa = TAILQ_FIRST(&pglist)->phys_addr;
    213  1.4        ad 	}
    214  1.4        ad 
    215  1.9        ad 	kva = (caddr_t)si->si_slotbase;
    216  1.1  jonathan 
    217  1.4        ad 	si->si_vdac = (u_int32_t *)(kva + PX_VDAC_OFFSET);
    218  1.4        ad 	si->si_vdac_reset = (u_int32_t *)(kva + PX_VDAC_RESET_OFFSET);
    219  1.4        ad 	si->si_stic = (volatile struct stic_regs *)(kva + PX_STIC_OFFSET);
    220  1.4        ad 	si->si_stamp = (u_int32_t *)(kva + PX_STAMP_OFFSET);
    221  1.4        ad 	si->si_buf = (u_int32_t *)TC_PHYS_TO_UNCACHED(bpa);
    222  1.9        ad 	si->si_buf_phys = bpa;
    223  1.4        ad 	si->si_buf_size = PX_BUF_SIZE;
    224  1.4        ad 	si->si_disptype = WSDISPLAY_TYPE_PX;
    225  1.4        ad 	si->si_depth = 8;
    226  1.9        ad 	si->si_sxc = (volatile struct stic_xcomm *)si->si_buf;
    227  1.1  jonathan 
    228  1.4        ad 	si->si_pbuf_get = px_pbuf_get;
    229  1.4        ad 	si->si_pbuf_post = px_pbuf_post;
    230  1.9        ad 	si->si_ioctl = px_ioctl;
    231  1.1  jonathan 
    232  1.4        ad 	memset(si->si_buf, 0, PX_BUF_SIZE);
    233  1.4        ad 
    234  1.4        ad 	stic_init(si);
    235  1.4        ad }
    236  1.1  jonathan 
    237  1.9        ad int
    238  1.4        ad px_intr(void *cookie)
    239  1.4        ad {
    240  1.4        ad 	volatile struct stic_regs *sr;
    241  1.9        ad 	volatile struct stic_xcomm *sxc;
    242  1.4        ad 	struct stic_info *si;
    243  1.9        ad 	struct px_softc *px;
    244  1.4        ad 	int state;
    245  1.4        ad 
    246  1.4        ad 	si = cookie;
    247  1.9        ad 	px = (struct px_softc *)si->si_dv;
    248  1.4        ad 	sr = si->si_stic;
    249  1.4        ad 	state = sr->sr_ipdvint;
    250  1.9        ad 	sxc = si->si_sxc;
    251  1.4        ad 
    252  1.9        ad 	/*
    253  1.9        ad 	 * Vertical-retrace condition.
    254  1.9        ad 	 *
    255  1.9        ad 	 * Clear the flag and flush out any waiting VDAC updates.  We do
    256  1.9        ad 	 * this at retrace time to avoid producing `shearing' and other
    257  1.9        ad 	 * nasty artifacts.
    258  1.9        ad 	 */
    259  1.4        ad 	if ((state & STIC_INT_V) != 0) {
    260  1.9        ad 		sr->sr_ipdvint = STIC_INT_V_WE | STIC_INT_V_EN;
    261  1.1  jonathan 		tc_wmb();
    262  1.4        ad 		stic_flush(si);
    263  1.1  jonathan 	}
    264  1.1  jonathan 
    265  1.9        ad 	/*
    266  1.9        ad 	 * Error condition.
    267  1.9        ad 	 *
    268  1.9        ad 	 * Simply clear the flag and report the error.
    269  1.9        ad 	 */
    270  1.9        ad 	if ((state & STIC_INT_E) != 0) {
    271  1.9        ad 		printf("%s: error intr, %x %x %x %x %x", px->px_dv.dv_xname,
    272  1.4        ad 		    sr->sr_ipdvint, sr->sr_sticsr, sr->sr_buscsr,
    273  1.4        ad 		    sr->sr_busadr, sr->sr_busdat);
    274  1.9        ad 		sr->sr_ipdvint = STIC_INT_E_WE | STIC_INT_E_EN;
    275  1.9        ad 		tc_wmb();
    276  1.9        ad 	}
    277  1.9        ad 
    278  1.9        ad 	/*
    279  1.9        ad 	 * Check for queue stalls.
    280  1.9        ad 	 */
    281  1.9        ad 	if (sxc->sxc_tail != sxc->sxc_head && !sxc->sxc_busy)
    282  1.9        ad 		state |= STIC_INT_P;
    283  1.9        ad 
    284  1.9        ad 	/*
    285  1.9        ad 	 * Packet-done condition.
    286  1.9        ad 	 *
    287  1.9        ad 	 * If packet queueing is enabled, clear the condition, and increment
    288  1.9        ad 	 * the tail (submitted) pointer.
    289  1.9        ad 	 */
    290  1.9        ad 	if ((si->si_hwflags & PXF_QUEUE) != 0 && (state & STIC_INT_P) != 0) {
    291  1.9        ad 		sr->sr_ipdvint = STIC_INT_P_WE | STIC_INT_P_EN;
    292  1.9        ad 		tc_wmb();
    293  1.9        ad 
    294  1.9        ad 		if (sxc->sxc_tail != sxc->sxc_head) {
    295  1.9        ad 			sxc->sxc_done[sxc->sxc_tail] = 0;
    296  1.9        ad 			sxc->sxc_tail = PX_BUF_INC(sxc->sxc_tail);
    297  1.9        ad 		}
    298  1.9        ad 
    299  1.9        ad 		if (sxc->sxc_tail != sxc->sxc_head) {
    300  1.9        ad 			if (*px->px_qpoll[sxc->sxc_tail] != STAMP_OK) {
    301  1.9        ad 				sxc->sxc_nreject++;
    302  1.9        ad 				sxc->sxc_busy = 0;
    303  1.9        ad 			} else
    304  1.9        ad 				sxc->sxc_busy = 1;
    305  1.9        ad 		} else
    306  1.9        ad 			sxc->sxc_busy = 0;
    307  1.4        ad 	}
    308  1.9        ad 
    309  1.9        ad 	if ((si->si_hwflags & PXF_QUEUE) != 0 && (state & STIC_INT_P_EN) == 0)
    310  1.9        ad 		printf("px_intr: STIC_INT_P_EN == 0\n");
    311  1.1  jonathan 
    312  1.4        ad 	return (1);
    313  1.1  jonathan }
    314  1.1  jonathan 
    315  1.9        ad u_int32_t *
    316  1.4        ad px_pbuf_get(struct stic_info *si)
    317  1.1  jonathan {
    318  1.9        ad 	u_long off;
    319  1.1  jonathan 
    320  1.4        ad 	si->si_pbuf_select ^= STIC_PACKET_SIZE;
    321  1.9        ad 	off = si->si_pbuf_select + STIC_XCOMM_SIZE;
    322  1.9        ad 	return ((u_int32_t *)((caddr_t)si->si_buf + off));
    323  1.1  jonathan }
    324  1.1  jonathan 
    325  1.9        ad int
    326  1.4        ad px_pbuf_post(struct stic_info *si, u_int32_t *buf)
    327  1.1  jonathan {
    328  1.5        ad 	volatile u_int32_t *poll, junk;
    329  1.5        ad 	volatile struct stic_regs *sr;
    330  1.4        ad 	u_long v;
    331  1.4        ad 	int c;
    332  1.4        ad 
    333  1.5        ad 	sr = si->si_stic;
    334  1.5        ad 
    335  1.4        ad 	/* Get address of poll register for this buffer. */
    336  1.4        ad 	v = (u_long)STIC_KSEG_TO_PHYS(buf);
    337  1.4        ad 	v = ((v & 0xffff8000) << 3) | (v & 0x7fff);
    338  1.5        ad 	poll = (volatile u_int32_t *)((caddr_t)si->si_slotbase + (v >> 9));
    339  1.4        ad 
    340  1.4        ad 	/*
    341  1.4        ad 	 * Read the poll register and make sure the stamp wants to accept
    342  1.4        ad 	 * our packet.  This read will initiate the DMA.  Don't wait for
    343  1.4        ad 	 * ever, just in case something's wrong.
    344  1.4        ad 	 */
    345  1.5        ad 	tc_mb();
    346  1.4        ad 
    347  1.4        ad 	for (c = STAMP_RETRIES; c != 0; c--) {
    348  1.5        ad 		if ((sr->sr_ipdvint & STIC_INT_P) != 0) {
    349  1.9        ad 			sr->sr_ipdvint = STIC_INT_P_WE;
    350  1.5        ad 			tc_wmb();
    351  1.5        ad 			junk = *poll;
    352  1.4        ad 			return (0);
    353  1.5        ad 		}
    354  1.4        ad 		DELAY(STAMP_DELAY);
    355  1.4        ad 	}
    356  1.1  jonathan 
    357  1.4        ad 	/* STIC has lost the plot, punish it. */
    358  1.4        ad 	stic_reset(si);
    359  1.4        ad 	return (-1);
    360  1.9        ad }
    361  1.9        ad 
    362  1.9        ad int
    363  1.9        ad px_ioctl(struct stic_info *si, u_long cmd, caddr_t data, int flag,
    364  1.9        ad 	 struct proc *p)
    365  1.9        ad {
    366  1.9        ad 	volatile struct stic_xcomm *sxc;
    367  1.9        ad 	volatile struct stic_regs *sr;
    368  1.9        ad 	struct stic_xinfo *sxi;
    369  1.9        ad 	int rv, s;
    370  1.9        ad 
    371  1.9        ad 	sr = si->si_stic;
    372  1.9        ad 
    373  1.9        ad 	switch (cmd) {
    374  1.9        ad 	case STICIO_STARTQ:
    375  1.9        ad 		if (si->si_dispmode != WSDISPLAYIO_MODE_MAPPED ||
    376  1.9        ad 		    (si->si_hwflags & PXF_QUEUE) != 0) {
    377  1.9        ad 			rv = EBUSY;
    378  1.9        ad 			break;
    379  1.9        ad 		}
    380  1.9        ad 
    381  1.9        ad 		sxc = si->si_sxc;
    382  1.9        ad 	 	memset((void *)sxc->sxc_done, 0, sizeof(sxc->sxc_done));
    383  1.9        ad 		sxc->sxc_head = 0;
    384  1.9        ad 		sxc->sxc_tail = 0;
    385  1.9        ad 		sxc->sxc_nreject = 0;
    386  1.9        ad 		sxc->sxc_nstall = 0;
    387  1.9        ad 
    388  1.9        ad 		s = spltty();
    389  1.9        ad 		si->si_hwflags |= PXF_QUEUE;
    390  1.9        ad 		sr->sr_ipdvint = STIC_INT_P_WE | STIC_INT_P_EN;
    391  1.9        ad 		tc_wmb();
    392  1.9        ad 		splx(s);
    393  1.9        ad 
    394  1.9        ad 		rv = 0;
    395  1.9        ad 		break;
    396  1.9        ad 
    397  1.9        ad 	case STICIO_STOPQ:
    398  1.9        ad 		s = spltty();
    399  1.9        ad 		si->si_hwflags &= ~PXF_QUEUE;
    400  1.9        ad 		sr->sr_ipdvint = STIC_INT_P_WE | STIC_INT_P;
    401  1.9        ad 		tc_wmb();
    402  1.9        ad 		splx(s);
    403  1.9        ad 		rv = 0;
    404  1.9        ad 		break;
    405  1.9        ad 
    406  1.9        ad 	case STICIO_GXINFO:
    407  1.9        ad 		sxi = (struct stic_xinfo *)data;
    408  1.9        ad 		sxi->sxi_unit = si->si_unit;
    409  1.9        ad 		sxi->sxi_stampw = si->si_stampw;
    410  1.9        ad 		sxi->sxi_stamph = si->si_stamph;
    411  1.9        ad 		sxi->sxi_buf_size = si->si_buf_size;
    412  1.9        ad 		sxi->sxi_buf_phys = (u_int)si->si_buf_phys;
    413  1.9        ad 		sxi->sxi_buf_pktoff = STIC_XCOMM_SIZE;
    414  1.9        ad 		sxi->sxi_buf_pktcnt = PX_BUF_COUNT;
    415  1.9        ad 		sxi->sxi_buf_imgoff =
    416  1.9        ad 		    STIC_XCOMM_SIZE + STIC_PACKET_SIZE * PX_BUF_COUNT;
    417  1.9        ad 		rv = 0;
    418  1.9        ad 		break;
    419  1.9        ad 
    420  1.9        ad 	default:
    421  1.9        ad 		rv = ENOTTY;
    422  1.9        ad 		break;
    423  1.9        ad 	}
    424  1.9        ad 
    425  1.9        ad 	return (rv);
    426  1.1  jonathan }
    427