aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/phy_fixed.h
diff options
context:
space:
mode:
authorVitaly Bordug <vitb@kernel.crashing.org>2007-08-10 17:05:16 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:53:50 -0400
commit7c32f470f4f6a0fdc6944cefcd22f288e59a0ae2 (patch)
tree747a4c855e6b6287421eb854496d23073315ba49 /include/linux/phy_fixed.h
parentcdcc520d7b73445c3552a70786afed9a2b22c010 (diff)
PHY fixed driver: rework release path and update phy_id notation
device_bind_driver() error code returning has been fixed. release() function has been written, so that to free resources in correct way; the release path is now clean. Before the rework, it used to cause Device 'fixed@100:1' does not have a release() function, it is broken and must be fixed. BUG: at drivers/base/core.c:104 device_release() Call Trace: [<ffffffff802ec380>] kobject_cleanup+0x53/0x7e [<ffffffff802ec3ab>] kobject_release+0x0/0x9 [<ffffffff802ecf3f>] kref_put+0x74/0x81 [<ffffffff8035493b>] fixed_mdio_register_device+0x230/0x265 [<ffffffff80564d31>] fixed_init+0x1f/0x35 [<ffffffff802071a4>] init+0x147/0x2fb [<ffffffff80223b6e>] schedule_tail+0x36/0x92 [<ffffffff8020a678>] child_rip+0xa/0x12 [<ffffffff80311714>] acpi_ds_init_one_object+0x0/0x83 [<ffffffff8020705d>] init+0x0/0x2fb [<ffffffff8020a66e>] child_rip+0x0/0x12 Also changed the notation of the fixed phy definition on mdio bus to the form of <speed>+<duplex> to make it able to be used by gianfar and ucc_geth that define phy_id strictly as "%d:%d" and cleaned up the whitespace issues. Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include/linux/phy_fixed.h')
-rw-r--r--include/linux/phy_fixed.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/linux/phy_fixed.h b/include/linux/phy_fixed.h
new file mode 100644
index 000000000000..04ba70d49fb8
--- /dev/null
+++ b/include/linux/phy_fixed.h
@@ -0,0 +1,38 @@
1#ifndef __PHY_FIXED_H
2#define __PHY_FIXED_H
3
4#define MII_REGS_NUM 29
5
6/* max number of virtual phy stuff */
7#define MAX_PHY_AMNT 10
8/*
9 The idea is to emulate normal phy behavior by responding with
10 pre-defined values to mii BMCR read, so that read_status hook could
11 take all the needed info.
12*/
13
14struct fixed_phy_status {
15 u8 link;
16 u16 speed;
17 u8 duplex;
18};
19
20/*-----------------------------------------------------------------------------
21 * Private information hoder for mii_bus
22 *-----------------------------------------------------------------------------*/
23struct fixed_info {
24 u16 *regs;
25 u8 regs_num;
26 struct fixed_phy_status phy_status;
27 struct phy_device *phydev; /* pointer to the container */
28 /* link & speed cb */
29 int (*link_update) (struct net_device *, struct fixed_phy_status *);
30
31};
32
33
34int fixed_mdio_set_link_update(struct phy_device *,
35 int (*link_update) (struct net_device *, struct fixed_phy_status *));
36struct fixed_info *fixed_mdio_get_phydev (int phydev_ind);
37
38#endif /* __PHY_FIXED_H */