aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_param.c
diff options
context:
space:
mode:
authorEmil Tantilov <emil.s.tantilov@intel.com>2010-04-27 10:02:58 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-27 20:05:03 -0400
commit675ad47375c76a7c3be4ace9554d92cd55518ced (patch)
tree54acb7e8aa4db5e93b960d565b1cc2dce45988b9 /drivers/net/e1000/e1000_param.c
parent709b9326ef6fc1b7e379d47d5f39ebc27dad3f4d (diff)
e1000: Use netdev_<level>, pr_<level> and dev_<level>
This patch is an alternative to similar patch provided by Joe Perches. Substitute DPRINTK macro for e_<level> that uses netdev_<level> and dev_<level> similar to e1000e. - Convert printk to pr_<level> where applicable. - Use common #define pr_fmt for the driver. - Use dev_<level> for displaying text in parts of the driver where the interface name is not assigned (like e1000_param.c). - Better align test with the new macros. CC: Joe Perches <joe@perches.com> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000/e1000_param.c')
-rw-r--r--drivers/net/e1000/e1000_param.c94
1 files changed, 40 insertions, 54 deletions
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index 38d2741ccae9..543c6d1767bc 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -226,17 +226,16 @@ static int __devinit e1000_validate_option(unsigned int *value,
226 case enable_option: 226 case enable_option:
227 switch (*value) { 227 switch (*value) {
228 case OPTION_ENABLED: 228 case OPTION_ENABLED:
229 DPRINTK(PROBE, INFO, "%s Enabled\n", opt->name); 229 e_dev_info("%s Enabled\n", opt->name);
230 return 0; 230 return 0;
231 case OPTION_DISABLED: 231 case OPTION_DISABLED:
232 DPRINTK(PROBE, INFO, "%s Disabled\n", opt->name); 232 e_dev_info("%s Disabled\n", opt->name);
233 return 0; 233 return 0;
234 } 234 }
235 break; 235 break;
236 case range_option: 236 case range_option:
237 if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) { 237 if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
238 DPRINTK(PROBE, INFO, 238 e_dev_info("%s set to %i\n", opt->name, *value);
239 "%s set to %i\n", opt->name, *value);
240 return 0; 239 return 0;
241 } 240 }
242 break; 241 break;
@@ -248,7 +247,7 @@ static int __devinit e1000_validate_option(unsigned int *value,
248 ent = &opt->arg.l.p[i]; 247 ent = &opt->arg.l.p[i];
249 if (*value == ent->i) { 248 if (*value == ent->i) {
250 if (ent->str[0] != '\0') 249 if (ent->str[0] != '\0')
251 DPRINTK(PROBE, INFO, "%s\n", ent->str); 250 e_dev_info("%s\n", ent->str);
252 return 0; 251 return 0;
253 } 252 }
254 } 253 }
@@ -258,7 +257,7 @@ static int __devinit e1000_validate_option(unsigned int *value,
258 BUG(); 257 BUG();
259 } 258 }
260 259
261 DPRINTK(PROBE, INFO, "Invalid %s value specified (%i) %s\n", 260 e_dev_info("Invalid %s value specified (%i) %s\n",
262 opt->name, *value, opt->err); 261 opt->name, *value, opt->err);
263 *value = opt->def; 262 *value = opt->def;
264 return -1; 263 return -1;
@@ -283,9 +282,8 @@ void __devinit e1000_check_options(struct e1000_adapter *adapter)
283 int bd = adapter->bd_number; 282 int bd = adapter->bd_number;
284 283
285 if (bd >= E1000_MAX_NIC) { 284 if (bd >= E1000_MAX_NIC) {
286 DPRINTK(PROBE, NOTICE, 285 e_dev_warn("Warning: no configuration for board #%i "
287 "Warning: no configuration for board #%i\n", bd); 286 "using defaults for all values\n", bd);
288 DPRINTK(PROBE, NOTICE, "Using defaults for all values\n");
289 } 287 }
290 288
291 { /* Transmit Descriptor Count */ 289 { /* Transmit Descriptor Count */
@@ -472,19 +470,17 @@ void __devinit e1000_check_options(struct e1000_adapter *adapter)
472 adapter->itr = InterruptThrottleRate[bd]; 470 adapter->itr = InterruptThrottleRate[bd];
473 switch (adapter->itr) { 471 switch (adapter->itr) {
474 case 0: 472 case 0:
475 DPRINTK(PROBE, INFO, "%s turned off\n", 473 e_dev_info("%s turned off\n", opt.name);
476 opt.name);
477 break; 474 break;
478 case 1: 475 case 1:
479 DPRINTK(PROBE, INFO, "%s set to dynamic mode\n", 476 e_dev_info("%s set to dynamic mode\n",
480 opt.name); 477 opt.name);
481 adapter->itr_setting = adapter->itr; 478 adapter->itr_setting = adapter->itr;
482 adapter->itr = 20000; 479 adapter->itr = 20000;
483 break; 480 break;
484 case 3: 481 case 3:
485 DPRINTK(PROBE, INFO, 482 e_dev_info("%s set to dynamic conservative "
486 "%s set to dynamic conservative mode\n", 483 "mode\n", opt.name);
487 opt.name);
488 adapter->itr_setting = adapter->itr; 484 adapter->itr_setting = adapter->itr;
489 adapter->itr = 20000; 485 adapter->itr = 20000;
490 break; 486 break;
@@ -543,19 +539,18 @@ static void __devinit e1000_check_fiber_options(struct e1000_adapter *adapter)
543{ 539{
544 int bd = adapter->bd_number; 540 int bd = adapter->bd_number;
545 if (num_Speed > bd) { 541 if (num_Speed > bd) {
546 DPRINTK(PROBE, INFO, "Speed not valid for fiber adapters, " 542 e_dev_info("Speed not valid for fiber adapters, parameter "
547 "parameter ignored\n"); 543 "ignored\n");
548 } 544 }
549 545
550 if (num_Duplex > bd) { 546 if (num_Duplex > bd) {
551 DPRINTK(PROBE, INFO, "Duplex not valid for fiber adapters, " 547 e_dev_info("Duplex not valid for fiber adapters, parameter "
552 "parameter ignored\n"); 548 "ignored\n");
553 } 549 }
554 550
555 if ((num_AutoNeg > bd) && (AutoNeg[bd] != 0x20)) { 551 if ((num_AutoNeg > bd) && (AutoNeg[bd] != 0x20)) {
556 DPRINTK(PROBE, INFO, "AutoNeg other than 1000/Full is " 552 e_dev_info("AutoNeg other than 1000/Full is not valid for fiber"
557 "not valid for fiber adapters, " 553 "adapters, parameter ignored\n");
558 "parameter ignored\n");
559 } 554 }
560} 555}
561 556
@@ -619,9 +614,8 @@ static void __devinit e1000_check_copper_options(struct e1000_adapter *adapter)
619 } 614 }
620 615
621 if ((num_AutoNeg > bd) && (speed != 0 || dplx != 0)) { 616 if ((num_AutoNeg > bd) && (speed != 0 || dplx != 0)) {
622 DPRINTK(PROBE, INFO, 617 e_dev_info("AutoNeg specified along with Speed or Duplex, "
623 "AutoNeg specified along with Speed or Duplex, " 618 "parameter ignored\n");
624 "parameter ignored\n");
625 adapter->hw.autoneg_advertised = AUTONEG_ADV_DEFAULT; 619 adapter->hw.autoneg_advertised = AUTONEG_ADV_DEFAULT;
626 } else { /* Autoneg */ 620 } else { /* Autoneg */
627 static const struct e1000_opt_list an_list[] = 621 static const struct e1000_opt_list an_list[] =
@@ -680,79 +674,72 @@ static void __devinit e1000_check_copper_options(struct e1000_adapter *adapter)
680 case 0: 674 case 0:
681 adapter->hw.autoneg = adapter->fc_autoneg = 1; 675 adapter->hw.autoneg = adapter->fc_autoneg = 1;
682 if ((num_Speed > bd) && (speed != 0 || dplx != 0)) 676 if ((num_Speed > bd) && (speed != 0 || dplx != 0))
683 DPRINTK(PROBE, INFO, 677 e_dev_info("Speed and duplex autonegotiation "
684 "Speed and duplex autonegotiation enabled\n"); 678 "enabled\n");
685 break; 679 break;
686 case HALF_DUPLEX: 680 case HALF_DUPLEX:
687 DPRINTK(PROBE, INFO, "Half Duplex specified without Speed\n"); 681 e_dev_info("Half Duplex specified without Speed\n");
688 DPRINTK(PROBE, INFO, "Using Autonegotiation at " 682 e_dev_info("Using Autonegotiation at Half Duplex only\n");
689 "Half Duplex only\n");
690 adapter->hw.autoneg = adapter->fc_autoneg = 1; 683 adapter->hw.autoneg = adapter->fc_autoneg = 1;
691 adapter->hw.autoneg_advertised = ADVERTISE_10_HALF | 684 adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
692 ADVERTISE_100_HALF; 685 ADVERTISE_100_HALF;
693 break; 686 break;
694 case FULL_DUPLEX: 687 case FULL_DUPLEX:
695 DPRINTK(PROBE, INFO, "Full Duplex specified without Speed\n"); 688 e_dev_info("Full Duplex specified without Speed\n");
696 DPRINTK(PROBE, INFO, "Using Autonegotiation at " 689 e_dev_info("Using Autonegotiation at Full Duplex only\n");
697 "Full Duplex only\n");
698 adapter->hw.autoneg = adapter->fc_autoneg = 1; 690 adapter->hw.autoneg = adapter->fc_autoneg = 1;
699 adapter->hw.autoneg_advertised = ADVERTISE_10_FULL | 691 adapter->hw.autoneg_advertised = ADVERTISE_10_FULL |
700 ADVERTISE_100_FULL | 692 ADVERTISE_100_FULL |
701 ADVERTISE_1000_FULL; 693 ADVERTISE_1000_FULL;
702 break; 694 break;
703 case SPEED_10: 695 case SPEED_10:
704 DPRINTK(PROBE, INFO, "10 Mbps Speed specified " 696 e_dev_info("10 Mbps Speed specified without Duplex\n");
705 "without Duplex\n"); 697 e_dev_info("Using Autonegotiation at 10 Mbps only\n");
706 DPRINTK(PROBE, INFO, "Using Autonegotiation at 10 Mbps only\n");
707 adapter->hw.autoneg = adapter->fc_autoneg = 1; 698 adapter->hw.autoneg = adapter->fc_autoneg = 1;
708 adapter->hw.autoneg_advertised = ADVERTISE_10_HALF | 699 adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
709 ADVERTISE_10_FULL; 700 ADVERTISE_10_FULL;
710 break; 701 break;
711 case SPEED_10 + HALF_DUPLEX: 702 case SPEED_10 + HALF_DUPLEX:
712 DPRINTK(PROBE, INFO, "Forcing to 10 Mbps Half Duplex\n"); 703 e_dev_info("Forcing to 10 Mbps Half Duplex\n");
713 adapter->hw.autoneg = adapter->fc_autoneg = 0; 704 adapter->hw.autoneg = adapter->fc_autoneg = 0;
714 adapter->hw.forced_speed_duplex = e1000_10_half; 705 adapter->hw.forced_speed_duplex = e1000_10_half;
715 adapter->hw.autoneg_advertised = 0; 706 adapter->hw.autoneg_advertised = 0;
716 break; 707 break;
717 case SPEED_10 + FULL_DUPLEX: 708 case SPEED_10 + FULL_DUPLEX:
718 DPRINTK(PROBE, INFO, "Forcing to 10 Mbps Full Duplex\n"); 709 e_dev_info("Forcing to 10 Mbps Full Duplex\n");
719 adapter->hw.autoneg = adapter->fc_autoneg = 0; 710 adapter->hw.autoneg = adapter->fc_autoneg = 0;
720 adapter->hw.forced_speed_duplex = e1000_10_full; 711 adapter->hw.forced_speed_duplex = e1000_10_full;
721 adapter->hw.autoneg_advertised = 0; 712 adapter->hw.autoneg_advertised = 0;
722 break; 713 break;
723 case SPEED_100: 714 case SPEED_100:
724 DPRINTK(PROBE, INFO, "100 Mbps Speed specified " 715 e_dev_info("100 Mbps Speed specified without Duplex\n");
725 "without Duplex\n"); 716 e_dev_info("Using Autonegotiation at 100 Mbps only\n");
726 DPRINTK(PROBE, INFO, "Using Autonegotiation at "
727 "100 Mbps only\n");
728 adapter->hw.autoneg = adapter->fc_autoneg = 1; 717 adapter->hw.autoneg = adapter->fc_autoneg = 1;
729 adapter->hw.autoneg_advertised = ADVERTISE_100_HALF | 718 adapter->hw.autoneg_advertised = ADVERTISE_100_HALF |
730 ADVERTISE_100_FULL; 719 ADVERTISE_100_FULL;
731 break; 720 break;
732 case SPEED_100 + HALF_DUPLEX: 721 case SPEED_100 + HALF_DUPLEX:
733 DPRINTK(PROBE, INFO, "Forcing to 100 Mbps Half Duplex\n"); 722 e_dev_info("Forcing to 100 Mbps Half Duplex\n");
734 adapter->hw.autoneg = adapter->fc_autoneg = 0; 723 adapter->hw.autoneg = adapter->fc_autoneg = 0;
735 adapter->hw.forced_speed_duplex = e1000_100_half; 724 adapter->hw.forced_speed_duplex = e1000_100_half;
736 adapter->hw.autoneg_advertised = 0; 725 adapter->hw.autoneg_advertised = 0;
737 break; 726 break;
738 case SPEED_100 + FULL_DUPLEX: 727 case SPEED_100 + FULL_DUPLEX:
739 DPRINTK(PROBE, INFO, "Forcing to 100 Mbps Full Duplex\n"); 728 e_dev_info("Forcing to 100 Mbps Full Duplex\n");
740 adapter->hw.autoneg = adapter->fc_autoneg = 0; 729 adapter->hw.autoneg = adapter->fc_autoneg = 0;
741 adapter->hw.forced_speed_duplex = e1000_100_full; 730 adapter->hw.forced_speed_duplex = e1000_100_full;
742 adapter->hw.autoneg_advertised = 0; 731 adapter->hw.autoneg_advertised = 0;
743 break; 732 break;
744 case SPEED_1000: 733 case SPEED_1000:
745 DPRINTK(PROBE, INFO, "1000 Mbps Speed specified without " 734 e_dev_info("1000 Mbps Speed specified without Duplex\n");
746 "Duplex\n");
747 goto full_duplex_only; 735 goto full_duplex_only;
748 case SPEED_1000 + HALF_DUPLEX: 736 case SPEED_1000 + HALF_DUPLEX:
749 DPRINTK(PROBE, INFO, 737 e_dev_info("Half Duplex is not supported at 1000 Mbps\n");
750 "Half Duplex is not supported at 1000 Mbps\n");
751 /* fall through */ 738 /* fall through */
752 case SPEED_1000 + FULL_DUPLEX: 739 case SPEED_1000 + FULL_DUPLEX:
753full_duplex_only: 740full_duplex_only:
754 DPRINTK(PROBE, INFO, 741 e_dev_info("Using Autonegotiation at 1000 Mbps Full Duplex "
755 "Using Autonegotiation at 1000 Mbps Full Duplex only\n"); 742 "only\n");
756 adapter->hw.autoneg = adapter->fc_autoneg = 1; 743 adapter->hw.autoneg = adapter->fc_autoneg = 1;
757 adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL; 744 adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
758 break; 745 break;
@@ -762,9 +749,8 @@ full_duplex_only:
762 749
763 /* Speed, AutoNeg and MDI/MDI-X must all play nice */ 750 /* Speed, AutoNeg and MDI/MDI-X must all play nice */
764 if (e1000_validate_mdi_setting(&(adapter->hw)) < 0) { 751 if (e1000_validate_mdi_setting(&(adapter->hw)) < 0) {
765 DPRINTK(PROBE, INFO, 752 e_dev_info("Speed, AutoNeg and MDI-X specs are incompatible. "
766 "Speed, AutoNeg and MDI-X specifications are " 753 "Setting MDI-X to a compatible value.\n");
767 "incompatible. Setting MDI-X to a compatible value.\n");
768 } 754 }
769} 755}
770 756