172132Ssemenu/*	OpenBSD: qsphyreg.h,v 1.2 1999/03/09 00:02:45 jason Exp 	*/
272132Ssemenu/*	NetBSD: qsphyreg.h,v 1.1 1998/08/11 00:01:03 thorpej Exp 	*/
372132Ssemenu/*	$FreeBSD$	*/
472132Ssemenu
572132Ssemenu/*-
672132Ssemenu * Copyright (c) 1998 The NetBSD Foundation, Inc.
772132Ssemenu * All rights reserved.
872132Ssemenu *
972132Ssemenu * This code is derived from software contributed to The NetBSD Foundation
1072132Ssemenu * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
1172132Ssemenu * NASA Ames Research Center.
1272132Ssemenu *
1372132Ssemenu * Redistribution and use in source and binary forms, with or without
1472132Ssemenu * modification, are permitted provided that the following conditions
1572132Ssemenu * are met:
1672132Ssemenu * 1. Redistributions of source code must retain the above copyright
1772132Ssemenu *    notice, this list of conditions and the following disclaimer.
1872132Ssemenu * 2. Redistributions in binary form must reproduce the above copyright
1972132Ssemenu *    notice, this list of conditions and the following disclaimer in the
2072132Ssemenu *    documentation and/or other materials provided with the distribution.
2172132Ssemenu *
2272132Ssemenu * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2372132Ssemenu * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2472132Ssemenu * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2572132Ssemenu * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2672132Ssemenu * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2772132Ssemenu * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2872132Ssemenu * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2972132Ssemenu * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
3072132Ssemenu * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3172132Ssemenu * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3272132Ssemenu * POSSIBILITY OF SUCH DAMAGE.
3372132Ssemenu */
3472132Ssemenu
3572132Ssemenu#ifndef _DEV_MII_QSPHYREG_H_
3672132Ssemenu#define	_DEV_MII_QSPHYREG_H_
3772132Ssemenu
3872132Ssemenu/*
3972132Ssemenu * Register definitions for the Quality Semiconductor QS6612
4072132Ssemenu * Further documentation can be found at:
4172132Ssemenu * 	http://www.qualitysemi.com/products/network.html
4272132Ssemenu */
4372132Ssemenu
4472132Ssemenu#define	MII_QSPHY_MCTL		0x11	/* Mode control */
4572132Ssemenu#define	MCTL_T4PRE		0x1000	/* 100baseT4 interface present */
4672132Ssemenu#define	MCTL_BTEXT		0x0800	/* reduce 10baseT squelch level */
4772132Ssemenu#define	MCTL_FACTTEST		0x0100	/* factory test mode */
4872132Ssemenu#define	MCTL_PHYADDRMASK	0x00f8	/* PHY address */
4972132Ssemenu#define	MCTL_FACTTEST2		0x0004	/* another factory test mode */
5072132Ssemenu#define	MCTL_NLPDIS		0x0002	/* disable link pulse tx */
5172132Ssemenu#define	MCTL_SQEDIS		0x0001	/* disable SQE */
5272132Ssemenu
5372132Ssemenu#define	MII_QSPHY_ISRC		0x1d	/* Interrupt source */
5472132Ssemenu#define	MII_QSPHY_IMASK		0x1e	/* Interrupt mask */
5572132Ssemenu#define	IMASK_TLINTR		0x8000	/* ThunderLAN interrupt mode */
5672132Ssemenu#define	IMASK_ANCPL		0x0040	/* autonegotiation complete */
5772132Ssemenu#define	IMASK_RFD		0x0020	/* remote fault detected */
5872132Ssemenu#define	IMASK_LD		0x0010	/* link down */
5972132Ssemenu#define	IMASK_ANLPA		0x0008	/* autonegotiation LP ACK */
6072132Ssemenu#define	IMASK_PDT		0x0004	/* parallel detection fault */
6172132Ssemenu#define	IMASK_ANPR		0x0002	/* autonegotiation page received */
6272132Ssemenu#define	IMASK_REF		0x0001	/* receive error counter full */
6372132Ssemenu
6472132Ssemenu#define	MII_QSPHY_PCTL		0x1f	/* PHY control */
6572132Ssemenu#define	PCTL_RXERDIS		0x2000	/* receive error counter disable */
6672132Ssemenu#define	PCTL_ANC		0x1000	/* autonegotiation complete */
6772132Ssemenu#define	PCTL_RLBEN		0x0200	/* remote coopback enable */
6872132Ssemenu#define	PCTL_DCREN		0x0100	/* DC restoration enable */
6972132Ssemenu#define	PCTL_4B5BEN		0x0040	/* 4b/5b encoding */
7072132Ssemenu#define	PCTL_PHYISO		0x0020	/* isolate PHY */
7172132Ssemenu#define	PCTL_OPMASK		0x001c	/* operation mode mask */
7272132Ssemenu#define	PCTL_AN			0x0000	/* autonegotiation in-progress */
7372132Ssemenu#define	PCTL_10_T		0x0004	/* 10baseT */
7472132Ssemenu#define	PCTL_100_TX		0x0008	/* 100baseTX */
7572132Ssemenu#define	PCTL_100_T4		0x0010	/* 100baseT4 */
7672132Ssemenu#define	PCTL_10_T_FDX		0x0014	/* 10baseT-FDX */
7772132Ssemenu#define	PCTL_100_TX_FDX		0x0018	/* 100baseTX-FDX */
7872132Ssemenu#define	PCTL_MLT3DIS		0x0002	/* disable MLT3 */
7972132Ssemenu#define	PCTL_SRCDIS		0x0001	/* disable scrambling */
8072132Ssemenu
8172132Ssemenu#endif /* _DEV_MII_QSPHYREG_H_ */
82