linux/drivers/net/ethernet/atheros/alx/main.c

/*
 * Copyright (c) 2013, 2021 Johannes Berg <[email protected]>
 *
 *  This file is free software: you may copy, redistribute and/or modify it
 *  under the terms of the GNU General Public License as published by the
 *  Free Software Foundation, either version 2 of the License, or (at your
 *  option) any later version.
 *
 *  This file is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * This file incorporates work covered by the following copyright and
 * permission notice:
 *
 * Copyright (c) 2012 Qualcomm Atheros, Inc.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include <linux/module.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/if_vlan.h>
#include <linux/mdio.h>
#include <linux/bitops.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <net/ip6_checksum.h>
#include <linux/crc32.h>
#include "alx.h"
#include "hw.h"
#include "reg.h"

static const char alx_drv_name[] =;

static void alx_free_txbuf(struct alx_tx_queue *txq, int entry)
{}

static int alx_refill_rx_ring(struct alx_priv *alx, gfp_t gfp)
{}

static struct alx_tx_queue *alx_tx_queue_mapping(struct alx_priv *alx,
						 struct sk_buff *skb)
{}

static struct netdev_queue *alx_get_tx_queue(const struct alx_tx_queue *txq)
{}

static inline int alx_tpd_avail(struct alx_tx_queue *txq)
{}

static bool alx_clean_tx_irq(struct alx_tx_queue *txq)
{}

static void alx_schedule_link_check(struct alx_priv *alx)
{}

static void alx_schedule_reset(struct alx_priv *alx)
{}

static int alx_clean_rx_irq(struct alx_rx_queue *rxq, int budget)
{}

static int alx_poll(struct napi_struct *napi, int budget)
{}

static bool alx_intr_handle_misc(struct alx_priv *alx, u32 intr)
{}

static irqreturn_t alx_intr_handle(struct alx_priv *alx, u32 intr)
{}

static irqreturn_t alx_intr_msix_ring(int irq, void *data)
{}

static irqreturn_t alx_intr_msix_misc(int irq, void *data)
{}

static irqreturn_t alx_intr_msi(int irq, void *data)
{}

static irqreturn_t alx_intr_legacy(int irq, void *data)
{}

static const u16 txring_header_reg[] =;

static void alx_init_ring_ptrs(struct alx_priv *alx)
{}

static void alx_free_txring_buf(struct alx_tx_queue *txq)
{}

static void alx_free_rxring_buf(struct alx_rx_queue *rxq)
{}

static void alx_free_buffers(struct alx_priv *alx)
{}

static int alx_reinit_rings(struct alx_priv *alx)
{}

static void alx_add_mc_addr(struct alx_hw *hw, const u8 *addr, u32 *mc_hash)
{}

static void __alx_set_rx_mode(struct net_device *netdev)
{}

static void alx_set_rx_mode(struct net_device *netdev)
{}

static int alx_set_mac_address(struct net_device *netdev, void *data)
{}

static int alx_alloc_tx_ring(struct alx_priv *alx, struct alx_tx_queue *txq,
			     int offset)
{}

static int alx_alloc_rx_ring(struct alx_priv *alx, struct alx_rx_queue *rxq,
			     int offset)
{}

static int alx_alloc_rings(struct alx_priv *alx)
{}

static void alx_free_rings(struct alx_priv *alx)
{}

static void alx_free_napis(struct alx_priv *alx)
{}

static const u16 tx_pidx_reg[] =;
static const u16 tx_cidx_reg[] =;
static const u32 tx_vect_mask[] =;
static const u32 rx_vect_mask[] =;

static int alx_alloc_napis(struct alx_priv *alx)
{}

static const int txq_vec_mapping_shift[] =;

static void alx_config_vector_mapping(struct alx_priv *alx)
{}

static int alx_enable_msix(struct alx_priv *alx)
{}

static int alx_request_msix(struct alx_priv *alx)
{}

static int alx_init_intr(struct alx_priv *alx)
{}

static void alx_irq_enable(struct alx_priv *alx)
{}

static void alx_irq_disable(struct alx_priv *alx)
{}

static int alx_realloc_resources(struct alx_priv *alx)
{}

static int alx_request_irq(struct alx_priv *alx)
{}

static void alx_free_irq(struct alx_priv *alx)
{}

static int alx_identify_hw(struct alx_priv *alx)
{}

static int alx_init_sw(struct alx_priv *alx)
{}


static netdev_features_t alx_fix_features(struct net_device *netdev,
					  netdev_features_t features)
{}

static void alx_netif_stop(struct alx_priv *alx)
{}

static void alx_halt(struct alx_priv *alx)
{}

static void alx_configure(struct alx_priv *alx)
{}

static void alx_activate(struct alx_priv *alx)
{}

static void alx_reinit(struct alx_priv *alx)
{}

static int alx_change_mtu(struct net_device *netdev, int mtu)
{}

static void alx_netif_start(struct alx_priv *alx)
{}

static int __alx_open(struct alx_priv *alx, bool resume)
{}

static void __alx_stop(struct alx_priv *alx)
{}

static const char *alx_speed_desc(struct alx_hw *hw)
{}

static void alx_check_link(struct alx_priv *alx)
{}

static int alx_open(struct net_device *netdev)
{}

static int alx_stop(struct net_device *netdev)
{}

static void alx_link_check(struct work_struct *work)
{}

static void alx_reset(struct work_struct *work)
{}

static int alx_tpd_req(struct sk_buff *skb)
{}

static int alx_tx_csum(struct sk_buff *skb, struct alx_txd *first)
{}

static int alx_tso(struct sk_buff *skb, struct alx_txd *first)
{}

static int alx_map_tx_skb(struct alx_tx_queue *txq, struct sk_buff *skb)
{}

static netdev_tx_t alx_start_xmit_ring(struct sk_buff *skb,
				       struct alx_tx_queue *txq)
{}

static netdev_tx_t alx_start_xmit(struct sk_buff *skb,
				  struct net_device *netdev)
{}

static void alx_tx_timeout(struct net_device *dev, unsigned int txqueue)
{}

static int alx_mdio_read(struct net_device *netdev,
			 int prtad, int devad, u16 addr)
{}

static int alx_mdio_write(struct net_device *netdev,
			  int prtad, int devad, u16 addr, u16 val)
{}

static int alx_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
{}

#ifdef CONFIG_NET_POLL_CONTROLLER
static void alx_poll_controller(struct net_device *netdev)
{}
#endif

static void alx_get_stats64(struct net_device *dev,
			    struct rtnl_link_stats64 *net_stats)
{}

static const struct net_device_ops alx_netdev_ops =;

static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{}

static void alx_remove(struct pci_dev *pdev)
{}

static int alx_suspend(struct device *dev)
{}

static int alx_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume);

static pci_ers_result_t alx_pci_error_detected(struct pci_dev *pdev,
					       pci_channel_state_t state)
{}

static pci_ers_result_t alx_pci_error_slot_reset(struct pci_dev *pdev)
{}

static void alx_pci_error_resume(struct pci_dev *pdev)
{}

static const struct pci_error_handlers alx_err_handlers =;

static const struct pci_device_id alx_pci_tbl[] =;

static struct pci_driver alx_driver =;

module_pci_driver();
MODULE_DEVICE_TABLE(pci, alx_pci_tbl);
MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();