diff options
Diffstat (limited to 'drivers/net/spider_net.c')
-rw-r--r-- | drivers/net/spider_net.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index cef7e6671c49..ebb6aa39f9c7 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c | |||
@@ -88,12 +88,11 @@ MODULE_DEVICE_TABLE(pci, spider_net_pci_tbl); | |||
88 | static inline u32 | 88 | static inline u32 |
89 | spider_net_read_reg(struct spider_net_card *card, u32 reg) | 89 | spider_net_read_reg(struct spider_net_card *card, u32 reg) |
90 | { | 90 | { |
91 | u32 value; | 91 | /* We use the powerpc specific variants instead of readl_be() because |
92 | 92 | * we know spidernet is not a real PCI device and we can thus avoid the | |
93 | value = readl(card->regs + reg); | 93 | * performance hit caused by the PCI workarounds. |
94 | value = le32_to_cpu(value); | 94 | */ |
95 | 95 | return in_be32(card->regs + reg); | |
96 | return value; | ||
97 | } | 96 | } |
98 | 97 | ||
99 | /** | 98 | /** |
@@ -105,8 +104,11 @@ spider_net_read_reg(struct spider_net_card *card, u32 reg) | |||
105 | static inline void | 104 | static inline void |
106 | spider_net_write_reg(struct spider_net_card *card, u32 reg, u32 value) | 105 | spider_net_write_reg(struct spider_net_card *card, u32 reg, u32 value) |
107 | { | 106 | { |
108 | value = cpu_to_le32(value); | 107 | /* We use the powerpc specific variants instead of writel_be() because |
109 | writel(value, card->regs + reg); | 108 | * we know spidernet is not a real PCI device and we can thus avoid the |
109 | * performance hit caused by the PCI workarounds. | ||
110 | */ | ||
111 | out_be32(card->regs + reg, value); | ||
110 | } | 112 | } |
111 | 113 | ||
112 | /** spider_net_write_phy - write to phy register | 114 | /** spider_net_write_phy - write to phy register |
@@ -1937,10 +1939,11 @@ spider_net_stop(struct net_device *netdev) | |||
1937 | * called as task when tx hangs, resets interface (if interface is up) | 1939 | * called as task when tx hangs, resets interface (if interface is up) |
1938 | */ | 1940 | */ |
1939 | static void | 1941 | static void |
1940 | spider_net_tx_timeout_task(void *data) | 1942 | spider_net_tx_timeout_task(struct work_struct *work) |
1941 | { | 1943 | { |
1942 | struct net_device *netdev = data; | 1944 | struct spider_net_card *card = |
1943 | struct spider_net_card *card = netdev_priv(netdev); | 1945 | container_of(work, struct spider_net_card, tx_timeout_task); |
1946 | struct net_device *netdev = card->netdev; | ||
1944 | 1947 | ||
1945 | if (!(netdev->flags & IFF_UP)) | 1948 | if (!(netdev->flags & IFF_UP)) |
1946 | goto out; | 1949 | goto out; |
@@ -2114,7 +2117,7 @@ spider_net_alloc_card(void) | |||
2114 | card = netdev_priv(netdev); | 2117 | card = netdev_priv(netdev); |
2115 | card->netdev = netdev; | 2118 | card->netdev = netdev; |
2116 | card->msg_enable = SPIDER_NET_DEFAULT_MSG; | 2119 | card->msg_enable = SPIDER_NET_DEFAULT_MSG; |
2117 | INIT_WORK(&card->tx_timeout_task, spider_net_tx_timeout_task, netdev); | 2120 | INIT_WORK(&card->tx_timeout_task, spider_net_tx_timeout_task); |
2118 | init_waitqueue_head(&card->waitq); | 2121 | init_waitqueue_head(&card->waitq); |
2119 | atomic_set(&card->tx_timeout_task_counter, 0); | 2122 | atomic_set(&card->tx_timeout_task_counter, 0); |
2120 | 2123 | ||