alx 95 drivers/net/ethernet/atheros/alx/alx.h struct alx_priv *alx; alx 131 drivers/net/ethernet/atheros/alx/ethtool.c struct alx_priv *alx = netdev_priv(netdev); alx 132 drivers/net/ethernet/atheros/alx/ethtool.c struct alx_hw *hw = &alx->hw; alx 180 drivers/net/ethernet/atheros/alx/ethtool.c struct alx_priv *alx = netdev_priv(netdev); alx 181 drivers/net/ethernet/atheros/alx/ethtool.c struct alx_hw *hw = &alx->hw; alx 209 drivers/net/ethernet/atheros/alx/ethtool.c struct alx_priv *alx = netdev_priv(netdev); alx 210 drivers/net/ethernet/atheros/alx/ethtool.c struct alx_hw *hw = &alx->hw; alx 222 drivers/net/ethernet/atheros/alx/ethtool.c struct alx_priv *alx = netdev_priv(netdev); alx 223 drivers/net/ethernet/atheros/alx/ethtool.c struct alx_hw *hw = &alx->hw; alx 263 drivers/net/ethernet/atheros/alx/ethtool.c struct alx_priv *alx = netdev_priv(netdev); alx 265 drivers/net/ethernet/atheros/alx/ethtool.c return alx->msg_enable; alx 270 drivers/net/ethernet/atheros/alx/ethtool.c struct alx_priv *alx = netdev_priv(netdev); alx 272 drivers/net/ethernet/atheros/alx/ethtool.c alx->msg_enable = data; alx 278 drivers/net/ethernet/atheros/alx/ethtool.c struct alx_priv *alx = netdev_priv(netdev); alx 279 drivers/net/ethernet/atheros/alx/ethtool.c struct alx_hw *hw = &alx->hw; alx 281 drivers/net/ethernet/atheros/alx/ethtool.c spin_lock(&alx->stats_lock); alx 288 drivers/net/ethernet/atheros/alx/ethtool.c spin_unlock(&alx->stats_lock); alx 72 drivers/net/ethernet/atheros/alx/main.c static int alx_refill_rx_ring(struct alx_priv *alx, gfp_t gfp) alx 74 drivers/net/ethernet/atheros/alx/main.c struct alx_rx_queue *rxq = alx->qnapi[0]->rxq; alx 81 drivers/net/ethernet/atheros/alx/main.c if (++next == alx->rx_ringsz) alx 97 drivers/net/ethernet/atheros/alx/main.c skb = __netdev_alloc_skb(alx->dev, alx->rxbuf_size + 64, gfp); alx 104 drivers/net/ethernet/atheros/alx/main.c dma = dma_map_single(&alx->hw.pdev->dev, alx 105 drivers/net/ethernet/atheros/alx/main.c skb->data, alx->rxbuf_size, alx 107 drivers/net/ethernet/atheros/alx/main.c if (dma_mapping_error(&alx->hw.pdev->dev, dma)) { alx 121 drivers/net/ethernet/atheros/alx/main.c dma_unmap_len_set(cur_buf, size, alx->rxbuf_size); alx 126 drivers/net/ethernet/atheros/alx/main.c if (++next == alx->rx_ringsz) alx 136 drivers/net/ethernet/atheros/alx/main.c alx_write_mem16(&alx->hw, ALX_RFD_PIDX, cur); alx 142 drivers/net/ethernet/atheros/alx/main.c static struct alx_tx_queue *alx_tx_queue_mapping(struct alx_priv *alx, alx 147 drivers/net/ethernet/atheros/alx/main.c if (r_idx >= alx->num_txq) alx 148 drivers/net/ethernet/atheros/alx/main.c r_idx = r_idx % alx->num_txq; alx 150 drivers/net/ethernet/atheros/alx/main.c return alx->qnapi[r_idx]->txq; alx 167 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx; alx 173 drivers/net/ethernet/atheros/alx/main.c alx = netdev_priv(txq->netdev); alx 177 drivers/net/ethernet/atheros/alx/main.c hw_read_idx = alx_read_mem16(&alx->hw, txq->c_reg); alx 200 drivers/net/ethernet/atheros/alx/main.c if (netif_tx_queue_stopped(tx_queue) && netif_carrier_ok(alx->dev) && alx 207 drivers/net/ethernet/atheros/alx/main.c static void alx_schedule_link_check(struct alx_priv *alx) alx 209 drivers/net/ethernet/atheros/alx/main.c schedule_work(&alx->link_check_wk); alx 212 drivers/net/ethernet/atheros/alx/main.c static void alx_schedule_reset(struct alx_priv *alx) alx 214 drivers/net/ethernet/atheros/alx/main.c schedule_work(&alx->reset_wk); alx 219 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx; alx 226 drivers/net/ethernet/atheros/alx/main.c alx = netdev_priv(rxq->netdev); alx 238 drivers/net/ethernet/atheros/alx/main.c alx_schedule_reset(alx); alx 264 drivers/net/ethernet/atheros/alx/main.c if (alx->dev->features & NETIF_F_RXCSUM && alx 288 drivers/net/ethernet/atheros/alx/main.c rfd_cleaned -= alx_refill_rx_ring(alx, GFP_ATOMIC); alx 292 drivers/net/ethernet/atheros/alx/main.c alx_refill_rx_ring(alx, GFP_ATOMIC); alx 300 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = np->alx; alx 301 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 317 drivers/net/ethernet/atheros/alx/main.c if (alx->hw.pdev->msix_enabled) { alx 320 drivers/net/ethernet/atheros/alx/main.c spin_lock_irqsave(&alx->irq_lock, flags); alx 321 drivers/net/ethernet/atheros/alx/main.c alx->int_mask |= ALX_ISR_TX_Q0 | ALX_ISR_RX_Q0; alx 322 drivers/net/ethernet/atheros/alx/main.c alx_write_mem32(hw, ALX_IMR, alx->int_mask); alx 323 drivers/net/ethernet/atheros/alx/main.c spin_unlock_irqrestore(&alx->irq_lock, flags); alx 331 drivers/net/ethernet/atheros/alx/main.c static bool alx_intr_handle_misc(struct alx_priv *alx, u32 intr) alx 333 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 336 drivers/net/ethernet/atheros/alx/main.c netif_warn(alx, hw, alx->dev, alx 338 drivers/net/ethernet/atheros/alx/main.c alx_schedule_reset(alx); alx 343 drivers/net/ethernet/atheros/alx/main.c netdev_warn(alx->dev, "alert interrupt: 0x%x\n", intr); alx 350 drivers/net/ethernet/atheros/alx/main.c alx->int_mask &= ~ALX_ISR_PHY; alx 351 drivers/net/ethernet/atheros/alx/main.c alx_write_mem32(hw, ALX_IMR, alx->int_mask); alx 352 drivers/net/ethernet/atheros/alx/main.c alx_schedule_link_check(alx); alx 358 drivers/net/ethernet/atheros/alx/main.c static irqreturn_t alx_intr_handle(struct alx_priv *alx, u32 intr) alx 360 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 362 drivers/net/ethernet/atheros/alx/main.c spin_lock(&alx->irq_lock); alx 366 drivers/net/ethernet/atheros/alx/main.c intr &= alx->int_mask; alx 368 drivers/net/ethernet/atheros/alx/main.c if (alx_intr_handle_misc(alx, intr)) alx 372 drivers/net/ethernet/atheros/alx/main.c napi_schedule(&alx->qnapi[0]->napi); alx 374 drivers/net/ethernet/atheros/alx/main.c alx->int_mask &= ~ALX_ISR_ALL_QUEUES; alx 375 drivers/net/ethernet/atheros/alx/main.c alx_write_mem32(hw, ALX_IMR, alx->int_mask); alx 381 drivers/net/ethernet/atheros/alx/main.c spin_unlock(&alx->irq_lock); alx 388 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &np->alx->hw; alx 402 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = data; alx 403 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 411 drivers/net/ethernet/atheros/alx/main.c intr &= (alx->int_mask & ~ALX_ISR_ALL_QUEUES); alx 413 drivers/net/ethernet/atheros/alx/main.c if (alx_intr_handle_misc(alx, intr)) alx 427 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = data; alx 429 drivers/net/ethernet/atheros/alx/main.c return alx_intr_handle(alx, alx_read_mem32(&alx->hw, ALX_ISR)); alx 434 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = data; alx 435 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 440 drivers/net/ethernet/atheros/alx/main.c if (intr & ALX_ISR_DIS || !(intr & alx->int_mask)) alx 443 drivers/net/ethernet/atheros/alx/main.c return alx_intr_handle(alx, intr); alx 451 drivers/net/ethernet/atheros/alx/main.c static void alx_init_ring_ptrs(struct alx_priv *alx) alx 453 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 454 drivers/net/ethernet/atheros/alx/main.c u32 addr_hi = ((u64)alx->descmem.dma) >> 32; alx 458 drivers/net/ethernet/atheros/alx/main.c for (i = 0; i < alx->num_napi; i++) { alx 459 drivers/net/ethernet/atheros/alx/main.c np = alx->qnapi[i]; alx 478 drivers/net/ethernet/atheros/alx/main.c alx_write_mem32(hw, ALX_TPD_RING_SZ, alx->tx_ringsz); alx 481 drivers/net/ethernet/atheros/alx/main.c alx_write_mem32(hw, ALX_RRD_RING_SZ, alx->rx_ringsz); alx 482 drivers/net/ethernet/atheros/alx/main.c alx_write_mem32(hw, ALX_RFD_RING_SZ, alx->rx_ringsz); alx 483 drivers/net/ethernet/atheros/alx/main.c alx_write_mem32(hw, ALX_RFD_BUF_SZ, alx->rxbuf_size); alx 534 drivers/net/ethernet/atheros/alx/main.c static void alx_free_buffers(struct alx_priv *alx) alx 538 drivers/net/ethernet/atheros/alx/main.c for (i = 0; i < alx->num_txq; i++) alx 539 drivers/net/ethernet/atheros/alx/main.c if (alx->qnapi[i] && alx->qnapi[i]->txq) alx 540 drivers/net/ethernet/atheros/alx/main.c alx_free_txring_buf(alx->qnapi[i]->txq); alx 542 drivers/net/ethernet/atheros/alx/main.c if (alx->qnapi[0] && alx->qnapi[0]->rxq) alx 543 drivers/net/ethernet/atheros/alx/main.c alx_free_rxring_buf(alx->qnapi[0]->rxq); alx 546 drivers/net/ethernet/atheros/alx/main.c static int alx_reinit_rings(struct alx_priv *alx) alx 548 drivers/net/ethernet/atheros/alx/main.c alx_free_buffers(alx); alx 550 drivers/net/ethernet/atheros/alx/main.c alx_init_ring_ptrs(alx); alx 552 drivers/net/ethernet/atheros/alx/main.c if (!alx_refill_rx_ring(alx, GFP_KERNEL)) alx 571 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = netdev_priv(netdev); alx 572 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 600 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = netdev_priv(netdev); alx 601 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 617 drivers/net/ethernet/atheros/alx/main.c static int alx_alloc_tx_ring(struct alx_priv *alx, struct alx_tx_queue *txq, alx 624 drivers/net/ethernet/atheros/alx/main.c txq->tpd = alx->descmem.virt + offset; alx 625 drivers/net/ethernet/atheros/alx/main.c txq->tpd_dma = alx->descmem.dma + offset; alx 631 drivers/net/ethernet/atheros/alx/main.c static int alx_alloc_rx_ring(struct alx_priv *alx, struct alx_rx_queue *rxq, alx 638 drivers/net/ethernet/atheros/alx/main.c rxq->rrd = alx->descmem.virt + offset; alx 639 drivers/net/ethernet/atheros/alx/main.c rxq->rrd_dma = alx->descmem.dma + offset; alx 642 drivers/net/ethernet/atheros/alx/main.c rxq->rfd = alx->descmem.virt + offset; alx 643 drivers/net/ethernet/atheros/alx/main.c rxq->rfd_dma = alx->descmem.dma + offset; alx 649 drivers/net/ethernet/atheros/alx/main.c static int alx_alloc_rings(struct alx_priv *alx) alx 659 drivers/net/ethernet/atheros/alx/main.c alx->descmem.size = sizeof(struct alx_txd) * alx->tx_ringsz * alx 660 drivers/net/ethernet/atheros/alx/main.c alx->num_txq + alx 661 drivers/net/ethernet/atheros/alx/main.c sizeof(struct alx_rrd) * alx->rx_ringsz + alx 662 drivers/net/ethernet/atheros/alx/main.c sizeof(struct alx_rfd) * alx->rx_ringsz; alx 663 drivers/net/ethernet/atheros/alx/main.c alx->descmem.virt = dma_alloc_coherent(&alx->hw.pdev->dev, alx 664 drivers/net/ethernet/atheros/alx/main.c alx->descmem.size, alx 665 drivers/net/ethernet/atheros/alx/main.c &alx->descmem.dma, GFP_KERNEL); alx 666 drivers/net/ethernet/atheros/alx/main.c if (!alx->descmem.virt) alx 673 drivers/net/ethernet/atheros/alx/main.c for (i = 0; i < alx->num_txq; i++) { alx 674 drivers/net/ethernet/atheros/alx/main.c offset = alx_alloc_tx_ring(alx, alx->qnapi[i]->txq, offset); alx 676 drivers/net/ethernet/atheros/alx/main.c netdev_err(alx->dev, "Allocation of tx buffer failed!\n"); alx 681 drivers/net/ethernet/atheros/alx/main.c offset = alx_alloc_rx_ring(alx, alx->qnapi[0]->rxq, offset); alx 683 drivers/net/ethernet/atheros/alx/main.c netdev_err(alx->dev, "Allocation of rx buffer failed!\n"); alx 690 drivers/net/ethernet/atheros/alx/main.c static void alx_free_rings(struct alx_priv *alx) alx 694 drivers/net/ethernet/atheros/alx/main.c alx_free_buffers(alx); alx 696 drivers/net/ethernet/atheros/alx/main.c for (i = 0; i < alx->num_txq; i++) alx 697 drivers/net/ethernet/atheros/alx/main.c if (alx->qnapi[i] && alx->qnapi[i]->txq) alx 698 drivers/net/ethernet/atheros/alx/main.c kfree(alx->qnapi[i]->txq->bufs); alx 700 drivers/net/ethernet/atheros/alx/main.c if (alx->qnapi[0] && alx->qnapi[0]->rxq) alx 701 drivers/net/ethernet/atheros/alx/main.c kfree(alx->qnapi[0]->rxq->bufs); alx 703 drivers/net/ethernet/atheros/alx/main.c if (alx->descmem.virt) alx 704 drivers/net/ethernet/atheros/alx/main.c dma_free_coherent(&alx->hw.pdev->dev, alx 705 drivers/net/ethernet/atheros/alx/main.c alx->descmem.size, alx 706 drivers/net/ethernet/atheros/alx/main.c alx->descmem.virt, alx 707 drivers/net/ethernet/atheros/alx/main.c alx->descmem.dma); alx 710 drivers/net/ethernet/atheros/alx/main.c static void alx_free_napis(struct alx_priv *alx) alx 715 drivers/net/ethernet/atheros/alx/main.c for (i = 0; i < alx->num_napi; i++) { alx 716 drivers/net/ethernet/atheros/alx/main.c np = alx->qnapi[i]; alx 724 drivers/net/ethernet/atheros/alx/main.c alx->qnapi[i] = NULL; alx 739 drivers/net/ethernet/atheros/alx/main.c static int alx_alloc_napis(struct alx_priv *alx) alx 746 drivers/net/ethernet/atheros/alx/main.c alx->int_mask &= ~ALX_ISR_ALL_QUEUES; alx 749 drivers/net/ethernet/atheros/alx/main.c for (i = 0; i < alx->num_napi; i++) { alx 754 drivers/net/ethernet/atheros/alx/main.c np->alx = alx; alx 755 drivers/net/ethernet/atheros/alx/main.c netif_napi_add(alx->dev, &np->napi, alx_poll, 64); alx 756 drivers/net/ethernet/atheros/alx/main.c alx->qnapi[i] = np; alx 760 drivers/net/ethernet/atheros/alx/main.c for (i = 0; i < alx->num_txq; i++) { alx 761 drivers/net/ethernet/atheros/alx/main.c np = alx->qnapi[i]; alx 770 drivers/net/ethernet/atheros/alx/main.c txq->count = alx->tx_ringsz; alx 771 drivers/net/ethernet/atheros/alx/main.c txq->netdev = alx->dev; alx 772 drivers/net/ethernet/atheros/alx/main.c txq->dev = &alx->hw.pdev->dev; alx 774 drivers/net/ethernet/atheros/alx/main.c alx->int_mask |= tx_vect_mask[i]; alx 778 drivers/net/ethernet/atheros/alx/main.c np = alx->qnapi[0]; alx 784 drivers/net/ethernet/atheros/alx/main.c rxq->np = alx->qnapi[0]; alx 786 drivers/net/ethernet/atheros/alx/main.c rxq->count = alx->rx_ringsz; alx 787 drivers/net/ethernet/atheros/alx/main.c rxq->netdev = alx->dev; alx 788 drivers/net/ethernet/atheros/alx/main.c rxq->dev = &alx->hw.pdev->dev; alx 790 drivers/net/ethernet/atheros/alx/main.c alx->int_mask |= rx_vect_mask[0]; alx 795 drivers/net/ethernet/atheros/alx/main.c netdev_err(alx->dev, "error allocating internal structures\n"); alx 796 drivers/net/ethernet/atheros/alx/main.c alx_free_napis(alx); alx 807 drivers/net/ethernet/atheros/alx/main.c static void alx_config_vector_mapping(struct alx_priv *alx) alx 809 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 813 drivers/net/ethernet/atheros/alx/main.c if (alx->hw.pdev->msix_enabled) { alx 815 drivers/net/ethernet/atheros/alx/main.c for (i = 0, vector = 1; i < alx->num_txq; i++, vector++) { alx 830 drivers/net/ethernet/atheros/alx/main.c static int alx_enable_msix(struct alx_priv *alx) alx 838 drivers/net/ethernet/atheros/alx/main.c err = pci_alloc_irq_vectors(alx->hw.pdev, num_vec, num_vec, alx 841 drivers/net/ethernet/atheros/alx/main.c netdev_warn(alx->dev, "Enabling MSI-X interrupts failed!\n"); alx 845 drivers/net/ethernet/atheros/alx/main.c alx->num_vec = num_vec; alx 846 drivers/net/ethernet/atheros/alx/main.c alx->num_napi = num_vec - 1; alx 847 drivers/net/ethernet/atheros/alx/main.c alx->num_txq = num_txq; alx 848 drivers/net/ethernet/atheros/alx/main.c alx->num_rxq = num_rxq; alx 853 drivers/net/ethernet/atheros/alx/main.c static int alx_request_msix(struct alx_priv *alx) alx 855 drivers/net/ethernet/atheros/alx/main.c struct net_device *netdev = alx->dev; alx 858 drivers/net/ethernet/atheros/alx/main.c err = request_irq(pci_irq_vector(alx->hw.pdev, 0), alx_intr_msix_misc, alx 859 drivers/net/ethernet/atheros/alx/main.c 0, netdev->name, alx); alx 863 drivers/net/ethernet/atheros/alx/main.c for (i = 0; i < alx->num_napi; i++) { alx 864 drivers/net/ethernet/atheros/alx/main.c struct alx_napi *np = alx->qnapi[i]; alx 881 drivers/net/ethernet/atheros/alx/main.c err = request_irq(pci_irq_vector(alx->hw.pdev, vector), alx 889 drivers/net/ethernet/atheros/alx/main.c free_irq(pci_irq_vector(alx->hw.pdev, free_vector++), alx); alx 893 drivers/net/ethernet/atheros/alx/main.c free_irq(pci_irq_vector(alx->hw.pdev,free_vector++), alx 894 drivers/net/ethernet/atheros/alx/main.c alx->qnapi[i]); alx 900 drivers/net/ethernet/atheros/alx/main.c static int alx_init_intr(struct alx_priv *alx) alx 904 drivers/net/ethernet/atheros/alx/main.c ret = pci_alloc_irq_vectors(alx->hw.pdev, 1, 1, alx 909 drivers/net/ethernet/atheros/alx/main.c alx->num_vec = 1; alx 910 drivers/net/ethernet/atheros/alx/main.c alx->num_napi = 1; alx 911 drivers/net/ethernet/atheros/alx/main.c alx->num_txq = 1; alx 912 drivers/net/ethernet/atheros/alx/main.c alx->num_rxq = 1; alx 916 drivers/net/ethernet/atheros/alx/main.c static void alx_irq_enable(struct alx_priv *alx) alx 918 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 923 drivers/net/ethernet/atheros/alx/main.c alx_write_mem32(hw, ALX_IMR, alx->int_mask); alx 926 drivers/net/ethernet/atheros/alx/main.c if (alx->hw.pdev->msix_enabled) { alx 928 drivers/net/ethernet/atheros/alx/main.c for (i = 0; i < alx->num_vec; i++) alx 933 drivers/net/ethernet/atheros/alx/main.c static void alx_irq_disable(struct alx_priv *alx) alx 935 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 942 drivers/net/ethernet/atheros/alx/main.c if (alx->hw.pdev->msix_enabled) { alx 943 drivers/net/ethernet/atheros/alx/main.c for (i = 0; i < alx->num_vec; i++) { alx 945 drivers/net/ethernet/atheros/alx/main.c synchronize_irq(pci_irq_vector(alx->hw.pdev, i)); alx 948 drivers/net/ethernet/atheros/alx/main.c synchronize_irq(pci_irq_vector(alx->hw.pdev, 0)); alx 952 drivers/net/ethernet/atheros/alx/main.c static int alx_realloc_resources(struct alx_priv *alx) alx 956 drivers/net/ethernet/atheros/alx/main.c alx_free_rings(alx); alx 957 drivers/net/ethernet/atheros/alx/main.c alx_free_napis(alx); alx 958 drivers/net/ethernet/atheros/alx/main.c pci_free_irq_vectors(alx->hw.pdev); alx 960 drivers/net/ethernet/atheros/alx/main.c err = alx_init_intr(alx); alx 964 drivers/net/ethernet/atheros/alx/main.c err = alx_alloc_napis(alx); alx 968 drivers/net/ethernet/atheros/alx/main.c err = alx_alloc_rings(alx); alx 975 drivers/net/ethernet/atheros/alx/main.c static int alx_request_irq(struct alx_priv *alx) alx 977 drivers/net/ethernet/atheros/alx/main.c struct pci_dev *pdev = alx->hw.pdev; alx 978 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 984 drivers/net/ethernet/atheros/alx/main.c if (alx->hw.pdev->msix_enabled) { alx 986 drivers/net/ethernet/atheros/alx/main.c err = alx_request_msix(alx); alx 991 drivers/net/ethernet/atheros/alx/main.c err = alx_realloc_resources(alx); alx 996 drivers/net/ethernet/atheros/alx/main.c if (alx->hw.pdev->msi_enabled) { alx 1000 drivers/net/ethernet/atheros/alx/main.c alx->dev->name, alx); alx 1005 drivers/net/ethernet/atheros/alx/main.c pci_free_irq_vectors(alx->hw.pdev); alx 1010 drivers/net/ethernet/atheros/alx/main.c alx->dev->name, alx); alx 1013 drivers/net/ethernet/atheros/alx/main.c alx_config_vector_mapping(alx); alx 1015 drivers/net/ethernet/atheros/alx/main.c netdev_err(alx->dev, "IRQ registration failed!\n"); alx 1019 drivers/net/ethernet/atheros/alx/main.c static void alx_free_irq(struct alx_priv *alx) alx 1021 drivers/net/ethernet/atheros/alx/main.c struct pci_dev *pdev = alx->hw.pdev; alx 1024 drivers/net/ethernet/atheros/alx/main.c free_irq(pci_irq_vector(pdev, 0), alx); alx 1025 drivers/net/ethernet/atheros/alx/main.c if (alx->hw.pdev->msix_enabled) { alx 1026 drivers/net/ethernet/atheros/alx/main.c for (i = 0; i < alx->num_napi; i++) alx 1027 drivers/net/ethernet/atheros/alx/main.c free_irq(pci_irq_vector(pdev, i + 1), alx->qnapi[i]); alx 1033 drivers/net/ethernet/atheros/alx/main.c static int alx_identify_hw(struct alx_priv *alx) alx 1035 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 1046 drivers/net/ethernet/atheros/alx/main.c static int alx_init_sw(struct alx_priv *alx) alx 1048 drivers/net/ethernet/atheros/alx/main.c struct pci_dev *pdev = alx->hw.pdev; alx 1049 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 1052 drivers/net/ethernet/atheros/alx/main.c err = alx_identify_hw(alx); alx 1058 drivers/net/ethernet/atheros/alx/main.c alx->hw.lnk_patch = alx 1065 drivers/net/ethernet/atheros/alx/main.c hw->mtu = alx->dev->mtu; alx 1066 drivers/net/ethernet/atheros/alx/main.c alx->rxbuf_size = ALX_MAX_FRAME_LEN(hw->mtu); alx 1068 drivers/net/ethernet/atheros/alx/main.c alx->dev->min_mtu = 34; alx 1069 drivers/net/ethernet/atheros/alx/main.c alx->dev->max_mtu = ALX_MAX_FRAME_LEN(ALX_MAX_FRAME_SIZE); alx 1070 drivers/net/ethernet/atheros/alx/main.c alx->tx_ringsz = 256; alx 1071 drivers/net/ethernet/atheros/alx/main.c alx->rx_ringsz = 512; alx 1073 drivers/net/ethernet/atheros/alx/main.c alx->int_mask = ALX_ISR_MISC; alx 1075 drivers/net/ethernet/atheros/alx/main.c hw->ith_tpd = alx->tx_ringsz / 3; alx 1108 drivers/net/ethernet/atheros/alx/main.c static void alx_netif_stop(struct alx_priv *alx) alx 1112 drivers/net/ethernet/atheros/alx/main.c netif_trans_update(alx->dev); alx 1113 drivers/net/ethernet/atheros/alx/main.c if (netif_carrier_ok(alx->dev)) { alx 1114 drivers/net/ethernet/atheros/alx/main.c netif_carrier_off(alx->dev); alx 1115 drivers/net/ethernet/atheros/alx/main.c netif_tx_disable(alx->dev); alx 1116 drivers/net/ethernet/atheros/alx/main.c for (i = 0; i < alx->num_napi; i++) alx 1117 drivers/net/ethernet/atheros/alx/main.c napi_disable(&alx->qnapi[i]->napi); alx 1121 drivers/net/ethernet/atheros/alx/main.c static void alx_halt(struct alx_priv *alx) alx 1123 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 1125 drivers/net/ethernet/atheros/alx/main.c alx_netif_stop(alx); alx 1133 drivers/net/ethernet/atheros/alx/main.c alx_irq_disable(alx); alx 1134 drivers/net/ethernet/atheros/alx/main.c alx_free_buffers(alx); alx 1137 drivers/net/ethernet/atheros/alx/main.c static void alx_configure(struct alx_priv *alx) alx 1139 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 1143 drivers/net/ethernet/atheros/alx/main.c __alx_set_rx_mode(alx->dev); alx 1148 drivers/net/ethernet/atheros/alx/main.c static void alx_activate(struct alx_priv *alx) alx 1151 drivers/net/ethernet/atheros/alx/main.c alx_reinit_rings(alx); alx 1152 drivers/net/ethernet/atheros/alx/main.c alx_configure(alx); alx 1155 drivers/net/ethernet/atheros/alx/main.c alx_write_mem32(&alx->hw, ALX_ISR, ~(u32)ALX_ISR_DIS); alx 1157 drivers/net/ethernet/atheros/alx/main.c alx_irq_enable(alx); alx 1159 drivers/net/ethernet/atheros/alx/main.c alx_schedule_link_check(alx); alx 1162 drivers/net/ethernet/atheros/alx/main.c static void alx_reinit(struct alx_priv *alx) alx 1166 drivers/net/ethernet/atheros/alx/main.c alx_halt(alx); alx 1167 drivers/net/ethernet/atheros/alx/main.c alx_activate(alx); alx 1172 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = netdev_priv(netdev); alx 1176 drivers/net/ethernet/atheros/alx/main.c alx->hw.mtu = mtu; alx 1177 drivers/net/ethernet/atheros/alx/main.c alx->rxbuf_size = max(max_frame, ALX_DEF_RXBUF_SIZE); alx 1180 drivers/net/ethernet/atheros/alx/main.c alx_reinit(alx); alx 1184 drivers/net/ethernet/atheros/alx/main.c static void alx_netif_start(struct alx_priv *alx) alx 1188 drivers/net/ethernet/atheros/alx/main.c netif_tx_wake_all_queues(alx->dev); alx 1189 drivers/net/ethernet/atheros/alx/main.c for (i = 0; i < alx->num_napi; i++) alx 1190 drivers/net/ethernet/atheros/alx/main.c napi_enable(&alx->qnapi[i]->napi); alx 1191 drivers/net/ethernet/atheros/alx/main.c netif_carrier_on(alx->dev); alx 1194 drivers/net/ethernet/atheros/alx/main.c static int __alx_open(struct alx_priv *alx, bool resume) alx 1198 drivers/net/ethernet/atheros/alx/main.c err = alx_enable_msix(alx); alx 1200 drivers/net/ethernet/atheros/alx/main.c err = alx_init_intr(alx); alx 1206 drivers/net/ethernet/atheros/alx/main.c netif_carrier_off(alx->dev); alx 1208 drivers/net/ethernet/atheros/alx/main.c err = alx_alloc_napis(alx); alx 1212 drivers/net/ethernet/atheros/alx/main.c err = alx_alloc_rings(alx); alx 1216 drivers/net/ethernet/atheros/alx/main.c alx_configure(alx); alx 1218 drivers/net/ethernet/atheros/alx/main.c err = alx_request_irq(alx); alx 1226 drivers/net/ethernet/atheros/alx/main.c alx_reinit_rings(alx); alx 1228 drivers/net/ethernet/atheros/alx/main.c netif_set_real_num_tx_queues(alx->dev, alx->num_txq); alx 1229 drivers/net/ethernet/atheros/alx/main.c netif_set_real_num_rx_queues(alx->dev, alx->num_rxq); alx 1232 drivers/net/ethernet/atheros/alx/main.c alx_write_mem32(&alx->hw, ALX_ISR, ~(u32)ALX_ISR_DIS); alx 1234 drivers/net/ethernet/atheros/alx/main.c alx_irq_enable(alx); alx 1237 drivers/net/ethernet/atheros/alx/main.c netif_tx_start_all_queues(alx->dev); alx 1239 drivers/net/ethernet/atheros/alx/main.c alx_schedule_link_check(alx); alx 1243 drivers/net/ethernet/atheros/alx/main.c alx_free_rings(alx); alx 1244 drivers/net/ethernet/atheros/alx/main.c alx_free_napis(alx); alx 1246 drivers/net/ethernet/atheros/alx/main.c pci_free_irq_vectors(alx->hw.pdev); alx 1250 drivers/net/ethernet/atheros/alx/main.c static void __alx_stop(struct alx_priv *alx) alx 1252 drivers/net/ethernet/atheros/alx/main.c alx_halt(alx); alx 1253 drivers/net/ethernet/atheros/alx/main.c alx_free_irq(alx); alx 1254 drivers/net/ethernet/atheros/alx/main.c alx_free_rings(alx); alx 1255 drivers/net/ethernet/atheros/alx/main.c alx_free_napis(alx); alx 1276 drivers/net/ethernet/atheros/alx/main.c static void alx_check_link(struct alx_priv *alx) alx 1278 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 1293 drivers/net/ethernet/atheros/alx/main.c spin_lock_irqsave(&alx->irq_lock, flags); alx 1294 drivers/net/ethernet/atheros/alx/main.c alx->int_mask |= ALX_ISR_PHY; alx 1295 drivers/net/ethernet/atheros/alx/main.c alx_write_mem32(hw, ALX_IMR, alx->int_mask); alx 1296 drivers/net/ethernet/atheros/alx/main.c spin_unlock_irqrestore(&alx->irq_lock, flags); alx 1302 drivers/net/ethernet/atheros/alx/main.c netif_info(alx, link, alx->dev, alx 1309 drivers/net/ethernet/atheros/alx/main.c alx_netif_start(alx); alx 1312 drivers/net/ethernet/atheros/alx/main.c alx_netif_stop(alx); alx 1313 drivers/net/ethernet/atheros/alx/main.c netif_info(alx, link, alx->dev, "Link Down\n"); alx 1317 drivers/net/ethernet/atheros/alx/main.c alx_irq_disable(alx); alx 1320 drivers/net/ethernet/atheros/alx/main.c err = alx_reinit_rings(alx); alx 1323 drivers/net/ethernet/atheros/alx/main.c alx_configure(alx); alx 1326 drivers/net/ethernet/atheros/alx/main.c alx_irq_enable(alx); alx 1332 drivers/net/ethernet/atheros/alx/main.c alx_schedule_reset(alx); alx 1348 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx; alx 1350 drivers/net/ethernet/atheros/alx/main.c alx = container_of(work, struct alx_priv, link_check_wk); alx 1353 drivers/net/ethernet/atheros/alx/main.c alx_check_link(alx); alx 1359 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = container_of(work, struct alx_priv, reset_wk); alx 1362 drivers/net/ethernet/atheros/alx/main.c alx_reinit(alx); alx 1510 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx; alx 1514 drivers/net/ethernet/atheros/alx/main.c alx = netdev_priv(txq->netdev); alx 1537 drivers/net/ethernet/atheros/alx/main.c alx_write_mem16(&alx->hw, txq->p_reg, txq->write_idx); alx 1552 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = netdev_priv(netdev); alx 1553 drivers/net/ethernet/atheros/alx/main.c return alx_start_xmit_ring(skb, alx_tx_queue_mapping(alx, skb)); alx 1558 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = netdev_priv(dev); alx 1560 drivers/net/ethernet/atheros/alx/main.c alx_schedule_reset(alx); alx 1566 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = netdev_priv(netdev); alx 1567 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 1587 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = netdev_priv(netdev); alx 1588 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 1601 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = netdev_priv(netdev); alx 1606 drivers/net/ethernet/atheros/alx/main.c return mdio_mii_ioctl(&alx->hw.mdio, if_mii(ifr), cmd); alx 1612 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = netdev_priv(netdev); alx 1615 drivers/net/ethernet/atheros/alx/main.c if (alx->hw.pdev->msix_enabled) { alx 1616 drivers/net/ethernet/atheros/alx/main.c alx_intr_msix_misc(0, alx); alx 1617 drivers/net/ethernet/atheros/alx/main.c for (i = 0; i < alx->num_txq; i++) alx 1618 drivers/net/ethernet/atheros/alx/main.c alx_intr_msix_ring(0, alx->qnapi[i]); alx 1619 drivers/net/ethernet/atheros/alx/main.c } else if (alx->hw.pdev->msi_enabled) alx 1620 drivers/net/ethernet/atheros/alx/main.c alx_intr_msi(0, alx); alx 1622 drivers/net/ethernet/atheros/alx/main.c alx_intr_legacy(0, alx); alx 1629 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = netdev_priv(dev); alx 1630 drivers/net/ethernet/atheros/alx/main.c struct alx_hw_stats *hw_stats = &alx->hw.stats; alx 1632 drivers/net/ethernet/atheros/alx/main.c spin_lock(&alx->stats_lock); alx 1634 drivers/net/ethernet/atheros/alx/main.c alx_update_hw_stats(&alx->hw); alx 1670 drivers/net/ethernet/atheros/alx/main.c spin_unlock(&alx->stats_lock); alx 1693 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx; alx 1733 drivers/net/ethernet/atheros/alx/main.c netdev = alloc_etherdev_mqs(sizeof(*alx), alx 1741 drivers/net/ethernet/atheros/alx/main.c alx = netdev_priv(netdev); alx 1742 drivers/net/ethernet/atheros/alx/main.c spin_lock_init(&alx->hw.mdio_lock); alx 1743 drivers/net/ethernet/atheros/alx/main.c spin_lock_init(&alx->irq_lock); alx 1744 drivers/net/ethernet/atheros/alx/main.c spin_lock_init(&alx->stats_lock); alx 1745 drivers/net/ethernet/atheros/alx/main.c alx->dev = netdev; alx 1746 drivers/net/ethernet/atheros/alx/main.c alx->hw.pdev = pdev; alx 1747 drivers/net/ethernet/atheros/alx/main.c alx->msg_enable = NETIF_MSG_LINK | NETIF_MSG_HW | NETIF_MSG_IFUP | alx 1749 drivers/net/ethernet/atheros/alx/main.c hw = &alx->hw; alx 1750 drivers/net/ethernet/atheros/alx/main.c pci_set_drvdata(pdev, alx); alx 1767 drivers/net/ethernet/atheros/alx/main.c err = alx_init_sw(alx); alx 1829 drivers/net/ethernet/atheros/alx/main.c INIT_WORK(&alx->link_check_wk, alx_link_check); alx 1830 drivers/net/ethernet/atheros/alx/main.c INIT_WORK(&alx->reset_wk, alx_reset); alx 1858 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = pci_get_drvdata(pdev); alx 1859 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 1861 drivers/net/ethernet/atheros/alx/main.c cancel_work_sync(&alx->link_check_wk); alx 1862 drivers/net/ethernet/atheros/alx/main.c cancel_work_sync(&alx->reset_wk); alx 1867 drivers/net/ethernet/atheros/alx/main.c unregister_netdev(alx->dev); alx 1874 drivers/net/ethernet/atheros/alx/main.c free_netdev(alx->dev); alx 1880 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = dev_get_drvdata(dev); alx 1882 drivers/net/ethernet/atheros/alx/main.c if (!netif_running(alx->dev)) alx 1884 drivers/net/ethernet/atheros/alx/main.c netif_device_detach(alx->dev); alx 1885 drivers/net/ethernet/atheros/alx/main.c __alx_stop(alx); alx 1891 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = dev_get_drvdata(dev); alx 1892 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 1897 drivers/net/ethernet/atheros/alx/main.c if (!netif_running(alx->dev)) alx 1899 drivers/net/ethernet/atheros/alx/main.c netif_device_attach(alx->dev); alx 1902 drivers/net/ethernet/atheros/alx/main.c err = __alx_open(alx, true); alx 1918 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = pci_get_drvdata(pdev); alx 1919 drivers/net/ethernet/atheros/alx/main.c struct net_device *netdev = alx->dev; alx 1928 drivers/net/ethernet/atheros/alx/main.c alx_halt(alx); alx 1943 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = pci_get_drvdata(pdev); alx 1944 drivers/net/ethernet/atheros/alx/main.c struct alx_hw *hw = &alx->hw; alx 1969 drivers/net/ethernet/atheros/alx/main.c struct alx_priv *alx = pci_get_drvdata(pdev); alx 1970 drivers/net/ethernet/atheros/alx/main.c struct net_device *netdev = alx->dev; alx 1977 drivers/net/ethernet/atheros/alx/main.c alx_activate(alx);