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