signals: consolidate checks for whether or not to ignore a signal
[deliverable/linux.git] / drivers / net / ibm_emac / ibm_emac_zmii.h
CommitLineData
1da177e4 1/*
37448f7d 2 * drivers/net/ibm_emac/ibm_emac_zmii.h
1da177e4 3 *
37448f7d 4 * Driver for PowerPC 4xx on-chip ethernet controller, ZMII bridge support.
1da177e4 5 *
37448f7d
ES
6 * Copyright (c) 2004, 2005 Zultys Technologies.
7 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
1da177e4 8 *
37448f7d
ES
9 * Based on original work by
10 * Armin Kuster <akuster@mvista.com>
11 * Copyright 2001 MontaVista Softare Inc.
1da177e4
LT
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
37448f7d 17 *
1da177e4 18 */
1da177e4
LT
19#ifndef _IBM_EMAC_ZMII_H_
20#define _IBM_EMAC_ZMII_H_
21
37448f7d
ES
22#include <linux/init.h>
23#include <asm/ocp.h>
1da177e4
LT
24
25/* ZMII bridge registers */
26struct zmii_regs {
27 u32 fer; /* Function enable reg */
28 u32 ssr; /* Speed select reg */
29 u32 smiirs; /* SMII status reg */
30};
31
1da177e4
LT
32/* ZMII device */
33struct ibm_ocp_zmii {
b43de2d8 34 struct zmii_regs __iomem *base;
37448f7d 35 int mode; /* subset of PHY_MODE_XXXX */
1da177e4 36 int users; /* number of EMACs using this ZMII bridge */
37448f7d 37 u32 fer_save; /* FER value left by firmware */
1da177e4
LT
38};
39
37448f7d
ES
40#ifdef CONFIG_IBM_EMAC_ZMII
41int zmii_attach(void *emac) __init;
1da177e4 42
0ec6d950 43void __zmii_fini(struct ocp_device *ocpdev, int input);
37448f7d
ES
44static inline void zmii_fini(struct ocp_device *ocpdev, int input)
45{
46 if (ocpdev)
47 __zmii_fini(ocpdev, input);
48}
1da177e4 49
37448f7d
ES
50void __zmii_enable_mdio(struct ocp_device *ocpdev, int input);
51static inline void zmii_enable_mdio(struct ocp_device *ocpdev, int input)
52{
53 if (ocpdev)
54 __zmii_enable_mdio(ocpdev, input);
55}
1da177e4 56
37448f7d
ES
57void __zmii_set_speed(struct ocp_device *ocpdev, int input, int speed);
58static inline void zmii_set_speed(struct ocp_device *ocpdev, int input,
59 int speed)
60{
61 if (ocpdev)
62 __zmii_set_speed(ocpdev, input, speed);
63}
1da177e4 64
37448f7d
ES
65int __zmii_get_regs_len(struct ocp_device *ocpdev);
66static inline int zmii_get_regs_len(struct ocp_device *ocpdev)
67{
68 return ocpdev ? __zmii_get_regs_len(ocpdev) : 0;
69}
1da177e4 70
37448f7d 71void *zmii_dump_regs(struct ocp_device *ocpdev, void *buf);
1da177e4 72
37448f7d
ES
73#else
74# define zmii_attach(x) 0
75# define zmii_fini(x,y) ((void)0)
76# define zmii_enable_mdio(x,y) ((void)0)
77# define zmii_set_speed(x,y,z) ((void)0)
78# define zmii_get_regs_len(x) 0
79# define zmii_dump_regs(x,buf) (buf)
80#endif /* !CONFIG_IBM_EMAC_ZMII */
1da177e4
LT
81
82#endif /* _IBM_EMAC_ZMII_H_ */
This page took 0.373576 seconds and 5 git commands to generate.