diff options
Diffstat (limited to 'drivers/net/wireless/iwlegacy')
-rw-r--r-- | drivers/net/wireless/iwlegacy/3945-mac.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/3945-rs.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/4965-mac.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/4965-rs.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/common.c | 31 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/debug.c | 12 |
6 files changed, 25 insertions, 42 deletions
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c index 0c1209390169..faec40467208 100644 --- a/drivers/net/wireless/iwlegacy/3945-mac.c +++ b/drivers/net/wireless/iwlegacy/3945-mac.c | |||
@@ -2673,8 +2673,6 @@ il3945_bg_restart(struct work_struct *data) | |||
2673 | 2673 | ||
2674 | if (test_and_clear_bit(S_FW_ERROR, &il->status)) { | 2674 | if (test_and_clear_bit(S_FW_ERROR, &il->status)) { |
2675 | mutex_lock(&il->mutex); | 2675 | mutex_lock(&il->mutex); |
2676 | /* FIXME: vif can be dereferenced */ | ||
2677 | il->vif = NULL; | ||
2678 | il->is_open = 0; | 2676 | il->is_open = 0; |
2679 | mutex_unlock(&il->mutex); | 2677 | mutex_unlock(&il->mutex); |
2680 | il3945_down(il); | 2678 | il3945_down(il); |
diff --git a/drivers/net/wireless/iwlegacy/3945-rs.c b/drivers/net/wireless/iwlegacy/3945-rs.c index 70bee1a4d876..4b10157d8686 100644 --- a/drivers/net/wireless/iwlegacy/3945-rs.c +++ b/drivers/net/wireless/iwlegacy/3945-rs.c | |||
@@ -821,12 +821,6 @@ out: | |||
821 | } | 821 | } |
822 | 822 | ||
823 | #ifdef CONFIG_MAC80211_DEBUGFS | 823 | #ifdef CONFIG_MAC80211_DEBUGFS |
824 | static int | ||
825 | il3945_open_file_generic(struct inode *inode, struct file *file) | ||
826 | { | ||
827 | file->private_data = inode->i_private; | ||
828 | return 0; | ||
829 | } | ||
830 | 824 | ||
831 | static ssize_t | 825 | static ssize_t |
832 | il3945_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf, | 826 | il3945_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf, |
@@ -862,7 +856,7 @@ il3945_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf, | |||
862 | 856 | ||
863 | static const struct file_operations rs_sta_dbgfs_stats_table_ops = { | 857 | static const struct file_operations rs_sta_dbgfs_stats_table_ops = { |
864 | .read = il3945_sta_dbgfs_stats_table_read, | 858 | .read = il3945_sta_dbgfs_stats_table_read, |
865 | .open = il3945_open_file_generic, | 859 | .open = simple_open, |
866 | .llseek = default_llseek, | 860 | .llseek = default_llseek, |
867 | }; | 861 | }; |
868 | 862 | ||
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c index 17f1c6853182..c46275a92565 100644 --- a/drivers/net/wireless/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/iwlegacy/4965-mac.c | |||
@@ -5652,8 +5652,6 @@ il4965_bg_restart(struct work_struct *data) | |||
5652 | 5652 | ||
5653 | if (test_and_clear_bit(S_FW_ERROR, &il->status)) { | 5653 | if (test_and_clear_bit(S_FW_ERROR, &il->status)) { |
5654 | mutex_lock(&il->mutex); | 5654 | mutex_lock(&il->mutex); |
5655 | /* FIXME: do we dereference vif without mutex locked ? */ | ||
5656 | il->vif = NULL; | ||
5657 | il->is_open = 0; | 5655 | il->is_open = 0; |
5658 | 5656 | ||
5659 | __il4965_down(il); | 5657 | __il4965_down(il); |
diff --git a/drivers/net/wireless/iwlegacy/4965-rs.c b/drivers/net/wireless/iwlegacy/4965-rs.c index d7e2856e41d3..11ab1247fae1 100644 --- a/drivers/net/wireless/iwlegacy/4965-rs.c +++ b/drivers/net/wireless/iwlegacy/4965-rs.c | |||
@@ -2518,12 +2518,6 @@ il4965_rs_free_sta(void *il_r, struct ieee80211_sta *sta, void *il_sta) | |||
2518 | } | 2518 | } |
2519 | 2519 | ||
2520 | #ifdef CONFIG_MAC80211_DEBUGFS | 2520 | #ifdef CONFIG_MAC80211_DEBUGFS |
2521 | static int | ||
2522 | il4965_open_file_generic(struct inode *inode, struct file *file) | ||
2523 | { | ||
2524 | file->private_data = inode->i_private; | ||
2525 | return 0; | ||
2526 | } | ||
2527 | 2521 | ||
2528 | static void | 2522 | static void |
2529 | il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta, u32 * rate_n_flags, int idx) | 2523 | il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta, u32 * rate_n_flags, int idx) |
@@ -2695,7 +2689,7 @@ il4965_rs_sta_dbgfs_scale_table_read(struct file *file, char __user *user_buf, | |||
2695 | static const struct file_operations rs_sta_dbgfs_scale_table_ops = { | 2689 | static const struct file_operations rs_sta_dbgfs_scale_table_ops = { |
2696 | .write = il4965_rs_sta_dbgfs_scale_table_write, | 2690 | .write = il4965_rs_sta_dbgfs_scale_table_write, |
2697 | .read = il4965_rs_sta_dbgfs_scale_table_read, | 2691 | .read = il4965_rs_sta_dbgfs_scale_table_read, |
2698 | .open = il4965_open_file_generic, | 2692 | .open = simple_open, |
2699 | .llseek = default_llseek, | 2693 | .llseek = default_llseek, |
2700 | }; | 2694 | }; |
2701 | 2695 | ||
@@ -2740,7 +2734,7 @@ il4965_rs_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf, | |||
2740 | 2734 | ||
2741 | static const struct file_operations rs_sta_dbgfs_stats_table_ops = { | 2735 | static const struct file_operations rs_sta_dbgfs_stats_table_ops = { |
2742 | .read = il4965_rs_sta_dbgfs_stats_table_read, | 2736 | .read = il4965_rs_sta_dbgfs_stats_table_read, |
2743 | .open = il4965_open_file_generic, | 2737 | .open = simple_open, |
2744 | .llseek = default_llseek, | 2738 | .llseek = default_llseek, |
2745 | }; | 2739 | }; |
2746 | 2740 | ||
@@ -2768,7 +2762,7 @@ il4965_rs_sta_dbgfs_rate_scale_data_read(struct file *file, | |||
2768 | 2762 | ||
2769 | static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = { | 2763 | static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = { |
2770 | .read = il4965_rs_sta_dbgfs_rate_scale_data_read, | 2764 | .read = il4965_rs_sta_dbgfs_rate_scale_data_read, |
2771 | .open = il4965_open_file_generic, | 2765 | .open = simple_open, |
2772 | .llseek = default_llseek, | 2766 | .llseek = default_llseek, |
2773 | }; | 2767 | }; |
2774 | 2768 | ||
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c index e5ac04739bcc..eaf249452e51 100644 --- a/drivers/net/wireless/iwlegacy/common.c +++ b/drivers/net/wireless/iwlegacy/common.c | |||
@@ -4508,6 +4508,7 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
4508 | { | 4508 | { |
4509 | struct il_priv *il = hw->priv; | 4509 | struct il_priv *il = hw->priv; |
4510 | int err; | 4510 | int err; |
4511 | bool reset; | ||
4511 | 4512 | ||
4512 | mutex_lock(&il->mutex); | 4513 | mutex_lock(&il->mutex); |
4513 | D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr); | 4514 | D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr); |
@@ -4518,7 +4519,12 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
4518 | goto out; | 4519 | goto out; |
4519 | } | 4520 | } |
4520 | 4521 | ||
4521 | if (il->vif) { | 4522 | /* |
4523 | * We do not support multiple virtual interfaces, but on hardware reset | ||
4524 | * we have to add the same interface again. | ||
4525 | */ | ||
4526 | reset = (il->vif == vif); | ||
4527 | if (il->vif && !reset) { | ||
4522 | err = -EOPNOTSUPP; | 4528 | err = -EOPNOTSUPP; |
4523 | goto out; | 4529 | goto out; |
4524 | } | 4530 | } |
@@ -4528,8 +4534,11 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
4528 | 4534 | ||
4529 | err = il_set_mode(il); | 4535 | err = il_set_mode(il); |
4530 | if (err) { | 4536 | if (err) { |
4531 | il->vif = NULL; | 4537 | IL_WARN("Fail to set mode %d\n", vif->type); |
4532 | il->iw_mode = NL80211_IFTYPE_STATION; | 4538 | if (!reset) { |
4539 | il->vif = NULL; | ||
4540 | il->iw_mode = NL80211_IFTYPE_STATION; | ||
4541 | } | ||
4533 | } | 4542 | } |
4534 | 4543 | ||
4535 | out: | 4544 | out: |
@@ -5279,9 +5288,9 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
5279 | D_MAC80211("BSSID %pM\n", bss_conf->bssid); | 5288 | D_MAC80211("BSSID %pM\n", bss_conf->bssid); |
5280 | 5289 | ||
5281 | /* | 5290 | /* |
5282 | * If there is currently a HW scan going on in the | 5291 | * If there is currently a HW scan going on in the background, |
5283 | * background then we need to cancel it else the RXON | 5292 | * then we need to cancel it, otherwise sometimes we are not |
5284 | * below/in post_associate will fail. | 5293 | * able to authenticate (FIXME: why ?) |
5285 | */ | 5294 | */ |
5286 | if (il_scan_cancel_timeout(il, 100)) { | 5295 | if (il_scan_cancel_timeout(il, 100)) { |
5287 | D_MAC80211("leave - scan abort failed\n"); | 5296 | D_MAC80211("leave - scan abort failed\n"); |
@@ -5290,14 +5299,10 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
5290 | } | 5299 | } |
5291 | 5300 | ||
5292 | /* mac80211 only sets assoc when in STATION mode */ | 5301 | /* mac80211 only sets assoc when in STATION mode */ |
5293 | if (vif->type == NL80211_IFTYPE_ADHOC || bss_conf->assoc) { | 5302 | memcpy(il->staging.bssid_addr, bss_conf->bssid, ETH_ALEN); |
5294 | memcpy(il->staging.bssid_addr, bss_conf->bssid, | ||
5295 | ETH_ALEN); | ||
5296 | 5303 | ||
5297 | /* currently needed in a few places */ | 5304 | /* FIXME: currently needed in a few places */ |
5298 | memcpy(il->bssid, bss_conf->bssid, ETH_ALEN); | 5305 | memcpy(il->bssid, bss_conf->bssid, ETH_ALEN); |
5299 | } else | ||
5300 | il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | ||
5301 | } | 5306 | } |
5302 | 5307 | ||
5303 | /* | 5308 | /* |
diff --git a/drivers/net/wireless/iwlegacy/debug.c b/drivers/net/wireless/iwlegacy/debug.c index 229849150aac..eff26501d60a 100644 --- a/drivers/net/wireless/iwlegacy/debug.c +++ b/drivers/net/wireless/iwlegacy/debug.c | |||
@@ -160,18 +160,12 @@ static ssize_t il_dbgfs_##name##_write(struct file *file, \ | |||
160 | const char __user *user_buf, \ | 160 | const char __user *user_buf, \ |
161 | size_t count, loff_t *ppos); | 161 | size_t count, loff_t *ppos); |
162 | 162 | ||
163 | static int | ||
164 | il_dbgfs_open_file_generic(struct inode *inode, struct file *file) | ||
165 | { | ||
166 | file->private_data = inode->i_private; | ||
167 | return 0; | ||
168 | } | ||
169 | 163 | ||
170 | #define DEBUGFS_READ_FILE_OPS(name) \ | 164 | #define DEBUGFS_READ_FILE_OPS(name) \ |
171 | DEBUGFS_READ_FUNC(name); \ | 165 | DEBUGFS_READ_FUNC(name); \ |
172 | static const struct file_operations il_dbgfs_##name##_ops = { \ | 166 | static const struct file_operations il_dbgfs_##name##_ops = { \ |
173 | .read = il_dbgfs_##name##_read, \ | 167 | .read = il_dbgfs_##name##_read, \ |
174 | .open = il_dbgfs_open_file_generic, \ | 168 | .open = simple_open, \ |
175 | .llseek = generic_file_llseek, \ | 169 | .llseek = generic_file_llseek, \ |
176 | }; | 170 | }; |
177 | 171 | ||
@@ -179,7 +173,7 @@ static const struct file_operations il_dbgfs_##name##_ops = { \ | |||
179 | DEBUGFS_WRITE_FUNC(name); \ | 173 | DEBUGFS_WRITE_FUNC(name); \ |
180 | static const struct file_operations il_dbgfs_##name##_ops = { \ | 174 | static const struct file_operations il_dbgfs_##name##_ops = { \ |
181 | .write = il_dbgfs_##name##_write, \ | 175 | .write = il_dbgfs_##name##_write, \ |
182 | .open = il_dbgfs_open_file_generic, \ | 176 | .open = simple_open, \ |
183 | .llseek = generic_file_llseek, \ | 177 | .llseek = generic_file_llseek, \ |
184 | }; | 178 | }; |
185 | 179 | ||
@@ -189,7 +183,7 @@ static const struct file_operations il_dbgfs_##name##_ops = { \ | |||
189 | static const struct file_operations il_dbgfs_##name##_ops = { \ | 183 | static const struct file_operations il_dbgfs_##name##_ops = { \ |
190 | .write = il_dbgfs_##name##_write, \ | 184 | .write = il_dbgfs_##name##_write, \ |
191 | .read = il_dbgfs_##name##_read, \ | 185 | .read = il_dbgfs_##name##_read, \ |
192 | .open = il_dbgfs_open_file_generic, \ | 186 | .open = simple_open, \ |
193 | .llseek = generic_file_llseek, \ | 187 | .llseek = generic_file_llseek, \ |
194 | }; | 188 | }; |
195 | 189 | ||