Merge branch 'davem-next' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / iwlwifi / iwl3945-base.c
index d15a2c9979549983316a1981bdc07edf27581c54..f675b2993a3df7c8be03600f247a1fc34a883d79 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/if_arp.h>
 
 #include <net/ieee80211_radiotap.h>
+#include <net/lib80211.h>
 #include <net/mac80211.h>
 
 #include <asm/div64.h>
@@ -107,46 +108,6 @@ static const struct ieee80211_supported_band *iwl3945_get_band(
        return priv->hw->wiphy->bands[band];
 }
 
-static int iwl3945_is_empty_essid(const char *essid, int essid_len)
-{
-       /* Single white space is for Linksys APs */
-       if (essid_len == 1 && essid[0] == ' ')
-               return 1;
-
-       /* Otherwise, if the entire essid is 0, we assume it is hidden */
-       while (essid_len) {
-               essid_len--;
-               if (essid[essid_len] != '\0')
-                       return 0;
-       }
-
-       return 1;
-}
-
-static const char *iwl3945_escape_essid(const char *essid, u8 essid_len)
-{
-       static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
-       const char *s = essid;
-       char *d = escaped;
-
-       if (iwl3945_is_empty_essid(essid, essid_len)) {
-               memcpy(escaped, "<hidden>", sizeof("<hidden>"));
-               return escaped;
-       }
-
-       essid_len = min(essid_len, (u8) IW_ESSID_MAX_SIZE);
-       while (essid_len--) {
-               if (*s == '\0') {
-                       *d++ = '\\';
-                       *d++ = '0';
-                       s++;
-               } else
-                       *d++ = *s++;
-       }
-       *d = '\0';
-       return escaped;
-}
-
 /*************** DMA-QUEUE-GENERAL-FUNCTIONS  *****
  * DMA services
  *
@@ -446,7 +407,6 @@ u8 iwl3945_add_station(struct iwl3945_priv *priv, const u8 *addr, int is_ap, u8
        int index = IWL_INVALID_STATION;
        struct iwl3945_station_entry *station;
        unsigned long flags_spin;
-       DECLARE_MAC_BUF(mac);
        u8 rate;
 
        spin_lock_irqsave(&priv->sta_lock, flags_spin);
@@ -480,7 +440,7 @@ u8 iwl3945_add_station(struct iwl3945_priv *priv, const u8 *addr, int is_ap, u8
                return index;
        }
 
-       IWL_DEBUG_ASSOC("Add STA ID %d: %s\n", index, print_mac(mac, addr));
+       IWL_DEBUG_ASSOC("Add STA ID %d: %pM\n", index, addr);
        station = &priv->stations[index];
        station->used = 1;
        priv->num_stations++;
@@ -1063,7 +1023,6 @@ static int iwl3945_commit_rxon(struct iwl3945_priv *priv)
        /* cast away the const for active_rxon in this function */
        struct iwl3945_rxon_cmd *active_rxon = (void *)&priv->active_rxon;
        int rc = 0;
-       DECLARE_MAC_BUF(mac);
 
        if (!iwl3945_is_alive(priv))
                return -1;
