diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-02-09 09:08:15 -0500 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-02-27 16:26:53 -0500 |
commit | 7120d9894c363ee31fd529e5dd962452b639ab8e (patch) | |
tree | fd62f51d9580247416f5649fb47578d451cd72e0 /drivers/net/wireless/iwlwifi | |
parent | 02e3835884f352ac707dcf14d8bf455c0c0acbc5 (diff) |
iwlwifi: virtualize op_mode's set_hw_rf_kill
Export it as "hw_rf_kill" notification.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-op-mode.h | 9 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-shared.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 6 |
7 files changed, 18 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 91aa83fbb432..28fda18df2b5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1388,6 +1388,7 @@ const struct iwl_op_mode_ops iwl_dvm_ops = { | |||
1388 | .rx = iwl_rx_dispatch, | 1388 | .rx = iwl_rx_dispatch, |
1389 | .queue_full = iwl_stop_sw_queue, | 1389 | .queue_full = iwl_stop_sw_queue, |
1390 | .queue_not_full = iwl_wake_sw_queue, | 1390 | .queue_not_full = iwl_wake_sw_queue, |
1391 | .hw_rf_kill = iwl_set_hw_rfkill_state, | ||
1391 | .free_skb = iwl_free_skb, | 1392 | .free_skb = iwl_free_skb, |
1392 | }; | 1393 | }; |
1393 | 1394 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index db0e2ae2f5bf..39d1e7960908 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -86,7 +86,7 @@ int __must_check iwl_rx_dispatch(struct iwl_op_mode *op_mode, | |||
86 | struct iwl_device_cmd *cmd); | 86 | struct iwl_device_cmd *cmd); |
87 | void iwl_stop_sw_queue(struct iwl_op_mode *op_mode, u8 ac); | 87 | void iwl_stop_sw_queue(struct iwl_op_mode *op_mode, u8 ac); |
88 | void iwl_wake_sw_queue(struct iwl_op_mode *op_mode, u8 ac); | 88 | void iwl_wake_sw_queue(struct iwl_op_mode *op_mode, u8 ac); |
89 | 89 | void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state); | |
90 | 90 | ||
91 | /* MAC80211 */ | 91 | /* MAC80211 */ |
92 | struct ieee80211_hw *iwl_alloc_all(void); | 92 | struct ieee80211_hw *iwl_alloc_all(void); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 2aa69e07e687..3b91b6b811aa 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -1455,8 +1455,10 @@ __le32 iwl_add_beacon_time(struct iwl_priv *priv, u32 base, | |||
1455 | return cpu_to_le32(res); | 1455 | return cpu_to_le32(res); |
1456 | } | 1456 | } |
1457 | 1457 | ||
1458 | void iwl_set_hw_rfkill_state(struct iwl_priv *priv, bool state) | 1458 | void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state) |
1459 | { | 1459 | { |
1460 | struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode); | ||
1461 | |||
1460 | wiphy_rfkill_set_hw_state(priv->hw->wiphy, state); | 1462 | wiphy_rfkill_set_hw_state(priv->hw->wiphy, state); |
1461 | } | 1463 | } |
1462 | 1464 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-op-mode.h b/drivers/net/wireless/iwlwifi/iwl-op-mode.h index c1664e1fd26a..8ce4aac29b0a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-op-mode.h +++ b/drivers/net/wireless/iwlwifi/iwl-op-mode.h | |||
@@ -84,6 +84,8 @@ struct iwl_rx_mem_buffer; | |||
84 | * Must be atomic | 84 | * Must be atomic |
85 | * @queue_not_full: notifies that a HW queue is not full any more. | 85 | * @queue_not_full: notifies that a HW queue is not full any more. |
86 | * Ac is the ac of the queue. Must be atomic | 86 | * Ac is the ac of the queue. Must be atomic |
87 | * @hw_rf_kill:notifies of a change in the HW rf kill switch. True means that | ||
88 | * the radio is killed. Must be atomic. | ||
87 | * @free_skb: allows the transport layer to free skbs that haven't been | 89 | * @free_skb: allows the transport layer to free skbs that haven't been |
88 | * reclaimed by the op_mode. This can happen when the driver is freed and | 90 | * reclaimed by the op_mode. This can happen when the driver is freed and |
89 | * there are Tx packets pending in the transport layer. | 91 | * there are Tx packets pending in the transport layer. |
@@ -96,6 +98,7 @@ struct iwl_op_mode_ops { | |||
96 | struct iwl_device_cmd *cmd); | 98 | struct iwl_device_cmd *cmd); |
97 | void (*queue_full)(struct iwl_op_mode *op_mode, u8 ac); | 99 | void (*queue_full)(struct iwl_op_mode *op_mode, u8 ac); |
98 | void (*queue_not_full)(struct iwl_op_mode *op_mode, u8 ac); | 100 | void (*queue_not_full)(struct iwl_op_mode *op_mode, u8 ac); |
101 | void (*hw_rf_kill)(struct iwl_op_mode *op_mode, bool state); | ||
99 | void (*free_skb)(struct iwl_op_mode *op_mode, struct sk_buff *skb); | 102 | void (*free_skb)(struct iwl_op_mode *op_mode, struct sk_buff *skb); |
100 | }; | 103 | }; |
101 | 104 | ||
@@ -136,6 +139,12 @@ static inline void iwl_op_mode_queue_not_full(struct iwl_op_mode *op_mode, | |||
136 | op_mode->ops->queue_not_full(op_mode, ac); | 139 | op_mode->ops->queue_not_full(op_mode, ac); |
137 | } | 140 | } |
138 | 141 | ||
142 | static inline void iwl_op_mode_hw_rf_kill(struct iwl_op_mode *op_mode, | ||
143 | bool state) | ||
144 | { | ||
145 | op_mode->ops->hw_rf_kill(op_mode, state); | ||
146 | } | ||
147 | |||
139 | static inline void iwl_op_mode_free_skb(struct iwl_op_mode *op_mode, | 148 | static inline void iwl_op_mode_free_skb(struct iwl_op_mode *op_mode, |
140 | struct sk_buff *skb) | 149 | struct sk_buff *skb) |
141 | { | 150 | { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h index 0a3f6fd6da60..5cbc637e63b6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-shared.h +++ b/drivers/net/wireless/iwlwifi/iwl-shared.h | |||
@@ -533,7 +533,6 @@ enum iwl_rxon_context_id { | |||
533 | }; | 533 | }; |
534 | 534 | ||
535 | int iwlagn_hw_valid_rtc_data_addr(u32 addr); | 535 | int iwlagn_hw_valid_rtc_data_addr(u32 addr); |
536 | void iwl_set_hw_rfkill_state(struct iwl_priv *priv, bool state); | ||
537 | void iwl_nic_config(struct iwl_priv *priv); | 536 | void iwl_nic_config(struct iwl_priv *priv); |
538 | void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand); | 537 | void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand); |
539 | const char *get_cmd_string(u8 cmd); | 538 | const char *get_cmd_string(u8 cmd); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c index 579131142163..abb5277f98e7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | |||
@@ -1036,7 +1036,7 @@ void iwl_irq_tasklet(struct iwl_trans *trans) | |||
1036 | else | 1036 | else |
1037 | clear_bit(STATUS_RF_KILL_HW, | 1037 | clear_bit(STATUS_RF_KILL_HW, |
1038 | &trans->shrd->status); | 1038 | &trans->shrd->status); |
1039 | iwl_set_hw_rfkill_state(priv(trans), hw_rf_kill); | 1039 | iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rf_kill); |
1040 | } | 1040 | } |
1041 | 1041 | ||
1042 | handled |= CSR_INT_BIT_RF_KILL; | 1042 | handled |= CSR_INT_BIT_RF_KILL; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c index 176063c4f781..ca0fa9c8e89c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | |||
@@ -1045,7 +1045,7 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, struct fw_img *fw) | |||
1045 | set_bit(STATUS_RF_KILL_HW, &trans->shrd->status); | 1045 | set_bit(STATUS_RF_KILL_HW, &trans->shrd->status); |
1046 | 1046 | ||
1047 | if (iwl_is_rfkill(trans->shrd)) { | 1047 | if (iwl_is_rfkill(trans->shrd)) { |
1048 | iwl_set_hw_rfkill_state(priv(trans), true); | 1048 | iwl_op_mode_hw_rf_kill(trans->op_mode, true); |
1049 | iwl_enable_interrupts(trans); | 1049 | iwl_enable_interrupts(trans); |
1050 | return -ERFKILL; | 1050 | return -ERFKILL; |
1051 | } | 1051 | } |
@@ -1524,7 +1524,7 @@ static int iwl_trans_pcie_start_hw(struct iwl_trans *trans) | |||
1524 | else | 1524 | else |
1525 | set_bit(STATUS_RF_KILL_HW, &trans->shrd->status); | 1525 | set_bit(STATUS_RF_KILL_HW, &trans->shrd->status); |
1526 | 1526 | ||
1527 | iwl_set_hw_rfkill_state(priv(trans), | 1527 | iwl_op_mode_hw_rf_kill(trans->op_mode, |
1528 | test_bit(STATUS_RF_KILL_HW, | 1528 | test_bit(STATUS_RF_KILL_HW, |
1529 | &trans->shrd->status)); | 1529 | &trans->shrd->status)); |
1530 | 1530 | ||
@@ -1669,7 +1669,7 @@ static int iwl_trans_pcie_resume(struct iwl_trans *trans) | |||
1669 | else | 1669 | else |
1670 | clear_bit(STATUS_RF_KILL_HW, &trans->shrd->status); | 1670 | clear_bit(STATUS_RF_KILL_HW, &trans->shrd->status); |
1671 | 1671 | ||
1672 | iwl_set_hw_rfkill_state(priv(trans), hw_rfkill); | 1672 | iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); |
1673 | 1673 | ||
1674 | return 0; | 1674 | return 0; |
1675 | } | 1675 | } |