diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 58 |
1 files changed, 23 insertions, 35 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 7c82ecfa30a4..444847ab1b5a 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -275,10 +275,8 @@ static int iwl3945_tx_queue_alloc(struct iwl3945_priv *priv, | |||
275 | return 0; | 275 | return 0; |
276 | 276 | ||
277 | error: | 277 | error: |
278 | if (txq->txb) { | 278 | kfree(txq->txb); |
279 | kfree(txq->txb); | 279 | txq->txb = NULL; |
280 | txq->txb = NULL; | ||
281 | } | ||
282 | 280 | ||
283 | return -ENOMEM; | 281 | return -ENOMEM; |
284 | } | 282 | } |
@@ -365,10 +363,8 @@ void iwl3945_tx_queue_free(struct iwl3945_priv *priv, struct iwl3945_tx_queue *t | |||
365 | txq->q.n_bd, txq->bd, txq->q.dma_addr); | 363 | txq->q.n_bd, txq->bd, txq->q.dma_addr); |
366 | 364 | ||
367 | /* De-alloc array of per-TFD driver data */ | 365 | /* De-alloc array of per-TFD driver data */ |
368 | if (txq->txb) { | 366 | kfree(txq->txb); |
369 | kfree(txq->txb); | 367 | txq->txb = NULL; |
370 | txq->txb = NULL; | ||
371 | } | ||
372 | 368 | ||
373 | /* 0-fill queue descriptor structure */ | 369 | /* 0-fill queue descriptor structure */ |
374 | memset(txq, 0, sizeof(*txq)); | 370 | memset(txq, 0, sizeof(*txq)); |
@@ -2703,9 +2699,8 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb) | |||
2703 | 2699 | ||
2704 | if (!ieee80211_has_morefrags(hdr->frame_control)) { | 2700 | if (!ieee80211_has_morefrags(hdr->frame_control)) { |
2705 | txq->need_update = 1; | 2701 | txq->need_update = 1; |
2706 | if (qc) { | 2702 | if (qc) |
2707 | priv->stations[sta_id].tid[tid].seq_number = seq_number; | 2703 | priv->stations[sta_id].tid[tid].seq_number = seq_number; |
2708 | } | ||
2709 | } else { | 2704 | } else { |
2710 | wait_write_ptr = 1; | 2705 | wait_write_ptr = 1; |
2711 | txq->need_update = 0; | 2706 | txq->need_update = 0; |
@@ -3813,7 +3808,7 @@ int iwl3945_calc_db_from_ratio(int sig_ratio) | |||
3813 | /* 100:1 or higher, divide by 10 and use table, | 3808 | /* 100:1 or higher, divide by 10 and use table, |
3814 | * add 20 dB to make up for divide by 10 */ | 3809 | * add 20 dB to make up for divide by 10 */ |
3815 | if (sig_ratio >= 100) | 3810 | if (sig_ratio >= 100) |
3816 | return (20 + (int)ratio2dB[sig_ratio/10]); | 3811 | return 20 + (int)ratio2dB[sig_ratio/10]; |
3817 | 3812 | ||
3818 | /* We shouldn't see this */ | 3813 | /* We shouldn't see this */ |
3819 | if (sig_ratio < 1) | 3814 | if (sig_ratio < 1) |
@@ -5088,7 +5083,7 @@ static void iwl3945_dealloc_ucode_pci(struct iwl3945_priv *priv) | |||
5088 | * iwl3945_verify_inst_full - verify runtime uCode image in card vs. host, | 5083 | * iwl3945_verify_inst_full - verify runtime uCode image in card vs. host, |
5089 | * looking at all data. | 5084 | * looking at all data. |
5090 | */ | 5085 | */ |
5091 | static int iwl3945_verify_inst_full(struct iwl3945_priv *priv, __le32 * image, u32 len) | 5086 | static int iwl3945_verify_inst_full(struct iwl3945_priv *priv, __le32 *image, u32 len) |
5092 | { | 5087 | { |
5093 | u32 val; | 5088 | u32 val; |
5094 | u32 save_len = len; | 5089 | u32 save_len = len; |
@@ -5237,7 +5232,7 @@ static int iwl3945_verify_bsm(struct iwl3945_priv *priv) | |||
5237 | val = iwl3945_read_prph(priv, BSM_WR_DWCOUNT_REG); | 5232 | val = iwl3945_read_prph(priv, BSM_WR_DWCOUNT_REG); |
5238 | for (reg = BSM_SRAM_LOWER_BOUND; | 5233 | for (reg = BSM_SRAM_LOWER_BOUND; |
5239 | reg < BSM_SRAM_LOWER_BOUND + len; | 5234 | reg < BSM_SRAM_LOWER_BOUND + len; |
5240 | reg += sizeof(u32), image ++) { | 5235 | reg += sizeof(u32), image++) { |
5241 | val = iwl3945_read_prph(priv, reg); | 5236 | val = iwl3945_read_prph(priv, reg); |
5242 | if (val != le32_to_cpu(*image)) { | 5237 | if (val != le32_to_cpu(*image)) { |
5243 | IWL_ERROR("BSM uCode verification failed at " | 5238 | IWL_ERROR("BSM uCode verification failed at " |
@@ -6336,7 +6331,7 @@ static void iwl3945_bg_post_associate(struct work_struct *data) | |||
6336 | DECLARE_MAC_BUF(mac); | 6331 | DECLARE_MAC_BUF(mac); |
6337 | 6332 | ||
6338 | if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { | 6333 | if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { |
6339 | IWL_ERROR("%s Should not be called in AP mode\n", __FUNCTION__); | 6334 | IWL_ERROR("%s Should not be called in AP mode\n", __func__); |
6340 | return; | 6335 | return; |
6341 | } | 6336 | } |
6342 | 6337 | ||
@@ -6417,7 +6412,7 @@ static void iwl3945_bg_post_associate(struct work_struct *data) | |||
6417 | 6412 | ||
6418 | default: | 6413 | default: |
6419 | IWL_ERROR("%s Should not be called in %d mode\n", | 6414 | IWL_ERROR("%s Should not be called in %d mode\n", |
6420 | __FUNCTION__, priv->iw_mode); | 6415 | __func__, priv->iw_mode); |
6421 | break; | 6416 | break; |
6422 | } | 6417 | } |
6423 | 6418 | ||
@@ -6594,12 +6589,6 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
6594 | 6589 | ||
6595 | IWL_DEBUG_MAC80211("enter\n"); | 6590 | IWL_DEBUG_MAC80211("enter\n"); |
6596 | 6591 | ||
6597 | if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) { | ||
6598 | IWL_DEBUG_MAC80211("leave - monitor\n"); | ||
6599 | dev_kfree_skb_any(skb); | ||
6600 | return 0; | ||
6601 | } | ||
6602 | |||
6603 | IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, | 6592 | IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, |
6604 | ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate); | 6593 | ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate); |
6605 | 6594 | ||
@@ -7456,7 +7445,7 @@ static ssize_t show_measurement(struct device *d, | |||
7456 | struct iwl3945_priv *priv = dev_get_drvdata(d); | 7445 | struct iwl3945_priv *priv = dev_get_drvdata(d); |
7457 | struct iwl3945_spectrum_notification measure_report; | 7446 | struct iwl3945_spectrum_notification measure_report; |
7458 | u32 size = sizeof(measure_report), len = 0, ofs = 0; | 7447 | u32 size = sizeof(measure_report), len = 0, ofs = 0; |
7459 | u8 *data = (u8 *) & measure_report; | 7448 | u8 *data = (u8 *)&measure_report; |
7460 | unsigned long flags; | 7449 | unsigned long flags; |
7461 | 7450 | ||
7462 | spin_lock_irqsave(&priv->lock, flags); | 7451 | spin_lock_irqsave(&priv->lock, flags); |
@@ -7627,7 +7616,7 @@ static ssize_t show_power_level(struct device *d, | |||
7627 | else | 7616 | else |
7628 | p += sprintf(p, " \n"); | 7617 | p += sprintf(p, " \n"); |
7629 | 7618 | ||
7630 | return (p - buf + 1); | 7619 | return p - buf + 1; |
7631 | 7620 | ||
7632 | } | 7621 | } |
7633 | 7622 | ||
@@ -7649,7 +7638,7 @@ static ssize_t show_statistics(struct device *d, | |||
7649 | struct iwl3945_priv *priv = dev_get_drvdata(d); | 7638 | struct iwl3945_priv *priv = dev_get_drvdata(d); |
7650 | u32 size = sizeof(struct iwl3945_notif_statistics); | 7639 | u32 size = sizeof(struct iwl3945_notif_statistics); |
7651 | u32 len = 0, ofs = 0; | 7640 | u32 len = 0, ofs = 0; |
7652 | u8 *data = (u8 *) & priv->statistics; | 7641 | u8 *data = (u8 *)&priv->statistics; |
7653 | int rc = 0; | 7642 | int rc = 0; |
7654 | 7643 | ||
7655 | if (!iwl3945_is_alive(priv)) | 7644 | if (!iwl3945_is_alive(priv)) |
@@ -8003,16 +7992,16 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
8003 | 7992 | ||
8004 | /* nic init */ | 7993 | /* nic init */ |
8005 | iwl3945_set_bit(priv, CSR_GIO_CHICKEN_BITS, | 7994 | iwl3945_set_bit(priv, CSR_GIO_CHICKEN_BITS, |
8006 | CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER); | 7995 | CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER); |
8007 | 7996 | ||
8008 | iwl3945_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); | 7997 | iwl3945_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); |
8009 | err = iwl3945_poll_bit(priv, CSR_GP_CNTRL, | 7998 | err = iwl3945_poll_bit(priv, CSR_GP_CNTRL, |
8010 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, | 7999 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, |
8011 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); | 8000 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); |
8012 | if (err < 0) { | 8001 | if (err < 0) { |
8013 | IWL_DEBUG_INFO("Failed to init the card\n"); | 8002 | IWL_DEBUG_INFO("Failed to init the card\n"); |
8014 | goto out_remove_sysfs; | 8003 | goto out_remove_sysfs; |
8015 | } | 8004 | } |
8016 | /* Read the EEPROM */ | 8005 | /* Read the EEPROM */ |
8017 | err = iwl3945_eeprom_init(priv); | 8006 | err = iwl3945_eeprom_init(priv); |
8018 | if (err) { | 8007 | if (err) { |
@@ -8114,9 +8103,8 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev) | |||
8114 | iwl3945_unset_hw_setting(priv); | 8103 | iwl3945_unset_hw_setting(priv); |
8115 | iwl3945_clear_stations_table(priv); | 8104 | iwl3945_clear_stations_table(priv); |
8116 | 8105 | ||
8117 | if (priv->mac80211_registered) { | 8106 | if (priv->mac80211_registered) |
8118 | ieee80211_unregister_hw(priv->hw); | 8107 | ieee80211_unregister_hw(priv->hw); |
8119 | } | ||
8120 | 8108 | ||
8121 | /*netif_stop_queue(dev); */ | 8109 | /*netif_stop_queue(dev); */ |
8122 | flush_workqueue(priv->workqueue); | 8110 | flush_workqueue(priv->workqueue); |