aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c11
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c21
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c16
4 files changed, 17 insertions, 37 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index df558796fbe6..530fae8cf16d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -414,13 +414,13 @@ void iwl_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rxq);
414void iwl_cmd_queue_free(struct iwl_priv *priv); 414void iwl_cmd_queue_free(struct iwl_priv *priv);
415int iwl_rx_queue_alloc(struct iwl_priv *priv); 415int iwl_rx_queue_alloc(struct iwl_priv *priv);
416void iwl_rx_handle(struct iwl_priv *priv); 416void iwl_rx_handle(struct iwl_priv *priv);
417int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, 417void iwl_rx_queue_update_write_ptr(struct iwl_priv *priv,
418 struct iwl_rx_queue *q); 418 struct iwl_rx_queue *q);
419void iwl_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq); 419void iwl_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq);
420void iwl_rx_replenish(struct iwl_priv *priv); 420void iwl_rx_replenish(struct iwl_priv *priv);
421void iwl_rx_replenish_now(struct iwl_priv *priv); 421void iwl_rx_replenish_now(struct iwl_priv *priv);
422int iwl_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq); 422int iwl_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq);
423int iwl_rx_queue_restock(struct iwl_priv *priv); 423void iwl_rx_queue_restock(struct iwl_priv *priv);
424int iwl_rx_queue_space(const struct iwl_rx_queue *q); 424int iwl_rx_queue_space(const struct iwl_rx_queue *q);
425void iwl_rx_allocate(struct iwl_priv *priv, gfp_t priority); 425void iwl_rx_allocate(struct iwl_priv *priv, gfp_t priority);
426void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb); 426void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb);
@@ -450,7 +450,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb);
450void iwl_hw_txq_ctx_free(struct iwl_priv *priv); 450void iwl_hw_txq_ctx_free(struct iwl_priv *priv);
451int iwl_hw_tx_queue_init(struct iwl_priv *priv, 451int iwl_hw_tx_queue_init(struct iwl_priv *priv,
452 struct iwl_tx_queue *txq); 452 struct iwl_tx_queue *txq);
453int iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq); 453void iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq);
454int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq, 454int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq,
455 int slots_num, u32 txq_id); 455 int slots_num, u32 txq_id);
456void iwl_tx_queue_free(struct iwl_priv *priv, int txq_id); 456void iwl_tx_queue_free(struct iwl_priv *priv, int txq_id);
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index 909d9c9b9ad8..428c9d689d4c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -123,12 +123,11 @@ EXPORT_SYMBOL(iwl_rx_queue_space);
123/** 123/**
124 * iwl_rx_queue_update_write_ptr - Update the write pointer for the RX queue 124 * iwl_rx_queue_update_write_ptr - Update the write pointer for the RX queue
125 */ 125 */
126int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, struct iwl_rx_queue *q) 126void iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, struct iwl_rx_queue *q)
127{ 127{
128 unsigned long flags; 128 unsigned long flags;
129 u32 rx_wrt_ptr_reg = priv->hw_params.rx_wrt_ptr_reg; 129 u32 rx_wrt_ptr_reg = priv->hw_params.rx_wrt_ptr_reg;
130 u32 reg; 130 u32 reg;
131 int ret = 0;
132 131
133 spin_lock_irqsave(&q->lock, flags); 132 spin_lock_irqsave(&q->lock, flags);
134 133
@@ -161,7 +160,6 @@ int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, struct iwl_rx_queue *q)
161 160
162 exit_unlock: 161 exit_unlock:
163 spin_unlock_irqrestore(&q->lock, flags); 162 spin_unlock_irqrestore(&q->lock, flags);
164 return ret;
165} 163}
166EXPORT_SYMBOL(iwl_rx_queue_update_write_ptr); 164EXPORT_SYMBOL(iwl_rx_queue_update_write_ptr);
167/** 165/**
@@ -184,14 +182,13 @@ static inline __le32 iwl_dma_addr2rbd_ptr(struct iwl_priv *priv,
184 * also updates the memory address in the firmware to reference the new 182 * also updates the memory address in the firmware to reference the new
185 * target buffer. 183 * target buffer.
186 */ 184 */
187int iwl_rx_queue_restock(struct iwl_priv *priv) 185void iwl_rx_queue_restock(struct iwl_priv *priv)
188{ 186{
189 struct iwl_rx_queue *rxq = &priv->rxq; 187 struct iwl_rx_queue *rxq = &priv->rxq;
190 struct list_head *element; 188 struct list_head *element;
191 struct iwl_rx_mem_buffer *rxb; 189 struct iwl_rx_mem_buffer *rxb;
192 unsigned long flags; 190 unsigned long flags;
193 int write; 191 int write;
194 int ret = 0;
195 192
196 spin_lock_irqsave(&rxq->lock, flags); 193 spin_lock_irqsave(&rxq->lock, flags);
197 write = rxq->write & ~0x7; 194 write = rxq->write & ~0x7;
@@ -220,10 +217,8 @@ int iwl_rx_queue_restock(struct iwl_priv *priv)
220 spin_lock_irqsave(&rxq->lock, flags); 217 spin_lock_irqsave(&rxq->lock, flags);
221 rxq->need_update = 1; 218 rxq->need_update = 1;
222 spin_unlock_irqrestore(&rxq->lock, flags); 219 spin_unlock_irqrestore(&rxq->lock, flags);
223 ret = iwl_rx_queue_update_write_ptr(priv, rxq); 220 iwl_rx_queue_update_write_ptr(priv, rxq);
224 } 221 }
225
226 return ret;
227} 222}
228EXPORT_SYMBOL(iwl_rx_queue_restock); 223EXPORT_SYMBOL(iwl_rx_queue_restock);
229 224
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index 3788a3d4ddc2..2199b1bc1c28 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -80,14 +80,13 @@ static inline void iwl_free_dma_ptr(struct iwl_priv *priv,
80/** 80/**
81 * iwl_txq_update_write_ptr - Send new write index to hardware 81 * iwl_txq_update_write_ptr - Send new write index to hardware
82 */ 82 */
83int iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq) 83void iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq)
84{ 84{
85 u32 reg = 0; 85 u32 reg = 0;
86 int ret = 0;
87 int txq_id = txq->q.id; 86 int txq_id = txq->q.id;
88 87
89 if (txq->need_update == 0) 88 if (txq->need_update == 0)
90 return ret; 89 return;
91 90
92 /* if we're trying to save power */ 91 /* if we're trying to save power */
93 if (test_bit(STATUS_POWER_PMI, &priv->status)) { 92 if (test_bit(STATUS_POWER_PMI, &priv->status)) {
@@ -101,7 +100,7 @@ int iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq)
101 txq_id, reg); 100 txq_id, reg);
102 iwl_set_bit(priv, CSR_GP_CNTRL, 101 iwl_set_bit(priv, CSR_GP_CNTRL,
103 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); 102 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
104 return ret; 103 return;
105 } 104 }
106 105
107 iwl_write_direct32(priv, HBUS_TARG_WRPTR, 106 iwl_write_direct32(priv, HBUS_TARG_WRPTR,
@@ -114,8 +113,6 @@ int iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq)
114 txq->q.write_ptr | (txq_id << 8)); 113 txq->q.write_ptr | (txq_id << 8));
115 114
116 txq->need_update = 0; 115 txq->need_update = 0;
117
118 return ret;
119} 116}
120EXPORT_SYMBOL(iwl_txq_update_write_ptr); 117EXPORT_SYMBOL(iwl_txq_update_write_ptr);
121 118
@@ -731,7 +728,6 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
731 u8 tid = 0; 728 u8 tid = 0;
732 u8 *qc = NULL; 729 u8 *qc = NULL;
733 unsigned long flags; 730 unsigned long flags;
734 int ret;
735 731
736 spin_lock_irqsave(&priv->lock, flags); 732 spin_lock_irqsave(&priv->lock, flags);
737 if (iwl_is_rfkill(priv)) { 733 if (iwl_is_rfkill(priv)) {
@@ -951,7 +947,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
951 947
952 /* Tell device the write index *just past* this latest filled TFD */ 948 /* Tell device the write index *just past* this latest filled TFD */
953 q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd); 949 q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd);
954 ret = iwl_txq_update_write_ptr(priv, txq); 950 iwl_txq_update_write_ptr(priv, txq);
955 spin_unlock_irqrestore(&priv->lock, flags); 951 spin_unlock_irqrestore(&priv->lock, flags);
956 952
957 /* 953 /*
@@ -965,9 +961,6 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
965 if (sta_priv && sta_priv->client) 961 if (sta_priv && sta_priv->client)
966 atomic_inc(&sta_priv->pending_frames); 962 atomic_inc(&sta_priv->pending_frames);
967 963
968 if (ret)
969 return ret;
970
971 if ((iwl_queue_space(q) < q->high_mark) && priv->mac80211_registered) { 964 if ((iwl_queue_space(q) < q->high_mark) && priv->mac80211_registered) {
972 if (wait_write_ptr) { 965 if (wait_write_ptr) {
973 spin_lock_irqsave(&priv->lock, flags); 966 spin_lock_irqsave(&priv->lock, flags);
@@ -1006,7 +999,7 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
1006 struct iwl_cmd_meta *out_meta; 999 struct iwl_cmd_meta *out_meta;
1007 dma_addr_t phys_addr; 1000 dma_addr_t phys_addr;
1008 unsigned long flags; 1001 unsigned long flags;
1009 int len, ret; 1002 int len;
1010 u32 idx; 1003 u32 idx;
1011 u16 fix_size; 1004 u16 fix_size;
1012 1005
@@ -1103,10 +1096,10 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
1103 1096
1104 /* Increment and update queue's write index */ 1097 /* Increment and update queue's write index */
1105 q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd); 1098 q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd);
1106 ret = iwl_txq_update_write_ptr(priv, txq); 1099 iwl_txq_update_write_ptr(priv, txq);
1107 1100
1108 spin_unlock_irqrestore(&priv->hcmd_lock, flags); 1101 spin_unlock_irqrestore(&priv->hcmd_lock, flags);
1109 return ret ? ret : idx; 1102 return idx;
1110} 1103}
1111 1104
1112static void iwl_tx_status(struct iwl_priv *priv, struct sk_buff *skb) 1105static void iwl_tx_status(struct iwl_priv *priv, struct sk_buff *skb)
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index eac2b9a95711..f6e8f45ff7f0 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -478,7 +478,6 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
478 u8 wait_write_ptr = 0; 478 u8 wait_write_ptr = 0;
479 u8 *qc = NULL; 479 u8 *qc = NULL;
480 unsigned long flags; 480 unsigned long flags;
481 int rc;
482 481
483 spin_lock_irqsave(&priv->lock, flags); 482 spin_lock_irqsave(&priv->lock, flags);
484 if (iwl_is_rfkill(priv)) { 483 if (iwl_is_rfkill(priv)) {
@@ -663,12 +662,9 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
663 662
664 /* Tell device the write index *just past* this latest filled TFD */ 663 /* Tell device the write index *just past* this latest filled TFD */
665 q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd); 664 q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd);
666 rc = iwl_txq_update_write_ptr(priv, txq); 665 iwl_txq_update_write_ptr(priv, txq);
667 spin_unlock_irqrestore(&priv->lock, flags); 666 spin_unlock_irqrestore(&priv->lock, flags);
668 667
669 if (rc)
670 return rc;
671
672 if ((iwl_queue_space(q) < q->high_mark) 668 if ((iwl_queue_space(q) < q->high_mark)
673 && priv->mac80211_registered) { 669 && priv->mac80211_registered) {
674 if (wait_write_ptr) { 670 if (wait_write_ptr) {
@@ -1063,13 +1059,13 @@ static inline __le32 iwl3945_dma_addr2rbd_ptr(struct iwl_priv *priv,
1063 * also updates the memory address in the firmware to reference the new 1059 * also updates the memory address in the firmware to reference the new
1064 * target buffer. 1060 * target buffer.
1065 */ 1061 */
1066static int iwl3945_rx_queue_restock(struct iwl_priv *priv) 1062static void iwl3945_rx_queue_restock(struct iwl_priv *priv)
1067{ 1063{
1068 struct iwl_rx_queue *rxq = &priv->rxq; 1064 struct iwl_rx_queue *rxq = &priv->rxq;
1069 struct list_head *element; 1065 struct list_head *element;
1070 struct iwl_rx_mem_buffer *rxb; 1066 struct iwl_rx_mem_buffer *rxb;
1071 unsigned long flags; 1067 unsigned long flags;
1072 int write, rc; 1068 int write;
1073 1069
1074 spin_lock_irqsave(&rxq->lock, flags); 1070 spin_lock_irqsave(&rxq->lock, flags);
1075 write = rxq->write & ~0x7; 1071 write = rxq->write & ~0x7;
@@ -1099,12 +1095,8 @@ static int iwl3945_rx_queue_restock(struct iwl_priv *priv)
1099 spin_lock_irqsave(&rxq->lock, flags); 1095 spin_lock_irqsave(&rxq->lock, flags);
1100 rxq->need_update = 1; 1096 rxq->need_update = 1;
1101 spin_unlock_irqrestore(&rxq->lock, flags); 1097 spin_unlock_irqrestore(&rxq->lock, flags);
1102 rc = iwl_rx_queue_update_write_ptr(priv, rxq); 1098 iwl_rx_queue_update_write_ptr(priv, rxq);
1103 if (rc)
1104 return rc;
1105 } 1099 }
1106
1107 return 0;
1108} 1100}
1109 1101
1110/** 1102/**