Commit 02e38358 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Wey-Yi Guy

iwlwifi: virtualize op_mode's stop/start queue

Export them as "queue_full" and "queue_not_full" notification.
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent db70f290
...@@ -1386,6 +1386,8 @@ const struct iwl_op_mode_ops iwl_dvm_ops = { ...@@ -1386,6 +1386,8 @@ const struct iwl_op_mode_ops iwl_dvm_ops = {
.start = iwl_op_mode_dvm_start, .start = iwl_op_mode_dvm_start,
.stop = iwl_op_mode_dvm_stop, .stop = iwl_op_mode_dvm_stop,
.rx = iwl_rx_dispatch, .rx = iwl_rx_dispatch,
.queue_full = iwl_stop_sw_queue,
.queue_not_full = iwl_wake_sw_queue,
.free_skb = iwl_free_skb, .free_skb = iwl_free_skb,
}; };
......
...@@ -84,6 +84,9 @@ void iwl_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb); ...@@ -84,6 +84,9 @@ void iwl_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb);
int __must_check iwl_rx_dispatch(struct iwl_op_mode *op_mode, int __must_check iwl_rx_dispatch(struct iwl_op_mode *op_mode,
struct iwl_rx_mem_buffer *rxb, struct iwl_rx_mem_buffer *rxb,
struct iwl_device_cmd *cmd); struct iwl_device_cmd *cmd);
void iwl_stop_sw_queue(struct iwl_op_mode *op_mode, u8 ac);
void iwl_wake_sw_queue(struct iwl_op_mode *op_mode, u8 ac);
/* MAC80211 */ /* MAC80211 */
struct ieee80211_hw *iwl_alloc_all(void); struct ieee80211_hw *iwl_alloc_all(void);
......
...@@ -1475,12 +1475,16 @@ void iwl_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb) ...@@ -1475,12 +1475,16 @@ void iwl_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb)
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
} }
void iwl_stop_sw_queue(struct iwl_priv *priv, u8 ac) void iwl_stop_sw_queue(struct iwl_op_mode *op_mode, u8 ac)
{ {
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
ieee80211_stop_queue(priv->hw, ac); ieee80211_stop_queue(priv->hw, ac);
} }
void iwl_wake_sw_queue(struct iwl_priv *priv, u8 ac) void iwl_wake_sw_queue(struct iwl_op_mode *op_mode, u8 ac)
{ {
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
ieee80211_wake_queue(priv->hw, ac); ieee80211_wake_queue(priv->hw, ac);
} }
...@@ -80,6 +80,10 @@ struct iwl_rx_mem_buffer; ...@@ -80,6 +80,10 @@ struct iwl_rx_mem_buffer;
* May sleep * May sleep
* @rx: Rx notification to the op_mode. rxb is the Rx buffer itself. Cmd is the * @rx: Rx notification to the op_mode. rxb is the Rx buffer itself. Cmd is the
* HCMD the this Rx responds to. * HCMD the this Rx responds to.
* @queue_full: notifies that a HW queue is full. Ac is the ac of the queue
* Must be atomic
* @queue_not_full: notifies that a HW queue is not full any more.
* Ac is the ac of the queue. Must be atomic
* @free_skb: allows the transport layer to free skbs that haven't been * @free_skb: allows the transport layer to free skbs that haven't been
* reclaimed by the op_mode. This can happen when the driver is freed and * reclaimed by the op_mode. This can happen when the driver is freed and
* there are Tx packets pending in the transport layer. * there are Tx packets pending in the transport layer.
...@@ -90,6 +94,8 @@ struct iwl_op_mode_ops { ...@@ -90,6 +94,8 @@ struct iwl_op_mode_ops {
void (*stop)(struct iwl_op_mode *op_mode); void (*stop)(struct iwl_op_mode *op_mode);
int (*rx)(struct iwl_op_mode *op_mode, struct iwl_rx_mem_buffer *rxb, int (*rx)(struct iwl_op_mode *op_mode, struct iwl_rx_mem_buffer *rxb,
struct iwl_device_cmd *cmd); struct iwl_device_cmd *cmd);
void (*queue_full)(struct iwl_op_mode *op_mode, u8 ac);
void (*queue_not_full)(struct iwl_op_mode *op_mode, u8 ac);
void (*free_skb)(struct iwl_op_mode *op_mode, struct sk_buff *skb); void (*free_skb)(struct iwl_op_mode *op_mode, struct sk_buff *skb);
}; };
...@@ -119,6 +125,17 @@ static inline int iwl_op_mode_rx(struct iwl_op_mode *op_mode, ...@@ -119,6 +125,17 @@ static inline int iwl_op_mode_rx(struct iwl_op_mode *op_mode,
return op_mode->ops->rx(op_mode, rxb, cmd); return op_mode->ops->rx(op_mode, rxb, cmd);
} }
static inline void iwl_op_mode_queue_full(struct iwl_op_mode *op_mode, u8 ac)
{
op_mode->ops->queue_full(op_mode, ac);
}
static inline void iwl_op_mode_queue_not_full(struct iwl_op_mode *op_mode,
u8 ac)
{
op_mode->ops->queue_not_full(op_mode, ac);
}
static inline void iwl_op_mode_free_skb(struct iwl_op_mode *op_mode, static inline void iwl_op_mode_free_skb(struct iwl_op_mode *op_mode,
struct sk_buff *skb) struct sk_buff *skb)
{ {
......
...@@ -539,8 +539,6 @@ void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand); ...@@ -539,8 +539,6 @@ void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand);
const char *get_cmd_string(u8 cmd); const char *get_cmd_string(u8 cmd);
bool iwl_check_for_ct_kill(struct iwl_priv *priv); bool iwl_check_for_ct_kill(struct iwl_priv *priv);
void iwl_stop_sw_queue(struct iwl_priv *priv, u8 ac);
void iwl_wake_sw_queue(struct iwl_priv *priv, u8 ac);
/* notification wait support */ /* notification wait support */
void iwl_abort_notification_waits(struct iwl_shared *shrd); void iwl_abort_notification_waits(struct iwl_shared *shrd);
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "iwl-trans.h" #include "iwl-trans.h"
#include "iwl-debug.h" #include "iwl-debug.h"
#include "iwl-io.h" #include "iwl-io.h"
#include "iwl-op-mode.h"
struct iwl_tx_queue; struct iwl_tx_queue;
struct iwl_queue; struct iwl_queue;
...@@ -374,7 +375,7 @@ static inline void iwl_wake_queue(struct iwl_trans *trans, ...@@ -374,7 +375,7 @@ static inline void iwl_wake_queue(struct iwl_trans *trans,
if (test_and_clear_bit(hwq, trans_pcie->queue_stopped)) { if (test_and_clear_bit(hwq, trans_pcie->queue_stopped)) {
if (atomic_dec_return(&trans_pcie->queue_stop_count[ac]) <= 0) { if (atomic_dec_return(&trans_pcie->queue_stop_count[ac]) <= 0) {
iwl_wake_sw_queue(priv(trans), ac); iwl_op_mode_queue_not_full(trans->op_mode, ac);
IWL_DEBUG_TX_QUEUES(trans, "Wake hwq %d ac %d. %s", IWL_DEBUG_TX_QUEUES(trans, "Wake hwq %d ac %d. %s",
hwq, ac, msg); hwq, ac, msg);
} else { } else {
...@@ -397,7 +398,7 @@ static inline void iwl_stop_queue(struct iwl_trans *trans, ...@@ -397,7 +398,7 @@ static inline void iwl_stop_queue(struct iwl_trans *trans,
if (!test_and_set_bit(hwq, trans_pcie->queue_stopped)) { if (!test_and_set_bit(hwq, trans_pcie->queue_stopped)) {
if (atomic_inc_return(&trans_pcie->queue_stop_count[ac]) > 0) { if (atomic_inc_return(&trans_pcie->queue_stop_count[ac]) > 0) {
iwl_stop_sw_queue(priv(trans), ac); iwl_op_mode_queue_full(trans->op_mode, ac);
IWL_DEBUG_TX_QUEUES(trans, "Stop hwq %d ac %d" IWL_DEBUG_TX_QUEUES(trans, "Stop hwq %d ac %d"
" stop count %d. %s", " stop count %d. %s",
hwq, ac, atomic_read(&trans_pcie-> hwq, ac, atomic_read(&trans_pcie->
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment