Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67a50035 authored by Bing Zhao's avatar Bing Zhao Committed by John W. Linville
Browse files

mwifiex: remove wireless.h inclusion and fix resulting bugs



replace IW_MAX_AP & IW_CUSTOM_MAX with local definitions
and remove usage of struct iw_statistics.

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 7c966a6d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -547,7 +547,7 @@ mwifiex_dump_station_info(struct mwifiex_private *priv,
	sinfo->tx_bytes = priv->stats.tx_bytes;
	sinfo->rx_packets = priv->stats.rx_packets;
	sinfo->tx_packets = priv->stats.tx_packets;
	sinfo->signal = priv->w_stats.qual.level;
	sinfo->signal = priv->qual_level;
	sinfo->txrate.legacy = rate.rate;

	return ret;
+2 −2
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter)
	struct mwifiex_bssdescriptor *temp_scan_table;

	/* Allocate buffer to store the BSSID list */
	buf_size = sizeof(struct mwifiex_bssdescriptor) * IW_MAX_AP;
	buf_size = sizeof(struct mwifiex_bssdescriptor) * MWIFIEX_MAX_AP;
	temp_scan_table = kzalloc(buf_size, GFP_KERNEL);
	if (!temp_scan_table) {
		dev_err(adapter->dev, "%s: failed to alloc temp_scan_table\n",
@@ -224,7 +224,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)

	adapter->num_in_scan_table = 0;
	memset(adapter->scan_table, 0,
	       (sizeof(struct mwifiex_bssdescriptor) * IW_MAX_AP));
	       (sizeof(struct mwifiex_bssdescriptor) * MWIFIEX_MAX_AP));
	adapter->scan_probes = 1;

	memset(adapter->bcn_buf, 0, sizeof(adapter->bcn_buf));
+3 −2
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@
#ifndef _MWIFIEX_IOCTL_H_
#define _MWIFIEX_IOCTL_H_

#include <linux/wireless.h>
#include <net/mac80211.h>

enum {
@@ -308,10 +307,12 @@ struct mwifiex_ds_read_eeprom {
	u8 value[MAX_EEPROM_DATA];
};

#define IEEE_MAX_IE_SIZE		256

struct mwifiex_ds_misc_gen_ie {
	u32 type;
	u32 len;
	u8 ie_data[IW_CUSTOM_MAX];
	u8 ie_data[IEEE_MAX_IE_SIZE];
};

struct mwifiex_ds_misc_cmd {
+3 −3
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@ struct mwifiex_drv_mode {
};


#define MWIFIEX_MAX_AP				64

#define MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT	(5 * HZ)

#define MWIFIEX_TIMER_10S			10000
@@ -246,8 +248,6 @@ struct ieee_types_obss_scan_param {

#define MWIFIEX_SUPPORTED_RATES_EXT             32

#define IEEE_MAX_IE_SIZE			256

struct ieee_types_vendor_specific {
	struct ieee_types_vendor_header vend_hdr;
	u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_vendor_header)];
@@ -468,7 +468,7 @@ struct mwifiex_private {
	struct dentry *dfs_dev_dir;
#endif
	u8 nick_name[16];
	struct iw_statistics w_stats;
	u8 qual_level, qual_noise;
	u16 current_key_index;
	struct semaphore async_sem;
	u8 scan_pending_on_block;
+3 −3
Original line number Diff line number Diff line
@@ -2308,7 +2308,7 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,

	if (!keep_previous_scan) {
		memset(adapter->scan_table, 0x00,
		       sizeof(struct mwifiex_bssdescriptor) * IW_MAX_AP);
		       sizeof(struct mwifiex_bssdescriptor) * MWIFIEX_MAX_AP);
		adapter->num_in_scan_table = 0;
		adapter->bcn_buf_end = adapter->bcn_buf;
	}
@@ -2430,7 +2430,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
		scan_rsp = &resp->params.scan_resp;


	if (scan_rsp->number_of_sets > IW_MAX_AP) {
	if (scan_rsp->number_of_sets > MWIFIEX_MAX_AP) {
		dev_err(adapter->dev, "SCAN_RESP: too many AP returned (%d)\n",
		       scan_rsp->number_of_sets);
		ret = -1;
@@ -2542,7 +2542,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
		if (bss_idx == num_in_table) {
			/* Range check the bss_idx, keep it limited to
			   the last entry */
			if (bss_idx == IW_MAX_AP)
			if (bss_idx == MWIFIEX_MAX_AP)
				bss_idx--;
			else
				num_in_table++;
Loading