diff options
Diffstat (limited to 'drivers/net/tokenring/olympic.c')
-rw-r--r-- | drivers/net/tokenring/olympic.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c index ecb5c7c96910..77dc9da4c0b9 100644 --- a/drivers/net/tokenring/olympic.c +++ b/drivers/net/tokenring/olympic.c | |||
@@ -187,7 +187,6 @@ static int olympic_close(struct net_device *dev); | |||
187 | static void olympic_set_rx_mode(struct net_device *dev); | 187 | static void olympic_set_rx_mode(struct net_device *dev); |
188 | static void olympic_freemem(struct net_device *dev) ; | 188 | static void olympic_freemem(struct net_device *dev) ; |
189 | static irqreturn_t olympic_interrupt(int irq, void *dev_id); | 189 | static irqreturn_t olympic_interrupt(int irq, void *dev_id); |
190 | static struct net_device_stats * olympic_get_stats(struct net_device *dev); | ||
191 | static int olympic_set_mac_address(struct net_device *dev, void *addr) ; | 190 | static int olympic_set_mac_address(struct net_device *dev, void *addr) ; |
192 | static void olympic_arb_cmd(struct net_device *dev); | 191 | static void olympic_arb_cmd(struct net_device *dev); |
193 | static int olympic_change_mtu(struct net_device *dev, int mtu); | 192 | static int olympic_change_mtu(struct net_device *dev, int mtu); |
@@ -195,6 +194,15 @@ static void olympic_srb_bh(struct net_device *dev) ; | |||
195 | static void olympic_asb_bh(struct net_device *dev) ; | 194 | static void olympic_asb_bh(struct net_device *dev) ; |
196 | static int olympic_proc_info(char *buffer, char **start, off_t offset, int length, int *eof, void *data) ; | 195 | static int olympic_proc_info(char *buffer, char **start, off_t offset, int length, int *eof, void *data) ; |
197 | 196 | ||
197 | static const struct net_device_ops olympic_netdev_ops = { | ||
198 | .ndo_open = olympic_open, | ||
199 | .ndo_stop = olympic_close, | ||
200 | .ndo_start_xmit = olympic_xmit, | ||
201 | .ndo_change_mtu = olympic_change_mtu, | ||
202 | .ndo_set_multicast_list = olympic_set_rx_mode, | ||
203 | .ndo_set_mac_address = olympic_set_mac_address, | ||
204 | }; | ||
205 | |||
198 | static int __devinit olympic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 206 | static int __devinit olympic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
199 | { | 207 | { |
200 | struct net_device *dev ; | 208 | struct net_device *dev ; |
@@ -253,14 +261,7 @@ static int __devinit olympic_probe(struct pci_dev *pdev, const struct pci_device | |||
253 | goto op_free_iomap; | 261 | goto op_free_iomap; |
254 | } | 262 | } |
255 | 263 | ||
256 | dev->open=&olympic_open; | 264 | dev->netdev_ops = &olympic_netdev_ops; |
257 | dev->hard_start_xmit=&olympic_xmit; | ||
258 | dev->change_mtu=&olympic_change_mtu; | ||
259 | dev->stop=&olympic_close; | ||
260 | dev->do_ioctl=NULL; | ||
261 | dev->set_multicast_list=&olympic_set_rx_mode; | ||
262 | dev->get_stats=&olympic_get_stats ; | ||
263 | dev->set_mac_address=&olympic_set_mac_address ; | ||
264 | SET_NETDEV_DEV(dev, &pdev->dev); | 265 | SET_NETDEV_DEV(dev, &pdev->dev); |
265 | 266 | ||
266 | pci_set_drvdata(pdev,dev) ; | 267 | pci_set_drvdata(pdev,dev) ; |
@@ -785,7 +786,7 @@ static void olympic_rx(struct net_device *dev) | |||
785 | } | 786 | } |
786 | olympic_priv->rx_ring_last_received += i ; | 787 | olympic_priv->rx_ring_last_received += i ; |
787 | olympic_priv->rx_ring_last_received &= (OLYMPIC_RX_RING_SIZE -1) ; | 788 | olympic_priv->rx_ring_last_received &= (OLYMPIC_RX_RING_SIZE -1) ; |
788 | olympic_priv->olympic_stats.rx_errors++; | 789 | dev->stats.rx_errors++; |
789 | } else { | 790 | } else { |
790 | 791 | ||
791 | if (buffer_cnt == 1) { | 792 | if (buffer_cnt == 1) { |
@@ -796,7 +797,7 @@ static void olympic_rx(struct net_device *dev) | |||
796 | 797 | ||
797 | if (skb == NULL) { | 798 | if (skb == NULL) { |
798 | printk(KERN_WARNING "%s: Not enough memory to copy packet to upper layers. \n",dev->name) ; | 799 | printk(KERN_WARNING "%s: Not enough memory to copy packet to upper layers. \n",dev->name) ; |
799 | olympic_priv->olympic_stats.rx_dropped++ ; | 800 | dev->stats.rx_dropped++; |
800 | /* Update counters even though we don't transfer the frame */ | 801 | /* Update counters even though we don't transfer the frame */ |
801 | olympic_priv->rx_ring_last_received += i ; | 802 | olympic_priv->rx_ring_last_received += i ; |
802 | olympic_priv->rx_ring_last_received &= (OLYMPIC_RX_RING_SIZE -1) ; | 803 | olympic_priv->rx_ring_last_received &= (OLYMPIC_RX_RING_SIZE -1) ; |
@@ -862,8 +863,8 @@ static void olympic_rx(struct net_device *dev) | |||
862 | skb->protocol = tr_type_trans(skb,dev); | 863 | skb->protocol = tr_type_trans(skb,dev); |
863 | netif_rx(skb) ; | 864 | netif_rx(skb) ; |
864 | } | 865 | } |
865 | olympic_priv->olympic_stats.rx_packets++ ; | 866 | dev->stats.rx_packets++ ; |
866 | olympic_priv->olympic_stats.rx_bytes += length ; | 867 | dev->stats.rx_bytes += length ; |
867 | } /* if skb == null */ | 868 | } /* if skb == null */ |
868 | } /* If status & 0x3b */ | 869 | } /* If status & 0x3b */ |
869 | 870 | ||
@@ -971,8 +972,8 @@ static irqreturn_t olympic_interrupt(int irq, void *dev_id) | |||
971 | olympic_priv->tx_ring_last_status++; | 972 | olympic_priv->tx_ring_last_status++; |
972 | olympic_priv->tx_ring_last_status &= (OLYMPIC_TX_RING_SIZE-1); | 973 | olympic_priv->tx_ring_last_status &= (OLYMPIC_TX_RING_SIZE-1); |
973 | olympic_priv->free_tx_ring_entries++; | 974 | olympic_priv->free_tx_ring_entries++; |
974 | olympic_priv->olympic_stats.tx_bytes += olympic_priv->tx_ring_skb[olympic_priv->tx_ring_last_status]->len; | 975 | dev->stats.tx_bytes += olympic_priv->tx_ring_skb[olympic_priv->tx_ring_last_status]->len; |
975 | olympic_priv->olympic_stats.tx_packets++ ; | 976 | dev->stats.tx_packets++ ; |
976 | pci_unmap_single(olympic_priv->pdev, | 977 | pci_unmap_single(olympic_priv->pdev, |
977 | le32_to_cpu(olympic_priv->olympic_tx_ring[olympic_priv->tx_ring_last_status].buffer), | 978 | le32_to_cpu(olympic_priv->olympic_tx_ring[olympic_priv->tx_ring_last_status].buffer), |
978 | olympic_priv->tx_ring_skb[olympic_priv->tx_ring_last_status]->len,PCI_DMA_TODEVICE); | 979 | olympic_priv->tx_ring_skb[olympic_priv->tx_ring_last_status]->len,PCI_DMA_TODEVICE); |
@@ -1344,13 +1345,6 @@ static void olympic_srb_bh(struct net_device *dev) | |||
1344 | 1345 | ||
1345 | } | 1346 | } |
1346 | 1347 | ||
1347 | static struct net_device_stats * olympic_get_stats(struct net_device *dev) | ||
1348 | { | ||
1349 | struct olympic_private *olympic_priv ; | ||
1350 | olympic_priv=netdev_priv(dev); | ||
1351 | return (struct net_device_stats *) &olympic_priv->olympic_stats; | ||
1352 | } | ||
1353 | |||
1354 | static int olympic_set_mac_address (struct net_device *dev, void *addr) | 1348 | static int olympic_set_mac_address (struct net_device *dev, void *addr) |
1355 | { | 1349 | { |
1356 | struct sockaddr *saddr = addr ; | 1350 | struct sockaddr *saddr = addr ; |