diff options
Diffstat (limited to 'drivers/net')
| -rw-r--r-- | drivers/net/bnx2.c | 6 | ||||
| -rw-r--r-- | drivers/net/enc28j60.c | 2 | ||||
| -rw-r--r-- | drivers/net/jme.h | 2 | ||||
| -rw-r--r-- | drivers/net/phy/mdio_bus.c | 5 | ||||
| -rw-r--r-- | drivers/net/ppp_generic.c | 28 | ||||
| -rw-r--r-- | drivers/net/starfire.c | 5 | ||||
| -rw-r--r-- | drivers/net/tlan.c | 23 |
7 files changed, 41 insertions, 30 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index a1a3d0e5d2b4..9e8222f9e90e 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
| @@ -543,9 +543,9 @@ bnx2_free_rx_mem(struct bnx2 *bp) | |||
| 543 | for (j = 0; j < bp->rx_max_pg_ring; j++) { | 543 | for (j = 0; j < bp->rx_max_pg_ring; j++) { |
| 544 | if (rxr->rx_pg_desc_ring[j]) | 544 | if (rxr->rx_pg_desc_ring[j]) |
| 545 | pci_free_consistent(bp->pdev, RXBD_RING_SIZE, | 545 | pci_free_consistent(bp->pdev, RXBD_RING_SIZE, |
| 546 | rxr->rx_pg_desc_ring[i], | 546 | rxr->rx_pg_desc_ring[j], |
| 547 | rxr->rx_pg_desc_mapping[i]); | 547 | rxr->rx_pg_desc_mapping[j]); |
| 548 | rxr->rx_pg_desc_ring[i] = NULL; | 548 | rxr->rx_pg_desc_ring[j] = NULL; |
| 549 | } | 549 | } |
| 550 | if (rxr->rx_pg_ring) | 550 | if (rxr->rx_pg_ring) |
| 551 | vfree(rxr->rx_pg_ring); | 551 | vfree(rxr->rx_pg_ring); |
diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index c414554ac321..36cb6e95b465 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c | |||
| @@ -959,7 +959,7 @@ static void enc28j60_hw_rx(struct net_device *ndev) | |||
| 959 | ndev->stats.rx_packets++; | 959 | ndev->stats.rx_packets++; |
| 960 | ndev->stats.rx_bytes += len; | 960 | ndev->stats.rx_bytes += len; |
| 961 | ndev->last_rx = jiffies; | 961 | ndev->last_rx = jiffies; |
| 962 | netif_rx(skb); | 962 | netif_rx_ni(skb); |
| 963 | } | 963 | } |
| 964 | } | 964 | } |
| 965 | /* | 965 | /* |
diff --git a/drivers/net/jme.h b/drivers/net/jme.h index f863aee6648b..3f5d91543246 100644 --- a/drivers/net/jme.h +++ b/drivers/net/jme.h | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | */ | 22 | */ |
| 23 | 23 | ||
| 24 | #ifndef __JME_H_INCLUDED__ | 24 | #ifndef __JME_H_INCLUDED__ |
| 25 | #define __JME_H_INCLUDEE__ | 25 | #define __JME_H_INCLUDED__ |
| 26 | 26 | ||
| 27 | #define DRV_NAME "jme" | 27 | #define DRV_NAME "jme" |
| 28 | #define DRV_VERSION "1.0.3" | 28 | #define DRV_VERSION "1.0.3" |
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 536bda1f428b..289fc267edf3 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
| @@ -105,8 +105,6 @@ int mdiobus_register(struct mii_bus *bus) | |||
| 105 | return -EINVAL; | 105 | return -EINVAL; |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | bus->state = MDIOBUS_REGISTERED; | ||
| 109 | |||
| 110 | mutex_init(&bus->mdio_lock); | 108 | mutex_init(&bus->mdio_lock); |
| 111 | 109 | ||
| 112 | if (bus->reset) | 110 | if (bus->reset) |
| @@ -123,6 +121,9 @@ int mdiobus_register(struct mii_bus *bus) | |||
| 123 | } | 121 | } |
| 124 | } | 122 | } |
| 125 | 123 | ||
| 124 | if (!err) | ||
| 125 | bus->state = MDIOBUS_REGISTERED; | ||
| 126 | |||
| 126 | pr_info("%s: probed\n", bus->name); | 127 | pr_info("%s: probed\n", bus->name); |
| 127 | 128 | ||
| 128 | return err; | 129 | return err; |
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 7e857e938adb..714a23035de1 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
| @@ -116,6 +116,7 @@ struct ppp { | |||
| 116 | unsigned long last_xmit; /* jiffies when last pkt sent 9c */ | 116 | unsigned long last_xmit; /* jiffies when last pkt sent 9c */ |
| 117 | unsigned long last_recv; /* jiffies when last pkt rcvd a0 */ | 117 | unsigned long last_recv; /* jiffies when last pkt rcvd a0 */ |
| 118 | struct net_device *dev; /* network interface device a4 */ | 118 | struct net_device *dev; /* network interface device a4 */ |
| 119 | int closing; /* is device closing down? a8 */ | ||
| 119 | #ifdef CONFIG_PPP_MULTILINK | 120 | #ifdef CONFIG_PPP_MULTILINK |
| 120 | int nxchan; /* next channel to send something on */ | 121 | int nxchan; /* next channel to send something on */ |
| 121 | u32 nxseq; /* next sequence number to send */ | 122 | u32 nxseq; /* next sequence number to send */ |
| @@ -995,7 +996,7 @@ ppp_xmit_process(struct ppp *ppp) | |||
| 995 | struct sk_buff *skb; | 996 | struct sk_buff *skb; |
| 996 | 997 | ||
| 997 | ppp_xmit_lock(ppp); | 998 | ppp_xmit_lock(ppp); |
| 998 | if (ppp->dev) { | 999 | if (!ppp->closing) { |
| 999 | ppp_push(ppp); | 1000 | ppp_push(ppp); |
| 1000 | while (!ppp->xmit_pending | 1001 | while (!ppp->xmit_pending |
| 1001 | && (skb = skb_dequeue(&ppp->file.xq))) | 1002 | && (skb = skb_dequeue(&ppp->file.xq))) |
| @@ -1463,8 +1464,7 @@ static inline void | |||
| 1463 | ppp_do_recv(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) | 1464 | ppp_do_recv(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) |
| 1464 | { | 1465 | { |
| 1465 | ppp_recv_lock(ppp); | 1466 | ppp_recv_lock(ppp); |
| 1466 | /* ppp->dev == 0 means interface is closing down */ | 1467 | if (!ppp->closing) |
| 1467 | if (ppp->dev) | ||
| 1468 | ppp_receive_frame(ppp, skb, pch); | 1468 | ppp_receive_frame(ppp, skb, pch); |
| 1469 | else | 1469 | else |
| 1470 | kfree_skb(skb); | 1470 | kfree_skb(skb); |
| @@ -2498,18 +2498,16 @@ init_ppp_file(struct ppp_file *pf, int kind) | |||
| 2498 | */ | 2498 | */ |
| 2499 | static void ppp_shutdown_interface(struct ppp *ppp) | 2499 | static void ppp_shutdown_interface(struct ppp *ppp) |
| 2500 | { | 2500 | { |
| 2501 | struct net_device *dev; | ||
| 2502 | |||
| 2503 | mutex_lock(&all_ppp_mutex); | 2501 | mutex_lock(&all_ppp_mutex); |
| 2504 | ppp_lock(ppp); | ||
| 2505 | dev = ppp->dev; | ||
| 2506 | ppp->dev = NULL; | ||
| 2507 | ppp_unlock(ppp); | ||
| 2508 | /* This will call dev_close() for us. */ | 2502 | /* This will call dev_close() for us. */ |
| 2509 | if (dev) { | 2503 | ppp_lock(ppp); |
| 2510 | unregister_netdev(dev); | 2504 | if (!ppp->closing) { |
| 2511 | free_netdev(dev); | 2505 | ppp->closing = 1; |
| 2512 | } | 2506 | ppp_unlock(ppp); |
| 2507 | unregister_netdev(ppp->dev); | ||
| 2508 | } else | ||
| 2509 | ppp_unlock(ppp); | ||
| 2510 | |||
| 2513 | cardmap_set(&all_ppp_units, ppp->file.index, NULL); | 2511 | cardmap_set(&all_ppp_units, ppp->file.index, NULL); |
| 2514 | ppp->file.dead = 1; | 2512 | ppp->file.dead = 1; |
| 2515 | ppp->owner = NULL; | 2513 | ppp->owner = NULL; |
| @@ -2554,7 +2552,7 @@ static void ppp_destroy_interface(struct ppp *ppp) | |||
| 2554 | if (ppp->xmit_pending) | 2552 | if (ppp->xmit_pending) |
| 2555 | kfree_skb(ppp->xmit_pending); | 2553 | kfree_skb(ppp->xmit_pending); |
| 2556 | 2554 | ||
| 2557 | kfree(ppp); | 2555 | free_netdev(ppp->dev); |
| 2558 | } | 2556 | } |
| 2559 | 2557 | ||
| 2560 | /* | 2558 | /* |
| @@ -2616,7 +2614,7 @@ ppp_connect_channel(struct channel *pch, int unit) | |||
| 2616 | if (pch->file.hdrlen > ppp->file.hdrlen) | 2614 | if (pch->file.hdrlen > ppp->file.hdrlen) |
| 2617 | ppp->file.hdrlen = pch->file.hdrlen; | 2615 | ppp->file.hdrlen = pch->file.hdrlen; |
| 2618 | hdrlen = pch->file.hdrlen + 2; /* for protocol bytes */ | 2616 | hdrlen = pch->file.hdrlen + 2; /* for protocol bytes */ |
| 2619 | if (ppp->dev && hdrlen > ppp->dev->hard_header_len) | 2617 | if (hdrlen > ppp->dev->hard_header_len) |
| 2620 | ppp->dev->hard_header_len = hdrlen; | 2618 | ppp->dev->hard_header_len = hdrlen; |
| 2621 | list_add_tail(&pch->clist, &ppp->channels); | 2619 | list_add_tail(&pch->clist, &ppp->channels); |
| 2622 | ++ppp->n_channels; | 2620 | ++ppp->n_channels; |
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index 1d2ef8f47780..5a40f2d78beb 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c | |||
| @@ -1509,6 +1509,11 @@ static int __netdev_rx(struct net_device *dev, int *quota) | |||
| 1509 | desc->status = 0; | 1509 | desc->status = 0; |
| 1510 | np->rx_done = (np->rx_done + 1) % DONE_Q_SIZE; | 1510 | np->rx_done = (np->rx_done + 1) % DONE_Q_SIZE; |
| 1511 | } | 1511 | } |
| 1512 | |||
| 1513 | if (*quota == 0) { /* out of rx quota */ | ||
| 1514 | retcode = 1; | ||
| 1515 | goto out; | ||
| 1516 | } | ||
| 1512 | writew(np->rx_done, np->base + CompletionQConsumerIdx); | 1517 | writew(np->rx_done, np->base + CompletionQConsumerIdx); |
| 1513 | 1518 | ||
| 1514 | out: | 1519 | out: |
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index c41d68761364..e60498232b94 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c | |||
| @@ -1098,6 +1098,7 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev ) | |||
| 1098 | dma_addr_t tail_list_phys; | 1098 | dma_addr_t tail_list_phys; |
| 1099 | u8 *tail_buffer; | 1099 | u8 *tail_buffer; |
| 1100 | unsigned long flags; | 1100 | unsigned long flags; |
| 1101 | unsigned int txlen; | ||
| 1101 | 1102 | ||
| 1102 | if ( ! priv->phyOnline ) { | 1103 | if ( ! priv->phyOnline ) { |
| 1103 | TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT: %s PHY is not ready\n", | 1104 | TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT: %s PHY is not ready\n", |
| @@ -1108,6 +1109,7 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev ) | |||
| 1108 | 1109 | ||
| 1109 | if (skb_padto(skb, TLAN_MIN_FRAME_SIZE)) | 1110 | if (skb_padto(skb, TLAN_MIN_FRAME_SIZE)) |
| 1110 | return 0; | 1111 | return 0; |
| 1112 | txlen = max(skb->len, (unsigned int)TLAN_MIN_FRAME_SIZE); | ||
| 1111 | 1113 | ||
| 1112 | tail_list = priv->txList + priv->txTail; | 1114 | tail_list = priv->txList + priv->txTail; |
| 1113 | tail_list_phys = priv->txListDMA + sizeof(TLanList) * priv->txTail; | 1115 | tail_list_phys = priv->txListDMA + sizeof(TLanList) * priv->txTail; |
| @@ -1125,16 +1127,16 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev ) | |||
| 1125 | 1127 | ||
| 1126 | if ( bbuf ) { | 1128 | if ( bbuf ) { |
| 1127 | tail_buffer = priv->txBuffer + ( priv->txTail * TLAN_MAX_FRAME_SIZE ); | 1129 | tail_buffer = priv->txBuffer + ( priv->txTail * TLAN_MAX_FRAME_SIZE ); |
| 1128 | skb_copy_from_linear_data(skb, tail_buffer, skb->len); | 1130 | skb_copy_from_linear_data(skb, tail_buffer, txlen); |
| 1129 | } else { | 1131 | } else { |
| 1130 | tail_list->buffer[0].address = pci_map_single(priv->pciDev, | 1132 | tail_list->buffer[0].address = pci_map_single(priv->pciDev, |
| 1131 | skb->data, skb->len, | 1133 | skb->data, txlen, |
| 1132 | PCI_DMA_TODEVICE); | 1134 | PCI_DMA_TODEVICE); |
| 1133 | TLan_StoreSKB(tail_list, skb); | 1135 | TLan_StoreSKB(tail_list, skb); |
| 1134 | } | 1136 | } |
| 1135 | 1137 | ||
| 1136 | tail_list->frameSize = (u16) skb->len; | 1138 | tail_list->frameSize = (u16) txlen; |
| 1137 | tail_list->buffer[0].count = TLAN_LAST_BUFFER | (u32) skb->len; | 1139 | tail_list->buffer[0].count = TLAN_LAST_BUFFER | (u32) txlen; |
| 1138 | tail_list->buffer[1].count = 0; | 1140 | tail_list->buffer[1].count = 0; |
| 1139 | tail_list->buffer[1].address = 0; | 1141 | tail_list->buffer[1].address = 0; |
| 1140 | 1142 | ||
| @@ -1431,7 +1433,9 @@ static u32 TLan_HandleTxEOF( struct net_device *dev, u16 host_int ) | |||
| 1431 | if ( ! bbuf ) { | 1433 | if ( ! bbuf ) { |
| 1432 | struct sk_buff *skb = TLan_GetSKB(head_list); | 1434 | struct sk_buff *skb = TLan_GetSKB(head_list); |
| 1433 | pci_unmap_single(priv->pciDev, head_list->buffer[0].address, | 1435 | pci_unmap_single(priv->pciDev, head_list->buffer[0].address, |
| 1434 | skb->len, PCI_DMA_TODEVICE); | 1436 | max(skb->len, |
| 1437 | (unsigned int)TLAN_MIN_FRAME_SIZE), | ||
| 1438 | PCI_DMA_TODEVICE); | ||
| 1435 | dev_kfree_skb_any(skb); | 1439 | dev_kfree_skb_any(skb); |
| 1436 | head_list->buffer[8].address = 0; | 1440 | head_list->buffer[8].address = 0; |
| 1437 | head_list->buffer[9].address = 0; | 1441 | head_list->buffer[9].address = 0; |
| @@ -2055,9 +2059,12 @@ static void TLan_FreeLists( struct net_device *dev ) | |||
| 2055 | list = priv->txList + i; | 2059 | list = priv->txList + i; |
| 2056 | skb = TLan_GetSKB(list); | 2060 | skb = TLan_GetSKB(list); |
| 2057 | if ( skb ) { | 2061 | if ( skb ) { |
| 2058 | pci_unmap_single(priv->pciDev, | 2062 | pci_unmap_single( |
| 2059 | list->buffer[0].address, skb->len, | 2063 | priv->pciDev, |
| 2060 | PCI_DMA_TODEVICE); | 2064 | list->buffer[0].address, |
| 2065 | max(skb->len, | ||
| 2066 | (unsigned int)TLAN_MIN_FRAME_SIZE), | ||
| 2067 | PCI_DMA_TODEVICE); | ||
| 2061 | dev_kfree_skb_any( skb ); | 2068 | dev_kfree_skb_any( skb ); |
| 2062 | list->buffer[8].address = 0; | 2069 | list->buffer[8].address = 0; |
| 2063 | list->buffer[9].address = 0; | 2070 | list->buffer[9].address = 0; |
