diff options
Diffstat (limited to 'drivers/net/hp100.c')
-rw-r--r-- | drivers/net/hp100.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index 8feda9fe8297..1d3429a415e6 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c | |||
@@ -1495,13 +1495,8 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev) | |||
1495 | hp100_outw(0x4210, TRACE); | 1495 | hp100_outw(0x4210, TRACE); |
1496 | printk("hp100: %s: start_xmit_bm\n", dev->name); | 1496 | printk("hp100: %s: start_xmit_bm\n", dev->name); |
1497 | #endif | 1497 | #endif |
1498 | |||
1499 | if (skb == NULL) { | ||
1500 | return 0; | ||
1501 | } | ||
1502 | |||
1503 | if (skb->len <= 0) | 1498 | if (skb->len <= 0) |
1504 | return 0; | 1499 | goto drop; |
1505 | 1500 | ||
1506 | if (lp->chip == HP100_CHIPID_SHASTA && skb_padto(skb, ETH_ZLEN)) | 1501 | if (lp->chip == HP100_CHIPID_SHASTA && skb_padto(skb, ETH_ZLEN)) |
1507 | return 0; | 1502 | return 0; |
@@ -1514,10 +1509,10 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev) | |||
1514 | #endif | 1509 | #endif |
1515 | /* not waited long enough since last tx? */ | 1510 | /* not waited long enough since last tx? */ |
1516 | if (time_before(jiffies, dev->trans_start + HZ)) | 1511 | if (time_before(jiffies, dev->trans_start + HZ)) |
1517 | return -EAGAIN; | 1512 | goto drop; |
1518 | 1513 | ||
1519 | if (hp100_check_lan(dev)) | 1514 | if (hp100_check_lan(dev)) |
1520 | return -EIO; | 1515 | goto drop; |
1521 | 1516 | ||
1522 | if (lp->lan_type == HP100_LAN_100 && lp->hub_status < 0) { | 1517 | if (lp->lan_type == HP100_LAN_100 && lp->hub_status < 0) { |
1523 | /* we have a 100Mb/s adapter but it isn't connected to hub */ | 1518 | /* we have a 100Mb/s adapter but it isn't connected to hub */ |
@@ -1551,7 +1546,7 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev) | |||
1551 | } | 1546 | } |
1552 | 1547 | ||
1553 | dev->trans_start = jiffies; | 1548 | dev->trans_start = jiffies; |
1554 | return -EAGAIN; | 1549 | goto drop; |
1555 | } | 1550 | } |
1556 | 1551 | ||
1557 | /* | 1552 | /* |
@@ -1591,6 +1586,10 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev) | |||
1591 | dev->trans_start = jiffies; | 1586 | dev->trans_start = jiffies; |
1592 | 1587 | ||
1593 | return 0; | 1588 | return 0; |
1589 | |||
1590 | drop: | ||
1591 | dev_kfree_skb(skb); | ||
1592 | return NETDEV_TX_OK; | ||
1594 | } | 1593 | } |
1595 | 1594 | ||
1596 | 1595 | ||
@@ -1648,16 +1647,11 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1648 | hp100_outw(0x4212, TRACE); | 1647 | hp100_outw(0x4212, TRACE); |
1649 | printk("hp100: %s: start_xmit\n", dev->name); | 1648 | printk("hp100: %s: start_xmit\n", dev->name); |
1650 | #endif | 1649 | #endif |
1651 | |||
1652 | if (skb == NULL) { | ||
1653 | return 0; | ||
1654 | } | ||
1655 | |||
1656 | if (skb->len <= 0) | 1650 | if (skb->len <= 0) |
1657 | return 0; | 1651 | goto drop; |
1658 | 1652 | ||
1659 | if (hp100_check_lan(dev)) | 1653 | if (hp100_check_lan(dev)) |
1660 | return -EIO; | 1654 | goto drop; |
1661 | 1655 | ||
1662 | /* If there is not enough free memory on the card... */ | 1656 | /* If there is not enough free memory on the card... */ |
1663 | i = hp100_inl(TX_MEM_FREE) & 0x7fffffff; | 1657 | i = hp100_inl(TX_MEM_FREE) & 0x7fffffff; |
@@ -1671,7 +1665,7 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1671 | printk("hp100: %s: trans_start timing problem\n", | 1665 | printk("hp100: %s: trans_start timing problem\n", |
1672 | dev->name); | 1666 | dev->name); |
1673 | #endif | 1667 | #endif |
1674 | return -EAGAIN; | 1668 | goto drop; |
1675 | } | 1669 | } |
1676 | if (lp->lan_type == HP100_LAN_100 && lp->hub_status < 0) { | 1670 | if (lp->lan_type == HP100_LAN_100 && lp->hub_status < 0) { |
1677 | /* we have a 100Mb/s adapter but it isn't connected to hub */ | 1671 | /* we have a 100Mb/s adapter but it isn't connected to hub */ |
@@ -1705,7 +1699,7 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1705 | } | 1699 | } |
1706 | } | 1700 | } |
1707 | dev->trans_start = jiffies; | 1701 | dev->trans_start = jiffies; |
1708 | return -EAGAIN; | 1702 | goto drop; |
1709 | } | 1703 | } |
1710 | 1704 | ||
1711 | for (i = 0; i < 6000 && (hp100_inb(OPTION_MSW) & HP100_TX_CMD); i++) { | 1705 | for (i = 0; i < 6000 && (hp100_inb(OPTION_MSW) & HP100_TX_CMD); i++) { |
@@ -1759,6 +1753,11 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1759 | #endif | 1753 | #endif |
1760 | 1754 | ||
1761 | return 0; | 1755 | return 0; |
1756 | |||
1757 | drop: | ||
1758 | dev_kfree_skb(skb); | ||
1759 | return NETDEV_TX_OK; | ||
1760 | |||
1762 | } | 1761 | } |
1763 | 1762 | ||
1764 | 1763 | ||