arswitch_reg.h revision 235288
1210753Srpaulo/*-
2210753Srpaulo * Copyright (c) 2011-2012 Stefan Bethke.
3210753Srpaulo * All rights reserved.
4210753Srpaulo *
5210753Srpaulo * Redistribution and use in source and binary forms, with or without
6210753Srpaulo * modification, are permitted provided that the following conditions
7210753Srpaulo * are met:
8210753Srpaulo * 1. Redistributions of source code must retain the above copyright
9210753Srpaulo *    notice, this list of conditions and the following disclaimer.
10210753Srpaulo * 2. Redistributions in binary form must reproduce the above copyright
11210753Srpaulo *    notice, this list of conditions and the following disclaimer in the
12210753Srpaulo *    documentation and/or other materials provided with the distribution.
13210753Srpaulo *
14210753Srpaulo * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15210753Srpaulo * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16210753Srpaulo * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17210753Srpaulo * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18210753Srpaulo * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19210753Srpaulo * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20210753Srpaulo * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21210753Srpaulo * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22210753Srpaulo * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23210753Srpaulo * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24210753Srpaulo * SUCH DAMAGE.
25210753Srpaulo *
26210753Srpaulo * $FreeBSD: head/sys/dev/etherswitch/arswitch/arswitch_reg.h 235288 2012-05-11 20:53:20Z adrian $
27210753Srpaulo */
28210753Srpaulo#ifndef	__ARSWITCH_REG_H__
29210753Srpaulo#define	__ARSWITCH_REG_H__
30210753Srpaulo
31210753Srpauloextern	void arswitch_writedbg(device_t dev, int phy, uint16_t dbg_addr,
32210753Srpaulo	    uint16_t dbg_data);
33210753Srpaulo
34210753Srpauloextern	int arswitch_readreg(device_t dev, int addr);
35210753Srpauloextern	int arswitch_writereg(device_t dev, int addr, int value);
36210753Srpauloextern	int arswitch_modifyreg(device_t dev, int addr, int mask, int set);
37210753Srpaulo
38210753Srpauloextern	int arswitch_readreg_lsb(device_t dev, int addr);
39210753Srpauloextern	int arswitch_readreg_msb(device_t dev, int addr);
40210753Srpaulo
41210753Srpauloextern	int arswitch_writereg_lsb(device_t dev, int addr, int data);
42210753Srpauloextern	int arswitch_writereg_msb(device_t dev, int addr, int data);
43210753Srpaulo
44210753Srpaulo#endif	/* __ARSWITCH_REG_H__ */
45210753Srpaulo