diff options
Diffstat (limited to 'drivers/net/wimax')
-rw-r--r-- | drivers/net/wimax/i2400m/control.c | 22 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/debugfs.c | 2 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/driver.c | 102 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/fw.c | 4 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/i2400m-sdio.h | 1 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/i2400m-usb.h | 6 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/i2400m.h | 36 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/netdev.c | 2 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/op-rfkill.c | 4 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/rx.c | 6 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/sdio-rx.c | 2 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/sdio.c | 1 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/tx.c | 4 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/usb-fw.c | 2 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/usb-rx.c | 2 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/usb-tx.c | 2 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/usb.c | 3 |
17 files changed, 58 insertions, 143 deletions
diff --git a/drivers/net/wimax/i2400m/control.c b/drivers/net/wimax/i2400m/control.c index 9fb03082153a..727d728649b7 100644 --- a/drivers/net/wimax/i2400m/control.c +++ b/drivers/net/wimax/i2400m/control.c | |||
@@ -98,7 +98,7 @@ MODULE_PARM_DESC(power_save_disabled, | |||
98 | "False by default (so the device is told to do power " | 98 | "False by default (so the device is told to do power " |
99 | "saving)."); | 99 | "saving)."); |
100 | 100 | ||
101 | int i2400m_passive_mode; /* 0 (passive mode disabled) by default */ | 101 | static int i2400m_passive_mode; /* 0 (passive mode disabled) by default */ |
102 | module_param_named(passive_mode, i2400m_passive_mode, int, 0644); | 102 | module_param_named(passive_mode, i2400m_passive_mode, int, 0644); |
103 | MODULE_PARM_DESC(passive_mode, | 103 | MODULE_PARM_DESC(passive_mode, |
104 | "If true, the driver will not do any device setup " | 104 | "If true, the driver will not do any device setup " |
@@ -378,7 +378,7 @@ void i2400m_report_tlv_system_state(struct i2400m *i2400m, | |||
378 | * the device's state as sometimes we need to do a link-renew (the BS | 378 | * the device's state as sometimes we need to do a link-renew (the BS |
379 | * wants us to renew a DHCP lease, for example). | 379 | * wants us to renew a DHCP lease, for example). |
380 | * | 380 | * |
381 | * In fact, doc says that everytime we get a link-up, we should do a | 381 | * In fact, doc says that every time we get a link-up, we should do a |
382 | * DHCP negotiation... | 382 | * DHCP negotiation... |
383 | */ | 383 | */ |
384 | static | 384 | static |
@@ -558,8 +558,9 @@ void i2400m_report_hook(struct i2400m *i2400m, | |||
558 | * processing should be done in the function that calls the | 558 | * processing should be done in the function that calls the |
559 | * command. This is here for some cases where it can't happen... | 559 | * command. This is here for some cases where it can't happen... |
560 | */ | 560 | */ |
561 | void i2400m_msg_ack_hook(struct i2400m *i2400m, | 561 | static void i2400m_msg_ack_hook(struct i2400m *i2400m, |
562 | const struct i2400m_l3l4_hdr *l3l4_hdr, size_t size) | 562 | const struct i2400m_l3l4_hdr *l3l4_hdr, |
563 | size_t size) | ||
563 | { | 564 | { |
564 | int result; | 565 | int result; |
565 | struct device *dev = i2400m_dev(i2400m); | 566 | struct device *dev = i2400m_dev(i2400m); |
@@ -674,7 +675,7 @@ void i2400m_msg_to_dev_cancel_wait(struct i2400m *i2400m, int code) | |||
674 | * - the ack message wasn't formatted correctly | 675 | * - the ack message wasn't formatted correctly |
675 | * | 676 | * |
676 | * The returned skb has been allocated with wimax_msg_to_user_alloc(), | 677 | * The returned skb has been allocated with wimax_msg_to_user_alloc(), |
677 | * it contains the reponse in a netlink attribute and is ready to be | 678 | * it contains the response in a netlink attribute and is ready to be |
678 | * passed up to user space with wimax_msg_to_user_send(). To access | 679 | * passed up to user space with wimax_msg_to_user_send(). To access |
679 | * the payload and its length, use wimax_msg_{data,len}() on the skb. | 680 | * the payload and its length, use wimax_msg_{data,len}() on the skb. |
680 | * | 681 | * |
@@ -1135,7 +1136,7 @@ error_alloc: | |||
1135 | * i2400m_report_state_hook() to parse the answer. This will set the | 1136 | * i2400m_report_state_hook() to parse the answer. This will set the |
1136 | * carrier state, as well as the RF Kill switches state. | 1137 | * carrier state, as well as the RF Kill switches state. |
1137 | */ | 1138 | */ |
1138 | int i2400m_cmd_get_state(struct i2400m *i2400m) | 1139 | static int i2400m_cmd_get_state(struct i2400m *i2400m) |
1139 | { | 1140 | { |
1140 | int result; | 1141 | int result; |
1141 | struct device *dev = i2400m_dev(i2400m); | 1142 | struct device *dev = i2400m_dev(i2400m); |
@@ -1177,8 +1178,6 @@ error_msg_to_dev: | |||
1177 | error_alloc: | 1178 | error_alloc: |
1178 | return result; | 1179 | return result; |
1179 | } | 1180 | } |
1180 | EXPORT_SYMBOL_GPL(i2400m_cmd_get_state); | ||
1181 | |||
1182 | 1181 | ||
1183 | /** | 1182 | /** |
1184 | * Set basic configuration settings | 1183 | * Set basic configuration settings |
@@ -1190,8 +1189,9 @@ EXPORT_SYMBOL_GPL(i2400m_cmd_get_state); | |||
1190 | * right endianess (LE). | 1189 | * right endianess (LE). |
1191 | * @arg_size: number of pointers in the @args array | 1190 | * @arg_size: number of pointers in the @args array |
1192 | */ | 1191 | */ |
1193 | int i2400m_set_init_config(struct i2400m *i2400m, | 1192 | static int i2400m_set_init_config(struct i2400m *i2400m, |
1194 | const struct i2400m_tlv_hdr **arg, size_t args) | 1193 | const struct i2400m_tlv_hdr **arg, |
1194 | size_t args) | ||
1195 | { | 1195 | { |
1196 | int result; | 1196 | int result; |
1197 | struct device *dev = i2400m_dev(i2400m); | 1197 | struct device *dev = i2400m_dev(i2400m); |
@@ -1258,8 +1258,6 @@ none: | |||
1258 | return result; | 1258 | return result; |
1259 | 1259 | ||
1260 | } | 1260 | } |
1261 | EXPORT_SYMBOL_GPL(i2400m_set_init_config); | ||
1262 | |||
1263 | 1261 | ||
1264 | /** | 1262 | /** |
1265 | * i2400m_set_idle_timeout - Set the device's idle mode timeout | 1263 | * i2400m_set_idle_timeout - Set the device's idle mode timeout |
diff --git a/drivers/net/wimax/i2400m/debugfs.c b/drivers/net/wimax/i2400m/debugfs.c index b1aec3e1892f..9c70b5fa3f51 100644 --- a/drivers/net/wimax/i2400m/debugfs.c +++ b/drivers/net/wimax/i2400m/debugfs.c | |||
@@ -119,6 +119,7 @@ const struct file_operations i2400m_rx_stats_fops = { | |||
119 | .open = i2400m_stats_open, | 119 | .open = i2400m_stats_open, |
120 | .read = i2400m_rx_stats_read, | 120 | .read = i2400m_rx_stats_read, |
121 | .write = i2400m_rx_stats_write, | 121 | .write = i2400m_rx_stats_write, |
122 | .llseek = default_llseek, | ||
122 | }; | 123 | }; |
123 | 124 | ||
124 | 125 | ||
@@ -171,6 +172,7 @@ const struct file_operations i2400m_tx_stats_fops = { | |||
171 | .open = i2400m_stats_open, | 172 | .open = i2400m_stats_open, |
172 | .read = i2400m_tx_stats_read, | 173 | .read = i2400m_tx_stats_read, |
173 | .write = i2400m_tx_stats_write, | 174 | .write = i2400m_tx_stats_write, |
175 | .llseek = default_llseek, | ||
174 | }; | 176 | }; |
175 | 177 | ||
176 | 178 | ||
diff --git a/drivers/net/wimax/i2400m/driver.c b/drivers/net/wimax/i2400m/driver.c index 9c8b78d4abd2..47cae7150bc1 100644 --- a/drivers/net/wimax/i2400m/driver.c +++ b/drivers/net/wimax/i2400m/driver.c | |||
@@ -92,54 +92,6 @@ MODULE_PARM_DESC(barkers, | |||
92 | "signal; values are appended to a list--setting one value " | 92 | "signal; values are appended to a list--setting one value " |
93 | "as zero cleans the existing list and starts a new one."); | 93 | "as zero cleans the existing list and starts a new one."); |
94 | 94 | ||
95 | static | ||
96 | struct i2400m_work *__i2400m_work_setup( | ||
97 | struct i2400m *i2400m, void (*fn)(struct work_struct *), | ||
98 | gfp_t gfp_flags, const void *pl, size_t pl_size) | ||
99 | { | ||
100 | struct i2400m_work *iw; | ||
101 | |||
102 | iw = kzalloc(sizeof(*iw) + pl_size, gfp_flags); | ||
103 | if (iw == NULL) | ||
104 | return NULL; | ||
105 | iw->i2400m = i2400m_get(i2400m); | ||
106 | iw->pl_size = pl_size; | ||
107 | memcpy(iw->pl, pl, pl_size); | ||
108 | INIT_WORK(&iw->ws, fn); | ||
109 | return iw; | ||
110 | } | ||
111 | |||
112 | |||
113 | /* | ||
114 | * Schedule i2400m's specific work on the system's queue. | ||
115 | * | ||
116 | * Used for a few cases where we really need it; otherwise, identical | ||
117 | * to i2400m_queue_work(). | ||
118 | * | ||
119 | * Returns < 0 errno code on error, 1 if ok. | ||
120 | * | ||
121 | * If it returns zero, something really bad happened, as it means the | ||
122 | * works struct was already queued, but we have just allocated it, so | ||
123 | * it should not happen. | ||
124 | */ | ||
125 | int i2400m_schedule_work(struct i2400m *i2400m, | ||
126 | void (*fn)(struct work_struct *), gfp_t gfp_flags, | ||
127 | const void *pl, size_t pl_size) | ||
128 | { | ||
129 | int result; | ||
130 | struct i2400m_work *iw; | ||
131 | |||
132 | result = -ENOMEM; | ||
133 | iw = __i2400m_work_setup(i2400m, fn, gfp_flags, pl, pl_size); | ||
134 | if (iw != NULL) { | ||
135 | result = schedule_work(&iw->ws); | ||
136 | if (WARN_ON(result == 0)) | ||
137 | result = -ENXIO; | ||
138 | } | ||
139 | return result; | ||
140 | } | ||
141 | |||
142 | |||
143 | /* | 95 | /* |
144 | * WiMAX stack operation: relay a message from user space | 96 | * WiMAX stack operation: relay a message from user space |
145 | * | 97 | * |
@@ -280,7 +232,7 @@ int i2400m_check_mac_addr(struct i2400m *i2400m) | |||
280 | result); | 232 | result); |
281 | goto error; | 233 | goto error; |
282 | } | 234 | } |
283 | /* Extract MAC addresss */ | 235 | /* Extract MAC address */ |
284 | ddi = (void *) skb->data; | 236 | ddi = (void *) skb->data; |
285 | BUILD_BUG_ON(ETH_ALEN != sizeof(ddi->mac_address)); | 237 | BUILD_BUG_ON(ETH_ALEN != sizeof(ddi->mac_address)); |
286 | d_printf(2, dev, "GET DEVICE INFO: mac addr %pM\n", | 238 | d_printf(2, dev, "GET DEVICE INFO: mac addr %pM\n", |
@@ -648,17 +600,11 @@ EXPORT_SYMBOL_GPL(i2400m_post_reset); | |||
648 | static | 600 | static |
649 | void __i2400m_dev_reset_handle(struct work_struct *ws) | 601 | void __i2400m_dev_reset_handle(struct work_struct *ws) |
650 | { | 602 | { |
651 | int result; | 603 | struct i2400m *i2400m = container_of(ws, struct i2400m, reset_ws); |
652 | struct i2400m_work *iw = container_of(ws, struct i2400m_work, ws); | 604 | const char *reason = i2400m->reset_reason; |
653 | const char *reason; | ||
654 | struct i2400m *i2400m = iw->i2400m; | ||
655 | struct device *dev = i2400m_dev(i2400m); | 605 | struct device *dev = i2400m_dev(i2400m); |
656 | struct i2400m_reset_ctx *ctx = i2400m->reset_ctx; | 606 | struct i2400m_reset_ctx *ctx = i2400m->reset_ctx; |
657 | 607 | int result; | |
658 | if (WARN_ON(iw->pl_size != sizeof(reason))) | ||
659 | reason = "SW BUG: reason n/a"; | ||
660 | else | ||
661 | memcpy(&reason, iw->pl, sizeof(reason)); | ||
662 | 608 | ||
663 | d_fnstart(3, dev, "(ws %p i2400m %p reason %s)\n", ws, i2400m, reason); | 609 | d_fnstart(3, dev, "(ws %p i2400m %p reason %s)\n", ws, i2400m, reason); |
664 | 610 | ||
@@ -708,7 +654,7 @@ void __i2400m_dev_reset_handle(struct work_struct *ws) | |||
708 | if (result == -EUCLEAN) { | 654 | if (result == -EUCLEAN) { |
709 | /* | 655 | /* |
710 | * We come here because the reset during operational mode | 656 | * We come here because the reset during operational mode |
711 | * wasn't successully done and need to proceed to a bus | 657 | * wasn't successfully done and need to proceed to a bus |
712 | * reset. For the dev_reset_handle() to be able to handle | 658 | * reset. For the dev_reset_handle() to be able to handle |
713 | * the reset event later properly, we restore boot_mode back | 659 | * the reset event later properly, we restore boot_mode back |
714 | * to the state before previous reset. ie: just like we are | 660 | * to the state before previous reset. ie: just like we are |
@@ -733,8 +679,6 @@ void __i2400m_dev_reset_handle(struct work_struct *ws) | |||
733 | } | 679 | } |
734 | } | 680 | } |
735 | out: | 681 | out: |
736 | i2400m_put(i2400m); | ||
737 | kfree(iw); | ||
738 | d_fnend(3, dev, "(ws %p i2400m %p reason %s) = void\n", | 682 | d_fnend(3, dev, "(ws %p i2400m %p reason %s) = void\n", |
739 | ws, i2400m, reason); | 683 | ws, i2400m, reason); |
740 | } | 684 | } |
@@ -754,8 +698,8 @@ out: | |||
754 | */ | 698 | */ |
755 | int i2400m_dev_reset_handle(struct i2400m *i2400m, const char *reason) | 699 | int i2400m_dev_reset_handle(struct i2400m *i2400m, const char *reason) |
756 | { | 700 | { |
757 | return i2400m_schedule_work(i2400m, __i2400m_dev_reset_handle, | 701 | i2400m->reset_reason = reason; |
758 | GFP_ATOMIC, &reason, sizeof(reason)); | 702 | return schedule_work(&i2400m->reset_ws); |
759 | } | 703 | } |
760 | EXPORT_SYMBOL_GPL(i2400m_dev_reset_handle); | 704 | EXPORT_SYMBOL_GPL(i2400m_dev_reset_handle); |
761 | 705 | ||
@@ -768,14 +712,9 @@ EXPORT_SYMBOL_GPL(i2400m_dev_reset_handle); | |||
768 | static | 712 | static |
769 | void __i2400m_error_recovery(struct work_struct *ws) | 713 | void __i2400m_error_recovery(struct work_struct *ws) |
770 | { | 714 | { |
771 | struct i2400m_work *iw = container_of(ws, struct i2400m_work, ws); | 715 | struct i2400m *i2400m = container_of(ws, struct i2400m, recovery_ws); |
772 | struct i2400m *i2400m = iw->i2400m; | ||
773 | 716 | ||
774 | i2400m_reset(i2400m, I2400M_RT_BUS); | 717 | i2400m_reset(i2400m, I2400M_RT_BUS); |
775 | |||
776 | i2400m_put(i2400m); | ||
777 | kfree(iw); | ||
778 | return; | ||
779 | } | 718 | } |
780 | 719 | ||
781 | /* | 720 | /* |
@@ -805,18 +744,10 @@ void __i2400m_error_recovery(struct work_struct *ws) | |||
805 | */ | 744 | */ |
806 | void i2400m_error_recovery(struct i2400m *i2400m) | 745 | void i2400m_error_recovery(struct i2400m *i2400m) |
807 | { | 746 | { |
808 | struct device *dev = i2400m_dev(i2400m); | 747 | if (atomic_add_return(1, &i2400m->error_recovery) == 1) |
809 | 748 | schedule_work(&i2400m->recovery_ws); | |
810 | if (atomic_add_return(1, &i2400m->error_recovery) == 1) { | 749 | else |
811 | if (i2400m_schedule_work(i2400m, __i2400m_error_recovery, | ||
812 | GFP_ATOMIC, NULL, 0) < 0) { | ||
813 | dev_err(dev, "run out of memory for " | ||
814 | "scheduling an error recovery ?\n"); | ||
815 | atomic_dec(&i2400m->error_recovery); | ||
816 | } | ||
817 | } else | ||
818 | atomic_dec(&i2400m->error_recovery); | 750 | atomic_dec(&i2400m->error_recovery); |
819 | return; | ||
820 | } | 751 | } |
821 | EXPORT_SYMBOL_GPL(i2400m_error_recovery); | 752 | EXPORT_SYMBOL_GPL(i2400m_error_recovery); |
822 | 753 | ||
@@ -824,7 +755,7 @@ EXPORT_SYMBOL_GPL(i2400m_error_recovery); | |||
824 | * Alloc the command and ack buffers for boot mode | 755 | * Alloc the command and ack buffers for boot mode |
825 | * | 756 | * |
826 | * Get the buffers needed to deal with boot mode messages. These | 757 | * Get the buffers needed to deal with boot mode messages. These |
827 | * buffers need to be allocated before the sdio recieve irq is setup. | 758 | * buffers need to be allocated before the sdio receive irq is setup. |
828 | */ | 759 | */ |
829 | static | 760 | static |
830 | int i2400m_bm_buf_alloc(struct i2400m *i2400m) | 761 | int i2400m_bm_buf_alloc(struct i2400m *i2400m) |
@@ -886,6 +817,10 @@ void i2400m_init(struct i2400m *i2400m) | |||
886 | 817 | ||
887 | mutex_init(&i2400m->init_mutex); | 818 | mutex_init(&i2400m->init_mutex); |
888 | /* wake_tx_ws is initialized in i2400m_tx_setup() */ | 819 | /* wake_tx_ws is initialized in i2400m_tx_setup() */ |
820 | |||
821 | INIT_WORK(&i2400m->reset_ws, __i2400m_dev_reset_handle); | ||
822 | INIT_WORK(&i2400m->recovery_ws, __i2400m_error_recovery); | ||
823 | |||
889 | atomic_set(&i2400m->bus_reset_retries, 0); | 824 | atomic_set(&i2400m->bus_reset_retries, 0); |
890 | 825 | ||
891 | i2400m->alive = 0; | 826 | i2400m->alive = 0; |
@@ -1040,6 +975,9 @@ void i2400m_release(struct i2400m *i2400m) | |||
1040 | 975 | ||
1041 | i2400m_dev_stop(i2400m); | 976 | i2400m_dev_stop(i2400m); |
1042 | 977 | ||
978 | cancel_work_sync(&i2400m->reset_ws); | ||
979 | cancel_work_sync(&i2400m->recovery_ws); | ||
980 | |||
1043 | i2400m_debugfs_rm(i2400m); | 981 | i2400m_debugfs_rm(i2400m); |
1044 | sysfs_remove_group(&i2400m->wimax_dev.net_dev->dev.kobj, | 982 | sysfs_remove_group(&i2400m->wimax_dev.net_dev->dev.kobj, |
1045 | &i2400m_dev_attr_group); | 983 | &i2400m_dev_attr_group); |
@@ -1083,8 +1021,6 @@ module_init(i2400m_driver_init); | |||
1083 | static | 1021 | static |
1084 | void __exit i2400m_driver_exit(void) | 1022 | void __exit i2400m_driver_exit(void) |
1085 | { | 1023 | { |
1086 | /* for scheds i2400m_dev_reset_handle() */ | ||
1087 | flush_scheduled_work(); | ||
1088 | i2400m_barker_db_exit(); | 1024 | i2400m_barker_db_exit(); |
1089 | } | 1025 | } |
1090 | module_exit(i2400m_driver_exit); | 1026 | module_exit(i2400m_driver_exit); |
diff --git a/drivers/net/wimax/i2400m/fw.c b/drivers/net/wimax/i2400m/fw.c index 8b55a5b14152..85dadd5bf4be 100644 --- a/drivers/net/wimax/i2400m/fw.c +++ b/drivers/net/wimax/i2400m/fw.c | |||
@@ -54,7 +54,7 @@ | |||
54 | * endpoint and read from it in the notification endpoint. In SDIO we | 54 | * endpoint and read from it in the notification endpoint. In SDIO we |
55 | * talk to it via the write address and read from the read address. | 55 | * talk to it via the write address and read from the read address. |
56 | * | 56 | * |
57 | * Upon entrance to boot mode, the device sends (preceeded with a few | 57 | * Upon entrance to boot mode, the device sends (preceded with a few |
58 | * zero length packets (ZLPs) on the notification endpoint in USB) a | 58 | * zero length packets (ZLPs) on the notification endpoint in USB) a |
59 | * reboot barker (4 le32 words with the same value). We ack it by | 59 | * reboot barker (4 le32 words with the same value). We ack it by |
60 | * sending the same barker to the device. The device acks with a | 60 | * sending the same barker to the device. The device acks with a |
@@ -1589,7 +1589,7 @@ int i2400m_dev_bootstrap(struct i2400m *i2400m, enum i2400m_bri flags) | |||
1589 | i2400m->fw_name = fw_name; | 1589 | i2400m->fw_name = fw_name; |
1590 | ret = i2400m_fw_bootstrap(i2400m, fw, flags); | 1590 | ret = i2400m_fw_bootstrap(i2400m, fw, flags); |
1591 | release_firmware(fw); | 1591 | release_firmware(fw); |
1592 | if (ret >= 0) /* firmware loaded succesfully */ | 1592 | if (ret >= 0) /* firmware loaded successfully */ |
1593 | break; | 1593 | break; |
1594 | i2400m->fw_name = NULL; | 1594 | i2400m->fw_name = NULL; |
1595 | } | 1595 | } |
diff --git a/drivers/net/wimax/i2400m/i2400m-sdio.h b/drivers/net/wimax/i2400m/i2400m-sdio.h index 360d4fb195f4..1d63ffdedfde 100644 --- a/drivers/net/wimax/i2400m/i2400m-sdio.h +++ b/drivers/net/wimax/i2400m/i2400m-sdio.h | |||
@@ -140,7 +140,6 @@ void i2400ms_init(struct i2400ms *i2400ms) | |||
140 | 140 | ||
141 | extern int i2400ms_rx_setup(struct i2400ms *); | 141 | extern int i2400ms_rx_setup(struct i2400ms *); |
142 | extern void i2400ms_rx_release(struct i2400ms *); | 142 | extern void i2400ms_rx_release(struct i2400ms *); |
143 | extern ssize_t __i2400ms_rx_get_size(struct i2400ms *); | ||
144 | 143 | ||
145 | extern int i2400ms_tx_setup(struct i2400ms *); | 144 | extern int i2400ms_tx_setup(struct i2400ms *); |
146 | extern void i2400ms_tx_release(struct i2400ms *); | 145 | extern void i2400ms_tx_release(struct i2400ms *); |
diff --git a/drivers/net/wimax/i2400m/i2400m-usb.h b/drivers/net/wimax/i2400m/i2400m-usb.h index eb80243e22df..6650fde99e1d 100644 --- a/drivers/net/wimax/i2400m/i2400m-usb.h +++ b/drivers/net/wimax/i2400m/i2400m-usb.h | |||
@@ -105,14 +105,14 @@ static inline void edc_init(struct edc *edc) | |||
105 | * | 105 | * |
106 | * @edc: pointer to error density counter. | 106 | * @edc: pointer to error density counter. |
107 | * @max_err: maximum number of errors we can accept over the timeframe | 107 | * @max_err: maximum number of errors we can accept over the timeframe |
108 | * @timeframe: lenght of the timeframe (in jiffies). | 108 | * @timeframe: length of the timeframe (in jiffies). |
109 | * | 109 | * |
110 | * Returns: !0 1 if maximum acceptable errors per timeframe has been | 110 | * Returns: !0 1 if maximum acceptable errors per timeframe has been |
111 | * exceeded. 0 otherwise. | 111 | * exceeded. 0 otherwise. |
112 | * | 112 | * |
113 | * This is way to determine if the number of acceptable errors per time | 113 | * This is way to determine if the number of acceptable errors per time |
114 | * period has been exceeded. It is not accurate as there are cases in which | 114 | * period has been exceeded. It is not accurate as there are cases in which |
115 | * this scheme will not work, for example if there are periodic occurences | 115 | * this scheme will not work, for example if there are periodic occurrences |
116 | * of errors that straddle updates to the start time. This scheme is | 116 | * of errors that straddle updates to the start time. This scheme is |
117 | * sufficient for our usage. | 117 | * sufficient for our usage. |
118 | * | 118 | * |
@@ -204,7 +204,7 @@ enum { | |||
204 | * usb_autopm_get/put_interface() barriers when executing | 204 | * usb_autopm_get/put_interface() barriers when executing |
205 | * commands. See doc in i2400mu_suspend() for more information. | 205 | * commands. See doc in i2400mu_suspend() for more information. |
206 | * | 206 | * |
207 | * @rx_size_auto_shrink: if true, the rx_size is shrinked | 207 | * @rx_size_auto_shrink: if true, the rx_size is shrunk |
208 | * automatically based on the average size of the received | 208 | * automatically based on the average size of the received |
209 | * transactions. This allows the receive code to allocate smaller | 209 | * transactions. This allows the receive code to allocate smaller |
210 | * chunks of memory and thus reduce pressure on the memory | 210 | * chunks of memory and thus reduce pressure on the memory |
diff --git a/drivers/net/wimax/i2400m/i2400m.h b/drivers/net/wimax/i2400m/i2400m.h index fa74777fd65f..5eacc653a94d 100644 --- a/drivers/net/wimax/i2400m/i2400m.h +++ b/drivers/net/wimax/i2400m/i2400m.h | |||
@@ -186,7 +186,7 @@ enum { | |||
186 | * struct i2400m_poke_table - Hardware poke table for the Intel 2400m | 186 | * struct i2400m_poke_table - Hardware poke table for the Intel 2400m |
187 | * | 187 | * |
188 | * This structure will be used to create a device specific poke table | 188 | * This structure will be used to create a device specific poke table |
189 | * to put the device in a consistant state at boot time. | 189 | * to put the device in a consistent state at boot time. |
190 | * | 190 | * |
191 | * @address: The device address to poke | 191 | * @address: The device address to poke |
192 | * | 192 | * |
@@ -526,7 +526,7 @@ struct i2400m_barker_db; | |||
526 | * | 526 | * |
527 | * @barker: barker type that the device uses; this is initialized by | 527 | * @barker: barker type that the device uses; this is initialized by |
528 | * i2400m_is_boot_barker() the first time it is called. Then it | 528 | * i2400m_is_boot_barker() the first time it is called. Then it |
529 | * won't change during the life cycle of the device and everytime | 529 | * won't change during the life cycle of the device and every time |
530 | * a boot barker is received, it is just verified for it being the | 530 | * a boot barker is received, it is just verified for it being the |
531 | * same. | 531 | * same. |
532 | * | 532 | * |
@@ -632,6 +632,11 @@ struct i2400m { | |||
632 | struct work_struct wake_tx_ws; | 632 | struct work_struct wake_tx_ws; |
633 | struct sk_buff *wake_tx_skb; | 633 | struct sk_buff *wake_tx_skb; |
634 | 634 | ||
635 | struct work_struct reset_ws; | ||
636 | const char *reset_reason; | ||
637 | |||
638 | struct work_struct recovery_ws; | ||
639 | |||
635 | struct dentry *debugfs_dentry; | 640 | struct dentry *debugfs_dentry; |
636 | const char *fw_name; /* name of the current firmware image */ | 641 | const char *fw_name; /* name of the current firmware image */ |
637 | unsigned long fw_version; /* version of the firmware interface */ | 642 | unsigned long fw_version; /* version of the firmware interface */ |
@@ -698,7 +703,7 @@ enum i2400m_bm_cmd_flags { | |||
698 | * @I2400M_BRI_MAC_REINIT: We need to reinitialize the boot | 703 | * @I2400M_BRI_MAC_REINIT: We need to reinitialize the boot |
699 | * rom after reading the MAC address. This is quite a dirty hack, | 704 | * rom after reading the MAC address. This is quite a dirty hack, |
700 | * if you ask me -- the device requires the bootrom to be | 705 | * if you ask me -- the device requires the bootrom to be |
701 | * intialized after reading the MAC address. | 706 | * initialized after reading the MAC address. |
702 | */ | 707 | */ |
703 | enum i2400m_bri { | 708 | enum i2400m_bri { |
704 | I2400M_BRI_SOFT = 1 << 1, | 709 | I2400M_BRI_SOFT = 1 << 1, |
@@ -896,42 +901,19 @@ struct device *i2400m_dev(struct i2400m *i2400m) | |||
896 | return i2400m->wimax_dev.net_dev->dev.parent; | 901 | return i2400m->wimax_dev.net_dev->dev.parent; |
897 | } | 902 | } |
898 | 903 | ||
899 | /* | ||
900 | * Helper for scheduling simple work functions | ||
901 | * | ||
902 | * This struct can get any kind of payload attached (normally in the | ||
903 | * form of a struct where you pack the stuff you want to pass to the | ||
904 | * _work function). | ||
905 | */ | ||
906 | struct i2400m_work { | ||
907 | struct work_struct ws; | ||
908 | struct i2400m *i2400m; | ||
909 | size_t pl_size; | ||
910 | u8 pl[0]; | ||
911 | }; | ||
912 | |||
913 | extern int i2400m_schedule_work(struct i2400m *, | ||
914 | void (*)(struct work_struct *), gfp_t, | ||
915 | const void *, size_t); | ||
916 | |||
917 | extern int i2400m_msg_check_status(const struct i2400m_l3l4_hdr *, | 904 | extern int i2400m_msg_check_status(const struct i2400m_l3l4_hdr *, |
918 | char *, size_t); | 905 | char *, size_t); |
919 | extern int i2400m_msg_size_check(struct i2400m *, | 906 | extern int i2400m_msg_size_check(struct i2400m *, |
920 | const struct i2400m_l3l4_hdr *, size_t); | 907 | const struct i2400m_l3l4_hdr *, size_t); |
921 | extern struct sk_buff *i2400m_msg_to_dev(struct i2400m *, const void *, size_t); | 908 | extern struct sk_buff *i2400m_msg_to_dev(struct i2400m *, const void *, size_t); |
922 | extern void i2400m_msg_to_dev_cancel_wait(struct i2400m *, int); | 909 | extern void i2400m_msg_to_dev_cancel_wait(struct i2400m *, int); |
923 | extern void i2400m_msg_ack_hook(struct i2400m *, | ||
924 | const struct i2400m_l3l4_hdr *, size_t); | ||
925 | extern void i2400m_report_hook(struct i2400m *, | 910 | extern void i2400m_report_hook(struct i2400m *, |
926 | const struct i2400m_l3l4_hdr *, size_t); | 911 | const struct i2400m_l3l4_hdr *, size_t); |
927 | extern void i2400m_report_hook_work(struct work_struct *); | 912 | extern void i2400m_report_hook_work(struct work_struct *); |
928 | extern int i2400m_cmd_enter_powersave(struct i2400m *); | 913 | extern int i2400m_cmd_enter_powersave(struct i2400m *); |
929 | extern int i2400m_cmd_get_state(struct i2400m *); | ||
930 | extern int i2400m_cmd_exit_idle(struct i2400m *); | 914 | extern int i2400m_cmd_exit_idle(struct i2400m *); |
931 | extern struct sk_buff *i2400m_get_device_info(struct i2400m *); | 915 | extern struct sk_buff *i2400m_get_device_info(struct i2400m *); |
932 | extern int i2400m_firmware_check(struct i2400m *); | 916 | extern int i2400m_firmware_check(struct i2400m *); |
933 | extern int i2400m_set_init_config(struct i2400m *, | ||
934 | const struct i2400m_tlv_hdr **, size_t); | ||
935 | extern int i2400m_set_idle_timeout(struct i2400m *, unsigned); | 917 | extern int i2400m_set_idle_timeout(struct i2400m *, unsigned); |
936 | 918 | ||
937 | static inline | 919 | static inline |
@@ -946,7 +928,7 @@ extern void i2400m_report_tlv_rf_switches_status( | |||
946 | struct i2400m *, const struct i2400m_tlv_rf_switches_status *); | 928 | struct i2400m *, const struct i2400m_tlv_rf_switches_status *); |
947 | 929 | ||
948 | /* | 930 | /* |
949 | * Helpers for firmware backwards compability | 931 | * Helpers for firmware backwards compatibility |
950 | * | 932 | * |
951 | * As we aim to support at least the firmware version that was | 933 | * As we aim to support at least the firmware version that was |
952 | * released with the previous kernel/driver release, some code will be | 934 | * released with the previous kernel/driver release, some code will be |
diff --git a/drivers/net/wimax/i2400m/netdev.c b/drivers/net/wimax/i2400m/netdev.c index 94742e1eafe0..2edd8fe1c1f3 100644 --- a/drivers/net/wimax/i2400m/netdev.c +++ b/drivers/net/wimax/i2400m/netdev.c | |||
@@ -166,7 +166,7 @@ void i2400m_wake_tx_work(struct work_struct *ws) | |||
166 | d_fnstart(3, dev, "(ws %p i2400m %p skb %p)\n", ws, i2400m, skb); | 166 | d_fnstart(3, dev, "(ws %p i2400m %p skb %p)\n", ws, i2400m, skb); |
167 | result = -EINVAL; | 167 | result = -EINVAL; |
168 | if (skb == NULL) { | 168 | if (skb == NULL) { |
169 | dev_err(dev, "WAKE&TX: skb dissapeared!\n"); | 169 | dev_err(dev, "WAKE&TX: skb disappeared!\n"); |
170 | goto out_put; | 170 | goto out_put; |
171 | } | 171 | } |
172 | /* If we have, somehow, lost the connection after this was | 172 | /* If we have, somehow, lost the connection after this was |
diff --git a/drivers/net/wimax/i2400m/op-rfkill.c b/drivers/net/wimax/i2400m/op-rfkill.c index 9e02b90b0080..b0dba35a8ad2 100644 --- a/drivers/net/wimax/i2400m/op-rfkill.c +++ b/drivers/net/wimax/i2400m/op-rfkill.c | |||
@@ -27,7 +27,7 @@ | |||
27 | * - report changes in the HW RF Kill switch [with | 27 | * - report changes in the HW RF Kill switch [with |
28 | * wimax_rfkill_{sw,hw}_report(), which happens when we detect those | 28 | * wimax_rfkill_{sw,hw}_report(), which happens when we detect those |
29 | * indications coming through hardware reports]. We also do it on | 29 | * indications coming through hardware reports]. We also do it on |
30 | * initialization to let the stack know the intial HW state. | 30 | * initialization to let the stack know the initial HW state. |
31 | * | 31 | * |
32 | * - implement indications from the stack to change the SW RF Kill | 32 | * - implement indications from the stack to change the SW RF Kill |
33 | * switch (coming from sysfs, the wimax stack or user space). | 33 | * switch (coming from sysfs, the wimax stack or user space). |
@@ -73,7 +73,7 @@ int i2400m_radio_is(struct i2400m *i2400m, enum wimax_rf_state state) | |||
73 | * Generic Netlink will call this function when a message is sent from | 73 | * Generic Netlink will call this function when a message is sent from |
74 | * userspace to change the software RF-Kill switch status. | 74 | * userspace to change the software RF-Kill switch status. |
75 | * | 75 | * |
76 | * This function will set the device's sofware RF-Kill switch state to | 76 | * This function will set the device's software RF-Kill switch state to |
77 | * match what is requested. | 77 | * match what is requested. |
78 | * | 78 | * |
79 | * NOTE: the i2400m has a strict state machine; we can only set the | 79 | * NOTE: the i2400m has a strict state machine; we can only set the |
diff --git a/drivers/net/wimax/i2400m/rx.c b/drivers/net/wimax/i2400m/rx.c index 1737d1488b35..2f94a872101f 100644 --- a/drivers/net/wimax/i2400m/rx.c +++ b/drivers/net/wimax/i2400m/rx.c | |||
@@ -349,7 +349,7 @@ error_no_waiter: | |||
349 | * | 349 | * |
350 | * For reports: We can't clone the original skb where the data is | 350 | * For reports: We can't clone the original skb where the data is |
351 | * because we need to send this up via netlink; netlink has to add | 351 | * because we need to send this up via netlink; netlink has to add |
352 | * headers and we can't overwrite what's preceeding the payload...as | 352 | * headers and we can't overwrite what's preceding the payload...as |
353 | * it is another message. So we just dup them. | 353 | * it is another message. So we just dup them. |
354 | */ | 354 | */ |
355 | static | 355 | static |
@@ -425,7 +425,7 @@ error_check: | |||
425 | * | 425 | * |
426 | * As in i2400m_rx_ctl(), we can't clone the original skb where the | 426 | * As in i2400m_rx_ctl(), we can't clone the original skb where the |
427 | * data is because we need to send this up via netlink; netlink has to | 427 | * data is because we need to send this up via netlink; netlink has to |
428 | * add headers and we can't overwrite what's preceeding the | 428 | * add headers and we can't overwrite what's preceding the |
429 | * payload...as it is another message. So we just dup them. | 429 | * payload...as it is another message. So we just dup them. |
430 | */ | 430 | */ |
431 | static | 431 | static |
@@ -922,7 +922,7 @@ void i2400m_roq_queue_update_ws(struct i2400m *i2400m, struct i2400m_roq *roq, | |||
922 | * rx_roq_refcount becomes zero. This routine gets executed when | 922 | * rx_roq_refcount becomes zero. This routine gets executed when |
923 | * rx_roq_refcount becomes zero. | 923 | * rx_roq_refcount becomes zero. |
924 | */ | 924 | */ |
925 | void i2400m_rx_roq_destroy(struct kref *ref) | 925 | static void i2400m_rx_roq_destroy(struct kref *ref) |
926 | { | 926 | { |
927 | unsigned itr; | 927 | unsigned itr; |
928 | struct i2400m *i2400m | 928 | struct i2400m *i2400m |
diff --git a/drivers/net/wimax/i2400m/sdio-rx.c b/drivers/net/wimax/i2400m/sdio-rx.c index 8b809c2ead6c..fb6396dd115f 100644 --- a/drivers/net/wimax/i2400m/sdio-rx.c +++ b/drivers/net/wimax/i2400m/sdio-rx.c | |||
@@ -87,7 +87,7 @@ static const __le32 i2400m_ACK_BARKER[4] = { | |||
87 | * | 87 | * |
88 | * sdio_readl() doesn't work. | 88 | * sdio_readl() doesn't work. |
89 | */ | 89 | */ |
90 | ssize_t __i2400ms_rx_get_size(struct i2400ms *i2400ms) | 90 | static ssize_t __i2400ms_rx_get_size(struct i2400ms *i2400ms) |
91 | { | 91 | { |
92 | int ret, cnt, val; | 92 | int ret, cnt, val; |
93 | ssize_t rx_size; | 93 | ssize_t rx_size; |
diff --git a/drivers/net/wimax/i2400m/sdio.c b/drivers/net/wimax/i2400m/sdio.c index 9bfc26e1bc6b..be428cae28d8 100644 --- a/drivers/net/wimax/i2400m/sdio.c +++ b/drivers/net/wimax/i2400m/sdio.c | |||
@@ -590,7 +590,6 @@ module_init(i2400ms_driver_init); | |||
590 | static | 590 | static |
591 | void __exit i2400ms_driver_exit(void) | 591 | void __exit i2400ms_driver_exit(void) |
592 | { | 592 | { |
593 | flush_scheduled_work(); /* for the stuff we schedule */ | ||
594 | sdio_unregister_driver(&i2400m_sdio_driver); | 593 | sdio_unregister_driver(&i2400m_sdio_driver); |
595 | } | 594 | } |
596 | module_exit(i2400ms_driver_exit); | 595 | module_exit(i2400ms_driver_exit); |
diff --git a/drivers/net/wimax/i2400m/tx.c b/drivers/net/wimax/i2400m/tx.c index 3f819efc06b5..4b30ed11d785 100644 --- a/drivers/net/wimax/i2400m/tx.c +++ b/drivers/net/wimax/i2400m/tx.c | |||
@@ -149,7 +149,7 @@ | |||
149 | * (with a moved message header to make sure it is size-aligned to | 149 | * (with a moved message header to make sure it is size-aligned to |
150 | * 16), TAIL room that was unusable (and thus is marked with a message | 150 | * 16), TAIL room that was unusable (and thus is marked with a message |
151 | * header that says 'skip this') and at the head of the buffer, an | 151 | * header that says 'skip this') and at the head of the buffer, an |
152 | * imcomplete message with a couple of payloads. | 152 | * incomplete message with a couple of payloads. |
153 | * | 153 | * |
154 | * N ___________________________________________________ | 154 | * N ___________________________________________________ |
155 | * | | | 155 | * | | |
@@ -819,7 +819,7 @@ EXPORT_SYMBOL_GPL(i2400m_tx); | |||
819 | * the FIF that is ready for transmission. | 819 | * the FIF that is ready for transmission. |
820 | * | 820 | * |
821 | * It sets the state in @i2400m to indicate the bus-specific driver is | 821 | * It sets the state in @i2400m to indicate the bus-specific driver is |
822 | * transfering that message (i2400m->tx_msg_size). | 822 | * transferring that message (i2400m->tx_msg_size). |
823 | * | 823 | * |
824 | * Once the transfer is completed, call i2400m_tx_msg_sent(). | 824 | * Once the transfer is completed, call i2400m_tx_msg_sent(). |
825 | * | 825 | * |
diff --git a/drivers/net/wimax/i2400m/usb-fw.c b/drivers/net/wimax/i2400m/usb-fw.c index b58ec56b86f8..1fda46c55eb3 100644 --- a/drivers/net/wimax/i2400m/usb-fw.c +++ b/drivers/net/wimax/i2400m/usb-fw.c | |||
@@ -169,7 +169,7 @@ retry: | |||
169 | * | 169 | * |
170 | * Command can be a raw command, which requires no preparation (and | 170 | * Command can be a raw command, which requires no preparation (and |
171 | * which might not even be following the command format). Checks that | 171 | * which might not even be following the command format). Checks that |
172 | * the right amount of data was transfered. | 172 | * the right amount of data was transferred. |
173 | * | 173 | * |
174 | * To satisfy USB requirements (no onstack, vmalloc or in data segment | 174 | * To satisfy USB requirements (no onstack, vmalloc or in data segment |
175 | * buffers), we copy the command to i2400m->bm_cmd_buf and send it from | 175 | * buffers), we copy the command to i2400m->bm_cmd_buf and send it from |
diff --git a/drivers/net/wimax/i2400m/usb-rx.c b/drivers/net/wimax/i2400m/usb-rx.c index a26483a812a5..e3257681e360 100644 --- a/drivers/net/wimax/i2400m/usb-rx.c +++ b/drivers/net/wimax/i2400m/usb-rx.c | |||
@@ -58,7 +58,7 @@ | |||
58 | * a zillion reads; by serializing, we are throttling. | 58 | * a zillion reads; by serializing, we are throttling. |
59 | * | 59 | * |
60 | * - RX data processing can get heavy enough so that it is not | 60 | * - RX data processing can get heavy enough so that it is not |
61 | * appropiate for doing it in the USB callback; thus we run it in a | 61 | * appropriate for doing it in the USB callback; thus we run it in a |
62 | * process context. | 62 | * process context. |
63 | * | 63 | * |
64 | * We provide a read buffer of an arbitrary size (short of a page); if | 64 | * We provide a read buffer of an arbitrary size (short of a page); if |
diff --git a/drivers/net/wimax/i2400m/usb-tx.c b/drivers/net/wimax/i2400m/usb-tx.c index c65b9979f87e..ac357acfb3e9 100644 --- a/drivers/net/wimax/i2400m/usb-tx.c +++ b/drivers/net/wimax/i2400m/usb-tx.c | |||
@@ -168,7 +168,7 @@ retry: | |||
168 | /* | 168 | /* |
169 | * Get the next TX message in the TX FIFO and send it to the device | 169 | * Get the next TX message in the TX FIFO and send it to the device |
170 | * | 170 | * |
171 | * Note we exit the loop if i2400mu_tx() fails; that funtion only | 171 | * Note we exit the loop if i2400mu_tx() fails; that function only |
172 | * fails on hard error (failing to tx a buffer not being one of them, | 172 | * fails on hard error (failing to tx a buffer not being one of them, |
173 | * see its doc). | 173 | * see its doc). |
174 | * | 174 | * |
diff --git a/drivers/net/wimax/i2400m/usb.c b/drivers/net/wimax/i2400m/usb.c index d3365ac85dde..298f2b0b6311 100644 --- a/drivers/net/wimax/i2400m/usb.c +++ b/drivers/net/wimax/i2400m/usb.c | |||
@@ -514,7 +514,7 @@ int i2400mu_probe(struct usb_interface *iface, | |||
514 | #ifdef CONFIG_PM | 514 | #ifdef CONFIG_PM |
515 | iface->needs_remote_wakeup = 1; /* autosuspend (15s delay) */ | 515 | iface->needs_remote_wakeup = 1; /* autosuspend (15s delay) */ |
516 | device_init_wakeup(dev, 1); | 516 | device_init_wakeup(dev, 1); |
517 | usb_dev->autosuspend_delay = 15 * HZ; | 517 | pm_runtime_set_autosuspend_delay(&usb_dev->dev, 15000); |
518 | usb_enable_autosuspend(usb_dev); | 518 | usb_enable_autosuspend(usb_dev); |
519 | #endif | 519 | #endif |
520 | 520 | ||
@@ -780,7 +780,6 @@ module_init(i2400mu_driver_init); | |||
780 | static | 780 | static |
781 | void __exit i2400mu_driver_exit(void) | 781 | void __exit i2400mu_driver_exit(void) |
782 | { | 782 | { |
783 | flush_scheduled_work(); /* for the stuff we schedule from sysfs.c */ | ||
784 | usb_deregister(&i2400mu_driver); | 783 | usb_deregister(&i2400mu_driver); |
785 | } | 784 | } |
786 | module_exit(i2400mu_driver_exit); | 785 | module_exit(i2400mu_driver_exit); |