diff options
| author | David S. Miller <davem@davemloft.net> | 2010-05-16 02:14:16 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-05-16 02:14:16 -0400 |
| commit | 1cdc5abf40c561982d2f7b06bcff17f9496309a5 (patch) | |
| tree | 92c0ca1688929a6660dc41e97df203aef23b8c09 | |
| parent | e0f43752a942b7be1bc06b9fd74e20ae337c1cca (diff) | |
| parent | 0fb0a4f00aaf5de9f328273d7a46e3aa27dab496 (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/inaky/wimax
| -rw-r--r-- | drivers/net/wimax/i2400m/control.c | 15 | ||||
| -rw-r--r-- | drivers/net/wimax/i2400m/driver.c | 165 | ||||
| -rw-r--r-- | drivers/net/wimax/i2400m/i2400m-sdio.h | 5 | ||||
| -rw-r--r-- | drivers/net/wimax/i2400m/i2400m.h | 82 | ||||
| -rw-r--r-- | drivers/net/wimax/i2400m/netdev.c | 12 | ||||
| -rw-r--r-- | drivers/net/wimax/i2400m/rx.c | 109 | ||||
| -rw-r--r-- | drivers/net/wimax/i2400m/sdio-tx.c | 35 | ||||
| -rw-r--r-- | drivers/net/wimax/i2400m/sdio.c | 7 | ||||
| -rw-r--r-- | drivers/net/wimax/i2400m/tx.c | 153 | ||||
| -rw-r--r-- | drivers/net/wimax/i2400m/usb.c | 12 | ||||
| -rw-r--r-- | net/wimax/stack.c | 2 |
11 files changed, 480 insertions, 117 deletions
diff --git a/drivers/net/wimax/i2400m/control.c b/drivers/net/wimax/i2400m/control.c index f8a9734243d0..ac5e2c4e517c 100644 --- a/drivers/net/wimax/i2400m/control.c +++ b/drivers/net/wimax/i2400m/control.c | |||
| @@ -83,6 +83,21 @@ | |||
| 83 | #define D_SUBMODULE control | 83 | #define D_SUBMODULE control |
| 84 | #include "debug-levels.h" | 84 | #include "debug-levels.h" |
| 85 | 85 | ||
| 86 | static int i2400m_idle_mode_disabled;/* 0 (idle mode enabled) by default */ | ||
| 87 | module_param_named(idle_mode_disabled, i2400m_idle_mode_disabled, int, 0644); | ||
| 88 | MODULE_PARM_DESC(idle_mode_disabled, | ||
| 89 | "If true, the device will not enable idle mode negotiation " | ||
| 90 | "with the base station (when connected) to save power."); | ||
| 91 | |||
| 92 | /* 0 (power saving enabled) by default */ | ||
| 93 | static int i2400m_power_save_disabled; | ||
| 94 | module_param_named(power_save_disabled, i2400m_power_save_disabled, int, 0644); | ||
| 95 | MODULE_PARM_DESC(power_save_disabled, | ||
| 96 | "If true, the driver will not tell the device to enter " | ||
| 97 | "power saving mode when it reports it is ready for it. " | ||
| 98 | "False by default (so the device is told to do power " | ||
| 99 | "saving)."); | ||
| 100 | |||
| 86 | int i2400m_passive_mode; /* 0 (passive mode disabled) by default */ | 101 | int i2400m_passive_mode; /* 0 (passive mode disabled) by default */ |
| 87 | module_param_named(passive_mode, i2400m_passive_mode, int, 0644); | 102 | module_param_named(passive_mode, i2400m_passive_mode, int, 0644); |
| 88 | MODULE_PARM_DESC(passive_mode, | 103 | MODULE_PARM_DESC(passive_mode, |
diff --git a/drivers/net/wimax/i2400m/driver.c b/drivers/net/wimax/i2400m/driver.c index 0043cc1152bd..9c8b78d4abd2 100644 --- a/drivers/net/wimax/i2400m/driver.c +++ b/drivers/net/wimax/i2400m/driver.c | |||
| @@ -75,25 +75,6 @@ | |||
| 75 | #include "debug-levels.h" | 75 | #include "debug-levels.h" |
| 76 | 76 | ||
| 77 | 77 | ||
| 78 | int i2400m_idle_mode_disabled; /* 0 (idle mode enabled) by default */ | ||
| 79 | module_param_named(idle_mode_disabled, i2400m_idle_mode_disabled, int, 0644); | ||
| 80 | MODULE_PARM_DESC(idle_mode_disabled, | ||
| 81 | "If true, the device will not enable idle mode negotiation " | ||
| 82 | "with the base station (when connected) to save power."); | ||
| 83 | |||
| 84 | int i2400m_rx_reorder_disabled; /* 0 (rx reorder enabled) by default */ | ||
| 85 | module_param_named(rx_reorder_disabled, i2400m_rx_reorder_disabled, int, 0644); | ||
| 86 | MODULE_PARM_DESC(rx_reorder_disabled, | ||
| 87 | "If true, RX reordering will be disabled."); | ||
| 88 | |||
| 89 | int i2400m_power_save_disabled; /* 0 (power saving enabled) by default */ | ||
| 90 | module_param_named(power_save_disabled, i2400m_power_save_disabled, int, 0644); | ||
| 91 | MODULE_PARM_DESC(power_save_disabled, | ||
| 92 | "If true, the driver will not tell the device to enter " | ||
| 93 | "power saving mode when it reports it is ready for it. " | ||
| 94 | "False by default (so the device is told to do power " | ||
| 95 | "saving)."); | ||
| 96 | |||
| 97 | static char i2400m_debug_params[128]; | 78 | static char i2400m_debug_params[128]; |
| 98 | module_param_string(debug, i2400m_debug_params, sizeof(i2400m_debug_params), | 79 | module_param_string(debug, i2400m_debug_params, sizeof(i2400m_debug_params), |
| 99 | 0644); | 80 | 0644); |
| @@ -395,6 +376,16 @@ retry: | |||
| 395 | result = i2400m_dev_initialize(i2400m); | 376 | result = i2400m_dev_initialize(i2400m); |
| 396 | if (result < 0) | 377 | if (result < 0) |
| 397 | goto error_dev_initialize; | 378 | goto error_dev_initialize; |
| 379 | |||
| 380 | /* We don't want any additional unwanted error recovery triggered | ||
| 381 | * from any other context so if anything went wrong before we come | ||
| 382 | * here, let's keep i2400m->error_recovery untouched and leave it to | ||
| 383 | * dev_reset_handle(). See dev_reset_handle(). */ | ||
| 384 | |||
| 385 | atomic_dec(&i2400m->error_recovery); | ||
| 386 | /* Every thing works so far, ok, now we are ready to | ||
| 387 | * take error recovery if it's required. */ | ||
| 388 | |||
| 398 | /* At this point, reports will come for the device and set it | 389 | /* At this point, reports will come for the device and set it |
| 399 | * to the right state if it is different than UNINITIALIZED */ | 390 | * to the right state if it is different than UNINITIALIZED */ |
| 400 | d_fnend(3, dev, "(net_dev %p [i2400m %p]) = %d\n", | 391 | d_fnend(3, dev, "(net_dev %p [i2400m %p]) = %d\n", |
| @@ -403,10 +394,10 @@ retry: | |||
| 403 | 394 | ||
| 404 | error_dev_initialize: | 395 | error_dev_initialize: |
| 405 | error_check_mac_addr: | 396 | error_check_mac_addr: |
| 397 | error_fw_check: | ||
| 406 | i2400m->ready = 0; | 398 | i2400m->ready = 0; |
| 407 | wmb(); /* see i2400m->ready's documentation */ | 399 | wmb(); /* see i2400m->ready's documentation */ |
| 408 | flush_workqueue(i2400m->work_queue); | 400 | flush_workqueue(i2400m->work_queue); |
| 409 | error_fw_check: | ||
| 410 | if (i2400m->bus_dev_stop) | 401 | if (i2400m->bus_dev_stop) |
| 411 | i2400m->bus_dev_stop(i2400m); | 402 | i2400m->bus_dev_stop(i2400m); |
| 412 | error_bus_dev_start: | 403 | error_bus_dev_start: |
| @@ -436,7 +427,8 @@ int i2400m_dev_start(struct i2400m *i2400m, enum i2400m_bri bm_flags) | |||
| 436 | result = __i2400m_dev_start(i2400m, bm_flags); | 427 | result = __i2400m_dev_start(i2400m, bm_flags); |
| 437 | if (result >= 0) { | 428 | if (result >= 0) { |
| 438 | i2400m->updown = 1; | 429 | i2400m->updown = 1; |
| 439 | wmb(); /* see i2400m->updown's documentation */ | 430 | i2400m->alive = 1; |
| 431 | wmb();/* see i2400m->updown and i2400m->alive's doc */ | ||
| 440 | } | 432 | } |
| 441 | } | 433 | } |
| 442 | mutex_unlock(&i2400m->init_mutex); | 434 | mutex_unlock(&i2400m->init_mutex); |
| @@ -497,7 +489,8 @@ void i2400m_dev_stop(struct i2400m *i2400m) | |||
| 497 | if (i2400m->updown) { | 489 | if (i2400m->updown) { |
| 498 | __i2400m_dev_stop(i2400m); | 490 | __i2400m_dev_stop(i2400m); |
| 499 | i2400m->updown = 0; | 491 | i2400m->updown = 0; |
| 500 | wmb(); /* see i2400m->updown's documentation */ | 492 | i2400m->alive = 0; |
| 493 | wmb(); /* see i2400m->updown and i2400m->alive's doc */ | ||
| 501 | } | 494 | } |
| 502 | mutex_unlock(&i2400m->init_mutex); | 495 | mutex_unlock(&i2400m->init_mutex); |
| 503 | } | 496 | } |
| @@ -617,12 +610,12 @@ int i2400m_post_reset(struct i2400m *i2400m) | |||
| 617 | error_dev_start: | 610 | error_dev_start: |
| 618 | if (i2400m->bus_release) | 611 | if (i2400m->bus_release) |
| 619 | i2400m->bus_release(i2400m); | 612 | i2400m->bus_release(i2400m); |
| 620 | error_bus_setup: | ||
| 621 | /* even if the device was up, it could not be recovered, so we | 613 | /* even if the device was up, it could not be recovered, so we |
| 622 | * mark it as down. */ | 614 | * mark it as down. */ |
| 623 | i2400m->updown = 0; | 615 | i2400m->updown = 0; |
| 624 | wmb(); /* see i2400m->updown's documentation */ | 616 | wmb(); /* see i2400m->updown's documentation */ |
| 625 | mutex_unlock(&i2400m->init_mutex); | 617 | mutex_unlock(&i2400m->init_mutex); |
| 618 | error_bus_setup: | ||
| 626 | d_fnend(3, dev, "(i2400m %p) = %d\n", i2400m, result); | 619 | d_fnend(3, dev, "(i2400m %p) = %d\n", i2400m, result); |
| 627 | return result; | 620 | return result; |
| 628 | } | 621 | } |
| @@ -669,6 +662,9 @@ void __i2400m_dev_reset_handle(struct work_struct *ws) | |||
| 669 | 662 | ||
| 670 | d_fnstart(3, dev, "(ws %p i2400m %p reason %s)\n", ws, i2400m, reason); | 663 | d_fnstart(3, dev, "(ws %p i2400m %p reason %s)\n", ws, i2400m, reason); |
| 671 | 664 | ||
| 665 | i2400m->boot_mode = 1; | ||
| 666 | wmb(); /* Make sure i2400m_msg_to_dev() sees boot_mode */ | ||
| 667 | |||
| 672 | result = 0; | 668 | result = 0; |
| 673 | if (mutex_trylock(&i2400m->init_mutex) == 0) { | 669 | if (mutex_trylock(&i2400m->init_mutex) == 0) { |
| 674 | /* We are still in i2400m_dev_start() [let it fail] or | 670 | /* We are still in i2400m_dev_start() [let it fail] or |
| @@ -679,32 +675,62 @@ void __i2400m_dev_reset_handle(struct work_struct *ws) | |||
| 679 | complete(&i2400m->msg_completion); | 675 | complete(&i2400m->msg_completion); |
| 680 | goto out; | 676 | goto out; |
| 681 | } | 677 | } |
| 682 | if (i2400m->updown == 0) { | 678 | |
| 683 | dev_info(dev, "%s: device is down, doing nothing\n", reason); | ||
| 684 | goto out_unlock; | ||
| 685 | } | ||
| 686 | dev_err(dev, "%s: reinitializing driver\n", reason); | 679 | dev_err(dev, "%s: reinitializing driver\n", reason); |
| 687 | __i2400m_dev_stop(i2400m); | 680 | rmb(); |
| 688 | result = __i2400m_dev_start(i2400m, | 681 | if (i2400m->updown) { |
| 689 | I2400M_BRI_SOFT | I2400M_BRI_MAC_REINIT); | 682 | __i2400m_dev_stop(i2400m); |
| 690 | if (result < 0) { | ||
| 691 | i2400m->updown = 0; | 683 | i2400m->updown = 0; |
| 692 | wmb(); /* see i2400m->updown's documentation */ | ||
