18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* Copyright(c) 1999 - 2006 Intel Corporation. */ 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci/* Linux PRO/1000 Ethernet Driver main header file */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#ifndef _E1000_H_ 78c2ecf20Sopenharmony_ci#define _E1000_H_ 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#include <linux/stddef.h> 108c2ecf20Sopenharmony_ci#include <linux/module.h> 118c2ecf20Sopenharmony_ci#include <linux/types.h> 128c2ecf20Sopenharmony_ci#include <asm/byteorder.h> 138c2ecf20Sopenharmony_ci#include <linux/mm.h> 148c2ecf20Sopenharmony_ci#include <linux/errno.h> 158c2ecf20Sopenharmony_ci#include <linux/ioport.h> 168c2ecf20Sopenharmony_ci#include <linux/pci.h> 178c2ecf20Sopenharmony_ci#include <linux/kernel.h> 188c2ecf20Sopenharmony_ci#include <linux/netdevice.h> 198c2ecf20Sopenharmony_ci#include <linux/etherdevice.h> 208c2ecf20Sopenharmony_ci#include <linux/skbuff.h> 218c2ecf20Sopenharmony_ci#include <linux/delay.h> 228c2ecf20Sopenharmony_ci#include <linux/timer.h> 238c2ecf20Sopenharmony_ci#include <linux/slab.h> 248c2ecf20Sopenharmony_ci#include <linux/vmalloc.h> 258c2ecf20Sopenharmony_ci#include <linux/interrupt.h> 268c2ecf20Sopenharmony_ci#include <linux/string.h> 278c2ecf20Sopenharmony_ci#include <linux/pagemap.h> 288c2ecf20Sopenharmony_ci#include <linux/dma-mapping.h> 298c2ecf20Sopenharmony_ci#include <linux/bitops.h> 308c2ecf20Sopenharmony_ci#include <asm/io.h> 318c2ecf20Sopenharmony_ci#include <asm/irq.h> 328c2ecf20Sopenharmony_ci#include <linux/capability.h> 338c2ecf20Sopenharmony_ci#include <linux/in.h> 348c2ecf20Sopenharmony_ci#include <linux/ip.h> 358c2ecf20Sopenharmony_ci#include <linux/ipv6.h> 368c2ecf20Sopenharmony_ci#include <linux/tcp.h> 378c2ecf20Sopenharmony_ci#include <linux/udp.h> 388c2ecf20Sopenharmony_ci#include <net/pkt_sched.h> 398c2ecf20Sopenharmony_ci#include <linux/list.h> 408c2ecf20Sopenharmony_ci#include <linux/reboot.h> 418c2ecf20Sopenharmony_ci#include <net/checksum.h> 428c2ecf20Sopenharmony_ci#include <linux/mii.h> 438c2ecf20Sopenharmony_ci#include <linux/ethtool.h> 448c2ecf20Sopenharmony_ci#include <linux/if_vlan.h> 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci#define BAR_0 0 478c2ecf20Sopenharmony_ci#define BAR_1 1 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci#define INTEL_E1000_ETHERNET_DEVICE(device_id) {\ 508c2ecf20Sopenharmony_ci PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)} 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_cistruct e1000_adapter; 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci#include "e1000_hw.h" 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci#define E1000_MAX_INTR 10 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci/* 598c2ecf20Sopenharmony_ci * Count for polling __E1000_RESET condition every 10-20msec. 608c2ecf20Sopenharmony_ci */ 618c2ecf20Sopenharmony_ci#define E1000_CHECK_RESET_COUNT 50 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci/* TX/RX descriptor defines */ 648c2ecf20Sopenharmony_ci#define E1000_DEFAULT_TXD 256 658c2ecf20Sopenharmony_ci#define E1000_MAX_TXD 256 668c2ecf20Sopenharmony_ci#define E1000_MIN_TXD 48 678c2ecf20Sopenharmony_ci#define E1000_MAX_82544_TXD 4096 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci#define E1000_DEFAULT_RXD 256 708c2ecf20Sopenharmony_ci#define E1000_MAX_RXD 256 718c2ecf20Sopenharmony_ci#define E1000_MIN_RXD 48 728c2ecf20Sopenharmony_ci#define E1000_MAX_82544_RXD 4096 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci#define E1000_MIN_ITR_USECS 10 /* 100000 irq/sec */ 758c2ecf20Sopenharmony_ci#define E1000_MAX_ITR_USECS 10000 /* 100 irq/sec */ 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci/* this is the size past which hardware will drop packets when setting LPE=0 */ 788c2ecf20Sopenharmony_ci#define MAXIMUM_ETHERNET_VLAN_SIZE 1522 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci/* Supported Rx Buffer Sizes */ 818c2ecf20Sopenharmony_ci#define E1000_RXBUFFER_128 128 /* Used for packet split */ 828c2ecf20Sopenharmony_ci#define E1000_RXBUFFER_256 256 /* Used for packet split */ 838c2ecf20Sopenharmony_ci#define E1000_RXBUFFER_512 512 848c2ecf20Sopenharmony_ci#define E1000_RXBUFFER_1024 1024 858c2ecf20Sopenharmony_ci#define E1000_RXBUFFER_2048 2048 868c2ecf20Sopenharmony_ci#define E1000_RXBUFFER_4096 4096 878c2ecf20Sopenharmony_ci#define E1000_RXBUFFER_8192 8192 888c2ecf20Sopenharmony_ci#define E1000_RXBUFFER_16384 16384 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_ci/* SmartSpeed delimiters */ 918c2ecf20Sopenharmony_ci#define E1000_SMARTSPEED_DOWNSHIFT 3 928c2ecf20Sopenharmony_ci#define E1000_SMARTSPEED_MAX 15 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci/* Packet Buffer allocations */ 958c2ecf20Sopenharmony_ci#define E1000_PBA_BYTES_SHIFT 0xA 968c2ecf20Sopenharmony_ci#define E1000_TX_HEAD_ADDR_SHIFT 7 978c2ecf20Sopenharmony_ci#define E1000_PBA_TX_MASK 0xFFFF0000 988c2ecf20Sopenharmony_ci 998c2ecf20Sopenharmony_ci/* Flow Control Watermarks */ 1008c2ecf20Sopenharmony_ci#define E1000_FC_HIGH_DIFF 0x1638 /* High: 5688 bytes below Rx FIFO size */ 1018c2ecf20Sopenharmony_ci#define E1000_FC_LOW_DIFF 0x1640 /* Low: 5696 bytes below Rx FIFO size */ 1028c2ecf20Sopenharmony_ci 1038c2ecf20Sopenharmony_ci#define E1000_FC_PAUSE_TIME 0xFFFF /* pause for the max or until send xon */ 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ci/* How many Tx Descriptors do we need to call netif_wake_queue ? */ 1068c2ecf20Sopenharmony_ci#define E1000_TX_QUEUE_WAKE 16 1078c2ecf20Sopenharmony_ci/* How many Rx Buffers do we bundle into one write to the hardware ? */ 1088c2ecf20Sopenharmony_ci#define E1000_RX_BUFFER_WRITE 16 /* Must be power of 2 */ 1098c2ecf20Sopenharmony_ci 1108c2ecf20Sopenharmony_ci#define AUTO_ALL_MODES 0 1118c2ecf20Sopenharmony_ci#define E1000_EEPROM_82544_APM 0x0004 1128c2ecf20Sopenharmony_ci#define E1000_EEPROM_APME 0x0400 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_ci#ifndef E1000_MASTER_SLAVE 1158c2ecf20Sopenharmony_ci/* Switch to override PHY master/slave setting */ 1168c2ecf20Sopenharmony_ci#define E1000_MASTER_SLAVE e1000_ms_hw_default 1178c2ecf20Sopenharmony_ci#endif 1188c2ecf20Sopenharmony_ci 1198c2ecf20Sopenharmony_ci#define E1000_MNG_VLAN_NONE (-1) 1208c2ecf20Sopenharmony_ci 1218c2ecf20Sopenharmony_ci/* wrapper around a pointer to a socket buffer, 1228c2ecf20Sopenharmony_ci * so a DMA handle can be stored along with the buffer 1238c2ecf20Sopenharmony_ci */ 1248c2ecf20Sopenharmony_cistruct e1000_tx_buffer { 1258c2ecf20Sopenharmony_ci struct sk_buff *skb; 1268c2ecf20Sopenharmony_ci dma_addr_t dma; 1278c2ecf20Sopenharmony_ci unsigned long time_stamp; 1288c2ecf20Sopenharmony_ci u16 length; 1298c2ecf20Sopenharmony_ci u16 next_to_watch; 1308c2ecf20Sopenharmony_ci bool mapped_as_page; 1318c2ecf20Sopenharmony_ci unsigned short segs; 1328c2ecf20Sopenharmony_ci unsigned int bytecount; 1338c2ecf20Sopenharmony_ci}; 1348c2ecf20Sopenharmony_ci 1358c2ecf20Sopenharmony_cistruct e1000_rx_buffer { 1368c2ecf20Sopenharmony_ci union { 1378c2ecf20Sopenharmony_ci struct page *page; /* jumbo: alloc_page */ 1388c2ecf20Sopenharmony_ci u8 *data; /* else, netdev_alloc_frag */ 1398c2ecf20Sopenharmony_ci } rxbuf; 1408c2ecf20Sopenharmony_ci dma_addr_t dma; 1418c2ecf20Sopenharmony_ci}; 1428c2ecf20Sopenharmony_ci 1438c2ecf20Sopenharmony_cistruct e1000_tx_ring { 1448c2ecf20Sopenharmony_ci /* pointer to the descriptor ring memory */ 1458c2ecf20Sopenharmony_ci void *desc; 1468c2ecf20Sopenharmony_ci /* physical address of the descriptor ring */ 1478c2ecf20Sopenharmony_ci dma_addr_t dma; 1488c2ecf20Sopenharmony_ci /* length of descriptor ring in bytes */ 1498c2ecf20Sopenharmony_ci unsigned int size; 1508c2ecf20Sopenharmony_ci /* number of descriptors in the ring */ 1518c2ecf20Sopenharmony_ci unsigned int count; 1528c2ecf20Sopenharmony_ci /* next descriptor to associate a buffer with */ 1538c2ecf20Sopenharmony_ci unsigned int next_to_use; 1548c2ecf20Sopenharmony_ci /* next descriptor to check for DD status bit */ 1558c2ecf20Sopenharmony_ci unsigned int next_to_clean; 1568c2ecf20Sopenharmony_ci /* array of buffer information structs */ 1578c2ecf20Sopenharmony_ci struct e1000_tx_buffer *buffer_info; 1588c2ecf20Sopenharmony_ci 1598c2ecf20Sopenharmony_ci u16 tdh; 1608c2ecf20Sopenharmony_ci u16 tdt; 1618c2ecf20Sopenharmony_ci bool last_tx_tso; 1628c2ecf20Sopenharmony_ci}; 1638c2ecf20Sopenharmony_ci 1648c2ecf20Sopenharmony_cistruct e1000_rx_ring { 1658c2ecf20Sopenharmony_ci /* pointer to the descriptor ring memory */ 1668c2ecf20Sopenharmony_ci void *desc; 1678c2ecf20Sopenharmony_ci /* physical address of the descriptor ring */ 1688c2ecf20Sopenharmony_ci dma_addr_t dma; 1698c2ecf20Sopenharmony_ci /* length of descriptor ring in bytes */ 1708c2ecf20Sopenharmony_ci unsigned int size; 1718c2ecf20Sopenharmony_ci /* number of descriptors in the ring */ 1728c2ecf20Sopenharmony_ci unsigned int count; 1738c2ecf20Sopenharmony_ci /* next descriptor to associate a buffer with */ 1748c2ecf20Sopenharmony_ci unsigned int next_to_use; 1758c2ecf20Sopenharmony_ci /* next descriptor to check for DD status bit */ 1768c2ecf20Sopenharmony_ci unsigned int next_to_clean; 1778c2ecf20Sopenharmony_ci /* array of buffer information structs */ 1788c2ecf20Sopenharmony_ci struct e1000_rx_buffer *buffer_info; 1798c2ecf20Sopenharmony_ci struct sk_buff *rx_skb_top; 1808c2ecf20Sopenharmony_ci 1818c2ecf20Sopenharmony_ci /* cpu for rx queue */ 1828c2ecf20Sopenharmony_ci int cpu; 1838c2ecf20Sopenharmony_ci 1848c2ecf20Sopenharmony_ci u16 rdh; 1858c2ecf20Sopenharmony_ci u16 rdt; 1868c2ecf20Sopenharmony_ci}; 1878c2ecf20Sopenharmony_ci 1888c2ecf20Sopenharmony_ci#define E1000_DESC_UNUSED(R) \ 1898c2ecf20Sopenharmony_ci({ \ 1908c2ecf20Sopenharmony_ci unsigned int clean = smp_load_acquire(&(R)->next_to_clean); \ 1918c2ecf20Sopenharmony_ci unsigned int use = READ_ONCE((R)->next_to_use); \ 1928c2ecf20Sopenharmony_ci (clean > use ? 0 : (R)->count) + clean - use - 1; \ 1938c2ecf20Sopenharmony_ci}) 1948c2ecf20Sopenharmony_ci 1958c2ecf20Sopenharmony_ci#define E1000_RX_DESC_EXT(R, i) \ 1968c2ecf20Sopenharmony_ci (&(((union e1000_rx_desc_extended *)((R).desc))[i])) 1978c2ecf20Sopenharmony_ci#define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i])) 1988c2ecf20Sopenharmony_ci#define E1000_RX_DESC(R, i) E1000_GET_DESC(R, i, e1000_rx_desc) 1998c2ecf20Sopenharmony_ci#define E1000_TX_DESC(R, i) E1000_GET_DESC(R, i, e1000_tx_desc) 2008c2ecf20Sopenharmony_ci#define E1000_CONTEXT_DESC(R, i) E1000_GET_DESC(R, i, e1000_context_desc) 2018c2ecf20Sopenharmony_ci 2028c2ecf20Sopenharmony_ci/* board specific private data structure */ 2038c2ecf20Sopenharmony_ci 2048c2ecf20Sopenharmony_cistruct e1000_adapter { 2058c2ecf20Sopenharmony_ci unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; 2068c2ecf20Sopenharmony_ci u16 mng_vlan_id; 2078c2ecf20Sopenharmony_ci u32 bd_number; 2088c2ecf20Sopenharmony_ci u32 rx_buffer_len; 2098c2ecf20Sopenharmony_ci u32 wol; 2108c2ecf20Sopenharmony_ci u32 smartspeed; 2118c2ecf20Sopenharmony_ci u32 en_mng_pt; 2128c2ecf20Sopenharmony_ci u16 link_speed; 2138c2ecf20Sopenharmony_ci u16 link_duplex; 2148c2ecf20Sopenharmony_ci spinlock_t stats_lock; 2158c2ecf20Sopenharmony_ci unsigned int total_tx_bytes; 2168c2ecf20Sopenharmony_ci unsigned int total_tx_packets; 2178c2ecf20Sopenharmony_ci unsigned int total_rx_bytes; 2188c2ecf20Sopenharmony_ci unsigned int total_rx_packets; 2198c2ecf20Sopenharmony_ci /* Interrupt Throttle Rate */ 2208c2ecf20Sopenharmony_ci u32 itr; 2218c2ecf20Sopenharmony_ci u32 itr_setting; 2228c2ecf20Sopenharmony_ci u16 tx_itr; 2238c2ecf20Sopenharmony_ci u16 rx_itr; 2248c2ecf20Sopenharmony_ci 2258c2ecf20Sopenharmony_ci u8 fc_autoneg; 2268c2ecf20Sopenharmony_ci 2278c2ecf20Sopenharmony_ci /* TX */ 2288c2ecf20Sopenharmony_ci struct e1000_tx_ring *tx_ring; /* One per active queue */ 2298c2ecf20Sopenharmony_ci unsigned int restart_queue; 2308c2ecf20Sopenharmony_ci u32 txd_cmd; 2318c2ecf20Sopenharmony_ci u32 tx_int_delay; 2328c2ecf20Sopenharmony_ci u32 tx_abs_int_delay; 2338c2ecf20Sopenharmony_ci u32 gotcl; 2348c2ecf20Sopenharmony_ci u64 gotcl_old; 2358c2ecf20Sopenharmony_ci u64 tpt_old; 2368c2ecf20Sopenharmony_ci u64 colc_old; 2378c2ecf20Sopenharmony_ci u32 tx_timeout_count; 2388c2ecf20Sopenharmony_ci u32 tx_fifo_head; 2398c2ecf20Sopenharmony_ci u32 tx_head_addr; 2408c2ecf20Sopenharmony_ci u32 tx_fifo_size; 2418c2ecf20Sopenharmony_ci u8 tx_timeout_factor; 2428c2ecf20Sopenharmony_ci atomic_t tx_fifo_stall; 2438c2ecf20Sopenharmony_ci bool pcix_82544; 2448c2ecf20Sopenharmony_ci bool detect_tx_hung; 2458c2ecf20Sopenharmony_ci bool dump_buffers; 2468c2ecf20Sopenharmony_ci 2478c2ecf20Sopenharmony_ci /* RX */ 2488c2ecf20Sopenharmony_ci bool (*clean_rx)(struct e1000_adapter *adapter, 2498c2ecf20Sopenharmony_ci struct e1000_rx_ring *rx_ring, 2508c2ecf20Sopenharmony_ci int *work_done, int work_to_do); 2518c2ecf20Sopenharmony_ci void (*alloc_rx_buf)(struct e1000_adapter *adapter, 2528c2ecf20Sopenharmony_ci struct e1000_rx_ring *rx_ring, 2538c2ecf20Sopenharmony_ci int cleaned_count); 2548c2ecf20Sopenharmony_ci struct e1000_rx_ring *rx_ring; /* One per active queue */ 2558c2ecf20Sopenharmony_ci struct napi_struct napi; 2568c2ecf20Sopenharmony_ci 2578c2ecf20Sopenharmony_ci int num_tx_queues; 2588c2ecf20Sopenharmony_ci int num_rx_queues; 2598c2ecf20Sopenharmony_ci 2608c2ecf20Sopenharmony_ci u64 hw_csum_err; 2618c2ecf20Sopenharmony_ci u64 hw_csum_good; 2628c2ecf20Sopenharmony_ci u32 alloc_rx_buff_failed; 2638c2ecf20Sopenharmony_ci u32 rx_int_delay; 2648c2ecf20Sopenharmony_ci u32 rx_abs_int_delay; 2658c2ecf20Sopenharmony_ci bool rx_csum; 2668c2ecf20Sopenharmony_ci u32 gorcl; 2678c2ecf20Sopenharmony_ci u64 gorcl_old; 2688c2ecf20Sopenharmony_ci 2698c2ecf20Sopenharmony_ci /* OS defined structs */ 2708c2ecf20Sopenharmony_ci struct net_device *netdev; 2718c2ecf20Sopenharmony_ci struct pci_dev *pdev; 2728c2ecf20Sopenharmony_ci 2738c2ecf20Sopenharmony_ci /* structs defined in e1000_hw.h */ 2748c2ecf20Sopenharmony_ci struct e1000_hw hw; 2758c2ecf20Sopenharmony_ci struct e1000_hw_stats stats; 2768c2ecf20Sopenharmony_ci struct e1000_phy_info phy_info; 2778c2ecf20Sopenharmony_ci struct e1000_phy_stats phy_stats; 2788c2ecf20Sopenharmony_ci 2798c2ecf20Sopenharmony_ci u32 test_icr; 2808c2ecf20Sopenharmony_ci struct e1000_tx_ring test_tx_ring; 2818c2ecf20Sopenharmony_ci struct e1000_rx_ring test_rx_ring; 2828c2ecf20Sopenharmony_ci 2838c2ecf20Sopenharmony_ci int msg_enable; 2848c2ecf20Sopenharmony_ci 2858c2ecf20Sopenharmony_ci /* to not mess up cache alignment, always add to the bottom */ 2868c2ecf20Sopenharmony_ci bool tso_force; 2878c2ecf20Sopenharmony_ci bool smart_power_down; /* phy smart power down */ 2888c2ecf20Sopenharmony_ci bool quad_port_a; 2898c2ecf20Sopenharmony_ci unsigned long flags; 2908c2ecf20Sopenharmony_ci u32 eeprom_wol; 2918c2ecf20Sopenharmony_ci 2928c2ecf20Sopenharmony_ci /* for ioport free */ 2938c2ecf20Sopenharmony_ci int bars; 2948c2ecf20Sopenharmony_ci int need_ioport; 2958c2ecf20Sopenharmony_ci 2968c2ecf20Sopenharmony_ci bool discarding; 2978c2ecf20Sopenharmony_ci 2988c2ecf20Sopenharmony_ci struct work_struct reset_task; 2998c2ecf20Sopenharmony_ci struct delayed_work watchdog_task; 3008c2ecf20Sopenharmony_ci struct delayed_work fifo_stall_task; 3018c2ecf20Sopenharmony_ci struct delayed_work phy_info_task; 3028c2ecf20Sopenharmony_ci}; 3038c2ecf20Sopenharmony_ci 3048c2ecf20Sopenharmony_cienum e1000_state_t { 3058c2ecf20Sopenharmony_ci __E1000_TESTING, 3068c2ecf20Sopenharmony_ci __E1000_RESETTING, 3078c2ecf20Sopenharmony_ci __E1000_DOWN, 3088c2ecf20Sopenharmony_ci __E1000_DISABLED 3098c2ecf20Sopenharmony_ci}; 3108c2ecf20Sopenharmony_ci 3118c2ecf20Sopenharmony_ci#undef pr_fmt 3128c2ecf20Sopenharmony_ci#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 3138c2ecf20Sopenharmony_ci 3148c2ecf20Sopenharmony_cistruct net_device *e1000_get_hw_dev(struct e1000_hw *hw); 3158c2ecf20Sopenharmony_ci#define e_dbg(format, arg...) \ 3168c2ecf20Sopenharmony_ci netdev_dbg(e1000_get_hw_dev(hw), format, ## arg) 3178c2ecf20Sopenharmony_ci#define e_err(msglvl, format, arg...) \ 3188c2ecf20Sopenharmony_ci netif_err(adapter, msglvl, adapter->netdev, format, ## arg) 3198c2ecf20Sopenharmony_ci#define e_info(msglvl, format, arg...) \ 3208c2ecf20Sopenharmony_ci netif_info(adapter, msglvl, adapter->netdev, format, ## arg) 3218c2ecf20Sopenharmony_ci#define e_warn(msglvl, format, arg...) \ 3228c2ecf20Sopenharmony_ci netif_warn(adapter, msglvl, adapter->netdev, format, ## arg) 3238c2ecf20Sopenharmony_ci#define e_notice(msglvl, format, arg...) \ 3248c2ecf20Sopenharmony_ci netif_notice(adapter, msglvl, adapter->netdev, format, ## arg) 3258c2ecf20Sopenharmony_ci#define e_dev_info(format, arg...) \ 3268c2ecf20Sopenharmony_ci dev_info(&adapter->pdev->dev, format, ## arg) 3278c2ecf20Sopenharmony_ci#define e_dev_warn(format, arg...) \ 3288c2ecf20Sopenharmony_ci dev_warn(&adapter->pdev->dev, format, ## arg) 3298c2ecf20Sopenharmony_ci#define e_dev_err(format, arg...) \ 3308c2ecf20Sopenharmony_ci dev_err(&adapter->pdev->dev, format, ## arg) 3318c2ecf20Sopenharmony_ci 3328c2ecf20Sopenharmony_ciextern char e1000_driver_name[]; 3338c2ecf20Sopenharmony_ci 3348c2ecf20Sopenharmony_ciint e1000_open(struct net_device *netdev); 3358c2ecf20Sopenharmony_ciint e1000_close(struct net_device *netdev); 3368c2ecf20Sopenharmony_ciint e1000_up(struct e1000_adapter *adapter); 3378c2ecf20Sopenharmony_civoid e1000_down(struct e1000_adapter *adapter); 3388c2ecf20Sopenharmony_civoid e1000_reinit_locked(struct e1000_adapter *adapter); 3398c2ecf20Sopenharmony_civoid e1000_reset(struct e1000_adapter *adapter); 3408c2ecf20Sopenharmony_ciint e1000_set_spd_dplx(struct e1000_adapter *adapter, u32 spd, u8 dplx); 3418c2ecf20Sopenharmony_ciint e1000_setup_all_rx_resources(struct e1000_adapter *adapter); 3428c2ecf20Sopenharmony_ciint e1000_setup_all_tx_resources(struct e1000_adapter *adapter); 3438c2ecf20Sopenharmony_civoid e1000_free_all_rx_resources(struct e1000_adapter *adapter); 3448c2ecf20Sopenharmony_civoid e1000_free_all_tx_resources(struct e1000_adapter *adapter); 3458c2ecf20Sopenharmony_civoid e1000_update_stats(struct e1000_adapter *adapter); 3468c2ecf20Sopenharmony_cibool e1000_has_link(struct e1000_adapter *adapter); 3478c2ecf20Sopenharmony_civoid e1000_power_up_phy(struct e1000_adapter *); 3488c2ecf20Sopenharmony_civoid e1000_set_ethtool_ops(struct net_device *netdev); 3498c2ecf20Sopenharmony_civoid e1000_check_options(struct e1000_adapter *adapter); 3508c2ecf20Sopenharmony_cichar *e1000_get_hw_dev_name(struct e1000_hw *hw); 3518c2ecf20Sopenharmony_ci 3528c2ecf20Sopenharmony_ci#endif /* _E1000_H_ */ 353