aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-06-17 17:19:06 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-17 17:19:06 -0400
commitbb9c03d8a6893517737b16fdbeb54be3c73b3023 (patch)
tree35fa0d1defaaf94641963a49126d7bb475ffa4c6 /drivers/net/wireless/iwlwifi
parent4de57826810fd2cfeb2ab5c7d003ff9116b8f7ee (diff)
parentabf52f86aa0a49a7377350cafa8f218c4cd227e7 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tx.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-calib.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c18
12 files changed, 58 insertions, 20 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 0fa1d51c9c5..93d513e1418 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -844,7 +844,7 @@ static int iwl3945_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src)
844 844
845static int iwl3945_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq) 845static int iwl3945_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
846{ 846{
847 iwl_write_direct32(priv, FH39_RCSR_RBD_BASE(0), rxq->dma_addr); 847 iwl_write_direct32(priv, FH39_RCSR_RBD_BASE(0), rxq->bd_dma);
848 iwl_write_direct32(priv, FH39_RCSR_RPTR_ADDR(0), rxq->rb_stts_dma); 848 iwl_write_direct32(priv, FH39_RCSR_RPTR_ADDR(0), rxq->rb_stts_dma);
849 iwl_write_direct32(priv, FH39_RCSR_WPTR(0), 0); 849 iwl_write_direct32(priv, FH39_RCSR_WPTR(0), 0);
850 iwl_write_direct32(priv, FH39_RCSR_CONFIG(0), 850 iwl_write_direct32(priv, FH39_RCSR_CONFIG(0),
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 548f51d92de..0e7b0661d61 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -486,7 +486,7 @@ int iwlagn_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
486 486
487 /* Tell device where to find RBD circular buffer in DRAM */ 487 /* Tell device where to find RBD circular buffer in DRAM */
488 iwl_write_direct32(priv, FH_RSCSR_CHNL0_RBDCB_BASE_REG, 488 iwl_write_direct32(priv, FH_RSCSR_CHNL0_RBDCB_BASE_REG,
489 (u32)(rxq->dma_addr >> 8)); 489 (u32)(rxq->bd_dma >> 8));
490 490
491 /* Tell device where in DRAM to update its Rx status */ 491 /* Tell device where in DRAM to update its Rx status */
492 iwl_write_direct32(priv, FH_RSCSR_CHNL0_STTS_WPTR_REG, 492 iwl_write_direct32(priv, FH_RSCSR_CHNL0_STTS_WPTR_REG,
@@ -751,7 +751,7 @@ void iwlagn_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
751 } 751 }
752 752
753 dma_free_coherent(&priv->pci_dev->dev, 4 * RX_QUEUE_SIZE, rxq->bd, 753 dma_free_coherent(&priv->pci_dev->dev, 4 * RX_QUEUE_SIZE, rxq->bd,
754 rxq->dma_addr); 754 rxq->bd_dma);
755 dma_free_coherent(&priv->pci_dev->dev, sizeof(struct iwl_rb_status), 755 dma_free_coherent(&priv->pci_dev->dev, sizeof(struct iwl_rb_status),
756 rxq->rb_stts, rxq->rb_stts_dma); 756 rxq->rb_stts, rxq->rb_stts_dma);
757 rxq->bd = NULL; 757 rxq->bd = NULL;
@@ -904,7 +904,7 @@ void iwlagn_rx_reply_rx(struct iwl_priv *priv,
904 struct iwl_rx_packet *pkt = rxb_addr(rxb); 904 struct iwl_rx_packet *pkt = rxb_addr(rxb);
905 struct iwl_rx_phy_res *phy_res; 905 struct iwl_rx_phy_res *phy_res;
906 __le32 rx_pkt_status; 906 __le32 rx_pkt_status;
907 struct iwl4965_rx_mpdu_res_start *amsdu; 907 struct iwl_rx_mpdu_res_start *amsdu;
908 u32 len; 908 u32 len;
909 u32 ampdu_status; 909 u32 ampdu_status;
910 u32 rate_n_flags; 910 u32 rate_n_flags;
@@ -933,7 +933,7 @@ void iwlagn_rx_reply_rx(struct iwl_priv *priv,
933 return; 933 return;
934 } 934 }
935 phy_res = &priv->_agn.last_phy_res; 935 phy_res = &priv->_agn.last_phy_res;
936 amsdu = (struct iwl4965_rx_mpdu_res_start *)pkt->u.raw; 936 amsdu = (struct iwl_rx_mpdu_res_start *)pkt->u.raw;
937 header = (struct ieee80211_hdr *)(pkt->u.raw + sizeof(*amsdu)); 937 header = (struct ieee80211_hdr *)(pkt->u.raw + sizeof(*amsdu));
938 len = le16_to_cpu(amsdu->byte_count); 938 len = le16_to_cpu(amsdu->byte_count);
939 rx_pkt_status = *(__le32 *)(pkt->u.raw + sizeof(*amsdu) + len); 939 rx_pkt_status = *(__le32 *)(pkt->u.raw + sizeof(*amsdu) + len);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
index f9134ceb69a..84df7fca750 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -1324,6 +1324,11 @@ void iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,
1324 sta_id = ba_resp->sta_id; 1324 sta_id = ba_resp->sta_id;
1325 tid = ba_resp->tid; 1325 tid = ba_resp->tid;
1326 agg = &priv->stations[sta_id].tid[tid].agg; 1326 agg = &priv->stations[sta_id].tid[tid].agg;
1327 if (unlikely(agg->txq_id != scd_flow)) {
1328 IWL_ERR(priv, "BA scd_flow %d does not match txq_id %d\n",
1329 scd_flow, agg->txq_id);
1330 return;
1331 }
1327 1332
1328 /* Find index just before block-ack window */ 1333 /* Find index just before block-ack window */
1329 index = iwl_queue_dec_wrap(ba_resp_scd_ssn & 0xff, txq->q.n_bd); 1334 index = iwl_queue_dec_wrap(ba_resp_scd_ssn & 0xff, txq->q.n_bd);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 69e17d78288..d857f8496f6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -941,6 +941,8 @@ void iwl_rx_handle(struct iwl_priv *priv)
941 fill_rx = 1; 941 fill_rx = 1;
942 942
943 while (i != r) { 943 while (i != r) {
944 int len;
945
944 rxb = rxq->queue[i]; 946 rxb = rxq->queue[i];
945 947
946 /* If an RXB doesn't have a Rx queue slot associated with it, 948 /* If an RXB doesn't have a Rx queue slot associated with it,
@@ -955,8 +957,9 @@ void iwl_rx_handle(struct iwl_priv *priv)
955 PCI_DMA_FROMDEVICE); 957 PCI_DMA_FROMDEVICE);
956 pkt = rxb_addr(rxb); 958 pkt = rxb_addr(rxb);
957 959
958 trace_iwlwifi_dev_rx(priv, pkt, 960 len = le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK;
959 le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK); 961 len += sizeof(u32); /* account for status word */
962 trace_iwlwifi_dev_rx(priv, pkt, len);
960 963
961 /* Reclaim a command buffer only if this packet is a response 964 /* Reclaim a command buffer only if this packet is a response
962 * to a (driver-originated) command. 965 * to a (driver-originated) command.
@@ -3462,10 +3465,12 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw,
3462 int ret; 3465 int ret;
3463 u8 sta_id; 3466 u8 sta_id;
3464 3467
3465 sta_priv->common.sta_id = IWL_INVALID_STATION;
3466
3467 IWL_DEBUG_INFO(priv, "received request to add station %pM\n", 3468 IWL_DEBUG_INFO(priv, "received request to add station %pM\n",
3468 sta->addr); 3469 sta->addr);
3470 mutex_lock(&priv->mutex);
3471 IWL_DEBUG_INFO(priv, "proceeding to add station %pM\n",
3472 sta->addr);
3473 sta_priv->common.sta_id = IWL_INVALID_STATION;
3469 3474
3470 atomic_set(&sta_priv->pending_frames, 0); 3475 atomic_set(&sta_priv->pending_frames, 0);
3471 if (vif->type == NL80211_IFTYPE_AP) 3476 if (vif->type == NL80211_IFTYPE_AP)
@@ -3477,6 +3482,7 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw,
3477 IWL_ERR(priv, "Unable to add station %pM (%d)\n", 3482 IWL_ERR(priv, "Unable to add station %pM (%d)\n",
3478 sta->addr, ret); 3483 sta->addr, ret);
3479 /* Should we return success if return code is EEXIST ? */ 3484 /* Should we return success if return code is EEXIST ? */
3485 mutex_unlock(&priv->mutex);
3480 return ret; 3486 return ret;
3481 } 3487 }
3482 3488
@@ -3486,6 +3492,7 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw,
3486 IWL_DEBUG_INFO(priv, "Initializing rate scaling for station %pM\n", 3492 IWL_DEBUG_INFO(priv, "Initializing rate scaling for station %pM\n",
3487 sta->addr); 3493 sta->addr);
3488 iwl_rs_rate_init(priv, sta, sta_id); 3494 iwl_rs_rate_init(priv, sta, sta_id);
3495 mutex_unlock(&priv->mutex);
3489 3496
3490 return 0; 3497 return 0;
3491} 3498}
@@ -3638,6 +3645,7 @@ static void iwl_cancel_deferred_work(struct iwl_priv *priv)
3638 cancel_delayed_work(&priv->scan_check); 3645 cancel_delayed_work(&priv->scan_check);
3639 cancel_work_sync(&priv->start_internal_scan); 3646 cancel_work_sync(&priv->start_internal_scan);
3640 cancel_delayed_work(&priv->alive_start); 3647 cancel_delayed_work(&priv->alive_start);
3648 cancel_work_sync(&priv->run_time_calib_work);
3641 cancel_work_sync(&priv->beacon_update); 3649 cancel_work_sync(&priv->beacon_update);
3642 del_timer_sync(&priv->statistics_periodic); 3650 del_timer_sync(&priv->statistics_periodic);
3643 del_timer_sync(&priv->ucode_trace); 3651 del_timer_sync(&priv->ucode_trace);
diff --git a/drivers/net/wireless/iwlwifi/iwl-calib.c b/drivers/net/wireless/iwlwifi/iwl-calib.c
index 7e822777321..22fa947e875 100644
--- a/drivers/net/wireless/iwlwifi/iwl-calib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-calib.c
@@ -846,6 +846,13 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
846 } 846 }
847 } 847 }
848 848
849 if (active_chains != priv->hw_params.valid_rx_ant &&
850 active_chains != priv->chain_noise_data.active_chains)
851 IWL_WARN(priv,
852 "Detected that not all antennas are connected! "
853 "Connected: %#x, valid: %#x.\n",
854 active_chains, priv->hw_params.valid_rx_ant);
855
849 /* Save for use within RXON, TX, SCAN commands, etc. */ 856 /* Save for use within RXON, TX, SCAN commands, etc. */
850 priv->chain_noise_data.active_chains = active_chains; 857 priv->chain_noise_data.active_chains = active_chains;
851 IWL_DEBUG_CALIB(priv, "active_chains (bitwise) = 0x%x\n", 858 IWL_DEBUG_CALIB(priv, "active_chains (bitwise) = 0x%x\n",
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index c579965ec55..28b1098334f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -1366,7 +1366,7 @@ struct iwl_rx_phy_res {
1366 __le16 reserved3; 1366 __le16 reserved3;
1367} __packed; 1367} __packed;
1368 1368
1369struct iwl4965_rx_mpdu_res_start { 1369struct iwl_rx_mpdu_res_start {
1370 __le16 byte_count; 1370 __le16 byte_count;
1371 __le16 reserved; 1371 __le16 reserved;
1372} __packed; 1372} __packed;
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index d9f21bb9d75..cee3d12eb38 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -1018,8 +1018,13 @@ static ssize_t iwl_dbgfs_rx_queue_read(struct file *file,
1018 rxq->write); 1018 rxq->write);
1019 pos += scnprintf(buf + pos, bufsz - pos, "free_count: %u\n", 1019 pos += scnprintf(buf + pos, bufsz - pos, "free_count: %u\n",
1020 rxq->free_count); 1020 rxq->free_count);
1021 pos += scnprintf(buf + pos, bufsz - pos, "closed_rb_num: %u\n", 1021 if (rxq->rb_stts) {
1022 pos += scnprintf(buf + pos, bufsz - pos, "closed_rb_num: %u\n",
1022 le16_to_cpu(rxq->rb_stts->closed_rb_num) & 0x0FFF); 1023 le16_to_cpu(rxq->rb_stts->closed_rb_num) & 0x0FFF);
1024 } else {
1025 pos += scnprintf(buf + pos, bufsz - pos,
1026 "closed_rb_num: Not Allocated\n");
1027 }
1023 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); 1028 return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
1024} 1029}
1025 1030
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index fc6072cdd96..338b5177029 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -348,7 +348,7 @@ struct iwl_host_cmd {
348/** 348/**
349 * struct iwl_rx_queue - Rx queue 349 * struct iwl_rx_queue - Rx queue
350 * @bd: driver's pointer to buffer of receive buffer descriptors (rbd) 350 * @bd: driver's pointer to buffer of receive buffer descriptors (rbd)
351 * @dma_addr: bus address of buffer of receive buffer descriptors (rbd) 351 * @bd_dma: bus address of buffer of receive buffer descriptors (rbd)
352 * @read: Shared index to newest available Rx buffer 352 * @read: Shared index to newest available Rx buffer
353 * @write: Shared index to oldest written Rx packet 353 * @write: Shared index to oldest written Rx packet
354 * @free_count: Number of pre-allocated buffers in rx_free 354 * @free_count: Number of pre-allocated buffers in rx_free
@@ -362,7 +362,7 @@ struct iwl_host_cmd {
362 */ 362 */
363struct iwl_rx_queue { 363struct iwl_rx_queue {
364 __le32 *bd; 364 __le32 *bd;
365 dma_addr_t dma_addr; 365 dma_addr_t bd_dma;
366 struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS]; 366 struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS];
367 struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE]; 367 struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE];
368 u32 read; 368 u32 read;
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index 5e32057d693..86a35376579 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -175,7 +175,7 @@ int iwl_rx_queue_alloc(struct iwl_priv *priv)
175 INIT_LIST_HEAD(&rxq->rx_used); 175 INIT_LIST_HEAD(&rxq->rx_used);
176 176
177 /* Alloc the circular buffer of Read Buffer Descriptors (RBDs) */ 177 /* Alloc the circular buffer of Read Buffer Descriptors (RBDs) */
178 rxq->bd = dma_alloc_coherent(dev, 4 * RX_QUEUE_SIZE, &rxq->dma_addr, 178 rxq->bd = dma_alloc_coherent(dev, 4 * RX_QUEUE_SIZE, &rxq->bd_dma,
179 GFP_KERNEL); 179 GFP_KERNEL);
180 if (!rxq->bd) 180 if (!rxq->bd)
181 goto err_bd; 181 goto err_bd;
@@ -199,7 +199,7 @@ int iwl_rx_queue_alloc(struct iwl_priv *priv)
199 199
200err_rb: 200err_rb:
201 dma_free_coherent(&priv->pci_dev->dev, 4 * RX_QUEUE_SIZE, rxq->bd, 201 dma_free_coherent(&priv->pci_dev->dev, 4 * RX_QUEUE_SIZE, rxq->bd,
202 rxq->dma_addr); 202 rxq->bd_dma);
203err_bd: 203err_bd:
204 return -ENOMEM; 204 return -ENOMEM;
205} 205}
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index b8bcd48eb8f..798f93e0ff5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -500,6 +500,7 @@ void iwl_bg_abort_scan(struct work_struct *work)
500 500
501 mutex_lock(&priv->mutex); 501 mutex_lock(&priv->mutex);
502 502
503 cancel_delayed_work_sync(&priv->scan_check);
503 set_bit(STATUS_SCAN_ABORTING, &priv->status); 504 set_bit(STATUS_SCAN_ABORTING, &priv->status);
504 iwl_send_scan_abort(priv); 505 iwl_send_scan_abort(priv);
505 506
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index c7127132c29..d57df6c02db 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -1373,10 +1373,14 @@ int iwl_mac_sta_remove(struct ieee80211_hw *hw,
1373 1373
1374 IWL_DEBUG_INFO(priv, "received request to remove station %pM\n", 1374 IWL_DEBUG_INFO(priv, "received request to remove station %pM\n",
1375 sta->addr); 1375 sta->addr);
1376 mutex_lock(&priv->mutex);
1377 IWL_DEBUG_INFO(priv, "proceeding to remove station %pM\n",
1378 sta->addr);
1376 ret = iwl_remove_station(priv, sta_common->sta_id, sta->addr); 1379 ret = iwl_remove_station(priv, sta_common->sta_id, sta->addr);
1377 if (ret) 1380 if (ret)
1378 IWL_ERR(priv, "Error removing station %pM\n", 1381 IWL_ERR(priv, "Error removing station %pM\n",
1379 sta->addr); 1382 sta->addr);
1383 mutex_unlock(&priv->mutex);
1380 return ret; 1384 return ret;
1381} 1385}
1382EXPORT_SYMBOL(iwl_mac_sta_remove); 1386EXPORT_SYMBOL(iwl_mac_sta_remove);
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 0f16c7d518f..697fa6caace 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -1171,7 +1171,7 @@ static void iwl3945_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rx
1171 } 1171 }
1172 1172
1173 dma_free_coherent(&priv->pci_dev->dev, 4 * RX_QUEUE_SIZE, rxq->bd, 1173 dma_free_coherent(&priv->pci_dev->dev, 4 * RX_QUEUE_SIZE, rxq->bd,
1174 rxq->dma_addr); 1174 rxq->bd_dma);
1175 dma_free_coherent(&priv->pci_dev->dev, sizeof(struct iwl_rb_status), 1175 dma_free_coherent(&priv->pci_dev->dev, sizeof(struct iwl_rb_status),
1176 rxq->rb_stts, rxq->rb_stts_dma); 1176 rxq->rb_stts, rxq->rb_stts_dma);
1177 rxq->bd = NULL; 1177 rxq->bd = NULL;
@@ -1252,6 +1252,8 @@ static void iwl3945_rx_handle(struct iwl_priv *priv)
1252 IWL_DEBUG_RX(priv, "r = %d, i = %d\n", r, i); 1252 IWL_DEBUG_RX(priv, "r = %d, i = %d\n", r, i);
1253 1253
1254 while (i != r) { 1254 while (i != r) {
1255 int len;
1256
1255 rxb = rxq->queue[i]; 1257 rxb = rxq->queue[i];
1256 1258
1257 /* If an RXB doesn't have a Rx queue slot associated with it, 1259 /* If an RXB doesn't have a Rx queue slot associated with it,
@@ -1266,8 +1268,9 @@ static void iwl3945_rx_handle(struct iwl_priv *priv)
1266 PCI_DMA_FROMDEVICE); 1268 PCI_DMA_FROMDEVICE);
1267 pkt = rxb_addr(rxb); 1269 pkt = rxb_addr(rxb);
1268 1270
1269 trace_iwlwifi_dev_rx(priv, pkt, 1271 len = le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK;
1270 le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK); 1272 len += sizeof(u32); /* account for status word */
1273 trace_iwlwifi_dev_rx(priv, pkt, len);
1271 1274
1272 /* Reclaim a command buffer only if this packet is a response 1275 /* Reclaim a command buffer only if this packet is a response
1273 * to a (driver-originated) command. 1276 * to a (driver-originated) command.
@@ -3360,10 +3363,13 @@ static int iwl3945_mac_sta_add(struct ieee80211_hw *hw,
3360 bool is_ap = vif->type == NL80211_IFTYPE_STATION; 3363 bool is_ap = vif->type == NL80211_IFTYPE_STATION;
3361 u8 sta_id; 3364 u8 sta_id;
3362 3365
3363 sta_priv->common.sta_id = IWL_INVALID_STATION;
3364
3365 IWL_DEBUG_INFO(priv, "received request to add station %pM\n", 3366 IWL_DEBUG_INFO(priv, "received request to add station %pM\n",
3366 sta->addr); 3367 sta->addr);
3368 mutex_lock(&priv->mutex);
3369 IWL_DEBUG_INFO(priv, "proceeding to add station %pM\n",
3370 sta->addr);
3371 sta_priv->common.sta_id = IWL_INVALID_STATION;
3372
3367 3373
3368 ret = iwl_add_station_common(priv, sta->addr, is_ap, &sta->ht_cap, 3374 ret = iwl_add_station_common(priv, sta->addr, is_ap, &sta->ht_cap,
3369 &sta_id); 3375 &sta_id);
@@ -3371,6 +3377,7 @@ static int iwl3945_mac_sta_add(struct ieee80211_hw *hw,
3371 IWL_ERR(priv, "Unable to add station %pM (%d)\n", 3377 IWL_ERR(priv, "Unable to add station %pM (%d)\n",
3372 sta->addr, ret); 3378 sta->addr, ret);
3373 /* Should we return success if return code is EEXIST ? */ 3379 /* Should we return success if return code is EEXIST ? */
3380 mutex_unlock(&priv->mutex);
3374 return ret; 3381 return ret;
3375 } 3382 }
3376 3383
@@ -3380,6 +3387,7 @@ static int iwl3945_mac_sta_add(struct ieee80211_hw *hw,
3380 IWL_DEBUG_INFO(priv, "Initializing rate scaling for station %pM\n", 3387 IWL_DEBUG_INFO(priv, "Initializing rate scaling for station %pM\n",
3381 sta->addr); 3388 sta->addr);
3382 iwl3945_rs_rate_init(priv, sta, sta_id); 3389 iwl3945_rs_rate_init(priv, sta, sta_id);
3390 mutex_unlock(&priv->mutex);
3383 3391
3384 return 0; 3392 return 0;
3385} 3393}