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