diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2009-10-30 08:13:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-02 07:25:40 -0500 |
commit | 9dfbbaa6b0b9f7c4d6c9dc3a59006f44e6521138 (patch) | |
tree | d0c93bae849fc79ab01c38974b02b949f1b623ec /drivers/net/qlge/qlge_main.c | |
parent | 536b2e92f1b7a86e177aeced097e4c051eeebe7d (diff) |
qlge: Add ethtool self-test.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge/qlge_main.c')
-rw-r--r-- | drivers/net/qlge/qlge_main.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 42ad811ec313..4de054505ec6 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -1680,6 +1680,13 @@ static void ql_process_mac_rx_intr(struct ql_adapter *qdev, | |||
1680 | return; | 1680 | return; |
1681 | } | 1681 | } |
1682 | 1682 | ||
1683 | /* loopback self test for ethtool */ | ||
1684 | if (test_bit(QL_SELFTEST, &qdev->flags)) { | ||
1685 | ql_check_lb_frame(qdev, skb); | ||
1686 | dev_kfree_skb_any(skb); | ||
1687 | return; | ||
1688 | } | ||
1689 | |||
1683 | prefetch(skb->data); | 1690 | prefetch(skb->data); |
1684 | skb->dev = ndev; | 1691 | skb->dev = ndev; |
1685 | if (ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_M_MASK) { | 1692 | if (ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_M_MASK) { |
@@ -2248,6 +2255,7 @@ static netdev_tx_t qlge_send(struct sk_buff *skb, struct net_device *ndev) | |||
2248 | return NETDEV_TX_OK; | 2255 | return NETDEV_TX_OK; |
2249 | } | 2256 | } |
2250 | 2257 | ||
2258 | |||
2251 | static void ql_free_shadow_space(struct ql_adapter *qdev) | 2259 | static void ql_free_shadow_space(struct ql_adapter *qdev) |
2252 | { | 2260 | { |
2253 | if (qdev->rx_ring_shadow_reg_area) { | 2261 | if (qdev->rx_ring_shadow_reg_area) { |
@@ -4174,7 +4182,6 @@ err_out: | |||
4174 | return err; | 4182 | return err; |
4175 | } | 4183 | } |
4176 | 4184 | ||
4177 | |||
4178 | static const struct net_device_ops qlge_netdev_ops = { | 4185 | static const struct net_device_ops qlge_netdev_ops = { |
4179 | .ndo_open = qlge_open, | 4186 | .ndo_open = qlge_open, |
4180 | .ndo_stop = qlge_close, | 4187 | .ndo_stop = qlge_close, |
@@ -4243,10 +4250,21 @@ static int __devinit qlge_probe(struct pci_dev *pdev, | |||
4243 | } | 4250 | } |
4244 | ql_link_off(qdev); | 4251 | ql_link_off(qdev); |
4245 | ql_display_dev_info(ndev); | 4252 | ql_display_dev_info(ndev); |
4253 | atomic_set(&qdev->lb_count, 0); | ||
4246 | cards_found++; | 4254 | cards_found++; |
4247 | return 0; | 4255 | return 0; |
4248 | } | 4256 | } |
4249 | 4257 | ||
4258 | netdev_tx_t ql_lb_send(struct sk_buff *skb, struct net_device *ndev) | ||
4259 | { | ||
4260 | return qlge_send(skb, ndev); | ||
4261 | } | ||
4262 | |||
4263 | int ql_clean_lb_rx_ring(struct rx_ring *rx_ring, int budget) | ||
4264 | { | ||
4265 | return ql_clean_inbound_rx_ring(rx_ring, budget); | ||
4266 | } | ||
4267 | |||
4250 | static void __devexit qlge_remove(struct pci_dev *pdev) | 4268 | static void __devexit qlge_remove(struct pci_dev *pdev) |
4251 | { | 4269 | { |
4252 | struct net_device *ndev = pci_get_drvdata(pdev); | 4270 | struct net_device *ndev = pci_get_drvdata(pdev); |