devices/e1000/e1000_param-2.6.13-orig.c
author Florian Pose <fp@igh-essen.com>
Wed, 13 Jan 2010 00:04:47 +0100
branchstable-1.4
changeset 1769 5c317e78a5ef
parent 673 21c266c3f463
permissions -rw-r--r--
merge
673
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     1
/*******************************************************************************
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     3
  
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
  Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     5
  
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     6
  This program is free software; you can redistribute it and/or modify it 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     7
  under the terms of the GNU General Public License as published by the Free 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     8
  Software Foundation; either version 2 of the License, or (at your option) 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     9
  any later version.
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    10
  
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    11
  This program is distributed in the hope that it will be useful, but WITHOUT 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    12
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    13
  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    14
  more details.
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    15
  
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    16
  You should have received a copy of the GNU General Public License along with
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    17
  this program; if not, write to the Free Software Foundation, Inc., 59 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    18
  Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    19
  
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    20
  The full GNU General Public License is included in this distribution in the
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    21
  file called LICENSE.
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    22
  
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    23
  Contact Information:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    24
  Linux NICS <linux.nics@intel.com>
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    25
  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    26
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    27
*******************************************************************************/
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    28
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    29
#include "e1000.h"
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    30
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    31
/* This is the only thing that needs to be changed to adjust the
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    32
 * maximum number of ports that the driver can manage.
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    33
 */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    34
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    35
#define E1000_MAX_NIC 32
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    36
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    37
#define OPTION_UNSET   -1
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    38
#define OPTION_DISABLED 0
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    39
#define OPTION_ENABLED  1
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    40
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    41
/* All parameters are treated the same, as an integer array of values.
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    42
 * This macro just reduces the need to repeat the same declaration code
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    43
 * over and over (plus this helps to avoid typo bugs).
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    44
 */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    45
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    46
#define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET }
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    47
#define E1000_PARAM(X, desc) \
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    48
	static int __devinitdata X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    49
	static int num_##X = 0; \
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    50
	module_param_array_named(X, X, int, &num_##X, 0); \
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    51
	MODULE_PARM_DESC(X, desc);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    52
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    53
/* Transmit Descriptor Count
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    54
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    55
 * Valid Range: 80-256 for 82542 and 82543 gigabit ethernet controllers
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    56
 * Valid Range: 80-4096 for 82544 and newer
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    57
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    58
 * Default Value: 256
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    59
 */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    60
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    61
E1000_PARAM(TxDescriptors, "Number of transmit descriptors");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    62
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    63
/* Receive Descriptor Count
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    64
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    65
 * Valid Range: 80-256 for 82542 and 82543 gigabit ethernet controllers
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    66
 * Valid Range: 80-4096 for 82544 and newer
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    67
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    68
 * Default Value: 256
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    69
 */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    70
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    71
E1000_PARAM(RxDescriptors, "Number of receive descriptors");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    72
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    73
/* User Specified Speed Override
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    74
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    75
 * Valid Range: 0, 10, 100, 1000
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    76
 *  - 0    - auto-negotiate at all supported speeds
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    77
 *  - 10   - only link at 10 Mbps
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    78
 *  - 100  - only link at 100 Mbps
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    79
 *  - 1000 - only link at 1000 Mbps
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    80
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    81
 * Default Value: 0
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    82
 */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    83
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    84
E1000_PARAM(Speed, "Speed setting");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    85
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    86
/* User Specified Duplex Override
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    87
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    88
 * Valid Range: 0-2
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    89
 *  - 0 - auto-negotiate for duplex
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    90
 *  - 1 - only link at half duplex
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    91
 *  - 2 - only link at full duplex
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    92
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    93
 * Default Value: 0
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    94
 */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    95
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    96
E1000_PARAM(Duplex, "Duplex setting");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    97
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    98
/* Auto-negotiation Advertisement Override
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    99
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   100
 * Valid Range: 0x01-0x0F, 0x20-0x2F (copper); 0x20 (fiber)
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   101
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   102
 * The AutoNeg value is a bit mask describing which speed and duplex
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   103
 * combinations should be advertised during auto-negotiation.
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   104
 * The supported speed and duplex modes are listed below
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   105
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   106
 * Bit           7     6     5      4      3     2     1      0
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   107
 * Speed (Mbps)  N/A   N/A   1000   N/A    100   100   10     10
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   108
 * Duplex                    Full          Full  Half  Full   Half
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   109
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   110
 * Default Value: 0x2F (copper); 0x20 (fiber)
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   111
 */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   112
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   113
E1000_PARAM(AutoNeg, "Advertised auto-negotiation setting");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   114
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   115
/* User Specified Flow Control Override
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   116
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   117
 * Valid Range: 0-3
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   118
 *  - 0 - No Flow Control
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   119
 *  - 1 - Rx only, respond to PAUSE frames but do not generate them
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   120
 *  - 2 - Tx only, generate PAUSE frames but ignore them on receive
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   121
 *  - 3 - Full Flow Control Support
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   122
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   123
 * Default Value: Read flow control settings from the EEPROM
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   124
 */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   125
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   126
E1000_PARAM(FlowControl, "Flow Control setting");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   127
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   128
/* XsumRX - Receive Checksum Offload Enable/Disable
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   129
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   130
 * Valid Range: 0, 1
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   131
 *  - 0 - disables all checksum offload
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   132
 *  - 1 - enables receive IP/TCP/UDP checksum offload
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   133
 *        on 82543 and newer -based NICs
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   134
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   135
 * Default Value: 1
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   136
 */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   137
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   138
E1000_PARAM(XsumRX, "Disable or enable Receive Checksum offload");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   139
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   140
/* Transmit Interrupt Delay in units of 1.024 microseconds
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   141
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   142
 * Valid Range: 0-65535
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   143
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   144
 * Default Value: 64
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   145
 */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   146
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   147
E1000_PARAM(TxIntDelay, "Transmit Interrupt Delay");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   148
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   149
/* Transmit Absolute Interrupt Delay in units of 1.024 microseconds
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   150
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   151
 * Valid Range: 0-65535
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   152
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   153
 * Default Value: 0
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   154
 */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   155
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   156
E1000_PARAM(TxAbsIntDelay, "Transmit Absolute Interrupt Delay");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   157
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   158
/* Receive Interrupt Delay in units of 1.024 microseconds
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   159
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   160
 * Valid Range: 0-65535
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   161
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   162
 * Default Value: 0
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   163
 */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   164
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   165
E1000_PARAM(RxIntDelay, "Receive Interrupt Delay");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   166
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   167
/* Receive Absolute Interrupt Delay in units of 1.024 microseconds
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   168
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   169
 * Valid Range: 0-65535
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   170
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   171
 * Default Value: 128
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   172
 */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   173
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   174
E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   175
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   176
/* Interrupt Throttle Rate (interrupts/sec)
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   177
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   178
 * Valid Range: 100-100000 (0=off, 1=dynamic)
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   179
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   180
 * Default Value: 1
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   181
 */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   182
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   183
E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   184
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   185
#define AUTONEG_ADV_DEFAULT  0x2F
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   186
#define AUTONEG_ADV_MASK     0x2F
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   187
#define FLOW_CONTROL_DEFAULT FLOW_CONTROL_FULL
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   188
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   189
#define DEFAULT_RDTR                   0
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   190
#define MAX_RXDELAY               0xFFFF
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   191
#define MIN_RXDELAY                    0
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   192
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   193
#define DEFAULT_RADV                 128
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   194
#define MAX_RXABSDELAY            0xFFFF
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   195
#define MIN_RXABSDELAY                 0
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   196
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   197
#define DEFAULT_TIDV                  64
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   198
#define MAX_TXDELAY               0xFFFF
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   199
#define MIN_TXDELAY                    0
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   200
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   201
#define DEFAULT_TADV                  64
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   202
#define MAX_TXABSDELAY            0xFFFF
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   203
#define MIN_TXABSDELAY                 0
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   204
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   205
#define DEFAULT_ITR                 8000
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   206
#define MAX_ITR                   100000
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   207
#define MIN_ITR                      100
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   208
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   209
struct e1000_option {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   210
	enum { enable_option, range_option, list_option } type;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   211
	char *name;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   212
	char *err;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   213
	int  def;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   214
	union {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   215
		struct { /* range_option info */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   216
			int min;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   217
			int max;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   218
		} r;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   219
		struct { /* list_option info */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   220
			int nr;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   221
			struct e1000_opt_list { int i; char *str; } *p;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   222
		} l;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   223
	} arg;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   224
};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   225
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   226
static int __devinit
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   227
e1000_validate_option(int *value, struct e1000_option *opt,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   228
		struct e1000_adapter *adapter)
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   229
{
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   230
	if(*value == OPTION_UNSET) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   231
		*value = opt->def;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   232
		return 0;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   233
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   234
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   235
	switch (opt->type) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   236
	case enable_option:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   237
		switch (*value) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   238
		case OPTION_ENABLED:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   239
			DPRINTK(PROBE, INFO, "%s Enabled\n", opt->name);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   240
			return 0;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   241
		case OPTION_DISABLED:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   242
			DPRINTK(PROBE, INFO, "%s Disabled\n", opt->name);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   243
			return 0;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   244
		}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   245
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   246
	case range_option:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   247
		if(*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   248
			DPRINTK(PROBE, INFO,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   249
					"%s set to %i\n", opt->name, *value);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   250
			return 0;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   251
		}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   252
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   253
	case list_option: {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   254
		int i;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   255
		struct e1000_opt_list *ent;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   256
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   257
		for(i = 0; i < opt->arg.l.nr; i++) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   258
			ent = &opt->arg.l.p[i];
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   259
			if(*value == ent->i) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   260
				if(ent->str[0] != '\0')
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   261
					DPRINTK(PROBE, INFO, "%s\n", ent->str);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   262
				return 0;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   263
			}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   264
		}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   265
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   266
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   267
	default:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   268
		BUG();
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   269
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   270
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   271
	DPRINTK(PROBE, INFO, "Invalid %s specified (%i) %s\n",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   272
	       opt->name, *value, opt->err);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   273
	*value = opt->def;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   274
	return -1;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   275
}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   276
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   277
static void e1000_check_fiber_options(struct e1000_adapter *adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   278
static void e1000_check_copper_options(struct e1000_adapter *adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   279
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   280
/**
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   281
 * e1000_check_options - Range Checking for Command Line Parameters
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   282
 * @adapter: board private structure
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   283
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   284
 * This routine checks all command line parameters for valid user
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   285
 * input.  If an invalid value is given, or if no user specified
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   286
 * value exists, a default value is used.  The final value is stored
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   287
 * in a variable in the adapter structure.
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   288
 **/
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   289
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   290
void __devinit
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   291
e1000_check_options(struct e1000_adapter *adapter)
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   292
{
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   293
	int bd = adapter->bd_number;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   294
	if(bd >= E1000_MAX_NIC) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   295
		DPRINTK(PROBE, NOTICE,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   296
		       "Warning: no configuration for board #%i\n", bd);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   297
		DPRINTK(PROBE, NOTICE, "Using defaults for all values\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   298
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   299
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   300
	{ /* Transmit Descriptor Count */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   301
		struct e1000_option opt = {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   302
			.type = range_option,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   303
			.name = "Transmit Descriptors",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   304
			.err  = "using default of "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   305
				__MODULE_STRING(E1000_DEFAULT_TXD),
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   306
			.def  = E1000_DEFAULT_TXD,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   307
			.arg  = { .r = { .min = E1000_MIN_TXD }}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   308
		};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   309
		struct e1000_desc_ring *tx_ring = &adapter->tx_ring;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   310
		e1000_mac_type mac_type = adapter->hw.mac_type;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   311
		opt.arg.r.max = mac_type < e1000_82544 ?
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   312
			E1000_MAX_TXD : E1000_MAX_82544_TXD;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   313
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   314
		if (num_TxDescriptors > bd) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   315
			tx_ring->count = TxDescriptors[bd];
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   316
			e1000_validate_option(&tx_ring->count, &opt, adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   317
			E1000_ROUNDUP(tx_ring->count, 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   318
						REQ_TX_DESCRIPTOR_MULTIPLE);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   319
		} else {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   320
			tx_ring->count = opt.def;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   321
		}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   322
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   323
	{ /* Receive Descriptor Count */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   324
		struct e1000_option opt = {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   325
			.type = range_option,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   326
			.name = "Receive Descriptors",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   327
			.err  = "using default of "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   328
				__MODULE_STRING(E1000_DEFAULT_RXD),
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   329
			.def  = E1000_DEFAULT_RXD,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   330
			.arg  = { .r = { .min = E1000_MIN_RXD }}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   331
		};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   332
		struct e1000_desc_ring *rx_ring = &adapter->rx_ring;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   333
		e1000_mac_type mac_type = adapter->hw.mac_type;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   334
		opt.arg.r.max = mac_type < e1000_82544 ? E1000_MAX_RXD :
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   335
			E1000_MAX_82544_RXD;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   336
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   337
		if (num_RxDescriptors > bd) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   338
			rx_ring->count = RxDescriptors[bd];
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   339
			e1000_validate_option(&rx_ring->count, &opt, adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   340
			E1000_ROUNDUP(rx_ring->count, 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   341
						REQ_RX_DESCRIPTOR_MULTIPLE);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   342
		} else {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   343
			rx_ring->count = opt.def;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   344
		}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   345
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   346
	{ /* Checksum Offload Enable/Disable */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   347
		struct e1000_option opt = {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   348
			.type = enable_option,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   349
			.name = "Checksum Offload",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   350
			.err  = "defaulting to Enabled",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   351
			.def  = OPTION_ENABLED
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   352
		};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   353
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   354
		if (num_XsumRX > bd) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   355
			int rx_csum = XsumRX[bd];
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   356
			e1000_validate_option(&rx_csum, &opt, adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   357
			adapter->rx_csum = rx_csum;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   358
		} else {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   359
			adapter->rx_csum = opt.def;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   360
		}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   361
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   362
	{ /* Flow Control */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   363
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   364
		struct e1000_opt_list fc_list[] =
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   365
			{{ e1000_fc_none,    "Flow Control Disabled" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   366
			 { e1000_fc_rx_pause,"Flow Control Receive Only" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   367
			 { e1000_fc_tx_pause,"Flow Control Transmit Only" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   368
			 { e1000_fc_full,    "Flow Control Enabled" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   369
			 { e1000_fc_default, "Flow Control Hardware Default" }};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   370
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   371
		struct e1000_option opt = {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   372
			.type = list_option,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   373
			.name = "Flow Control",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   374
			.err  = "reading default settings from EEPROM",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   375
			.def  = e1000_fc_default,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   376
			.arg  = { .l = { .nr = ARRAY_SIZE(fc_list),
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   377
					 .p = fc_list }}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   378
		};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   379
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   380
		if (num_FlowControl > bd) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   381
			int fc = FlowControl[bd];
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   382
			e1000_validate_option(&fc, &opt, adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   383
			adapter->hw.fc = adapter->hw.original_fc = fc;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   384
		} else {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   385
			adapter->hw.fc = opt.def;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   386
		}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   387
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   388
	{ /* Transmit Interrupt Delay */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   389
		struct e1000_option opt = {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   390
			.type = range_option,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   391
			.name = "Transmit Interrupt Delay",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   392
			.err  = "using default of " __MODULE_STRING(DEFAULT_TIDV),
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   393
			.def  = DEFAULT_TIDV,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   394
			.arg  = { .r = { .min = MIN_TXDELAY,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   395
					 .max = MAX_TXDELAY }}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   396
		};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   397
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   398
		if (num_TxIntDelay > bd) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   399
			adapter->tx_int_delay = TxIntDelay[bd];
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   400
			e1000_validate_option(&adapter->tx_int_delay, &opt, 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   401
								adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   402
		} else {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   403
			adapter->tx_int_delay = opt.def;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   404
		}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   405
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   406
	{ /* Transmit Absolute Interrupt Delay */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   407
		struct e1000_option opt = {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   408
			.type = range_option,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   409
			.name = "Transmit Absolute Interrupt Delay",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   410
			.err  = "using default of " __MODULE_STRING(DEFAULT_TADV),
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   411
			.def  = DEFAULT_TADV,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   412
			.arg  = { .r = { .min = MIN_TXABSDELAY,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   413
					 .max = MAX_TXABSDELAY }}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   414
		};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   415
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   416
		if (num_TxAbsIntDelay > bd) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   417
			adapter->tx_abs_int_delay = TxAbsIntDelay[bd];
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   418
			e1000_validate_option(&adapter->tx_abs_int_delay, &opt, 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   419
								adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   420
		} else {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   421
			adapter->tx_abs_int_delay = opt.def;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   422
		}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   423
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   424
	{ /* Receive Interrupt Delay */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   425
		struct e1000_option opt = {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   426
			.type = range_option,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   427
			.name = "Receive Interrupt Delay",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   428
			.err  = "using default of " __MODULE_STRING(DEFAULT_RDTR),
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   429
			.def  = DEFAULT_RDTR,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   430
			.arg  = { .r = { .min = MIN_RXDELAY,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   431
					 .max = MAX_RXDELAY }}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   432
		};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   433
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   434
		if (num_RxIntDelay > bd) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   435
			adapter->rx_int_delay = RxIntDelay[bd];
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   436
			e1000_validate_option(&adapter->rx_int_delay, &opt, 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   437
								adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   438
		} else {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   439
			adapter->rx_int_delay = opt.def;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   440
		}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   441
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   442
	{ /* Receive Absolute Interrupt Delay */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   443
		struct e1000_option opt = {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   444
			.type = range_option,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   445
			.name = "Receive Absolute Interrupt Delay",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   446
			.err  = "using default of " __MODULE_STRING(DEFAULT_RADV),
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   447
			.def  = DEFAULT_RADV,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   448
			.arg  = { .r = { .min = MIN_RXABSDELAY,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   449
					 .max = MAX_RXABSDELAY }}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   450
		};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   451
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   452
		if (num_RxAbsIntDelay > bd) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   453
			adapter->rx_abs_int_delay = RxAbsIntDelay[bd];
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   454
			e1000_validate_option(&adapter->rx_abs_int_delay, &opt, 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   455
								adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   456
		} else {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   457
			adapter->rx_abs_int_delay = opt.def;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   458
		}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   459
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   460
	{ /* Interrupt Throttling Rate */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   461
		struct e1000_option opt = {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   462
			.type = range_option,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   463
			.name = "Interrupt Throttling Rate (ints/sec)",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   464
			.err  = "using default of " __MODULE_STRING(DEFAULT_ITR),
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   465
			.def  = DEFAULT_ITR,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   466
			.arg  = { .r = { .min = MIN_ITR,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   467
					 .max = MAX_ITR }}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   468
		};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   469
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   470
		if (num_InterruptThrottleRate > bd) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   471
			adapter->itr = InterruptThrottleRate[bd];
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   472
			switch(adapter->itr) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   473
			case 0:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   474
				DPRINTK(PROBE, INFO, "%s turned off\n", 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   475
					opt.name);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   476
				break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   477
			case 1:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   478
				DPRINTK(PROBE, INFO, "%s set to dynamic mode\n", 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   479
					opt.name);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   480
				break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   481
			default:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   482
				e1000_validate_option(&adapter->itr, &opt, 
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   483
					adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   484
				break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   485
			}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   486
		} else {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   487
			adapter->itr = opt.def;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   488
		}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   489
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   490
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   491
	switch(adapter->hw.media_type) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   492
	case e1000_media_type_fiber:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   493
	case e1000_media_type_internal_serdes:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   494
		e1000_check_fiber_options(adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   495
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   496
	case e1000_media_type_copper:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   497
		e1000_check_copper_options(adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   498
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   499
	default:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   500
		BUG();
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   501
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   502
}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   503
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   504
/**
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   505
 * e1000_check_fiber_options - Range Checking for Link Options, Fiber Version
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   506
 * @adapter: board private structure
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   507
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   508
 * Handles speed and duplex options on fiber adapters
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   509
 **/
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   510
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   511
static void __devinit
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   512
e1000_check_fiber_options(struct e1000_adapter *adapter)
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   513
{
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   514
	int bd = adapter->bd_number;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   515
	if(num_Speed > bd) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   516
		DPRINTK(PROBE, INFO, "Speed not valid for fiber adapters, "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   517
		       "parameter ignored\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   518
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   519
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   520
	if(num_Duplex > bd) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   521
		DPRINTK(PROBE, INFO, "Duplex not valid for fiber adapters, "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   522
		       "parameter ignored\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   523
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   524
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   525
	if((num_AutoNeg > bd) && (AutoNeg[bd] != 0x20)) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   526
		DPRINTK(PROBE, INFO, "AutoNeg other than 1000/Full is "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   527
				 "not valid for fiber adapters, "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   528
				 "parameter ignored\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   529
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   530
}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   531
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   532
/**
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   533
 * e1000_check_copper_options - Range Checking for Link Options, Copper Version
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   534
 * @adapter: board private structure
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   535
 *
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   536
 * Handles speed and duplex options on copper adapters
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   537
 **/
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   538
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   539
static void __devinit
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   540
e1000_check_copper_options(struct e1000_adapter *adapter)
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   541
{
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   542
	int speed, dplx;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   543
	int bd = adapter->bd_number;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   544
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   545
	{ /* Speed */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   546
		struct e1000_opt_list speed_list[] = {{          0, "" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   547
						      {   SPEED_10, "" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   548
						      {  SPEED_100, "" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   549
						      { SPEED_1000, "" }};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   550
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   551
		struct e1000_option opt = {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   552
			.type = list_option,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   553
			.name = "Speed",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   554
			.err  = "parameter ignored",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   555
			.def  = 0,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   556
			.arg  = { .l = { .nr = ARRAY_SIZE(speed_list),
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   557
					 .p = speed_list }}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   558
		};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   559
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   560
		if (num_Speed > bd) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   561
			speed = Speed[bd];
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   562
			e1000_validate_option(&speed, &opt, adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   563
		} else {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   564
			speed = opt.def;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   565
		}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   566
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   567
	{ /* Duplex */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   568
		struct e1000_opt_list dplx_list[] = {{           0, "" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   569
						     { HALF_DUPLEX, "" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   570
						     { FULL_DUPLEX, "" }};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   571
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   572
		struct e1000_option opt = {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   573
			.type = list_option,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   574
			.name = "Duplex",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   575
			.err  = "parameter ignored",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   576
			.def  = 0,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   577
			.arg  = { .l = { .nr = ARRAY_SIZE(dplx_list),
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   578
					 .p = dplx_list }}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   579
		};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   580
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   581
		if (num_Duplex > bd) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   582
			dplx = Duplex[bd];
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   583
			e1000_validate_option(&dplx, &opt, adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   584
		} else {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   585
			dplx = opt.def;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   586
		}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   587
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   588
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   589
	if((num_AutoNeg > bd) && (speed != 0 || dplx != 0)) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   590
		DPRINTK(PROBE, INFO,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   591
		       "AutoNeg specified along with Speed or Duplex, "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   592
		       "parameter ignored\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   593
		adapter->hw.autoneg_advertised = AUTONEG_ADV_DEFAULT;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   594
	} else { /* Autoneg */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   595
		struct e1000_opt_list an_list[] =
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   596
			#define AA "AutoNeg advertising "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   597
			{{ 0x01, AA "10/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   598
			 { 0x02, AA "10/FD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   599
			 { 0x03, AA "10/FD, 10/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   600
			 { 0x04, AA "100/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   601
			 { 0x05, AA "100/HD, 10/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   602
			 { 0x06, AA "100/HD, 10/FD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   603
			 { 0x07, AA "100/HD, 10/FD, 10/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   604
			 { 0x08, AA "100/FD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   605
			 { 0x09, AA "100/FD, 10/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   606
			 { 0x0a, AA "100/FD, 10/FD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   607
			 { 0x0b, AA "100/FD, 10/FD, 10/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   608
			 { 0x0c, AA "100/FD, 100/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   609
			 { 0x0d, AA "100/FD, 100/HD, 10/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   610
			 { 0x0e, AA "100/FD, 100/HD, 10/FD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   611
			 { 0x0f, AA "100/FD, 100/HD, 10/FD, 10/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   612
			 { 0x20, AA "1000/FD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   613
			 { 0x21, AA "1000/FD, 10/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   614
			 { 0x22, AA "1000/FD, 10/FD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   615
			 { 0x23, AA "1000/FD, 10/FD, 10/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   616
			 { 0x24, AA "1000/FD, 100/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   617
			 { 0x25, AA "1000/FD, 100/HD, 10/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   618
			 { 0x26, AA "1000/FD, 100/HD, 10/FD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   619
			 { 0x27, AA "1000/FD, 100/HD, 10/FD, 10/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   620
			 { 0x28, AA "1000/FD, 100/FD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   621
			 { 0x29, AA "1000/FD, 100/FD, 10/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   622
			 { 0x2a, AA "1000/FD, 100/FD, 10/FD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   623
			 { 0x2b, AA "1000/FD, 100/FD, 10/FD, 10/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   624
			 { 0x2c, AA "1000/FD, 100/FD, 100/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   625
			 { 0x2d, AA "1000/FD, 100/FD, 100/HD, 10/HD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   626
			 { 0x2e, AA "1000/FD, 100/FD, 100/HD, 10/FD" },
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   627
			 { 0x2f, AA "1000/FD, 100/FD, 100/HD, 10/FD, 10/HD" }};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   628
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   629
		struct e1000_option opt = {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   630
			.type = list_option,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   631
			.name = "AutoNeg",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   632
			.err  = "parameter ignored",
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   633
			.def  = AUTONEG_ADV_DEFAULT,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   634
			.arg  = { .l = { .nr = ARRAY_SIZE(an_list),
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   635
					 .p = an_list }}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   636
		};
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   637
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   638
		int an = AutoNeg[bd];
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   639
		e1000_validate_option(&an, &opt, adapter);
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   640
		adapter->hw.autoneg_advertised = an;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   641
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   642
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   643
	switch (speed + dplx) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   644
	case 0:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   645
		adapter->hw.autoneg = adapter->fc_autoneg = 1;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   646
		if((num_Speed > bd) && (speed != 0 || dplx != 0))
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   647
			DPRINTK(PROBE, INFO,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   648
			       "Speed and duplex autonegotiation enabled\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   649
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   650
	case HALF_DUPLEX:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   651
		DPRINTK(PROBE, INFO, "Half Duplex specified without Speed\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   652
		DPRINTK(PROBE, INFO, "Using Autonegotiation at "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   653
			"Half Duplex only\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   654
		adapter->hw.autoneg = adapter->fc_autoneg = 1;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   655
		adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   656
		                                 ADVERTISE_100_HALF;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   657
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   658
	case FULL_DUPLEX:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   659
		DPRINTK(PROBE, INFO, "Full Duplex specified without Speed\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   660
		DPRINTK(PROBE, INFO, "Using Autonegotiation at "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   661
			"Full Duplex only\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   662
		adapter->hw.autoneg = adapter->fc_autoneg = 1;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   663
		adapter->hw.autoneg_advertised = ADVERTISE_10_FULL |
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   664
		                                 ADVERTISE_100_FULL |
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   665
		                                 ADVERTISE_1000_FULL;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   666
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   667
	case SPEED_10:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   668
		DPRINTK(PROBE, INFO, "10 Mbps Speed specified "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   669
			"without Duplex\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   670
		DPRINTK(PROBE, INFO, "Using Autonegotiation at 10 Mbps only\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   671
		adapter->hw.autoneg = adapter->fc_autoneg = 1;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   672
		adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   673
		                                 ADVERTISE_10_FULL;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   674
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   675
	case SPEED_10 + HALF_DUPLEX:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   676
		DPRINTK(PROBE, INFO, "Forcing to 10 Mbps Half Duplex\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   677
		adapter->hw.autoneg = adapter->fc_autoneg = 0;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   678
		adapter->hw.forced_speed_duplex = e1000_10_half;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   679
		adapter->hw.autoneg_advertised = 0;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   680
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   681
	case SPEED_10 + FULL_DUPLEX:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   682
		DPRINTK(PROBE, INFO, "Forcing to 10 Mbps Full Duplex\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   683
		adapter->hw.autoneg = adapter->fc_autoneg = 0;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   684
		adapter->hw.forced_speed_duplex = e1000_10_full;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   685
		adapter->hw.autoneg_advertised = 0;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   686
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   687
	case SPEED_100:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   688
		DPRINTK(PROBE, INFO, "100 Mbps Speed specified "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   689
			"without Duplex\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   690
		DPRINTK(PROBE, INFO, "Using Autonegotiation at "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   691
			"100 Mbps only\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   692
		adapter->hw.autoneg = adapter->fc_autoneg = 1;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   693
		adapter->hw.autoneg_advertised = ADVERTISE_100_HALF |
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   694
		                                 ADVERTISE_100_FULL;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   695
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   696
	case SPEED_100 + HALF_DUPLEX:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   697
		DPRINTK(PROBE, INFO, "Forcing to 100 Mbps Half Duplex\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   698
		adapter->hw.autoneg = adapter->fc_autoneg = 0;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   699
		adapter->hw.forced_speed_duplex = e1000_100_half;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   700
		adapter->hw.autoneg_advertised = 0;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   701
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   702
	case SPEED_100 + FULL_DUPLEX:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   703
		DPRINTK(PROBE, INFO, "Forcing to 100 Mbps Full Duplex\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   704
		adapter->hw.autoneg = adapter->fc_autoneg = 0;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   705
		adapter->hw.forced_speed_duplex = e1000_100_full;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   706
		adapter->hw.autoneg_advertised = 0;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   707
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   708
	case SPEED_1000:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   709
		DPRINTK(PROBE, INFO, "1000 Mbps Speed specified without "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   710
			"Duplex\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   711
		DPRINTK(PROBE, INFO,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   712
			"Using Autonegotiation at 1000 Mbps "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   713
			"Full Duplex only\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   714
		adapter->hw.autoneg = adapter->fc_autoneg = 1;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   715
		adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   716
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   717
	case SPEED_1000 + HALF_DUPLEX:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   718
		DPRINTK(PROBE, INFO,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   719
			"Half Duplex is not supported at 1000 Mbps\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   720
		DPRINTK(PROBE, INFO,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   721
			"Using Autonegotiation at 1000 Mbps "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   722
			"Full Duplex only\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   723
		adapter->hw.autoneg = adapter->fc_autoneg = 1;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   724
		adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   725
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   726
	case SPEED_1000 + FULL_DUPLEX:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   727
		DPRINTK(PROBE, INFO,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   728
		       "Using Autonegotiation at 1000 Mbps Full Duplex only\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   729
		adapter->hw.autoneg = adapter->fc_autoneg = 1;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   730
		adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   731
		break;
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   732
	default:
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   733
		BUG();
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   734
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   735
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   736
	/* Speed, AutoNeg and MDI/MDI-X must all play nice */
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   737
	if (e1000_validate_mdi_setting(&(adapter->hw)) < 0) {
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   738
		DPRINTK(PROBE, INFO,
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   739
			"Speed, AutoNeg and MDI-X specifications are "
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   740
			"incompatible. Setting MDI-X to a compatible value.\n");
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   741
	}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   742
}
21c266c3f463 Added e1000 driver for kernel 2.6.13.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   743