diff options
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-op-mode.h | 17 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-shared.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h | 5 |
6 files changed, 31 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index bafa546939ba..91aa83fbb432 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1386,6 +1386,8 @@ const struct iwl_op_mode_ops iwl_dvm_ops = { | |||
1386 | .start = iwl_op_mode_dvm_start, | 1386 | .start = iwl_op_mode_dvm_start, |
1387 | .stop = iwl_op_mode_dvm_stop, | 1387 | .stop = iwl_op_mode_dvm_stop, |
1388 | .rx = iwl_rx_dispatch, | 1388 | .rx = iwl_rx_dispatch, |
1389 | .queue_full = iwl_stop_sw_queue, | ||
1390 | .queue_not_full = iwl_wake_sw_queue, | ||
1389 | .free_skb = iwl_free_skb, | 1391 | .free_skb = iwl_free_skb, |
1390 | }; | 1392 | }; |
1391 | 1393 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index 337e0984702b..db0e2ae2f5bf 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -84,6 +84,9 @@ void iwl_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb); | |||
84 | int __must_check iwl_rx_dispatch(struct iwl_op_mode *op_mode, | 84 | int __must_check iwl_rx_dispatch(struct iwl_op_mode *op_mode, |
85 | struct iwl_rx_mem_buffer *rxb, | 85 | struct iwl_rx_mem_buffer *rxb, |
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); | ||
88 | void iwl_wake_sw_queue(struct iwl_op_mode *op_mode, u8 ac); | ||
89 | |||
87 | 90 | ||
88 | /* MAC80211 */ | 91 | /* MAC80211 */ |
89 | 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 675464a0218e..2aa69e07e687 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -1475,12 +1475,16 @@ void iwl_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb) | |||
1475 | dev_kfree_skb_any(skb); | 1475 | dev_kfree_skb_any(skb); |
1476 | } | 1476 | } |
1477 | 1477 | ||
1478 | void iwl_stop_sw_queue(struct iwl_priv *priv, u8 ac) | 1478 | void iwl_stop_sw_queue(struct iwl_op_mode *op_mode, u8 ac) |
1479 | { | 1479 | { |
1480 | struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode); | ||
1481 | |||
1480 | ieee80211_stop_queue(priv->hw, ac); | 1482 | ieee80211_stop_queue(priv->hw, ac); |
1481 | } | 1483 | } |
1482 | 1484 | ||
1483 | void iwl_wake_sw_queue(struct iwl_priv *priv, u8 ac) | 1485 | void iwl_wake_sw_queue(struct iwl_op_mode *op_mode, u8 ac) |
1484 | { | 1486 | { |
1487 | struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode); | ||
1488 | |||
1485 | ieee80211_wake_queue(priv->hw, ac); | 1489 | ieee80211_wake_queue(priv->hw, ac); |
1486 | } | 1490 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-op-mode.h b/drivers/net/wireless/iwlwifi/iwl-op-mode.h index b0272fd9b537..c1664e1fd26a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-op-mode.h +++ b/drivers/net/wireless/iwlwifi/iwl-op-mode.h | |||
@@ -80,6 +80,10 @@ struct iwl_rx_mem_buffer; | |||
80 | * May sleep | 80 | * May sleep |
81 | * @rx: Rx notification to the op_mode. rxb is the Rx buffer itself. Cmd is the | 81 | * @rx: Rx notification to the op_mode. rxb is the Rx buffer itself. Cmd is the |
82 | * HCMD the this Rx responds to. | 82 | * HCMD the this Rx responds to. |
83 | * @queue_full: notifies that a HW queue is full. Ac is the ac of the queue | ||
84 | * Must be atomic | ||
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 | ||
83 | * @free_skb: allows the transport layer to free skbs that haven't been | 87 | * @free_skb: allows the transport layer to free skbs that haven't been |
84 | * reclaimed by the op_mode. This can happen when the driver is freed and | 88 | * reclaimed by the op_mode. This can happen when the driver is freed and |
85 | * there are Tx packets pending in the transport layer. | 89 | * there are Tx packets pending in the transport layer. |
@@ -90,6 +94,8 @@ struct iwl_op_mode_ops { | |||
90 | void (*stop)(struct iwl_op_mode *op_mode); | 94 | void (*stop)(struct iwl_op_mode *op_mode); |
91 | int (*rx)(struct iwl_op_mode *op_mode, struct iwl_rx_mem_buffer *rxb, | 95 | int (*rx)(struct iwl_op_mode *op_mode, struct iwl_rx_mem_buffer *rxb, |
92 | struct iwl_device_cmd *cmd); | 96 | struct iwl_device_cmd *cmd); |
97 | void (*queue_full)(struct iwl_op_mode *op_mode, u8 ac); | ||
98 | void (*queue_not_full)(struct iwl_op_mode *op_mode, u8 ac); | ||
93 | void (*free_skb)(struct iwl_op_mode *op_mode, struct sk_buff *skb); | 99 | void (*free_skb)(struct iwl_op_mode *op_mode, struct sk_buff *skb); |
94 | }; | 100 | }; |
95 | 101 | ||
@@ -119,6 +125,17 @@ static inline int iwl_op_mode_rx(struct iwl_op_mode *op_mode, | |||
119 | return op_mode->ops->rx(op_mode, rxb, cmd); | 125 | return op_mode->ops->rx(op_mode, rxb, cmd); |
120 | } | 126 | } |
121 | 127 | ||
128 | static inline void iwl_op_mode_queue_full(struct iwl_op_mode *op_mode, u8 ac) | ||
129 | { | ||
130 | op_mode->ops->queue_full(op_mode, ac); | ||
131 | } | ||
132 | |||
133 | static inline void iwl_op_mode_queue_not_full(struct iwl_op_mode *op_mode, | ||
134 | u8 ac) | ||
135 | { | ||
136 | op_mode->ops->queue_not_full(op_mode, ac); | ||
137 | } | ||
138 | |||
122 | static inline void iwl_op_mode_free_skb(struct iwl_op_mode *op_mode, | 139 | static inline void iwl_op_mode_free_skb(struct iwl_op_mode *op_mode, |
123 | struct sk_buff *skb) | 140 | struct sk_buff *skb) |
124 | { | 141 | { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h index b63423f6d2b4..0a3f6fd6da60 100644 --- a/drivers/net/wireless/iwlwifi/iwl-shared.h +++ b/drivers/net/wireless/iwlwifi/iwl-shared.h | |||
@@ -539,8 +539,6 @@ void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand); | |||
539 | const char *get_cmd_string(u8 cmd); | 539 | const char *get_cmd_string(u8 cmd); |
540 | bool iwl_check_for_ct_kill(struct iwl_priv *priv); | 540 | bool iwl_check_for_ct_kill(struct iwl_priv *priv); |
541 | 541 | ||
542 | void iwl_stop_sw_queue(struct iwl_priv *priv, u8 ac); | ||
543 | void iwl_wake_sw_queue(struct iwl_priv *priv, u8 ac); | ||
544 | 542 | ||
545 | /* notification wait support */ | 543 | /* notification wait support */ |
546 | void iwl_abort_notification_waits(struct iwl_shared *shrd); | 544 | void iwl_abort_notification_waits(struct iwl_shared *shrd); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h index 8c30fea8c2b3..5b26b71ae3d5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h | |||
@@ -40,6 +40,7 @@ | |||
40 | #include "iwl-trans.h" | 40 | #include "iwl-trans.h" |
41 | #include "iwl-debug.h" | 41 | #include "iwl-debug.h" |
42 | #include "iwl-io.h" | 42 | #include "iwl-io.h" |
43 | #include "iwl-op-mode.h" | ||
43 | 44 | ||
44 | struct iwl_tx_queue; | 45 | struct iwl_tx_queue; |
45 | struct iwl_queue; | 46 | struct iwl_queue; |
@@ -374,7 +375,7 @@ static inline void iwl_wake_queue(struct iwl_trans *trans, | |||
374 | 375 | ||
375 | if (test_and_clear_bit(hwq, trans_pcie->queue_stopped)) { | 376 | if (test_and_clear_bit(hwq, trans_pcie->queue_stopped)) { |
376 | if (atomic_dec_return(&trans_pcie->queue_stop_count[ac]) <= 0) { | 377 | if (atomic_dec_return(&trans_pcie->queue_stop_count[ac]) <= 0) { |
377 | iwl_wake_sw_queue(priv(trans), ac); | 378 | iwl_op_mode_queue_not_full(trans->op_mode, ac); |
378 | IWL_DEBUG_TX_QUEUES(trans, "Wake hwq %d ac %d. %s", | 379 | IWL_DEBUG_TX_QUEUES(trans, "Wake hwq %d ac %d. %s", |
379 | hwq, ac, msg); | 380 | hwq, ac, msg); |
380 | } else { | 381 | } else { |
@@ -397,7 +398,7 @@ static inline void iwl_stop_queue(struct iwl_trans *trans, | |||
397 | 398 | ||
398 | if (!test_and_set_bit(hwq, trans_pcie->queue_stopped)) { | 399 | if (!test_and_set_bit(hwq, trans_pcie->queue_stopped)) { |
399 | if (atomic_inc_return(&trans_pcie->queue_stop_count[ac]) > 0) { | 400 | if (atomic_inc_return(&trans_pcie->queue_stop_count[ac]) > 0) { |
400 | iwl_stop_sw_queue(priv(trans), ac); | 401 | iwl_op_mode_queue_full(trans->op_mode, ac); |
401 | IWL_DEBUG_TX_QUEUES(trans, "Stop hwq %d ac %d" | 402 | IWL_DEBUG_TX_QUEUES(trans, "Stop hwq %d ac %d" |
402 | " stop count %d. %s", | 403 | " stop count %d. %s", |
403 | hwq, ac, atomic_read(&trans_pcie-> | 404 | hwq, ac, atomic_read(&trans_pcie-> |