aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlegacy/3945-mac.c8
-rw-r--r--drivers/net/wireless/iwlegacy/3945.c29
-rw-r--r--drivers/net/wireless/iwlegacy/4965-calib.c4
-rw-r--r--drivers/net/wireless/iwlegacy/4965-mac.c23
-rw-r--r--drivers/net/wireless/iwlegacy/4965.c19
-rw-r--r--drivers/net/wireless/iwlegacy/common.c34
-rw-r--r--drivers/net/wireless/iwlegacy/common.h31
-rw-r--r--drivers/net/wireless/iwlegacy/debug.c4
8 files changed, 71 insertions, 81 deletions
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index ba01d2d2ff97..19a4d56dd0ab 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -616,7 +616,7 @@ il3945_tx_skb(struct il_priv *il, struct sk_buff *skb)
616 616
617 /* Add buffer containing Tx command and MAC(!) header to TFD's 617 /* Add buffer containing Tx command and MAC(!) header to TFD's
618 * first entry */ 618 * first entry */
619 il->ops->lib->txq_attach_buf_to_tfd(il, txq, txcmd_phys, len, 1, 0); 619 il->ops->txq_attach_buf_to_tfd(il, txq, txcmd_phys, len, 1, 0);
620 620
621 /* Set up TFD's 2nd entry to point directly to remainder of skb, 621 /* Set up TFD's 2nd entry to point directly to remainder of skb,
622 * if any (802.11 null frames have no payload). */ 622 * if any (802.11 null frames have no payload). */
@@ -625,8 +625,8 @@ il3945_tx_skb(struct il_priv *il, struct sk_buff *skb)
625 phys_addr = 625 phys_addr =
626 pci_map_single(il->pci_dev, skb->data + hdr_len, len, 626 pci_map_single(il->pci_dev, skb->data + hdr_len, len,
627 PCI_DMA_TODEVICE); 627 PCI_DMA_TODEVICE);
628 il->ops->lib->txq_attach_buf_to_tfd(il, txq, phys_addr, len, 0, 628 il->ops->txq_attach_buf_to_tfd(il, txq, phys_addr, len, 0,
629 U32_PAD(len)); 629 U32_PAD(len));
630 } 630 }
631 631
632 /* Tell device the write idx *just past* this latest filled TFD */ 632 /* Tell device the write idx *just past* this latest filled TFD */
@@ -2413,7 +2413,7 @@ __il3945_up(struct il_priv *il)
2413 /* load bootstrap state machine, 2413 /* load bootstrap state machine,
2414 * load bootstrap program into processor's memory, 2414 * load bootstrap program into processor's memory,
2415 * prepare to load the "initialize" uCode */ 2415 * prepare to load the "initialize" uCode */
2416 rc = il->ops->lib->load_ucode(il); 2416 rc = il->ops->load_ucode(il);
2417 2417
2418 if (rc) { 2418 if (rc) {
2419 IL_ERR("Unable to set up bootstrap uCode: %d\n", rc); 2419 IL_ERR("Unable to set up bootstrap uCode: %d\n", rc);
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c
index a21ec25ec9d1..f5833d049654 100644
--- a/drivers/net/wireless/iwlegacy/3945.c
+++ b/drivers/net/wireless/iwlegacy/3945.c
@@ -303,7 +303,7 @@ il3945_tx_queue_reclaim(struct il_priv *il, int txq_id, int idx)
303 skb = txq->skbs[txq->q.read_ptr]; 303 skb = txq->skbs[txq->q.read_ptr];
304 ieee80211_tx_status_irqsafe(il->hw, skb); 304 ieee80211_tx_status_irqsafe(il->hw, skb);
305 txq->skbs[txq->q.read_ptr] = NULL; 305 txq->skbs[txq->q.read_ptr] = NULL;
306 il->ops->lib->txq_free_tfd(il, txq); 306 il->ops->txq_free_tfd(il, txq);
307 } 307 }
308 308
309 if (il_queue_space(q) > q->low_mark && txq_id >= 0 && 309 if (il_queue_space(q) > q->low_mark && txq_id >= 0 &&
@@ -1612,7 +1612,7 @@ il3945_hw_reg_comp_txpower_temp(struct il_priv *il)
1612 } 1612 }
1613 1613
1614 /* send Txpower command for current channel to ucode */ 1614 /* send Txpower command for current channel to ucode */
1615 return il->ops->lib->send_tx_power(il); 1615 return il->ops->send_tx_power(il);
1616} 1616}
1617 1617
1618int 1618int
@@ -2634,19 +2634,6 @@ static struct il_hcmd_ops il3945_hcmd = {
2634 .commit_rxon = il3945_commit_rxon, 2634 .commit_rxon = il3945_commit_rxon,
2635}; 2635};
2636 2636
2637static struct il_lib_ops il3945_lib = {
2638 .txq_attach_buf_to_tfd = il3945_hw_txq_attach_buf_to_tfd,
2639 .txq_free_tfd = il3945_hw_txq_free_tfd,
2640 .txq_init = il3945_hw_tx_queue_init,
2641 .load_ucode = il3945_load_bsm,
2642 .dump_nic_error_log = il3945_dump_nic_error_log,
2643 .apm_init = il3945_apm_init,
2644 .send_tx_power = il3945_send_tx_power,
2645 .is_valid_rtc_data_addr = il3945_hw_valid_rtc_data_addr,
2646 .eeprom_acquire_semaphore = il3945_eeprom_acquire_semaphore,
2647 .eeprom_release_semaphore = il3945_eeprom_release_semaphore,
2648};
2649
2650static const struct il_legacy_ops il3945_legacy_ops = { 2637static const struct il_legacy_ops il3945_legacy_ops = {
2651 .post_associate = il3945_post_associate, 2638 .post_associate = il3945_post_associate,
2652 .config_ap = il3945_config_ap, 2639 .config_ap = il3945_config_ap,
@@ -2661,7 +2648,17 @@ static struct il_hcmd_utils_ops il3945_hcmd_utils = {
2661}; 2648};
2662 2649
2663const struct il_ops il3945_ops = { 2650const struct il_ops il3945_ops = {
2664 .lib = &il3945_lib, 2651 .txq_attach_buf_to_tfd = il3945_hw_txq_attach_buf_to_tfd,
2652 .txq_free_tfd = il3945_hw_txq_free_tfd,
2653 .txq_init = il3945_hw_tx_queue_init,
2654 .load_ucode = il3945_load_bsm,
2655 .dump_nic_error_log = il3945_dump_nic_error_log,
2656 .apm_init = il3945_apm_init,
2657 .send_tx_power = il3945_send_tx_power,
2658 .is_valid_rtc_data_addr = il3945_hw_valid_rtc_data_addr,
2659 .eeprom_acquire_semaphore = il3945_eeprom_acquire_semaphore,
2660 .eeprom_release_semaphore = il3945_eeprom_release_semaphore,
2661
2665 .hcmd = &il3945_hcmd, 2662 .hcmd = &il3945_hcmd,
2666 .utils = &il3945_hcmd_utils, 2663 .utils = &il3945_hcmd_utils,
2667 .led = &il3945_led_ops, 2664 .led = &il3945_led_ops,
diff --git a/drivers/net/wireless/iwlegacy/4965-calib.c b/drivers/net/wireless/iwlegacy/4965-calib.c
index fe9171506a91..47c20e3d5605 100644
--- a/drivers/net/wireless/iwlegacy/4965-calib.c
+++ b/drivers/net/wireless/iwlegacy/4965-calib.c
@@ -923,8 +923,8 @@ il4965_chain_noise_calibration(struct il_priv *il, void *stat_resp)
923 /* Some power changes may have been made during the calibration. 923 /* Some power changes may have been made during the calibration.
924 * Update and commit the RXON 924 * Update and commit the RXON
925 */ 925 */
926 if (il->ops->lib->update_chain_flags) 926 if (il->ops->update_chain_flags)
927 il->ops->lib->update_chain_flags(il); 927 il->ops->update_chain_flags(il);
928 928
929 data->state = IL_CHAIN_NOISE_DONE; 929 data->state = IL_CHAIN_NOISE_DONE;
930 il_power_update_mode(il, false); 930 il_power_update_mode(il, false);
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index ebfcfc8a9ae6..cc2963be001e 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -1811,7 +1811,7 @@ il4965_tx_skb(struct il_priv *il, struct sk_buff *skb)
1811 dma_unmap_len_set(out_meta, len, firstlen); 1811 dma_unmap_len_set(out_meta, len, firstlen);
1812 /* Add buffer containing Tx command and MAC(!) header to TFD's 1812 /* Add buffer containing Tx command and MAC(!) header to TFD's
1813 * first entry */ 1813 * first entry */
1814 il->ops->lib->txq_attach_buf_to_tfd(il, txq, txcmd_phys, firstlen, 1, 0); 1814 il->ops->txq_attach_buf_to_tfd(il, txq, txcmd_phys, firstlen, 1, 0);
1815 1815
1816 if (!ieee80211_has_morefrags(hdr->frame_control)) { 1816 if (!ieee80211_has_morefrags(hdr->frame_control)) {
1817 txq->need_update = 1; 1817 txq->need_update = 1;
@@ -1827,8 +1827,8 @@ il4965_tx_skb(struct il_priv *il, struct sk_buff *skb)
1827 phys_addr = 1827 phys_addr =
1828 pci_map_single(il->pci_dev, skb->data + hdr_len, secondlen, 1828 pci_map_single(il->pci_dev, skb->data + hdr_len, secondlen,
1829 PCI_DMA_TODEVICE); 1829 PCI_DMA_TODEVICE);
1830 il->ops->lib->txq_attach_buf_to_tfd(il, txq, phys_addr, 1830 il->ops->txq_attach_buf_to_tfd(il, txq, phys_addr, secondlen,
1831 secondlen, 0, 0); 1831 0, 0);
1832 } 1832 }
1833 1833
1834 scratch_phys = 1834 scratch_phys =
@@ -1848,8 +1848,7 @@ il4965_tx_skb(struct il_priv *il, struct sk_buff *skb)
1848 1848
1849 /* Set up entry for this TFD in Tx byte-count array */ 1849 /* Set up entry for this TFD in Tx byte-count array */
1850 if (info->flags & IEEE80211_TX_CTL_AMPDU) 1850 if (info->flags & IEEE80211_TX_CTL_AMPDU)
1851 il->ops->lib->txq_update_byte_cnt_tbl(il, txq, 1851 il->ops->txq_update_byte_cnt_tbl(il, txq, le16_to_cpu(tx_cmd->len));
1852 le16_to_cpu(tx_cmd->len));
1853 1852
1854 pci_dma_sync_single_for_device(il->pci_dev, txcmd_phys, firstlen, 1853 pci_dma_sync_single_for_device(il->pci_dev, txcmd_phys, firstlen,
1855 PCI_DMA_BIDIRECTIONAL); 1854 PCI_DMA_BIDIRECTIONAL);
@@ -2470,7 +2469,7 @@ il4965_tx_queue_reclaim(struct il_priv *il, int txq_id, int idx)
2470 il4965_tx_status(il, skb, txq_id >= IL4965_FIRST_AMPDU_QUEUE); 2469 il4965_tx_status(il, skb, txq_id >= IL4965_FIRST_AMPDU_QUEUE);
2471 2470
2472 txq->skbs[txq->q.read_ptr] = NULL; 2471 txq->skbs[txq->q.read_ptr] = NULL;
2473 il->ops->lib->txq_free_tfd(il, txq); 2472 il->ops->txq_free_tfd(il, txq);
2474 } 2473 }
2475 return nfreed; 2474 return nfreed;
2476} 2475}
@@ -5072,7 +5071,7 @@ il4965_dump_nic_error_log(struct il_priv *il)
5072 else 5071 else
5073 base = le32_to_cpu(il->card_alive.error_event_table_ptr); 5072 base = le32_to_cpu(il->card_alive.error_event_table_ptr);
5074 5073
5075 if (!il->ops->lib->is_valid_rtc_data_addr(base)) { 5074 if (!il->ops->is_valid_rtc_data_addr(base)) {
5076 IL_ERR("Not valid error log pointer 0x%08X for %s uCode\n", 5075 IL_ERR("Not valid error log pointer 0x%08X for %s uCode\n",
5077 base, (il->ucode_type == UCODE_INIT) ? "Init" : "RT"); 5076 base, (il->ucode_type == UCODE_INIT) ? "Init" : "RT");
5078 return; 5077 return;
@@ -5574,7 +5573,7 @@ __il4965_up(struct il_priv *il)
5574 /* load bootstrap state machine, 5573 /* load bootstrap state machine,
5575 * load bootstrap program into processor's memory, 5574 * load bootstrap program into processor's memory,
5576 * prepare to load the "initialize" uCode */ 5575 * prepare to load the "initialize" uCode */
5577 ret = il->ops->lib->load_ucode(il); 5576 ret = il->ops->load_ucode(il);
5578 5577
5579 if (ret) { 5578 if (ret) {
5580 IL_ERR("Unable to set up bootstrap uCode: %d\n", ret); 5579 IL_ERR("Unable to set up bootstrap uCode: %d\n", ret);
@@ -5615,7 +5614,7 @@ il4965_bg_init_alive_start(struct work_struct *data)
5615 if (test_bit(S_EXIT_PENDING, &il->status)) 5614 if (test_bit(S_EXIT_PENDING, &il->status))
5616 goto out; 5615 goto out;
5617 5616
5618 il->ops->lib->init_alive_start(il); 5617 il->ops->init_alive_start(il);
5619out: 5618out:
5620 mutex_unlock(&il->mutex); 5619 mutex_unlock(&il->mutex);
5621} 5620}
@@ -6047,7 +6046,7 @@ il4965_mac_channel_switch(struct ieee80211_hw *hw,
6047 if (!il_is_associated(il)) 6046 if (!il_is_associated(il))
6048 goto out; 6047 goto out;
6049 6048
6050 if (!il->ops->lib->set_channel_switch) 6049 if (!il->ops->set_channel_switch)
6051 goto out; 6050 goto out;
6052 6051
6053 ch = channel->hw_value; 6052 ch = channel->hw_value;
@@ -6099,7 +6098,7 @@ il4965_mac_channel_switch(struct ieee80211_hw *hw,
6099 */ 6098 */
6100 set_bit(S_CHANNEL_SWITCH_PENDING, &il->status); 6099 set_bit(S_CHANNEL_SWITCH_PENDING, &il->status);
6101 il->switch_channel = cpu_to_le16(ch); 6100 il->switch_channel = cpu_to_le16(ch);
6102 if (il->ops->lib->set_channel_switch(il, ch_switch)) { 6101 if (il->ops->set_channel_switch(il, ch_switch)) {
6103 clear_bit(S_CHANNEL_SWITCH_PENDING, &il->status); 6102 clear_bit(S_CHANNEL_SWITCH_PENDING, &il->status);
6104 il->switch_channel = 0; 6103 il->switch_channel = 0;
6105 ieee80211_chswitch_done(il->vif, false); 6104 ieee80211_chswitch_done(il->vif, false);
@@ -6182,7 +6181,7 @@ il4965_bg_txpower_work(struct work_struct *work)
6182 /* Regardless of if we are associated, we must reconfigure the 6181 /* Regardless of if we are associated, we must reconfigure the
6183 * TX power since frames can be sent on non-radar channels while 6182 * TX power since frames can be sent on non-radar channels while
6184 * not associated */ 6183 * not associated */
6185 il->ops->lib->send_tx_power(il); 6184 il->ops->send_tx_power(il);
6186 6185
6187 /* Update last_temperature to keep is_calib_needed from running 6186 /* Update last_temperature to keep is_calib_needed from running
6188 * when it isn't needed... */ 6187 * when it isn't needed... */
diff --git a/drivers/net/wireless/iwlegacy/4965.c b/drivers/net/wireless/iwlegacy/4965.c
index e5e5ab24d171..805a4ea8351a 100644
--- a/drivers/net/wireless/iwlegacy/4965.c
+++ b/drivers/net/wireless/iwlegacy/4965.c
@@ -1889,7 +1889,14 @@ static struct il_hcmd_utils_ops il4965_hcmd_utils = {
1889 .post_scan = il4965_post_scan, 1889 .post_scan = il4965_post_scan,
1890}; 1890};
1891 1891
1892static struct il_lib_ops il4965_lib = { 1892static 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
1899const struct il_ops il4965_ops = {
1893 .txq_update_byte_cnt_tbl = il4965_txq_update_byte_cnt_tbl, 1900 .txq_update_byte_cnt_tbl = il4965_txq_update_byte_cnt_tbl,
1894 .txq_attach_buf_to_tfd = il4965_hw_txq_attach_buf_to_tfd, 1901 .txq_attach_buf_to_tfd = il4965_hw_txq_attach_buf_to_tfd,
1895 .txq_free_tfd = il4965_hw_txq_free_tfd, 1902 .txq_free_tfd = il4965_hw_txq_free_tfd,
@@ -1905,17 +1912,7 @@ static struct il_lib_ops il4965_lib = {
1905 .update_chain_flags = il4965_update_chain_flags, 1912 .update_chain_flags = il4965_update_chain_flags,
1906 .eeprom_acquire_semaphore = il4965_eeprom_acquire_semaphore, 1913 .eeprom_acquire_semaphore = il4965_eeprom_acquire_semaphore,
1907 .eeprom_release_semaphore = il4965_eeprom_release_semaphore, 1914 .eeprom_release_semaphore = il4965_eeprom_release_semaphore,
1908};
1909 1915
1910static const struct il_legacy_ops il4965_legacy_ops = {
1911 .post_associate = il4965_post_associate,
1912 .config_ap = il4965_config_ap,
1913 .manage_ibss_station = il4965_manage_ibss_station,
1914 .update_bcast_stations = il4965_update_bcast_stations,
1915};
1916
1917const struct il_ops il4965_ops = {
1918 .lib = &il4965_lib,
1919 .hcmd = &il4965_hcmd, 1916 .hcmd = &il4965_hcmd,
1920 .utils = &il4965_hcmd_utils, 1917 .utils = &il4965_hcmd_utils,
1921 .led = &il4965_led_ops, 1918 .led = &il4965_led_ops,
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 6e63d9fee565..d522a4324a11 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -730,7 +730,7 @@ il_eeprom_init(struct il_priv *il)
730 } 730 }
731 e = (__le16 *) il->eeprom; 731 e = (__le16 *) il->eeprom;
732 732
733 il->ops->lib->apm_init(il); 733 il->ops->apm_init(il);
734 734
735 ret = il_eeprom_verify_signature(il); 735 ret = il_eeprom_verify_signature(il);
736 if (ret < 0) { 736 if (ret < 0) {
@@ -740,7 +740,7 @@ il_eeprom_init(struct il_priv *il)
740 } 740 }
741 741
742 /* Make sure driver (instead of uCode) is allowed to read EEPROM */ 742 /* Make sure driver (instead of uCode) is allowed to read EEPROM */
743 ret = il->ops->lib->eeprom_acquire_semaphore(il); 743 ret = il->ops->eeprom_acquire_semaphore(il);
744 if (ret < 0) { 744 if (ret < 0) {
745 IL_ERR("Failed to acquire EEPROM semaphore.\n"); 745 IL_ERR("Failed to acquire EEPROM semaphore.\n");
746 ret = -ENOENT; 746 ret = -ENOENT;
@@ -772,7 +772,7 @@ il_eeprom_init(struct il_priv *il)
772 772
773 ret = 0; 773 ret = 0;
774done: 774done:
775 il->ops->lib->eeprom_release_semaphore(il); 775 il->ops->eeprom_release_semaphore(il);
776 776
777err: 777err:
778 if (ret) 778 if (ret)
@@ -1155,9 +1155,9 @@ il_power_set_mode(struct il_priv *il, struct il_powertable_cmd *cmd, bool force)
1155 if (!(cmd->flags & IL_POWER_DRIVER_ALLOW_SLEEP_MSK)) 1155 if (!(cmd->flags & IL_POWER_DRIVER_ALLOW_SLEEP_MSK))
1156 clear_bit(S_POWER_PMI, &il->status); 1156 clear_bit(S_POWER_PMI, &il->status);
1157 1157
1158 if (il->ops->lib->update_chain_flags && update_chains) 1158 if (il->ops->update_chain_flags && update_chains)
1159 il->ops->lib->update_chain_flags(il); 1159 il->ops->update_chain_flags(il);
1160 else if (il->ops->lib->update_chain_flags) 1160 else if (il->ops->update_chain_flags)
1161 D_POWER("Cannot update the power, chain noise " 1161 D_POWER("Cannot update the power, chain noise "
1162 "calibration running: %d\n", 1162 "calibration running: %d\n",
1163 il->chain_noise_data.state); 1163 il->chain_noise_data.state);
@@ -2719,7 +2719,7 @@ il_tx_queue_unmap(struct il_priv *il, int txq_id)
2719 return; 2719 return;
2720 2720
2721 while (q->write_ptr != q->read_ptr) { 2721 while (q->write_ptr != q->read_ptr) {
2722 il->ops->lib->txq_free_tfd(il, txq); 2722 il->ops->txq_free_tfd(il, txq);
2723 q->read_ptr = il_queue_inc_wrap(q->read_ptr, q->n_bd); 2723 q->read_ptr = il_queue_inc_wrap(q->read_ptr, q->n_bd);
2724 } 2724 }
2725} 2725}
@@ -3019,7 +3019,7 @@ il_tx_queue_init(struct il_priv *il, struct il_tx_queue *txq, int slots_num,
3019 il_queue_init(il, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id); 3019 il_queue_init(il, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id);
3020 3020
3021 /* Tell device where to find queue */ 3021 /* Tell device where to find queue */
3022 il->ops->lib->txq_init(il, txq); 3022 il->ops->txq_init(il, txq);
3023 3023
3024 return 0; 3024 return 0;
3025err: 3025err:
@@ -3050,7 +3050,7 @@ il_tx_queue_reset(struct il_priv *il, struct il_tx_queue *txq, int slots_num,
3050 il_queue_init(il, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id); 3050 il_queue_init(il, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id);
3051 3051
3052 /* Tell device where to find queue */ 3052 /* Tell device where to find queue */
3053 il->ops->lib->txq_init(il, txq); 3053 il->ops->txq_init(il, txq);
3054} 3054}
3055EXPORT_SYMBOL(il_tx_queue_reset); 3055EXPORT_SYMBOL(il_tx_queue_reset);
3056 3056
@@ -3157,9 +3157,9 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)
3157#endif 3157#endif
3158 txq->need_update = 1; 3158 txq->need_update = 1;
3159 3159
3160 if (il->ops->lib->txq_update_byte_cnt_tbl) 3160 if (il->ops->txq_update_byte_cnt_tbl)
3161 /* Set up entry in queue's byte count circular buffer */ 3161 /* Set up entry in queue's byte count circular buffer */
3162 il->ops->lib->txq_update_byte_cnt_tbl(il, txq, 0); 3162 il->ops->txq_update_byte_cnt_tbl(il, txq, 0);
3163 3163
3164 phys_addr = 3164 phys_addr =
3165 pci_map_single(il->pci_dev, &out_cmd->hdr, fix_size, 3165 pci_map_single(il->pci_dev, &out_cmd->hdr, fix_size,
@@ -3167,7 +3167,7 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)
3167 dma_unmap_addr_set(out_meta, mapping, phys_addr); 3167 dma_unmap_addr_set(out_meta, mapping, phys_addr);
3168 dma_unmap_len_set(out_meta, len, fix_size); 3168 dma_unmap_len_set(out_meta, len, fix_size);
3169 3169
3170 il->ops->lib->txq_attach_buf_to_tfd(il, txq, phys_addr, fix_size, 1, 3170 il->ops->txq_attach_buf_to_tfd(il, txq, phys_addr, fix_size, 1,
3171 U32_PAD(cmd->len)); 3171 U32_PAD(cmd->len));
3172 3172
3173 /* Increment and update queue's write idx */ 3173 /* Increment and update queue's write idx */
@@ -4101,9 +4101,9 @@ il_irq_handle_error(struct il_priv *il)
4101 4101
4102 IL_ERR("Loaded firmware version: %s\n", il->hw->wiphy->fw_version); 4102 IL_ERR("Loaded firmware version: %s\n", il->hw->wiphy->fw_version);
4103 4103
4104 il->ops->lib->dump_nic_error_log(il); 4104 il->ops->dump_nic_error_log(il);
4105 if (il->ops->lib->dump_fh) 4105 if (il->ops->dump_fh)
4106 il->ops->lib->dump_fh(il, NULL, false); 4106 il->ops->dump_fh(il, NULL, false);
4107#ifdef CONFIG_IWLEGACY_DEBUG 4107#ifdef CONFIG_IWLEGACY_DEBUG
4108 if (il_get_debug_level(il) & IL_DL_FW_ERRORS) 4108 if (il_get_debug_level(il) & IL_DL_FW_ERRORS)
4109 il_print_rx_config_cmd(il); 4109 il_print_rx_config_cmd(il);
@@ -4290,7 +4290,7 @@ il_set_tx_power(struct il_priv *il, s8 tx_power, bool force)
4290 if (il->tx_power_user_lmt == tx_power && !force) 4290 if (il->tx_power_user_lmt == tx_power && !force)
4291 return 0; 4291 return 0;
4292 4292
4293 if (!il->ops->lib->send_tx_power) 4293 if (!il->ops->send_tx_power)
4294 return -EOPNOTSUPP; 4294 return -EOPNOTSUPP;
4295 4295
4296 /* 0 dBm mean 1 milliwatt */ 4296 /* 0 dBm mean 1 milliwatt */
@@ -4323,7 +4323,7 @@ il_set_tx_power(struct il_priv *il, s8 tx_power, bool force)
4323 prev_tx_power = il->tx_power_user_lmt; 4323 prev_tx_power = il->tx_power_user_lmt;
4324 il->tx_power_user_lmt = tx_power; 4324 il->tx_power_user_lmt = tx_power;
4325 4325
4326 ret = il->ops->lib->send_tx_power(il); 4326 ret = il->ops->send_tx_power(il);
4327 4327
4328 /* if fail to set tx_power, restore the orig. tx power */ 4328 /* if fail to set tx_power, restore the orig. tx power */
4329 if (ret) { 4329 if (ret) {
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index ca68b58674c6..91624ee57fed 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1578,7 +1578,20 @@ struct il_debugfs_ops {
1578}; 1578};
1579#endif 1579#endif
1580 1580
1581struct il_lib_ops { 1581struct il_led_ops {
1582 int (*cmd) (struct il_priv *il, struct il_led_cmd *led_cmd);
1583};
1584
1585struct 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
1594struct il_ops {
1582 /* Handling TX */ 1595 /* Handling TX */
1583 void (*txq_update_byte_cnt_tbl) (struct il_priv *il, 1596 void (*txq_update_byte_cnt_tbl) (struct il_priv *il,
1584 struct il_tx_queue *txq, 1597 struct il_tx_queue *txq,
@@ -1609,23 +1622,7 @@ struct il_lib_ops {
1609 /* eeprom operations */ 1622 /* eeprom operations */
1610 int (*eeprom_acquire_semaphore) (struct il_priv *il); 1623 int (*eeprom_acquire_semaphore) (struct il_priv *il);
1611 void (*eeprom_release_semaphore) (struct il_priv *il); 1624 void (*eeprom_release_semaphore) (struct il_priv *il);
1612};
1613 1625
1614struct il_led_ops {
1615 int (*cmd) (struct il_priv *il, struct il_led_cmd *led_cmd);
1616};
1617
1618struct il_legacy_ops {
1619 void (*post_associate) (struct il_priv *il);
1620 void (*config_ap) (struct il_priv *il);
1621 /* station management */
1622 int (*update_bcast_stations) (struct il_priv *il);
1623 int (*manage_ibss_station) (struct il_priv *il,
1624 struct ieee80211_vif *vif, bool add);
1625};
1626
1627struct il_ops {
1628 const struct il_lib_ops *lib;
1629 const struct il_hcmd_ops *hcmd; 1626 const struct il_hcmd_ops *hcmd;
1630 const struct il_hcmd_utils_ops *utils; 1627 const struct il_hcmd_utils_ops *utils;
1631 const struct il_led_ops *led; 1628 const struct il_led_ops *led;
diff --git a/drivers/net/wireless/iwlegacy/debug.c b/drivers/net/wireless/iwlegacy/debug.c
index 5091db813d66..be6005da785d 100644
--- a/drivers/net/wireless/iwlegacy/debug.c
+++ b/drivers/net/wireless/iwlegacy/debug.c
@@ -1178,8 +1178,8 @@ il_dbgfs_fh_reg_read(struct file *file, char __user *user_buf, size_t count,
1178 int pos = 0; 1178 int pos = 0;
1179 ssize_t ret = -EFAULT; 1179 ssize_t ret = -EFAULT;
1180 1180
1181 if (il->ops->lib->dump_fh) { 1181 if (il->ops->dump_fh) {
1182 ret = pos = il->ops->lib->dump_fh(il, &buf, true); 1182 ret = pos = il->ops->dump_fh(il, &buf, true);
1183 if (buf) { 1183 if (buf) {
1184 ret = 1184 ret =
1185 simple_read_from_buffer(user_buf, count, ppos, buf, 1185 simple_read_from_buffer(user_buf, count, ppos, buf,