@@ -1124,11 +1083,11 @@ static int iwl3945_commit_rxon(struct iwl3945_priv *priv)
        IWL_DEBUG_INFO("Sending RXON\n"
                       "* with%s RXON_FILTER_ASSOC_MSK\n"
                       "* channel = %d\n"
-                      "* bssid = %s\n",
+                      "* bssid = %pM\n",
                       ((priv->staging_rxon.filter_flags &
                         RXON_FILTER_ASSOC_MSK) ? "" : "out"),
                       le16_to_cpu(priv->staging_rxon.channel),
-                      print_mac(mac, priv->staging_rxon.bssid_addr));
+                      priv->staging_rxon.bssid_addr);
 
        /* Apply the new configuration */
        rc = iwl3945_send_cmd_pdu(priv, REPLY_RXON,
@@ -1846,7 +1805,7 @@ static void iwl3945_activate_qos(struct iwl3945_priv *priv, u8 force)
        spin_unlock_irqrestore(&priv->lock, flags);
 
        if (force || iwl3945_is_associated(priv)) {
-               IWL_DEBUG_QOS("send QoS cmd with Qos active %d \n",
+               IWL_DEBUG_QOS("send QoS cmd with QoS active %d \n",
                              priv->qos_data.qos_active);
 
                iwl3945_send_qos_params_command(priv,
@@ -1870,7 +1829,7 @@ static void iwl3945_activate_qos(struct iwl3945_priv *priv, u8 force)
 
 
 /* default power management (not Tx power) table values */
-/* for tim  0-10 */
+/* for TIM  0-10 */
 static struct iwl3945_power_vec_entry range_0[IWL_POWER_AC] = {
        {{NOSLP, SLP_TIMEOUT(0), SLP_TIMEOUT(0), SLP_VEC(0, 0, 0, 0, 0)}, 0},
        {{SLP, SLP_TIMEOUT(200), SLP_TIMEOUT(500), SLP_VEC(1, 2, 3, 4, 4)}, 0},
@@ -1880,7 +1839,7 @@ static struct iwl3945_power_vec_entry range_0[IWL_POWER_AC] = {
        {{SLP, SLP_TIMEOUT(25), SLP_TIMEOUT(25), SLP_VEC(4, 7, 10, 10, 10)}, 1}
 };
 
-/* for tim > 10 */
+/* for TIM > 10 */
 static struct iwl3945_power_vec_entry range_1[IWL_POWER_AC] = {
        {{NOSLP, SLP_TIMEOUT(0), SLP_TIMEOUT(0), SLP_VEC(0, 0, 0, 0, 0)}, 0},
        {{SLP, SLP_TIMEOUT(200), SLP_TIMEOUT(500),
@@ -2323,7 +2282,7 @@ static int iwl3945_set_mode(struct iwl3945_priv *priv, int mode)
 
        iwl3945_clear_stations_table(priv);
 
-       /* dont commit rxon if rf-kill is on*/
+       /* don't commit rxon if rf-kill is on*/
        if (!iwl3945_is_ready_rf(priv))
                return -EAGAIN;
 
@@ -2352,7 +2311,7 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv,
        case ALG_CCMP:
                cmd->cmd.tx.sec_ctl = TX_CMD_SEC_CCM;
                memcpy(cmd->cmd.tx.key, keyinfo->key, keyinfo->keylen);
-               IWL_DEBUG_TX("tx_cmd with aes hwcrypto\n");
+               IWL_DEBUG_TX("tx_cmd with AES hwcrypto\n");
                break;
 
        case ALG_TKIP:
@@ -2397,6 +2356,7 @@ static void iwl3945_build_tx_cmd_basic(struct iwl3945_priv *priv,
 {
        __le16 fc = hdr->frame_control;
        __le32 tx_flags = cmd->cmd.tx.tx_flags;
+       u8 rc_flags = info->control.rates[0].flags;
 
        cmd->cmd.tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
        if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) {
@@ -2423,10 +2383,10 @@ static void iwl3945_build_tx_cmd_basic(struct iwl3945_priv *priv,
                tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
        }
 
-       if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) {
+       if (rc_flags & IEEE80211_TX_RC_USE_RTS_CTS) {
                tx_flags |= TX_CMD_FLG_RTS_MSK;
                tx_flags &= ~TX_CMD_FLG_CTS_MSK;
-       } else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) {
+       } else if (rc_flags & IEEE80211_TX_RC_USE_CTS_PROTECT) {
                tx_flags &= ~TX_CMD_FLG_RTS_MSK;
                tx_flags |= TX_CMD_FLG_CTS_MSK;
        }
@@ -2482,8 +2442,6 @@ static int iwl3945_get_sta_id(struct iwl3945_priv *priv, struct ieee80211_hdr *h
        /* If this frame is going out to an IBSS network, find the station,
         * or create a new station table entry */
        case NL80211_IFTYPE_ADHOC: {
-               DECLARE_MAC_BUF(mac);
-
                /* Create new station table entry */
                sta_id = iwl3945_hw_find_station(priv, hdr->addr1);
                if (sta_id != IWL_INVALID_STATION)
@@ -2494,9 +2452,9 @@ static int iwl3945_get_sta_id(struct iwl3945_priv *priv, struct ieee80211_hdr *h
                if (sta_id != IWL_INVALID_STATION)
                        return sta_id;
 
-               IWL_DEBUG_DROP("Station %s not in station map. "
+               IWL_DEBUG_DROP("Station %pM not in station map. "
                               "Defaulting to broadcast...\n",
-                              print_mac(mac, hdr->addr1));
+                              hdr->addr1);
                iwl3945_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
                return priv->hw_setting.bcast_sta_id;
        }
@@ -2579,10 +2537,8 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb)
        /* Find (or create) index into station table for destination station */
        sta_id = iwl3945_get_sta_id(priv, hdr);
        if (sta_id == IWL_INVALID_STATION) {
-               DECLARE_MAC_BUF(mac);
-
-               IWL_DEBUG_DROP("Dropping - INVALID STATION: %s\n",
-                              print_mac(mac, hdr->addr1));
+               IWL_DEBUG_DROP("Dropping - INVALID STATION: %pM\n",
+                              hdr->addr1);
                goto drop;
        }
 
@@ -4019,8 +3975,6 @@ static int iwl3945_tx_queue_update_write_ptr(struct iwl3945_priv *priv,
 #ifdef CONFIG_IWL3945_DEBUG
 static void iwl3945_print_rx_config_cmd(struct iwl3945_rxon_cmd *rxon)
 {
-       DECLARE_MAC_BUF(mac);
-
        IWL_DEBUG_RADIO("RX CONFIG:\n");
        iwl3945_print_hex_dump(IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon));
        IWL_DEBUG_RADIO("u16 channel: 0x%x\n", le16_to_cpu(rxon->channel));
@@ -4031,10 +3985,8 @@ static void iwl3945_print_rx_config_cmd(struct iwl3945_rxon_cmd *rxon)
        IWL_DEBUG_RADIO("u8 ofdm_basic_rates: 0x%02x\n",
                        rxon->ofdm_basic_rates);
        IWL_DEBUG_RADIO("u8 cck_basic_rates: 0x%02x\n", rxon->cck_basic_rates);
-       IWL_DEBUG_RADIO("u8[6] node_addr: %s\n",
-                       print_mac(mac, rxon->node_addr));
-       IWL_DEBUG_RADIO("u8[6] bssid_addr: %s\n",
-                       print_mac(mac, rxon->bssid_addr));
+       IWL_DEBUG_RADIO("u8[6] node_addr: %pM\n", rxon->node_addr);
+       IWL_DEBUG_RADIO("u8[6] bssid_addr: %pM\n", rxon->bssid_addr);
        IWL_DEBUG_RADIO("u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id));
 }
 #endif
@@ -4050,7 +4002,7 @@ static void iwl3945_enable_interrupts(struct iwl3945_priv *priv)
 /* call this function to flush any scheduled tasklet */
 static inline void iwl_synchronize_irq(struct iwl3945_priv *priv)
 {
-       /* wait to make sure we flush pedding tasklet*/
+       /* wait to make sure we flush pending tasklet*/
        synchronize_irq(priv->pci_dev->irq);
        tasklet_kill(&priv->irq_tasklet);
 }
@@ -5607,7 +5559,7 @@ static int iwl3945_set_ucode_ptrs(struct iwl3945_priv *priv)
        iwl3945_write_prph(priv, BSM_DRAM_DATA_BYTECOUNT_REG,
                                 priv->ucode_data.len);
 
-       /* Inst bytecount must be last to set up, bit 31 signals uCode
+       /* Inst byte count must be last to set up, bit 31 signals uCode
         *   that all new ptr/size info is in place */
        iwl3945_write_prph(priv, BSM_DRAM_INST_BYTECOUNT_REG,
                                 priv->ucode_code.len | BSM_DRAM_INST_LOAD);
@@ -5699,7 +5651,7 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv)
 
        rc = iwl3945_grab_nic_access(priv);
        if (rc) {
-               IWL_WARNING("Can not read rfkill status from adapter\n");
+               IWL_WARNING("Can not read RFKILL status from adapter\n");
                return;
        }
 
@@ -5709,7 +5661,7 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv)
 
        if (rfkill & 0x1) {
                clear_bit(STATUS_RF_KILL_HW, &priv->status);
-               /* if rfkill is not on, then wait for thermal
+               /* if RFKILL is not on, then wait for thermal
                 * sensor in adapter to kick in */
                while (iwl3945_hw_get_temperature(priv) == 0) {
                        thermal_spin++;
@@ -5768,7 +5720,6 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv)
        if (priv->error_recovering)
                iwl3945_error_recovery(priv);
 
-       ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC);
        return;
 
  restart:
@@ -5903,7 +5854,7 @@ static int __iwl3945_up(struct iwl3945_priv *priv)
        }
 
        if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) {
-               IWL_ERROR("ucode not available for device bringup\n");
+               IWL_ERROR("ucode not available for device bring up\n");
                return -EIO;
        }
 
@@ -6013,6 +5964,7 @@ static void iwl3945_bg_alive_start(struct work_struct *data)
        mutex_lock(&priv->mutex);
        iwl3945_alive_start(priv);
        mutex_unlock(&priv->mutex);
+       ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC);
 }
 
 static void iwl3945_bg_rf_kill(struct work_struct *work)
@@ -6102,6 +6054,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
        struct ieee80211_conf *conf = NULL;
        u8 n_probes = 2;
        enum ieee80211_band band;
+       DECLARE_SSID_BUF(ssid);
 
        conf = ieee80211_get_hw_conf(priv->hw);
 
@@ -6112,7 +6065,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
                goto done;
        }
 
-       /* Make sure the scan wasn't cancelled before this queued work
+       /* Make sure the scan wasn't canceled before this queued work
         * was given the chance to run... */
        if (!test_bit(STATUS_SCANNING, &priv->status))
                goto done;
@@ -6202,8 +6155,8 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
        if (priv->one_direct_scan) {
                IWL_DEBUG_SCAN
                    ("Kicking off one direct scan for '%s'\n",
-                    iwl3945_escape_essid(priv->direct_ssid,
-                                     priv->direct_ssid_len));
+                    print_ssid(ssid, priv->direct_ssid,
+                               priv->direct_ssid_len));
                scan->direct_scan[0].id = WLAN_EID_SSID;
                scan->direct_scan[0].len = priv->direct_ssid_len;
                memcpy(scan->direct_scan[0].ssid,
@@ -6212,7 +6165,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
        } else if (!iwl3945_is_associated(priv) && priv->essid_len) {
                IWL_DEBUG_SCAN
                  ("Kicking off one direct scan for '%s' when not associated\n",
-                  iwl3945_escape_essid(priv->essid, priv->essid_len));
+                  print_ssid(ssid, priv->essid, priv->essid_len));
                scan->direct_scan[0].id = WLAN_EID_SSID;
                scan->direct_scan[0].len = priv->essid_len;
                memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len);
@@ -6256,6 +6209,11 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
                                              n_probes,
                        (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]);
 
+       if (scan->channel_count == 0) {
+               IWL_DEBUG_SCAN("channel count %d\n", scan->channel_count);
+               goto done;
+       }
+
        cmd.len += le16_to_cpu(scan->tx_cmd.len) +
            scan->channel_count * sizeof(struct iwl3945_scan_channel);
        cmd.data = scan;
@@ -6273,6 +6231,14 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
        return;
 
  done:
+       /* can not perform scan make sure we clear scanning
+        * bits from status so next scan request can be performed.
+        * if we dont clear scanning status bit here all next scan
+        * will fail
+       */
+       clear_bit(STATUS_SCAN_HW, &priv->status);
+       clear_bit(STATUS_SCANNING, &priv->status);
+
        /* inform mac80211 scan aborted */
        queue_work(priv->workqueue, &priv->scan_completed);
        mutex_unlock(&priv->mutex);
@@ -6321,7 +6287,6 @@ static void iwl3945_post_associate(struct iwl3945_priv *priv)
 {
        int rc = 0;
        struct ieee80211_conf *conf = NULL;
-       DECLARE_MAC_BUF(mac);
 
        if (priv->iw_mode == NL80211_IFTYPE_AP) {
                IWL_ERROR("%s Should not be called in AP mode\n", __func__);
@@ -6329,9 +6294,8 @@ static void iwl3945_post_associate(struct iwl3945_priv *priv)
        }
 
 
-       IWL_DEBUG_ASSOC("Associated as %d to: %s\n",
-                       priv->assoc_id,
-                       print_mac(mac, priv->active_rxon.bssid_addr));
+       IWL_DEBUG_ASSOC("Associated as %d to: %pM\n",
+                       priv->assoc_id, priv->active_rxon.bssid_addr);
 
        if (test_bit(STATUS_EXIT_PENDING, &priv->status))
                return;
@@ -6427,7 +6391,7 @@ static void iwl3945_bg_abort_scan(struct work_struct *work)
        mutex_unlock(&priv->mutex);
 }
 
-static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
+static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed);
 
 static void iwl3945_bg_scan_completed(struct work_struct *work)
 {
@@ -6440,7 +6404,7 @@ static void iwl3945_bg_scan_completed(struct work_struct *work)
                return;
 
        if (test_bit(STATUS_CONF_PENDING, &priv->status))
-               iwl3945_mac_config(priv->hw, ieee80211_get_hw_conf(priv->hw));
+               iwl3945_mac_config(priv->hw, 0);
 
        ieee80211_scan_completed(priv->hw);
 
@@ -6592,7 +6556,6 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
 {
        struct iwl3945_priv *priv = hw->priv;
        unsigned long flags;
-       DECLARE_MAC_BUF(mac);
 
        IWL_DEBUG_MAC80211("enter: type %d\n", conf->type);
 
@@ -6609,7 +6572,7 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
        mutex_lock(&priv->mutex);
 
        if (conf->mac_addr) {
-               IWL_DEBUG_MAC80211("Set: %s\n", print_mac(mac, conf->mac_addr));
+               IWL_DEBUG_MAC80211("Set: %pM\n", conf->mac_addr);
                memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN);
        }
 
@@ -6629,10 +6592,11 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
  * be set inappropriately and the driver currently sets the hardware up to
  * use it whenever needed.
  */
-static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
+static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed)
 {
        struct iwl3945_priv *priv = hw->priv;
        const struct iwl3945_channel_info *ch_info;
+       struct ieee80211_conf *conf = &hw->conf;
        unsigned long flags;
        int ret = 0;
 
@@ -6778,7 +6742,6 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
                                    struct ieee80211_if_conf *conf)
 {
        struct iwl3945_priv *priv = hw->priv;
-       DECLARE_MAC_BUF(mac);
        unsigned long flags;
        int rc;
 
@@ -6816,8 +6779,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
        mutex_lock(&priv->mutex);
 
        if (conf->bssid)
-               IWL_DEBUG_MAC80211("bssid: %s\n",
-                                  print_mac(mac, conf->bssid));
+               IWL_DEBUG_MAC80211("bssid: %pM\n", conf->bssid);
 
 /*
  * very dubious code was here; the probe filtering flag is never set:
@@ -6830,8 +6792,8 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
                if (!conf->bssid) {
                        conf->bssid = priv->mac_addr;
                        memcpy(priv->bssid, priv->mac_addr, ETH_ALEN);
-                       IWL_DEBUG_MAC80211("bssid was set to: %s\n",
-                                          print_mac(mac, conf->bssid));
+                       IWL_DEBUG_MAC80211("bssid was set to: %pM\n",
+                                          conf->bssid);
                }
                if (priv->ibss_beacon)
                        dev_kfree_skb(priv->ibss_beacon);
@@ -6998,6 +6960,7 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
        int rc = 0;
        unsigned long flags;
        struct iwl3945_priv *priv = hw->priv;
+       DECLARE_SSID_BUF(ssid_buf);
 
        IWL_DEBUG_MAC80211("enter\n");
 
@@ -7031,7 +6994,7 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
        }
        if (len) {
                IWL_DEBUG_SCAN("direct scan for %s [%d]\n ",
-                              iwl3945_escape_essid(ssid, len), (int)len);
+                              print_ssid(ssid_buf, ssid, len), (int)len);
 
                priv->one_direct_scan = 1;
                priv->direct_ssid_len = (u8)
@@ -7072,10 +7035,8 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 
        sta_id = iwl3945_hw_find_station(priv, addr);
        if (sta_id == IWL_INVALID_STATION) {
-               DECLARE_MAC_BUF(mac);
-
-               IWL_DEBUG_MAC80211("leave - %s not in station map.\n",
-                                  print_mac(mac, addr));
+               IWL_DEBUG_MAC80211("leave - %pM not in station map.\n",
+                                  addr);
                return -EINVAL;
        }
 
@@ -7207,14 +7168,6 @@ static int iwl3945_mac_get_stats(struct ieee80211_hw *hw,
        return 0;
 }
 
-static u64 iwl3945_mac_get_tsf(struct ieee80211_hw *hw)
-{
-       IWL_DEBUG_MAC80211("enter\n");
-       IWL_DEBUG_MAC80211("leave\n");
-
-       return 0;
-}
-
 static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
 {
        struct iwl3945_priv *priv = hw->priv;
@@ -7780,7 +7733,7 @@ static DEVICE_ATTR(dump_events, S_IWUSR, NULL, dump_event_log);
 
 /*****************************************************************************
  *
- * driver setup and teardown
+ * driver setup and tear down
  *
  *****************************************************************************/
 
@@ -7857,7 +7810,6 @@ static struct ieee80211_ops iwl3945_hw_ops = {
        .get_stats = iwl3945_mac_get_stats,
        .get_tx_stats = iwl3945_mac_get_tx_stats,
        .conf_tx = iwl3945_mac_conf_tx,
-       .get_tsf = iwl3945_mac_get_tsf,
        .reset_tsf = iwl3945_mac_reset_tsf,
        .bss_info_changed = iwl3945_bss_info_changed,
        .hw_scan = iwl3945_mac_hw_scan
@@ -7870,7 +7822,6 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
        struct ieee80211_hw *hw;
        struct iwl_3945_cfg *cfg = (struct iwl_3945_cfg *)(ent->driver_data);
        unsigned long flags;
-       DECLARE_MAC_BUF(mac);
 
        /* Disabling hardware scan means that mac80211 will perform scans
         * "the hard way", rather than using device's scan. */
@@ -8045,7 +7996,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
        }
        /* MAC Address location in EEPROM same for 3945/4965 */
        get_eeprom_mac(priv, priv->mac_addr);
-       IWL_DEBUG_INFO("MAC address: %s\n", print_mac(mac, priv->mac_addr));
+       IWL_DEBUG_INFO("MAC address: %pM\n", priv->mac_addr);
        SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr);
 
        err = iwl3945_init_channel_map(priv);
@@ -8210,7 +8161,7 @@ static int iwl3945_rfkill_soft_rf_kill(void *data, enum rfkill_state state)
        if (test_bit(STATUS_EXIT_PENDING, &priv->status))
                return 0;
 
-       IWL_DEBUG_RF_KILL("we recieved soft RFKILL set to state %d\n", state);
+       IWL_DEBUG_RF_KILL("we received soft RFKILL set to state %d\n", state);
        mutex_lock(&priv->mutex);
 
        switch (state) {
@@ -8225,7 +8176,7 @@ static int iwl3945_rfkill_soft_rf_kill(void *data, enum rfkill_state state)
                iwl3945_radio_kill_sw(priv, 1);
                break;
        default:
-               IWL_WARNING("we recieved unexpected RFKILL state %d\n", state);
+               IWL_WARNING("we received unexpected RFKILL state %d\n", state);
                break;
        }
 out_unlock: