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 | |
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>
-rw-r--r-- | drivers/net/wireless/iwlegacy/3945.c | 39 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/4965-mac.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/4965.c | 51 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/common.c | 50 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/common.h | 52 |
5 files changed, 78 insertions, 131 deletions
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c index f5833d049654..fde6979d080a 100644 --- a/drivers/net/wireless/iwlegacy/3945.c +++ b/drivers/net/wireless/iwlegacy/3945.c | |||
@@ -57,10 +57,6 @@ il3945_send_led_cmd(struct il_priv *il, struct il_led_cmd *led_cmd) | |||
57 | return il_send_cmd(il, &cmd); | 57 | return il_send_cmd(il, &cmd); |
58 | } | 58 | } |
59 | 59 | ||
60 | const struct il_led_ops il3945_led_ops = { | ||
61 | .cmd = il3945_send_led_cmd, | ||
62 | }; | ||
63 | |||
64 | #define IL_DECLARE_RATE_INFO(r, ip, in, rp, rn, pp, np) \ | 60 | #define IL_DECLARE_RATE_INFO(r, ip, in, rp, rn, pp, np) \ |
65 | [RATE_##r##M_IDX] = { RATE_##r##M_PLCP, \ | 61 | [RATE_##r##M_IDX] = { RATE_##r##M_PLCP, \ |
66 | RATE_##r##M_IEEE, \ | 62 | RATE_##r##M_IEEE, \ |
@@ -2629,24 +2625,6 @@ il3945_load_bsm(struct il_priv *il) | |||
2629 | return 0; | 2625 | return 0; |
2630 | } | 2626 | } |
2631 | 2627 | ||
2632 | static struct il_hcmd_ops il3945_hcmd = { | ||
2633 | .rxon_assoc = il3945_send_rxon_assoc, | ||
2634 | .commit_rxon = il3945_commit_rxon, | ||
2635 | }; | ||
2636 | |||
2637 | static const struct il_legacy_ops il3945_legacy_ops = { | ||
2638 | .post_associate = il3945_post_associate, | ||
2639 | .config_ap = il3945_config_ap, | ||
2640 | .manage_ibss_station = il3945_manage_ibss_station, | ||
2641 | }; | ||
2642 | |||
2643 | static struct il_hcmd_utils_ops il3945_hcmd_utils = { | ||
2644 | .get_hcmd_size = il3945_get_hcmd_size, | ||
2645 | .build_addsta_hcmd = il3945_build_addsta_hcmd, | ||
2646 | .request_scan = il3945_request_scan, | ||
2647 | .post_scan = il3945_post_scan, | ||
2648 | }; | ||
2649 | |||
2650 | const struct il_ops il3945_ops = { | 2628 | const struct il_ops il3945_ops = { |
2651 | .txq_attach_buf_to_tfd = il3945_hw_txq_attach_buf_to_tfd, | 2629 | .txq_attach_buf_to_tfd = il3945_hw_txq_attach_buf_to_tfd, |
2652 | .txq_free_tfd = il3945_hw_txq_free_tfd, | 2630 | .txq_free_tfd = il3945_hw_txq_free_tfd, |
@@ -2659,10 +2637,19 @@ const struct il_ops il3945_ops = { | |||
2659 | .eeprom_acquire_semaphore = il3945_eeprom_acquire_semaphore, | 2637 | .eeprom_acquire_semaphore = il3945_eeprom_acquire_semaphore, |
2660 | .eeprom_release_semaphore = il3945_eeprom_release_semaphore, | 2638 | .eeprom_release_semaphore = il3945_eeprom_release_semaphore, |
2661 | 2639 | ||
2662 | .hcmd = &il3945_hcmd, | 2640 | .rxon_assoc = il3945_send_rxon_assoc, |
2663 | .utils = &il3945_hcmd_utils, | 2641 | .commit_rxon = il3945_commit_rxon, |
2664 | .led = &il3945_led_ops, | 2642 | |
2665 | .legacy = &il3945_legacy_ops, | 2643 | .get_hcmd_size = il3945_get_hcmd_size, |
2644 | .build_addsta_hcmd = il3945_build_addsta_hcmd, | ||
2645 | .request_scan = il3945_request_scan, | ||
2646 | .post_scan = il3945_post_scan, | ||
2647 | |||
2648 | .post_associate = il3945_post_associate, | ||
2649 | .config_ap = il3945_config_ap, | ||
2650 | .manage_ibss_station = il3945_manage_ibss_station, | ||
2651 | |||
2652 | .send_led_cmd = il3945_send_led_cmd, | ||
2666 | }; | 2653 | }; |
2667 | 2654 | ||
2668 | static struct il_cfg il3945_bg_cfg = { | 2655 | static struct il_cfg il3945_bg_cfg = { |
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c index cc2963be001e..89275bfe559f 100644 --- a/drivers/net/wireless/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/iwlegacy/4965-mac.c | |||
@@ -3649,8 +3649,8 @@ il4965_sta_modify_sleep_tx_count(struct il_priv *il, int sta_id, int cnt) | |||
3649 | void | 3649 | void |
3650 | il4965_update_chain_flags(struct il_priv *il) | 3650 | il4965_update_chain_flags(struct il_priv *il) |
3651 | { | 3651 | { |
3652 | if (il->ops->hcmd->set_rxon_chain) { | 3652 | if (il->ops->set_rxon_chain) { |
3653 | il->ops->hcmd->set_rxon_chain(il); | 3653 | il->ops->set_rxon_chain(il); |
3654 | if (il->active.rx_chain != il->staging.rx_chain) | 3654 | if (il->active.rx_chain != il->staging.rx_chain) |
3655 | il_commit_rxon(il); | 3655 | il_commit_rxon(il); |
3656 | } | 3656 | } |
@@ -4399,9 +4399,8 @@ il4965_irq_tasklet(struct il_priv *il) | |||
4399 | /* HW RF KILL switch toggled */ | 4399 | /* HW RF KILL switch toggled */ |
4400 | if (inta & CSR_INT_BIT_RF_KILL) { | 4400 | if (inta & CSR_INT_BIT_RF_KILL) { |
4401 | int hw_rf_kill = 0; | 4401 | int hw_rf_kill = 0; |
4402 | if (! | 4402 | |
4403 | (_il_rd(il, CSR_GP_CNTRL) & | 4403 | if (!(_il_rd(il, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)) |
4404 | CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)) | ||
4405 | hw_rf_kill = 1; | 4404 | hw_rf_kill = 1; |
4406 | 4405 | ||
4407 | IL_WARN("RF_KILL bit toggled to %s.\n", | 4406 | IL_WARN("RF_KILL bit toggled to %s.\n", |
@@ -5300,8 +5299,8 @@ il4965_alive_start(struct il_priv *il) | |||
5300 | /* Initialize our rx_config data */ | 5299 | /* Initialize our rx_config data */ |
5301 | il_connection_init_rx_config(il); | 5300 | il_connection_init_rx_config(il); |
5302 | 5301 | ||
5303 | if (il->ops->hcmd->set_rxon_chain) | 5302 | if (il->ops->set_rxon_chain) |
5304 | il->ops->hcmd->set_rxon_chain(il); | 5303 | il->ops->set_rxon_chain(il); |
5305 | } | 5304 | } |
5306 | 5305 | ||
5307 | /* Configure bluetooth coexistence if enabled */ | 5306 | /* Configure bluetooth coexistence if enabled */ |
@@ -6333,8 +6332,8 @@ il4965_init_drv(struct il_priv *il) | |||
6333 | il->force_reset.reset_duration = IL_DELAY_NEXT_FORCE_FW_RELOAD; | 6332 | il->force_reset.reset_duration = IL_DELAY_NEXT_FORCE_FW_RELOAD; |
6334 | 6333 | ||
6335 | /* Choose which receivers/antennas to use */ | 6334 | /* Choose which receivers/antennas to use */ |
6336 | if (il->ops->hcmd->set_rxon_chain) | 6335 | if (il->ops->set_rxon_chain) |
6337 | il->ops->hcmd->set_rxon_chain(il); | 6336 | il->ops->set_rxon_chain(il); |
6338 | 6337 | ||
6339 | il_init_scan_params(il); | 6338 | il_init_scan_params(il); |
6340 | 6339 | ||
diff --git a/drivers/net/wireless/iwlegacy/4965.c b/drivers/net/wireless/iwlegacy/4965.c index 805a4ea8351a..5db11714e047 100644 --- a/drivers/net/wireless/iwlegacy/4965.c +++ b/drivers/net/wireless/iwlegacy/4965.c | |||
@@ -264,10 +264,6 @@ il4965_led_enable(struct il_priv *il) | |||
264 | _il_wr(il, CSR_LED_REG, CSR_LED_REG_TRUN_ON); | 264 | _il_wr(il, CSR_LED_REG, CSR_LED_REG_TRUN_ON); |
265 | } | 265 | } |
266 | 266 | ||
267 | const struct il_led_ops il4965_led_ops = { | ||
268 | .cmd = il4965_send_led_cmd, | ||
269 | }; | ||
270 | |||
271 | static int il4965_send_tx_power(struct il_priv *il); | 267 | static int il4965_send_tx_power(struct il_priv *il); |
272 | static int il4965_hw_get_temperature(struct il_priv *il); | 268 | static int il4965_hw_get_temperature(struct il_priv *il); |
273 | 269 | ||
@@ -1737,12 +1733,6 @@ il4965_build_addsta_hcmd(const struct il_addsta_cmd *cmd, u8 * data) | |||
1737 | return (u16) sizeof(struct il4965_addsta_cmd); | 1733 | return (u16) sizeof(struct il4965_addsta_cmd); |
1738 | } | 1734 | } |
1739 | 1735 | ||
1740 | static struct il_hcmd_ops il4965_hcmd = { | ||
1741 | .rxon_assoc = il4965_send_rxon_assoc, | ||
1742 | .commit_rxon = il4965_commit_rxon, | ||
1743 | .set_rxon_chain = il4965_set_rxon_chain, | ||
1744 | }; | ||
1745 | |||
1746 | static void | 1736 | static void |
1747 | il4965_post_scan(struct il_priv *il) | 1737 | il4965_post_scan(struct il_priv *il) |
1748 | { | 1738 | { |
@@ -1782,8 +1772,8 @@ il4965_post_associate(struct il_priv *il) | |||
1782 | 1772 | ||
1783 | il_set_rxon_ht(il, &il->current_ht_config); | 1773 | il_set_rxon_ht(il, &il->current_ht_config); |
1784 | 1774 | ||
1785 | if (il->ops->hcmd->set_rxon_chain) | 1775 | if (il->ops->set_rxon_chain) |
1786 | il->ops->hcmd->set_rxon_chain(il); | 1776 | il->ops->set_rxon_chain(il); |
1787 | 1777 | ||
1788 | il->staging.assoc_id = cpu_to_le16(vif->bss_conf.aid); | 1778 | il->staging.assoc_id = cpu_to_le16(vif->bss_conf.aid); |
1789 | 1779 | ||
@@ -1857,8 +1847,8 @@ il4965_config_ap(struct il_priv *il) | |||
1857 | /* AP has all antennas */ | 1847 | /* AP has all antennas */ |
1858 | il->chain_noise_data.active_chains = il->hw_params.valid_rx_ant; | 1848 | il->chain_noise_data.active_chains = il->hw_params.valid_rx_ant; |
1859 | il_set_rxon_ht(il, &il->current_ht_config); | 1849 | il_set_rxon_ht(il, &il->current_ht_config); |
1860 | if (il->ops->hcmd->set_rxon_chain) | 1850 | if (il->ops->set_rxon_chain) |
1861 | il->ops->hcmd->set_rxon_chain(il); | 1851 | il->ops->set_rxon_chain(il); |
1862 | 1852 | ||
1863 | il->staging.assoc_id = 0; | 1853 | il->staging.assoc_id = 0; |
1864 | 1854 | ||
@@ -1882,20 +1872,6 @@ il4965_config_ap(struct il_priv *il) | |||
1882 | il4965_send_beacon_cmd(il); | 1872 | il4965_send_beacon_cmd(il); |
1883 | } | 1873 | } |
1884 | 1874 | ||
1885 | static struct il_hcmd_utils_ops il4965_hcmd_utils = { | ||
1886 | .get_hcmd_size = il4965_get_hcmd_size, | ||
1887 | .build_addsta_hcmd = il4965_build_addsta_hcmd, | ||
1888 | .request_scan = il4965_request_scan, | ||
1889 | .post_scan = il4965_post_scan, | ||
1890 | }; | ||
1891 | |||
1892 | static const struct il_legacy_ops il4965_legacy_ops = { | ||
1893 | .post_associate = il4965_post_associate, | ||
1894 | .config_ap = il4965_config_ap, | ||
1895 | .manage_ibss_station = il4965_manage_ibss_station, | ||
1896 | .update_bcast_stations = il4965_update_bcast_stations, | ||
1897 | }; | ||
1898 | |||
1899 | const struct il_ops il4965_ops = { | 1875 | const struct il_ops il4965_ops = { |
1900 | .txq_update_byte_cnt_tbl = il4965_txq_update_byte_cnt_tbl, | 1876 | .txq_update_byte_cnt_tbl = il4965_txq_update_byte_cnt_tbl, |
1901 | .txq_attach_buf_to_tfd = il4965_hw_txq_attach_buf_to_tfd, | 1877 | .txq_attach_buf_to_tfd = il4965_hw_txq_attach_buf_to_tfd, |
@@ -1913,10 +1889,21 @@ const struct il_ops il4965_ops = { | |||
1913 | .eeprom_acquire_semaphore = il4965_eeprom_acquire_semaphore, | 1889 | .eeprom_acquire_semaphore = il4965_eeprom_acquire_semaphore, |
1914 | .eeprom_release_semaphore = il4965_eeprom_release_semaphore, | 1890 | .eeprom_release_semaphore = il4965_eeprom_release_semaphore, |
1915 | 1891 | ||
1916 | .hcmd = &il4965_hcmd, | 1892 | .rxon_assoc = il4965_send_rxon_assoc, |
1917 | .utils = &il4965_hcmd_utils, | 1893 | .commit_rxon = il4965_commit_rxon, |
1918 | .led = &il4965_led_ops, | 1894 | .set_rxon_chain = il4965_set_rxon_chain, |
1919 | .legacy = &il4965_legacy_ops, | 1895 | |
1896 | .get_hcmd_size = il4965_get_hcmd_size, | ||
1897 | .build_addsta_hcmd = il4965_build_addsta_hcmd, | ||
1898 | .request_scan = il4965_request_scan, | ||
1899 | .post_scan = il4965_post_scan, | ||
1900 | |||
1901 | .post_associate = il4965_post_associate, | ||
1902 | .config_ap = il4965_config_ap, | ||
1903 | .manage_ibss_station = il4965_manage_ibss_station, | ||
1904 | .update_bcast_stations = il4965_update_bcast_stations, | ||
1905 | |||
1906 | .send_led_cmd = il4965_send_led_cmd, | ||
1920 | }; | 1907 | }; |
1921 | 1908 | ||
1922 | struct il_cfg il4965_cfg = { | 1909 | struct il_cfg il4965_cfg = { |
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", |
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h index 91624ee57fed..873182ec3fbf 100644 --- a/drivers/net/wireless/iwlegacy/common.h +++ b/drivers/net/wireless/iwlegacy/common.h | |||
@@ -1553,19 +1553,6 @@ il_free_pages(struct il_priv *il, unsigned long page) | |||
1553 | #define IL_RX_BUF_SIZE_4K (4 * 1024) | 1553 | #define IL_RX_BUF_SIZE_4K (4 * 1024) |
1554 | #define IL_RX_BUF_SIZE_8K (8 * 1024) | 1554 | #define IL_RX_BUF_SIZE_8K (8 * 1024) |
1555 | 1555 | ||
1556 | struct il_hcmd_ops { | ||
1557 | int (*rxon_assoc) (struct il_priv *il); | ||
1558 | int (*commit_rxon) (struct il_priv *il); | ||
1559 | void (*set_rxon_chain) (struct il_priv *il); | ||
1560 | }; | ||
1561 | |||
1562 | struct il_hcmd_utils_ops { | ||
1563 | u16(*get_hcmd_size) (u8 cmd_id, u16 len); | ||
1564 | u16(*build_addsta_hcmd) (const struct il_addsta_cmd *cmd, u8 *data); | ||
1565 | int (*request_scan) (struct il_priv *il, struct ieee80211_vif *vif); | ||
1566 | void (*post_scan) (struct il_priv *il); | ||
1567 | }; | ||
1568 | |||
1569 | #ifdef CONFIG_IWLEGACY_DEBUGFS | 1556 | #ifdef CONFIG_IWLEGACY_DEBUGFS |
1570 | struct il_debugfs_ops { | 1557 | struct il_debugfs_ops { |
1571 | ssize_t(*rx_stats_read) (struct file *file, char __user *user_buf, | 1558 | ssize_t(*rx_stats_read) (struct file *file, char __user *user_buf, |
@@ -1578,19 +1565,6 @@ struct il_debugfs_ops { | |||
1578 | }; | 1565 | }; |
1579 | #endif | 1566 | #endif |
1580 | 1567 | ||
1581 | struct il_led_ops { | ||
1582 | int (*cmd) (struct il_priv *il, struct il_led_cmd *led_cmd); | ||
1583 | }; | ||
1584 | |||
1585 | struct il_legacy_ops { | ||
1586 | void (*post_associate) (struct il_priv *il); | ||
1587 | void (*config_ap) (struct il_priv *il); | ||
1588 | /* station management */ | ||
1589 | int (*update_bcast_stations) (struct il_priv *il); | ||
1590 | int (*manage_ibss_station) (struct il_priv *il, | ||
1591 | struct ieee80211_vif *vif, bool add); | ||
1592 | }; | ||
1593 | |||
1594 | struct il_ops { | 1568 | struct il_ops { |
1595 | /* Handling TX */ | 1569 | /* Handling TX */ |
1596 | void (*txq_update_byte_cnt_tbl) (struct il_priv *il, | 1570 | void (*txq_update_byte_cnt_tbl) (struct il_priv *il, |
@@ -1623,11 +1597,23 @@ struct il_ops { | |||
1623 | int (*eeprom_acquire_semaphore) (struct il_priv *il); | 1597 | int (*eeprom_acquire_semaphore) (struct il_priv *il); |
1624 | void (*eeprom_release_semaphore) (struct il_priv *il); | 1598 | void (*eeprom_release_semaphore) (struct il_priv *il); |
1625 | 1599 | ||
1626 | const struct il_hcmd_ops *hcmd; | 1600 | int (*rxon_assoc) (struct il_priv *il); |
1627 | const struct il_hcmd_utils_ops *utils; | 1601 | int (*commit_rxon) (struct il_priv *il); |
1628 | const struct il_led_ops *led; | 1602 | void (*set_rxon_chain) (struct il_priv *il); |
1629 | const struct il_nic_ops *nic; | 1603 | |
1630 | const struct il_legacy_ops *legacy; | 1604 | u16(*get_hcmd_size) (u8 cmd_id, u16 len); |
1605 | u16(*build_addsta_hcmd) (const struct il_addsta_cmd *cmd, u8 *data); | ||
1606 | |||
1607 | int (*request_scan) (struct il_priv *il, struct ieee80211_vif *vif); | ||
1608 | void (*post_scan) (struct il_priv *il); | ||
1609 | void (*post_associate) (struct il_priv *il); | ||
1610 | void (*config_ap) (struct il_priv *il); | ||
1611 | /* station management */ | ||
1612 | int (*update_bcast_stations) (struct il_priv *il); | ||
1613 | int (*manage_ibss_station) (struct il_priv *il, | ||
1614 | struct ieee80211_vif *vif, bool add); | ||
1615 | |||
1616 | int (*send_led_cmd) (struct il_priv *il, struct il_led_cmd *led_cmd); | ||
1631 | }; | 1617 | }; |
1632 | 1618 | ||
1633 | struct il_mod_params { | 1619 | struct il_mod_params { |
@@ -2053,13 +2039,13 @@ int il_send_rxon_timing(struct il_priv *il); | |||
2053 | static inline int | 2039 | static inline int |
2054 | il_send_rxon_assoc(struct il_priv *il) | 2040 | il_send_rxon_assoc(struct il_priv *il) |
2055 | { | 2041 | { |
2056 | return il->ops->hcmd->rxon_assoc(il); | 2042 | return il->ops->rxon_assoc(il); |
2057 | } | 2043 | } |
2058 | 2044 | ||
2059 | static inline int | 2045 | static inline int |
2060 | il_commit_rxon(struct il_priv *il) | 2046 | il_commit_rxon(struct il_priv *il) |
2061 | { | 2047 | { |
2062 | return il->ops->hcmd->commit_rxon(il); | 2048 | return il->ops->commit_rxon(il); |
2063 | } | 2049 | } |
2064 | 2050 | ||
2065 | static inline const struct ieee80211_supported_band * | 2051 | static inline const struct ieee80211_supported_band * |