Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / net / wireless / mwifiex / scan.c
index efaf26c..04dc7ca 100644 (file)
@@ -1034,14 +1034,12 @@ mwifiex_ret_802_11_scan_get_tlv_ptrs(struct mwifiex_adapter *adapter,
                        case TLV_TYPE_TSFTIMESTAMP:
                                dev_dbg(adapter->dev, "info: SCAN_RESP: TSF "
                                        "timestamp TLV, len = %d\n", tlv_len);
-                               *tlv_data = (struct mwifiex_ie_types_data *)
-                                       current_tlv;
+                               *tlv_data = current_tlv;
                                break;
                        case TLV_TYPE_CHANNELBANDLIST:
                                dev_dbg(adapter->dev, "info: SCAN_RESP: channel"
                                        " band list TLV, len = %d\n", tlv_len);
-                               *tlv_data = (struct mwifiex_ie_types_data *)
-                                       current_tlv;
+                               *tlv_data = current_tlv;
                                break;
                        default:
                                dev_err(adapter->dev,
@@ -1246,15 +1244,15 @@ int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
                                        bss_entry->beacon_buf);
                        break;
                case WLAN_EID_BSS_COEX_2040:
-                       bss_entry->bcn_bss_co_2040 = (u8 *) (current_ptr +
-                                       sizeof(struct ieee_types_header));
+                       bss_entry->bcn_bss_co_2040 = current_ptr +
+                               sizeof(struct ieee_types_header);
                        bss_entry->bss_co_2040_offset = (u16) (current_ptr +
                                        sizeof(struct ieee_types_header) -
                                                bss_entry->beacon_buf);
                        break;
                case WLAN_EID_EXT_CAPABILITY:
-                       bss_entry->bcn_ext_cap = (u8 *) (current_ptr +
-                                       sizeof(struct ieee_types_header));
+                       bss_entry->bcn_ext_cap = current_ptr +
+                               sizeof(struct ieee_types_header);
                        bss_entry->ext_cap_offset = (u16) (current_ptr +
                                        sizeof(struct ieee_types_header) -
                                        bss_entry->beacon_buf);
@@ -1296,8 +1294,8 @@ mwifiex_radio_type_to_band(u8 radio_type)
  * order to send the appropriate scan commands to firmware to populate or
  * update the internal driver scan table.
  */
-static int mwifiex_scan_networks(struct mwifiex_private *priv,
-               const struct mwifiex_user_scan_cfg *user_scan_in)
+int mwifiex_scan_networks(struct mwifiex_private *priv,
+                         const struct mwifiex_user_scan_cfg *user_scan_in)
 {
        int ret = 0;
        struct mwifiex_adapter *adapter = priv->adapter;
@@ -1362,6 +1360,7 @@ static int mwifiex_scan_networks(struct mwifiex_private *priv,
                        adapter->cmd_queued = cmd_node;
                        mwifiex_insert_cmd_to_pending_q(adapter, cmd_node,
                                                        true);
+                       queue_work(adapter->workqueue, &adapter->main_work);
                } else {
                        spin_unlock_irqrestore(&adapter->scan_pending_q_lock,
                                               flags);
@@ -1378,26 +1377,6 @@ static int mwifiex_scan_networks(struct mwifiex_private *priv,
 }
 
 /*
- * Sends IOCTL request to start a scan with user configurations.
- *
- * This function allocates the IOCTL request buffer, fills it
- * with requisite parameters and calls the IOCTL handler.
- *
- * Upon completion, it also generates a wireless event to notify
- * applications.
- */
-int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv,
-                               struct mwifiex_user_scan_cfg *scan_req)
-{
-       int status;
-
-       status = mwifiex_scan_networks(priv, scan_req);
-       queue_work(priv->adapter->workqueue, &priv->adapter->main_work);
-
-       return status;
-}
-
-/*
  * This function prepares a scan command to be sent to the firmware.
  *
  * This uses the scan command configuration sent to the command processing
@@ -1703,8 +1682,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
                                goto done;
                        }
                        if (element_id == WLAN_EID_DS_PARAMS) {
-                               channel = *(u8 *) (current_ptr +
-                                       sizeof(struct ieee_types_header));
+                               channel = *(current_ptr + sizeof(struct ieee_types_header));
                                break;
                        }
 
@@ -2039,12 +2017,11 @@ mwifiex_save_curr_bcn(struct mwifiex_private *priv)
 
        if (curr_bss->bcn_bss_co_2040)
                curr_bss->bcn_bss_co_2040 =
-                       (u8 *) (curr_bss->beacon_buf +
-                                       curr_bss->bss_co_2040_offset);
+                       (curr_bss->beacon_buf + curr_bss->bss_co_2040_offset);
 
        if (curr_bss->bcn_ext_cap)
-               curr_bss->bcn_ext_cap = (u8 *) (curr_bss->beacon_buf +
-                               curr_bss->ext_cap_offset);
+               curr_bss->bcn_ext_cap = curr_bss->beacon_buf +
+                       curr_bss->ext_cap_offset;
 }
 
 /*