diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2012-02-13 05:23:19 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-22 14:51:15 -0500 |
commit | c936355172a7e4aeadbbdcaae48f10e31f604899 (patch) | |
tree | 7ddc633e8690f7f7f07e7d1e5f53df8e78ee97c1 /drivers/net/wireless/iwlegacy/common.c | |
parent | 1600b87542ce93e3dc094f6b108d8c2953e2ca0e (diff) |
iwlegacy: merge all ops structures into one
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy/common.c')
-rw-r--r-- | drivers/net/wireless/iwlegacy/common.c | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c index d522a4324a11..1bf861626c86 100644 --- a/drivers/net/wireless/iwlegacy/common.c +++ b/drivers/net/wireless/iwlegacy/common.c | |||
@@ -519,7 +519,7 @@ il_led_cmd(struct il_priv *il, unsigned long on, unsigned long off) | |||
519 | il_blink_compensation(il, off, | 519 | il_blink_compensation(il, off, |
520 | il->cfg->led_compensation); | 520 | il->cfg->led_compensation); |
521 | 521 | ||
522 | ret = il->ops->led->cmd(il, &led_cmd); | 522 | ret = il->ops->send_led_cmd(il, &led_cmd); |
523 | if (!ret) { | 523 | if (!ret) { |
524 | il->blink_on = on; | 524 | il->blink_on = on; |
525 | il->blink_off = off; | 525 | il->blink_off = off; |
@@ -1482,9 +1482,6 @@ il_scan_initiate(struct il_priv *il, struct ieee80211_vif *vif) | |||
1482 | 1482 | ||
1483 | lockdep_assert_held(&il->mutex); | 1483 | lockdep_assert_held(&il->mutex); |
1484 | 1484 | ||
1485 | if (WARN_ON(!il->ops->utils->request_scan)) | ||
1486 | return -EOPNOTSUPP; | ||
1487 | |||
1488 | cancel_delayed_work(&il->scan_check); | 1485 | cancel_delayed_work(&il->scan_check); |
1489 | 1486 | ||
1490 | if (!il_is_ready_rf(il)) { | 1487 | if (!il_is_ready_rf(il)) { |
@@ -1507,7 +1504,7 @@ il_scan_initiate(struct il_priv *il, struct ieee80211_vif *vif) | |||
1507 | set_bit(S_SCANNING, &il->status); | 1504 | set_bit(S_SCANNING, &il->status); |
1508 | il->scan_start = jiffies; | 1505 | il->scan_start = jiffies; |
1509 | 1506 | ||
1510 | ret = il->ops->utils->request_scan(il, vif); | 1507 | ret = il->ops->request_scan(il, vif); |
1511 | if (ret) { | 1508 | if (ret) { |
1512 | clear_bit(S_SCANNING, &il->status); | 1509 | clear_bit(S_SCANNING, &il->status); |
1513 | return ret; | 1510 | return ret; |
@@ -1669,7 +1666,7 @@ out_settings: | |||
1669 | il_power_set_mode(il, &il->power_data.sleep_cmd_next, false); | 1666 | il_power_set_mode(il, &il->power_data.sleep_cmd_next, false); |
1670 | il_set_tx_power(il, il->tx_power_next, false); | 1667 | il_set_tx_power(il, il->tx_power_next, false); |
1671 | 1668 | ||
1672 | il->ops->utils->post_scan(il); | 1669 | il->ops->post_scan(il); |
1673 | 1670 | ||
1674 | out: | 1671 | out: |
1675 | mutex_unlock(&il->mutex); | 1672 | mutex_unlock(&il->mutex); |
@@ -1811,7 +1808,7 @@ il_send_add_sta(struct il_priv *il, struct il_addsta_cmd *sta, u8 flags) | |||
1811 | might_sleep(); | 1808 | might_sleep(); |
1812 | } | 1809 | } |
1813 | 1810 | ||
1814 | cmd.len = il->ops->utils->build_addsta_hcmd(sta, data); | 1811 | cmd.len = il->ops->build_addsta_hcmd(sta, data); |
1815 | ret = il_send_cmd(il, &cmd); | 1812 | ret = il_send_cmd(il, &cmd); |
1816 | 1813 | ||
1817 | if (ret || (flags & CMD_ASYNC)) | 1814 | if (ret || (flags & CMD_ASYNC)) |
@@ -3078,7 +3075,7 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd) | |||
3078 | u32 idx; | 3075 | u32 idx; |
3079 | u16 fix_size; | 3076 | u16 fix_size; |
3080 | 3077 | ||
3081 | cmd->len = il->ops->utils->get_hcmd_size(cmd->id, cmd->len); | 3078 | cmd->len = il->ops->get_hcmd_size(cmd->id, cmd->len); |
3082 | fix_size = (u16) (cmd->len + sizeof(out_cmd->hdr)); | 3079 | fix_size = (u16) (cmd->len + sizeof(out_cmd->hdr)); |
3083 | 3080 | ||
3084 | /* If any of the command structures end up being larger than | 3081 | /* If any of the command structures end up being larger than |
@@ -3842,8 +3839,8 @@ _il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf) | |||
3842 | rxon->flags |= RXON_FLG_CHANNEL_MODE_LEGACY; | 3839 | rxon->flags |= RXON_FLG_CHANNEL_MODE_LEGACY; |
3843 | } | 3840 | } |
3844 | 3841 | ||
3845 | if (il->ops->hcmd->set_rxon_chain) | 3842 | if (il->ops->set_rxon_chain) |
3846 | il->ops->hcmd->set_rxon_chain(il); | 3843 | il->ops->set_rxon_chain(il); |
3847 | 3844 | ||
3848 | D_ASSOC("rxon flags 0x%X operation mode :0x%X " | 3845 | D_ASSOC("rxon flags 0x%X operation mode :0x%X " |
3849 | "extension channel offset 0x%x\n", le32_to_cpu(rxon->flags), | 3846 | "extension channel offset 0x%x\n", le32_to_cpu(rxon->flags), |
@@ -4472,8 +4469,8 @@ il_set_mode(struct il_priv *il) | |||
4472 | { | 4469 | { |
4473 | il_connection_init_rx_config(il); | 4470 | il_connection_init_rx_config(il); |
4474 | 4471 | ||
4475 | if (il->ops->hcmd->set_rxon_chain) | 4472 | if (il->ops->set_rxon_chain) |
4476 | il->ops->hcmd->set_rxon_chain(il); | 4473 | il->ops->set_rxon_chain(il); |
4477 | 4474 | ||
4478 | return il_commit_rxon(il); | 4475 | return il_commit_rxon(il); |
4479 | } | 4476 | } |
@@ -5171,9 +5168,6 @@ il_mac_config(struct ieee80211_hw *hw, u32 changed) | |||
5171 | int scan_active = 0; | 5168 | int scan_active = 0; |
5172 | bool ht_changed = false; | 5169 | bool ht_changed = false; |
5173 | 5170 | ||
5174 | if (WARN_ON(!il->ops->legacy)) | ||
5175 | return -EOPNOTSUPP; | ||
5176 | |||
5177 | mutex_lock(&il->mutex); | 5171 | mutex_lock(&il->mutex); |
5178 | 5172 | ||
5179 | D_MAC80211("enter to channel %d changed 0x%X\n", channel->hw_value, | 5173 | D_MAC80211("enter to channel %d changed 0x%X\n", channel->hw_value, |
@@ -5196,8 +5190,8 @@ il_mac_config(struct ieee80211_hw *hw, u32 changed) | |||
5196 | * set up the SM PS mode to OFF if an HT channel is | 5190 | * set up the SM PS mode to OFF if an HT channel is |
5197 | * configured. | 5191 | * configured. |
5198 | */ | 5192 | */ |
5199 | if (il->ops->hcmd->set_rxon_chain) | 5193 | if (il->ops->set_rxon_chain) |
5200 | il->ops->hcmd->set_rxon_chain(il); | 5194 | il->ops->set_rxon_chain(il); |
5201 | } | 5195 | } |
5202 | 5196 | ||
5203 | /* during scanning mac80211 will delay channel setting until | 5197 | /* during scanning mac80211 will delay channel setting until |
@@ -5266,8 +5260,8 @@ il_mac_config(struct ieee80211_hw *hw, u32 changed) | |||
5266 | 5260 | ||
5267 | spin_unlock_irqrestore(&il->lock, flags); | 5261 | spin_unlock_irqrestore(&il->lock, flags); |
5268 | 5262 | ||
5269 | if (il->ops->legacy->update_bcast_stations) | 5263 | if (il->ops->update_bcast_stations) |
5270 | ret = il->ops->legacy->update_bcast_stations(il); | 5264 | ret = il->ops->update_bcast_stations(il); |
5271 | 5265 | ||
5272 | set_ch_out: | 5266 | set_ch_out: |
5273 | /* The list of supported rates and rate mask can be different | 5267 | /* The list of supported rates and rate mask can be different |
@@ -5317,9 +5311,6 @@ il_mac_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
5317 | struct il_priv *il = hw->priv; | 5311 | struct il_priv *il = hw->priv; |
5318 | unsigned long flags; | 5312 | unsigned long flags; |
5319 | 5313 | ||
5320 | if (WARN_ON(!il->ops->legacy)) | ||
5321 | return; | ||
5322 | |||
5323 | mutex_lock(&il->mutex); | 5314 | mutex_lock(&il->mutex); |
5324 | D_MAC80211("enter\n"); | 5315 | D_MAC80211("enter\n"); |
5325 | 5316 | ||
@@ -5472,7 +5463,7 @@ il_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
5472 | return; | 5463 | return; |
5473 | } | 5464 | } |
5474 | 5465 | ||
5475 | il->ops->legacy->post_associate(il); | 5466 | il->ops->post_associate(il); |
5476 | } | 5467 | } |
5477 | 5468 | ||
5478 | void | 5469 | void |
@@ -5482,9 +5473,6 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
5482 | struct il_priv *il = hw->priv; | 5473 | struct il_priv *il = hw->priv; |
5483 | int ret; | 5474 | int ret; |
5484 | 5475 | ||
5485 | if (WARN_ON(!il->ops->legacy)) | ||
5486 | return; | ||
5487 | |||
5488 | D_MAC80211("changes = 0x%X\n", changes); | 5476 | D_MAC80211("changes = 0x%X\n", changes); |
5489 | 5477 | ||
5490 | mutex_lock(&il->mutex); | 5478 | mutex_lock(&il->mutex); |
@@ -5587,8 +5575,8 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
5587 | if (changes & BSS_CHANGED_HT) { | 5575 | if (changes & BSS_CHANGED_HT) { |
5588 | il_ht_conf(il, vif); | 5576 | il_ht_conf(il, vif); |
5589 | 5577 | ||
5590 | if (il->ops->hcmd->set_rxon_chain) | 5578 | if (il->ops->set_rxon_chain) |
5591 | il->ops->hcmd->set_rxon_chain(il); | 5579 | il->ops->set_rxon_chain(il); |
5592 | } | 5580 | } |
5593 | 5581 | ||
5594 | if (changes & BSS_CHANGED_ASSOC) { | 5582 | if (changes & BSS_CHANGED_ASSOC) { |
@@ -5597,7 +5585,7 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
5597 | il->timestamp = bss_conf->timestamp; | 5585 | il->timestamp = bss_conf->timestamp; |
5598 | 5586 | ||
5599 | if (!il_is_rfkill(il)) | 5587 | if (!il_is_rfkill(il)) |
5600 | il->ops->legacy->post_associate(il); | 5588 | il->ops->post_associate(il); |
5601 | } else | 5589 | } else |
5602 | il_set_no_assoc(il, vif); | 5590 | il_set_no_assoc(il, vif); |
5603 | } | 5591 | } |
@@ -5617,14 +5605,14 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
5617 | memcpy(il->staging.bssid_addr, bss_conf->bssid, | 5605 | memcpy(il->staging.bssid_addr, bss_conf->bssid, |
5618 | ETH_ALEN); | 5606 | ETH_ALEN); |
5619 | memcpy(il->bssid, bss_conf->bssid, ETH_ALEN); | 5607 | memcpy(il->bssid, bss_conf->bssid, ETH_ALEN); |
5620 | il->ops->legacy->config_ap(il); | 5608 | il->ops->config_ap(il); |
5621 | } else | 5609 | } else |
5622 | il_set_no_assoc(il, vif); | 5610 | il_set_no_assoc(il, vif); |
5623 | } | 5611 | } |
5624 | 5612 | ||
5625 | if (changes & BSS_CHANGED_IBSS) { | 5613 | if (changes & BSS_CHANGED_IBSS) { |
5626 | ret = | 5614 | ret = |
5627 | il->ops->legacy->manage_ibss_station(il, vif, | 5615 | il->ops->manage_ibss_station(il, vif, |
5628 | bss_conf->ibss_joined); | 5616 | bss_conf->ibss_joined); |
5629 | if (ret) | 5617 | if (ret) |
5630 | IL_ERR("failed to %s IBSS station %pM\n", | 5618 | IL_ERR("failed to %s IBSS station %pM\n", |