86b0309d4a70c087eb8c693465335489886fea6f
[openwrt/svn-archive/archive.git] / target / linux / generic-2.4 / patches / 803-mii_ioctl.patch
1 --- a/include/linux/mii.h
2 +++ b/include/linux/mii.h
3 @@ -9,7 +9,6 @@
4 #define __LINUX_MII_H__
5
6 #include <linux/types.h>
7 -#include <linux/if.h>
8
9 /* Generic MII registers. */
10
11 @@ -104,6 +103,19 @@
12 #define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */
13 #define NWAYTEST_RESV2 0xfe00 /* Unused... */
14
15 +/* This structure is used in all SIOCxMIIxxx ioctl calls */
16 +struct mii_ioctl_data {
17 + __u16 phy_id;
18 + __u16 reg_num;
19 + __u16 val_in;
20 + __u16 val_out;
21 +};
22 +
23 +#ifdef __KERNEL__
24 +
25 +#include <linux/if.h>
26 +
27 +struct ethtool_cmd;
28
29 struct mii_if_info {
30 int phy_id;
31 @@ -119,9 +131,6 @@ struct mii_if_info {
32 void (*mdio_write) (struct net_device *dev, int phy_id, int location, int val);
33 };
34
35 -struct ethtool_cmd;
36 -struct mii_ioctl_data;
37 -
38 extern int mii_link_ok (struct mii_if_info *mii);
39 extern int mii_nway_restart (struct mii_if_info *mii);
40 extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
41 @@ -136,15 +145,6 @@ extern int generic_mii_ioctl(struct mii_
42
43
44
45 -/* This structure is used in all SIOCxMIIxxx ioctl calls */
46 -struct mii_ioctl_data {
47 - u16 phy_id;
48 - u16 reg_num;
49 - u16 val_in;
50 - u16 val_out;
51 -};
52 -
53 -
54 static inline struct mii_ioctl_data *if_mii(struct ifreq *rq)
55 {
56 return (struct mii_ioctl_data *) &rq->ifr_ifru;
57 @@ -202,5 +202,5 @@ static inline unsigned int mii_duplex (u
58 return 0;
59 }
60
61 -
62 +#endif /* __KERNEL__ */
63 #endif /* __LINUX_MII_H__ */