diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
commit | 62b8c978ee6b8d135d9e7953221de58000dba986 (patch) | |
tree | 683b04b2e627f6710c22c151b23c8cc9a165315e /drivers/staging/et131x | |
parent | 78fd82238d0e5716578c326404184a27ba67fd6e (diff) | |
download | linux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz |
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'drivers/staging/et131x')
-rw-r--r-- | drivers/staging/et131x/Module.symvers | 0 | ||||
-rw-r--r-- | drivers/staging/et131x/README | 7 | ||||
-rw-r--r-- | drivers/staging/et131x/et131x.c | 53 |
3 files changed, 41 insertions, 19 deletions
diff --git a/drivers/staging/et131x/Module.symvers b/drivers/staging/et131x/Module.symvers deleted file mode 100644 index e69de29..0000000 --- a/drivers/staging/et131x/Module.symvers +++ /dev/null diff --git a/drivers/staging/et131x/README b/drivers/staging/et131x/README index 8da96a6..9272a24 100644 --- a/drivers/staging/et131x/README +++ b/drivers/staging/et131x/README @@ -11,12 +11,7 @@ TODO: - Look at reducing the number of spinlocks - Simplify code in nic_rx_pkts(), when determining multicast_pkts_rcvd - Implement NAPI support - - In et131x_tx(), don't return NETDEV_TX_BUSY, just drop the packet with kfree_skb(). - - Reduce the number of split lines by careful consideration of variable names etc. - - Do this in et131x.c: - struct fbr_lookup *fbr; - fbr = rx_local->fbr[id]; - Then replace all the instances of "rx_local->fbr[id]" with fbr. + - in et131x_tx(), don't return NETDEV_TX_BUSY, just drop the packet with kfree_skb(). Please send patches to: Greg Kroah-Hartman <gregkh@linuxfoundation.org> diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index ab8b29d..f73e58f 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -493,8 +493,11 @@ struct et131x_adapter { spinlock_t send_hw_lock; spinlock_t rcv_lock; + spinlock_t rcv_pend_lock; spinlock_t fbr_lock; + spinlock_t phy_lock; + /* Packet Filter and look ahead size */ u32 packet_filter; @@ -2774,9 +2777,10 @@ static void et131x_handle_recv_interrupt(struct et131x_adapter *adapter) adapter->net_stats.rx_packets++; /* Set the status on the packet, either resources or success */ - if (adapter->rx_ring.num_ready_recv < RFD_LOW_WATER_MARK) - dev_warn(&adapter->pdev->dev, "RFD's are running out\n"); - + if (adapter->rx_ring.num_ready_recv < RFD_LOW_WATER_MARK) { + dev_warn(&adapter->pdev->dev, + "RFD's are running out\n"); + } count++; } @@ -2902,9 +2906,8 @@ static int nic_send_packet(struct et131x_adapter *adapter, struct tcb *tcb) * number of fragments. If needed, we can call this function, * although it is less efficient. */ - - /* nr_frags should be no more than 18. */ - BUILD_BUG_ON(MAX_SKB_FRAGS + 1 > 23); + if (nr_frags > 23) + return -EIO; memset(desc, 0, sizeof(struct tx_desc) * (nr_frags + 1)); @@ -3097,10 +3100,11 @@ static int send_packet(struct sk_buff *skb, struct et131x_adapter *adapter) shbufva = (u16 *) skb->data; if ((shbufva[0] == 0xffff) && - (shbufva[1] == 0xffff) && (shbufva[2] == 0xffff)) + (shbufva[1] == 0xffff) && (shbufva[2] == 0xffff)) { tcb->flags |= FMP_DEST_BROAD; - else if ((shbufva[0] & 0x3) == 0x0001) + } else if ((shbufva[0] & 0x3) == 0x0001) { tcb->flags |= FMP_DEST_MULTI; + } } tcb->next = NULL; @@ -3601,10 +3605,17 @@ static int et131x_pci_init(struct et131x_adapter *adapter, goto err_out; } - /* Let's set up the PORT LOGIC Register. */ + /* Let's set up the PORT LOGIC Register. First we need to know what + * the max_payload_size is + */ + if (pcie_capability_read_word(pdev, PCI_EXP_DEVCAP, &max_payload)) { + dev_err(&pdev->dev, + "Could not read PCI config space for Max Payload Size\n"); + goto err_out; + } /* Program the Ack/Nak latency and replay timers */ - max_payload = pdev->pcie_mpss; + max_payload &= 0x07; if (max_payload < 2) { static const u16 acknak[2] = { 0x76, 0xD0 }; @@ -3634,7 +3645,8 @@ static int et131x_pci_init(struct et131x_adapter *adapter, } /* Change the max read size to 2k */ - if (pcie_set_readrq(pdev, 2048)) { + if (pcie_capability_clear_and_set_word(pdev, PCI_EXP_DEVCTL, + PCI_EXP_DEVCTL_READRQ, 0x4 << 12)) { dev_err(&pdev->dev, "Couldn't change PCI config space for Max read size\n"); goto err_out; @@ -3914,7 +3926,9 @@ static struct et131x_adapter *et131x_adapter_init(struct net_device *netdev, spin_lock_init(&adapter->tcb_ready_qlock); spin_lock_init(&adapter->send_hw_lock); spin_lock_init(&adapter->rcv_lock); + spin_lock_init(&adapter->rcv_pend_lock); spin_lock_init(&adapter->fbr_lock); + spin_lock_init(&adapter->phy_lock); adapter->registry_jumbo_packet = 1514; /* 1514-9216 */ @@ -4783,8 +4797,21 @@ static int et131x_pci_setup(struct pci_dev *pdev, pci_set_master(pdev); /* Check the DMA addressing support of this device */ - if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) && - dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) { + if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) { + rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64)); + if (rc < 0) { + dev_err(&pdev->dev, + "Unable to obtain 64 bit DMA for consistent allocations\n"); + goto err_release_res; + } + } else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) { + rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); + if (rc < 0) { + dev_err(&pdev->dev, + "Unable to obtain 32 bit DMA for consistent allocations\n"); + goto err_release_res; + } + } else { dev_err(&pdev->dev, "No usable DMA addressing method\n"); rc = -EIO; goto err_release_res; |