diff options
| -rw-r--r-- | drivers/net/fec.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 52a6f945c001..91daf0785ee8 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
| @@ -190,6 +190,8 @@ struct fec_enet_private { | |||
| 190 | /* Hardware registers of the FEC device */ | 190 | /* Hardware registers of the FEC device */ |
| 191 | volatile fec_t *hwp; | 191 | volatile fec_t *hwp; |
| 192 | 192 | ||
| 193 | struct net_device *netdev; | ||
| 194 | |||
| 193 | /* The saved address of a sent-in-place packet/buffer, for skfree(). */ | 195 | /* The saved address of a sent-in-place packet/buffer, for skfree(). */ |
| 194 | unsigned char *tx_bounce[TX_RING_SIZE]; | 196 | unsigned char *tx_bounce[TX_RING_SIZE]; |
| 195 | struct sk_buff* tx_skbuff[TX_RING_SIZE]; | 197 | struct sk_buff* tx_skbuff[TX_RING_SIZE]; |
| @@ -1939,9 +1941,10 @@ static void mii_display_status(struct net_device *dev) | |||
| 1939 | printk(".\n"); | 1941 | printk(".\n"); |
| 1940 | } | 1942 | } |
| 1941 | 1943 | ||
| 1942 | static void mii_display_config(struct net_device *dev) | 1944 | static void mii_display_config(struct work_struct *work) |
| 1943 | { | 1945 | { |
| 1944 | struct fec_enet_private *fep = netdev_priv(dev); | 1946 | struct fec_enet_private *fep = container_of(work, struct fec_enet_private, phy_task); |
| 1947 | struct net_device *dev = fep->netdev; | ||
| 1945 | uint status = fep->phy_status; | 1948 | uint status = fep->phy_status; |
| 1946 | 1949 | ||
| 1947 | /* | 1950 | /* |
| @@ -1975,9 +1978,10 @@ static void mii_display_config(struct net_device *dev) | |||
| 1975 | fep->sequence_done = 1; | 1978 | fep->sequence_done = 1; |
| 1976 | } | 1979 | } |
| 1977 | 1980 | ||
| 1978 | static void mii_relink(struct net_device *dev) | 1981 | static void mii_relink(struct work_struct *work) |
| 1979 | { | 1982 | { |
| 1980 | struct fec_enet_private *fep = netdev_priv(dev); | 1983 | struct fec_enet_private *fep = container_of(work, struct fec_enet_private, phy_task); |
| 1984 | struct net_device *dev = fep->netdev; | ||
| 1981 | int duplex; | 1985 | int duplex; |
| 1982 | 1986 | ||
| 1983 | /* | 1987 | /* |
| @@ -2021,7 +2025,7 @@ static void mii_queue_relink(uint mii_reg, struct net_device *dev) | |||
| 2021 | return; | 2025 | return; |
| 2022 | 2026 | ||
| 2023 | fep->mii_phy_task_queued = 1; | 2027 | fep->mii_phy_task_queued = 1; |
| 2024 | INIT_WORK(&fep->phy_task, (void*)mii_relink, dev); | 2028 | INIT_WORK(&fep->phy_task, mii_relink); |
| 2025 | schedule_work(&fep->phy_task); | 2029 | schedule_work(&fep->phy_task); |
| 2026 | } | 2030 | } |
| 2027 | 2031 | ||
| @@ -2034,7 +2038,7 @@ static void mii_queue_config(uint mii_reg, struct net_device *dev) | |||
| 2034 | return; | 2038 | return; |
| 2035 | 2039 | ||
| 2036 | fep->mii_phy_task_queued = 1; | 2040 | fep->mii_phy_task_queued = 1; |
| 2037 | INIT_WORK(&fep->phy_task, (void*)mii_display_config, dev); | 2041 | INIT_WORK(&fep->phy_task, mii_display_config); |
| 2038 | schedule_work(&fep->phy_task); | 2042 | schedule_work(&fep->phy_task); |
| 2039 | } | 2043 | } |
| 2040 | 2044 | ||
| @@ -2329,6 +2333,7 @@ int __init fec_enet_init(struct net_device *dev) | |||
| 2329 | 2333 | ||
| 2330 | fep->index = index; | 2334 | fep->index = index; |
| 2331 | fep->hwp = fecp; | 2335 | fep->hwp = fecp; |
| 2336 | fep->netdev = dev; | ||
| 2332 | 2337 | ||
| 2333 | /* Whack a reset. We should wait for this. | 2338 | /* Whack a reset. We should wait for this. |
| 2334 | */ | 2339 | */ |
