// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright(c) 2007 Atheros Corporation. All rights reserved. * * Derived from Intel e1000 driver * Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved. */ #include <linux/netdevice.h> #include "atl1e.h" /* This is the only thing that needs to be changed to adjust the * maximum number of ports that the driver can manage. */ #define ATL1E_MAX_NIC … #define OPTION_UNSET … #define OPTION_DISABLED … #define OPTION_ENABLED … /* All parameters are treated the same, as an integer array of values. * This macro just reduces the need to repeat the same declaration code * over and over (plus this helps to avoid typo bugs). */ #define ATL1E_PARAM_INIT … #define ATL1E_PARAM(x, desc) … /* Transmit Memory count * * Valid Range: 64-2048 * * Default Value: 128 */ #define ATL1E_MIN_TX_DESC_CNT … #define ATL1E_MAX_TX_DESC_CNT … #define ATL1E_DEFAULT_TX_DESC_CNT … ATL1E_PARAM(tx_desc_cnt, "Transmit description count"); /* Receive Memory Block Count * * Valid Range: 16-512 * * Default Value: 128 */ #define ATL1E_MIN_RX_MEM_SIZE … #define ATL1E_MAX_RX_MEM_SIZE … #define ATL1E_DEFAULT_RX_MEM_SIZE … ATL1E_PARAM(rx_mem_size, "memory size of rx buffer(KB)"); /* User Specified MediaType Override * * Valid Range: 0-5 * - 0 - auto-negotiate at all supported speeds * - 1 - only link at 100Mbps Full Duplex * - 2 - only link at 100Mbps Half Duplex * - 3 - only link at 10Mbps Full Duplex * - 4 - only link at 10Mbps Half Duplex * Default Value: 0 */ ATL1E_PARAM(media_type, "MediaType Select"); /* Interrupt Moderate Timer in units of 2 us * * Valid Range: 10-65535 * * Default Value: 45000(90ms) */ #define INT_MOD_DEFAULT_CNT … #define INT_MOD_MAX_CNT … #define INT_MOD_MIN_CNT … ATL1E_PARAM(int_mod_timer, "Interrupt Moderator Timer"); #define AUTONEG_ADV_DEFAULT … #define AUTONEG_ADV_MASK … #define FLOW_CONTROL_DEFAULT … #define FLASH_VENDOR_DEFAULT … #define FLASH_VENDOR_MIN … #define FLASH_VENDOR_MAX … struct atl1e_option { … }; static int atl1e_validate_option(int *value, struct atl1e_option *opt, struct atl1e_adapter *adapter) { … } /** * atl1e_check_options - Range Checking for Command Line Parameters * @adapter: board private structure * * This routine checks all command line parameters for valid user * input. If an invalid value is given, or if no user specified * value exists, a default value is used. The final value is stored * in a variable in the adapter structure. */ void atl1e_check_options(struct atl1e_adapter *adapter) { … }