aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mii.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mii.h')
-rw-r--r--include/linux/mii.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 68f5a0f392dd..beddc6d3b0f6 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -9,7 +9,6 @@
9#define __LINUX_MII_H__ 9#define __LINUX_MII_H__
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12#include <linux/if.h>
13 12
14/* Generic MII registers. */ 13/* Generic MII registers. */
15 14
@@ -136,6 +135,20 @@
136#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */ 135#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */
137#define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */ 136#define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */
138 137
138/* This structure is used in all SIOCxMIIxxx ioctl calls */
139struct mii_ioctl_data {
140 __u16 phy_id;
141 __u16 reg_num;
142 __u16 val_in;
143 __u16 val_out;
144};
145
146#ifdef __KERNEL__
147
148#include <linux/if.h>
149
150struct ethtool_cmd;
151
139struct mii_if_info { 152struct mii_if_info {
140 int phy_id; 153 int phy_id;
141 int advertising; 154 int advertising;
@@ -151,9 +164,6 @@ struct mii_if_info {
151 void (*mdio_write) (struct net_device *dev, int phy_id, int location, int val); 164 void (*mdio_write) (struct net_device *dev, int phy_id, int location, int val);
152}; 165};
153 166
154struct ethtool_cmd;
155struct mii_ioctl_data;
156
157extern int mii_link_ok (struct mii_if_info *mii); 167extern int mii_link_ok (struct mii_if_info *mii);
158extern int mii_nway_restart (struct mii_if_info *mii); 168extern int mii_nway_restart (struct mii_if_info *mii);
159extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); 169extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
@@ -168,16 +178,6 @@ extern int generic_mii_ioctl(struct mii_if_info *mii_if,
168 unsigned int *duplex_changed); 178 unsigned int *duplex_changed);
169 179
170 180
171
172/* This structure is used in all SIOCxMIIxxx ioctl calls */
173struct mii_ioctl_data {
174 u16 phy_id;
175 u16 reg_num;
176 u16 val_in;
177 u16 val_out;
178};
179
180
181static inline struct mii_ioctl_data *if_mii(struct ifreq *rq) 181static inline struct mii_ioctl_data *if_mii(struct ifreq *rq)
182{ 182{
183 return (struct mii_ioctl_data *) &rq->ifr_ifru; 183 return (struct mii_ioctl_data *) &rq->ifr_ifru;
@@ -235,5 +235,5 @@ static inline unsigned int mii_duplex (unsigned int duplex_lock,
235 return 0; 235 return 0;
236} 236}
237 237
238 238#endif /* __KERNEL__ */
239#endif /* __LINUX_MII_H__ */ 239#endif /* __LINUX_MII_H__ */