diff options
Diffstat (limited to 'drivers/net/chelsio/cxgb2.c')
-rw-r--r-- | drivers/net/chelsio/cxgb2.c | 202 |
1 files changed, 101 insertions, 101 deletions
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c index a65660b0ea63..3309bfc774e0 100644 --- a/drivers/net/chelsio/cxgb2.c +++ b/drivers/net/chelsio/cxgb2.c | |||
@@ -120,7 +120,7 @@ static void t1_set_rxmode(struct net_device *dev) | |||
120 | static void link_report(struct port_info *p) | 120 | static void link_report(struct port_info *p) |
121 | { | 121 | { |
122 | if (!netif_carrier_ok(p->dev)) | 122 | if (!netif_carrier_ok(p->dev)) |
123 | printk(KERN_INFO "%s: link down\n", p->dev->name); | 123 | printk(KERN_INFO "%s: link down\n", p->dev->name); |
124 | else { | 124 | else { |
125 | const char *s = "10Mbps"; | 125 | const char *s = "10Mbps"; |
126 | 126 | ||
@@ -130,7 +130,7 @@ static void link_report(struct port_info *p) | |||
130 | case SPEED_100: s = "100Mbps"; break; | 130 | case SPEED_100: s = "100Mbps"; break; |
131 | } | 131 | } |
132 | 132 | ||
133 | printk(KERN_INFO "%s: link up, %s, %s-duplex\n", | 133 | printk(KERN_INFO "%s: link up, %s, %s-duplex\n", |
134 | p->dev->name, s, | 134 | p->dev->name, s, |
135 | p->link_config.duplex == DUPLEX_FULL ? "full" : "half"); | 135 | p->link_config.duplex == DUPLEX_FULL ? "full" : "half"); |
136 | } | 136 | } |
@@ -261,7 +261,7 @@ static struct net_device_stats *t1_get_stats(struct net_device *dev) | |||
261 | 261 | ||
262 | /* Do a full update of the MAC stats */ | 262 | /* Do a full update of the MAC stats */ |
263 | pstats = p->mac->ops->statistics_update(p->mac, | 263 | pstats = p->mac->ops->statistics_update(p->mac, |
264 | MAC_STATS_UPDATE_FULL); | 264 | MAC_STATS_UPDATE_FULL); |
265 | 265 | ||
266 | ns->tx_packets = pstats->TxUnicastFramesOK + | 266 | ns->tx_packets = pstats->TxUnicastFramesOK + |
267 | pstats->TxMulticastFramesOK + pstats->TxBroadcastFramesOK; | 267 | pstats->TxMulticastFramesOK + pstats->TxBroadcastFramesOK; |
@@ -315,39 +315,39 @@ static void set_msglevel(struct net_device *dev, u32 val) | |||
315 | } | 315 | } |
316 | 316 | ||
317 | static char stats_strings[][ETH_GSTRING_LEN] = { | 317 | static char stats_strings[][ETH_GSTRING_LEN] = { |
318 | "TxOctetsOK", | 318 | "TxOctetsOK", |
319 | "TxOctetsBad", | 319 | "TxOctetsBad", |
320 | "TxUnicastFramesOK", | 320 | "TxUnicastFramesOK", |
321 | "TxMulticastFramesOK", | 321 | "TxMulticastFramesOK", |
322 | "TxBroadcastFramesOK", | 322 | "TxBroadcastFramesOK", |
323 | "TxPauseFrames", | 323 | "TxPauseFrames", |
324 | "TxFramesWithDeferredXmissions", | 324 | "TxFramesWithDeferredXmissions", |
325 | "TxLateCollisions", | 325 | "TxLateCollisions", |
326 | "TxTotalCollisions", | 326 | "TxTotalCollisions", |
327 | "TxFramesAbortedDueToXSCollisions", | 327 | "TxFramesAbortedDueToXSCollisions", |
328 | "TxUnderrun", | 328 | "TxUnderrun", |
329 | "TxLengthErrors", | 329 | "TxLengthErrors", |
330 | "TxInternalMACXmitError", | 330 | "TxInternalMACXmitError", |
331 | "TxFramesWithExcessiveDeferral", | 331 | "TxFramesWithExcessiveDeferral", |
332 | "TxFCSErrors", | 332 | "TxFCSErrors", |
333 | 333 | ||
334 | "RxOctetsOK", | 334 | "RxOctetsOK", |
335 | "RxOctetsBad", | 335 | "RxOctetsBad", |
336 | "RxUnicastFramesOK", | 336 | "RxUnicastFramesOK", |
337 | "RxMulticastFramesOK", | 337 | "RxMulticastFramesOK", |
338 | "RxBroadcastFramesOK", | 338 | "RxBroadcastFramesOK", |
339 | "RxPauseFrames", | 339 | "RxPauseFrames", |
340 | "RxFCSErrors", | 340 | "RxFCSErrors", |
341 | "RxAlignErrors", | 341 | "RxAlignErrors", |
342 | "RxSymbolErrors", | 342 | "RxSymbolErrors", |
343 | "RxDataErrors", | 343 | "RxDataErrors", |
344 | "RxSequenceErrors", | 344 | "RxSequenceErrors", |
345 | "RxRuntErrors", | 345 | "RxRuntErrors", |
346 | "RxJabberErrors", | 346 | "RxJabberErrors", |
347 | "RxInternalMACRcvError", | 347 | "RxInternalMACRcvError", |
348 | "RxInRangeLengthErrors", | 348 | "RxInRangeLengthErrors", |
349 | "RxOutOfRangeLengthField", | 349 | "RxOutOfRangeLengthField", |
350 | "RxFrameTooLongErrors", | 350 | "RxFrameTooLongErrors", |
351 | 351 | ||
352 | "TSO", | 352 | "TSO", |
353 | "VLANextractions", | 353 | "VLANextractions", |
@@ -367,7 +367,7 @@ static char stats_strings[][ETH_GSTRING_LEN] = { | |||
367 | "tx_reg_pkts", | 367 | "tx_reg_pkts", |
368 | "tx_lso_pkts", | 368 | "tx_lso_pkts", |
369 | "tx_do_cksum", | 369 | "tx_do_cksum", |
370 | 370 | ||
371 | "espi_DIP2ParityErr", | 371 | "espi_DIP2ParityErr", |
372 | "espi_DIP4Err", | 372 | "espi_DIP4Err", |
373 | "espi_RxDrops", | 373 | "espi_RxDrops", |
@@ -375,7 +375,7 @@ static char stats_strings[][ETH_GSTRING_LEN] = { | |||
375 | "espi_RxOvfl", | 375 | "espi_RxOvfl", |
376 | "espi_ParityErr" | 376 | "espi_ParityErr" |
377 | }; | 377 | }; |
378 | 378 | ||
379 | #define T2_REGMAP_SIZE (3 * 1024) | 379 | #define T2_REGMAP_SIZE (3 * 1024) |
380 | 380 | ||
381 | static int get_regs_len(struct net_device *dev) | 381 | static int get_regs_len(struct net_device *dev) |
@@ -417,39 +417,39 @@ static void get_stats(struct net_device *dev, struct ethtool_stats *stats, | |||
417 | ss = t1_sge_get_port_stats(adapter->sge, dev->if_port); | 417 | ss = t1_sge_get_port_stats(adapter->sge, dev->if_port); |
418 | t = t1_sge_get_intr_counts(adapter->sge); | 418 | t = t1_sge_get_intr_counts(adapter->sge); |
419 | 419 | ||
420 | *data++ = s->TxOctetsOK; | 420 | *data++ = s->TxOctetsOK; |
421 | *data++ = s->TxOctetsBad; | 421 | *data++ = s->TxOctetsBad; |
422 | *data++ = s->TxUnicastFramesOK; | 422 | *data++ = s->TxUnicastFramesOK; |
423 | *data++ = s->TxMulticastFramesOK; | 423 | *data++ = s->TxMulticastFramesOK; |
424 | *data++ = s->TxBroadcastFramesOK; | 424 | *data++ = s->TxBroadcastFramesOK; |
425 | *data++ = s->TxPauseFrames; | 425 | *data++ = s->TxPauseFrames; |
426 | *data++ = s->TxFramesWithDeferredXmissions; | 426 | *data++ = s->TxFramesWithDeferredXmissions; |
427 | *data++ = s->TxLateCollisions; | 427 | *data++ = s->TxLateCollisions; |
428 | *data++ = s->TxTotalCollisions; | 428 | *data++ = s->TxTotalCollisions; |
429 | *data++ = s->TxFramesAbortedDueToXSCollisions; | 429 | *data++ = s->TxFramesAbortedDueToXSCollisions; |
430 | *data++ = s->TxUnderrun; | 430 | *data++ = s->TxUnderrun; |
431 | *data++ = s->TxLengthErrors; | 431 | *data++ = s->TxLengthErrors; |
432 | *data++ = s->TxInternalMACXmitError; | 432 | *data++ = s->TxInternalMACXmitError; |
433 | *data++ = s->TxFramesWithExcessiveDeferral; | 433 | *data++ = s->TxFramesWithExcessiveDeferral; |
434 | *data++ = s->TxFCSErrors; | 434 | *data++ = s->TxFCSErrors; |
435 | 435 | ||
436 | *data++ = s->RxOctetsOK; | 436 | *data++ = s->RxOctetsOK; |
437 | *data++ = s->RxOctetsBad; | 437 | *data++ = s->RxOctetsBad; |
438 | *data++ = s->RxUnicastFramesOK; | 438 | *data++ = s->RxUnicastFramesOK; |
439 | *data++ = s->RxMulticastFramesOK; | 439 | *data++ = s->RxMulticastFramesOK; |
440 | *data++ = s->RxBroadcastFramesOK; | 440 | *data++ = s->RxBroadcastFramesOK; |
441 | *data++ = s->RxPauseFrames; | 441 | *data++ = s->RxPauseFrames; |
442 | *data++ = s->RxFCSErrors; | 442 | *data++ = s->RxFCSErrors; |
443 | *data++ = s->RxAlignErrors; | 443 | *data++ = s->RxAlignErrors; |
444 | *data++ = s->RxSymbolErrors; | 444 | *data++ = s->RxSymbolErrors; |
445 | *data++ = s->RxDataErrors; | 445 | *data++ = s->RxDataErrors; |
446 | *data++ = s->RxSequenceErrors; | 446 | *data++ = s->RxSequenceErrors; |
447 | *data++ = s->RxRuntErrors; | 447 | *data++ = s->RxRuntErrors; |
448 | *data++ = s->RxJabberErrors; | 448 | *data++ = s->RxJabberErrors; |
449 | *data++ = s->RxInternalMACRcvError; | 449 | *data++ = s->RxInternalMACRcvError; |
450 | *data++ = s->RxInRangeLengthErrors; | 450 | *data++ = s->RxInRangeLengthErrors; |
451 | *data++ = s->RxOutOfRangeLengthField; | 451 | *data++ = s->RxOutOfRangeLengthField; |
452 | *data++ = s->RxFrameTooLongErrors; | 452 | *data++ = s->RxFrameTooLongErrors; |
453 | 453 | ||
454 | *data++ = ss->tso; | 454 | *data++ = ss->tso; |
455 | *data++ = ss->vlan_xtract; | 455 | *data++ = ss->vlan_xtract; |
@@ -510,12 +510,12 @@ static int get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
510 | cmd->duplex = -1; | 510 | cmd->duplex = -1; |
511 | } | 511 | } |
512 | 512 | ||
513 | cmd->port = (cmd->supported & SUPPORTED_TP) ? PORT_TP : PORT_FIBRE; | 513 | cmd->port = (cmd->supported & SUPPORTED_TP) ? PORT_TP : PORT_FIBRE; |
514 | cmd->phy_address = p->phy->addr; | 514 | cmd->phy_address = p->phy->addr; |
515 | cmd->transceiver = XCVR_EXTERNAL; | 515 | cmd->transceiver = XCVR_EXTERNAL; |
516 | cmd->autoneg = p->link_config.autoneg; | 516 | cmd->autoneg = p->link_config.autoneg; |
517 | cmd->maxtxpkt = 0; | 517 | cmd->maxtxpkt = 0; |
518 | cmd->maxrxpkt = 0; | 518 | cmd->maxrxpkt = 0; |
519 | return 0; | 519 | return 0; |
520 | } | 520 | } |
521 | 521 | ||
@@ -686,7 +686,7 @@ static int set_sge_param(struct net_device *dev, struct ethtool_ringparam *e) | |||
686 | return -EINVAL; | 686 | return -EINVAL; |
687 | 687 | ||
688 | if (adapter->flags & FULL_INIT_DONE) | 688 | if (adapter->flags & FULL_INIT_DONE) |
689 | return -EBUSY; | 689 | return -EBUSY; |
690 | 690 | ||
691 | adapter->params.sge.freelQ_size[!jumbo_fl] = e->rx_pending; | 691 | adapter->params.sge.freelQ_size[!jumbo_fl] = e->rx_pending; |
692 | adapter->params.sge.freelQ_size[jumbo_fl] = e->rx_jumbo_pending; | 692 | adapter->params.sge.freelQ_size[jumbo_fl] = e->rx_jumbo_pending; |
@@ -793,34 +793,34 @@ static void cxgb_proc_cleanup(struct adapter *adapter, | |||
793 | 793 | ||
794 | static int t1_ioctl(struct net_device *dev, struct ifreq *req, int cmd) | 794 | static int t1_ioctl(struct net_device *dev, struct ifreq *req, int cmd) |
795 | { | 795 | { |
796 | struct adapter *adapter = dev->priv; | 796 | struct adapter *adapter = dev->priv; |
797 | struct mii_ioctl_data *data = if_mii(req); | 797 | struct mii_ioctl_data *data = if_mii(req); |
798 | 798 | ||
799 | switch (cmd) { | 799 | switch (cmd) { |
800 | case SIOCGMIIPHY: | 800 | case SIOCGMIIPHY: |
801 | data->phy_id = adapter->port[dev->if_port].phy->addr; | 801 | data->phy_id = adapter->port[dev->if_port].phy->addr; |
802 | /* FALLTHRU */ | 802 | /* FALLTHRU */ |
803 | case SIOCGMIIREG: { | 803 | case SIOCGMIIREG: { |
804 | struct cphy *phy = adapter->port[dev->if_port].phy; | 804 | struct cphy *phy = adapter->port[dev->if_port].phy; |
805 | u32 val; | 805 | u32 val; |
806 | 806 | ||
807 | if (!phy->mdio_read) | 807 | if (!phy->mdio_read) |
808 | return -EOPNOTSUPP; | 808 | return -EOPNOTSUPP; |
809 | phy->mdio_read(adapter, data->phy_id, 0, data->reg_num & 0x1f, | 809 | phy->mdio_read(adapter, data->phy_id, 0, data->reg_num & 0x1f, |
810 | &val); | 810 | &val); |
811 | data->val_out = val; | 811 | data->val_out = val; |
812 | break; | 812 | break; |
813 | } | 813 | } |
814 | case SIOCSMIIREG: { | 814 | case SIOCSMIIREG: { |
815 | struct cphy *phy = adapter->port[dev->if_port].phy; | 815 | struct cphy *phy = adapter->port[dev->if_port].phy; |
816 | 816 | ||
817 | if (!capable(CAP_NET_ADMIN)) | 817 | if (!capable(CAP_NET_ADMIN)) |
818 | return -EPERM; | 818 | return -EPERM; |
819 | if (!phy->mdio_write) | 819 | if (!phy->mdio_write) |
820 | return -EOPNOTSUPP; | 820 | return -EOPNOTSUPP; |
821 | phy->mdio_write(adapter, data->phy_id, 0, data->reg_num & 0x1f, | 821 | phy->mdio_write(adapter, data->phy_id, 0, data->reg_num & 0x1f, |
822 | data->val_in); | 822 | data->val_in); |
823 | break; | 823 | break; |
824 | } | 824 | } |
825 | 825 | ||
826 | default: | 826 | default: |
@@ -836,9 +836,9 @@ static int t1_change_mtu(struct net_device *dev, int new_mtu) | |||
836 | struct cmac *mac = adapter->port[dev->if_port].mac; | 836 | struct cmac *mac = adapter->port[dev->if_port].mac; |
837 | 837 | ||
838 | if (!mac->ops->set_mtu) | 838 | if (!mac->ops->set_mtu) |
839 | return -EOPNOTSUPP; | 839 | return -EOPNOTSUPP; |
840 | if (new_mtu < 68) | 840 | if (new_mtu < 68) |
841 | return -EINVAL; | 841 | return -EINVAL; |
842 | if ((ret = mac->ops->set_mtu(mac, new_mtu))) | 842 | if ((ret = mac->ops->set_mtu(mac, new_mtu))) |
843 | return ret; | 843 | return ret; |
844 | dev->mtu = new_mtu; | 844 | dev->mtu = new_mtu; |
@@ -889,7 +889,7 @@ static void t1_netpoll(struct net_device *dev) | |||
889 | struct adapter *adapter = dev->priv; | 889 | struct adapter *adapter = dev->priv; |
890 | 890 | ||
891 | local_irq_save(flags); | 891 | local_irq_save(flags); |
892 | t1_select_intr_handler(adapter)(adapter->pdev->irq, adapter); | 892 | t1_select_intr_handler(adapter)(adapter->pdev->irq, adapter); |
893 | local_irq_restore(flags); | 893 | local_irq_restore(flags); |
894 | } | 894 | } |
895 | #endif | 895 | #endif |
@@ -933,7 +933,7 @@ static void ext_intr_task(void *data) | |||
933 | adapter->slow_intr_mask |= F_PL_INTR_EXT; | 933 | adapter->slow_intr_mask |= F_PL_INTR_EXT; |
934 | writel(F_PL_INTR_EXT, adapter->regs + A_PL_CAUSE); | 934 | writel(F_PL_INTR_EXT, adapter->regs + A_PL_CAUSE); |
935 | writel(adapter->slow_intr_mask | F_PL_INTR_SGE_DATA, | 935 | writel(adapter->slow_intr_mask | F_PL_INTR_SGE_DATA, |
936 | adapter->regs + A_PL_ENABLE); | 936 | adapter->regs + A_PL_ENABLE); |
937 | spin_unlock_irq(&adapter->async_lock); | 937 | spin_unlock_irq(&adapter->async_lock); |
938 | } | 938 | } |
939 | 939 | ||
@@ -949,7 +949,7 @@ void t1_elmer0_ext_intr(struct adapter *adapter) | |||
949 | */ | 949 | */ |
950 | adapter->slow_intr_mask &= ~F_PL_INTR_EXT; | 950 | adapter->slow_intr_mask &= ~F_PL_INTR_EXT; |
951 | writel(adapter->slow_intr_mask | F_PL_INTR_SGE_DATA, | 951 | writel(adapter->slow_intr_mask | F_PL_INTR_SGE_DATA, |
952 | adapter->regs + A_PL_ENABLE); | 952 | adapter->regs + A_PL_ENABLE); |
953 | schedule_work(&adapter->ext_intr_handler_task); | 953 | schedule_work(&adapter->ext_intr_handler_task); |
954 | } | 954 | } |
955 | 955 | ||
@@ -982,7 +982,7 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
982 | 982 | ||
983 | err = pci_enable_device(pdev); | 983 | err = pci_enable_device(pdev); |
984 | if (err) | 984 | if (err) |
985 | return err; | 985 | return err; |
986 | 986 | ||
987 | if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { | 987 | if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { |
988 | CH_ERR("%s: cannot find PCI device memory base address\n", | 988 | CH_ERR("%s: cannot find PCI device memory base address\n", |
@@ -1014,7 +1014,7 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
1014 | 1014 | ||
1015 | pci_set_master(pdev); | 1015 | pci_set_master(pdev); |
1016 | 1016 | ||
1017 | mmio_start = pci_resource_start(pdev, 0); | 1017 | mmio_start = pci_resource_start(pdev, 0); |
1018 | mmio_len = pci_resource_len(pdev, 0); | 1018 | mmio_len = pci_resource_len(pdev, 0); |
1019 | bi = t1_get_board_info(ent->driver_data); | 1019 | bi = t1_get_board_info(ent->driver_data); |
1020 | 1020 | ||
@@ -1107,7 +1107,7 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
1107 | #endif | 1107 | #endif |
1108 | netdev->weight = 64; | 1108 | netdev->weight = 64; |
1109 | 1109 | ||
1110 | SET_ETHTOOL_OPS(netdev, &t1_ethtool_ops); | 1110 | SET_ETHTOOL_OPS(netdev, &t1_ethtool_ops); |
1111 | } | 1111 | } |
1112 | 1112 | ||
1113 | if (t1_init_sw_modules(adapter, bi) < 0) { | 1113 | if (t1_init_sw_modules(adapter, bi) < 0) { |
@@ -1134,7 +1134,7 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
1134 | if (!adapter->registered_device_map) | 1134 | if (!adapter->registered_device_map) |
1135 | adapter->name = adapter->port[i].dev->name; | 1135 | adapter->name = adapter->port[i].dev->name; |
1136 | 1136 | ||
1137 | __set_bit(i, &adapter->registered_device_map); | 1137 | __set_bit(i, &adapter->registered_device_map); |
1138 | } | 1138 | } |
1139 | } | 1139 | } |
1140 | if (!adapter->registered_device_map) { | 1140 | if (!adapter->registered_device_map) { |