~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/net/ixgb/ixgb_param.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
*******************************************************************************/
28
28
 
 
29
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
30
 
29
31
#include "ixgb.h"
30
32
 
31
33
/* This is the only thing that needs to be changed to adjust the
189
191
                } r;
190
192
                struct {        /* list_option info */
191
193
                        int nr;
192
 
                        struct ixgb_opt_list {
 
194
                        const struct ixgb_opt_list {
193
195
                                int i;
194
 
                                char *str;
 
196
                                const char *str;
195
197
                        } *p;
196
198
                } l;
197
199
        } arg;
209
211
        case enable_option:
210
212
                switch (*value) {
211
213
                case OPTION_ENABLED:
212
 
                        printk(KERN_INFO "%s Enabled\n", opt->name);
 
214
                        pr_info("%s Enabled\n", opt->name);
213
215
                        return 0;
214
216
                case OPTION_DISABLED:
215
 
                        printk(KERN_INFO "%s Disabled\n", opt->name);
 
217
                        pr_info("%s Disabled\n", opt->name);
216
218
                        return 0;
217
219
                }
218
220
                break;
219
221
        case range_option:
220
222
                if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
221
 
                        printk(KERN_INFO "%s set to %i\n", opt->name, *value);
 
223
                        pr_info("%s set to %i\n", opt->name, *value);
222
224
                        return 0;
223
225
                }
224
226
                break;
225
227
        case list_option: {
226
228
                int i;
227
 
                struct ixgb_opt_list *ent;
 
229
                const struct ixgb_opt_list *ent;
228
230
 
229
231
                for (i = 0; i < opt->arg.l.nr; i++) {
230
232
                        ent = &opt->arg.l.p[i];
231
233
                        if (*value == ent->i) {
232
234
                                if (ent->str[0] != '\0')
233
 
                                        printk(KERN_INFO "%s\n", ent->str);
 
235
                                        pr_info("%s\n", ent->str);
234
236
                                return 0;
235
237
                        }
236
238
                }
240
242
                BUG();
241
243
        }
242
244
 
243
 
        printk(KERN_INFO "Invalid %s specified (%i) %s\n",
244
 
                   opt->name, *value, opt->err);
 
245
        pr_info("Invalid %s specified (%i) %s\n", opt->name, *value, opt->err);
245
246
        *value = opt->def;
246
247
        return -1;
247
248
}
261
262
{
262
263
        int bd = adapter->bd_number;
263
264
        if (bd >= IXGB_MAX_NIC) {
264
 
                printk(KERN_NOTICE
265
 
                           "Warning: no configuration for board #%i\n", bd);
266
 
                printk(KERN_NOTICE "Using defaults for all values\n");
 
265
                pr_notice("Warning: no configuration for board #%i\n", bd);
 
266
                pr_notice("Using defaults for all values\n");
267
267
        }
268
268
 
269
269
        { /* Transmit Descriptor Count */
322
322
        }
323
323
        { /* Flow Control */
324
324
 
325
 
                struct ixgb_opt_list fc_list[] =
326
 
                        {{ ixgb_fc_none,        "Flow Control Disabled" },
327
 
                         { ixgb_fc_rx_pause,"Flow Control Receive Only" },
328
 
                         { ixgb_fc_tx_pause,"Flow Control Transmit Only" },
329
 
                         { ixgb_fc_full,        "Flow Control Enabled" },
330
 
                         { ixgb_fc_default, "Flow Control Hardware Default" }};
 
325
                static const struct ixgb_opt_list fc_list[] = {
 
326
                       { ixgb_fc_none, "Flow Control Disabled" },
 
327
                       { ixgb_fc_rx_pause, "Flow Control Receive Only" },
 
328
                       { ixgb_fc_tx_pause, "Flow Control Transmit Only" },
 
329
                       { ixgb_fc_full, "Flow Control Enabled" },
 
330
                       { ixgb_fc_default, "Flow Control Hardware Default" }
 
331
                };
331
332
 
332
 
                const struct ixgb_option opt = {
 
333
                static const struct ixgb_option opt = {
333
334
                        .type = list_option,
334
335
                        .name = "Flow Control",
335
336
                        .err  = "reading default settings from EEPROM",
363
364
                        adapter->hw.fc.high_water = opt.def;
364
365
                }
365
366
                if (!(adapter->hw.fc.type & ixgb_fc_tx_pause) )
366
 
                        printk(KERN_INFO
367
 
                                "Ignoring RxFCHighThresh when no RxFC\n");
 
367
                        pr_info("Ignoring RxFCHighThresh when no RxFC\n");
368
368
        }
369
369
        { /* Receive Flow Control Low Threshold */
370
370
                const struct ixgb_option opt = {
383
383
                        adapter->hw.fc.low_water = opt.def;
384
384
                }
385
385
                if (!(adapter->hw.fc.type & ixgb_fc_tx_pause) )
386
 
                        printk(KERN_INFO
387
 
                                "Ignoring RxFCLowThresh when no RxFC\n");
 
386
                        pr_info("Ignoring RxFCLowThresh when no RxFC\n");
388
387
        }
389
388
        { /* Flow Control Pause Time Request*/
390
389
                const struct ixgb_option opt = {
404
403
                        adapter->hw.fc.pause_time = opt.def;
405
404
                }
406
405
                if (!(adapter->hw.fc.type & ixgb_fc_tx_pause) )
407
 
                        printk(KERN_INFO
408
 
                                "Ignoring FCReqTimeout when no RxFC\n");
 
406
                        pr_info("Ignoring FCReqTimeout when no RxFC\n");
409
407
        }
410
408
        /* high low and spacing check for rx flow control thresholds */
411
409
        if (adapter->hw.fc.type & ixgb_fc_tx_pause) {
412
410
                /* high must be greater than low */
413
411
                if (adapter->hw.fc.high_water < (adapter->hw.fc.low_water + 8)) {
414
412
                        /* set defaults */
415
 
                        printk(KERN_INFO
416
 
                                "RxFCHighThresh must be >= (RxFCLowThresh + 8), "
417
 
                                "Using Defaults\n");
 
413
                        pr_info("RxFCHighThresh must be >= (RxFCLowThresh + 8), Using Defaults\n");
418
414
                        adapter->hw.fc.high_water = DEFAULT_FCRTH;
419
415
                        adapter->hw.fc.low_water  = DEFAULT_FCRTL;
420
416
                }