Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Bing Zhao and committed by
John W. Linville
67a50035 7c966a6d

+19 -28
+1 -1
drivers/net/wireless/mwifiex/cfg80211.c
··· 547 547 sinfo->tx_bytes = priv->stats.tx_bytes; 548 548 sinfo->rx_packets = priv->stats.rx_packets; 549 549 sinfo->tx_packets = priv->stats.tx_packets; 550 - sinfo->signal = priv->w_stats.qual.level; 550 + sinfo->signal = priv->qual_level; 551 551 sinfo->txrate.legacy = rate.rate; 552 552 553 553 return ret;
+2 -2
drivers/net/wireless/mwifiex/init.c
··· 156 156 struct mwifiex_bssdescriptor *temp_scan_table; 157 157 158 158 /* Allocate buffer to store the BSSID list */ 159 - buf_size = sizeof(struct mwifiex_bssdescriptor) * IW_MAX_AP; 159 + buf_size = sizeof(struct mwifiex_bssdescriptor) * MWIFIEX_MAX_AP; 160 160 temp_scan_table = kzalloc(buf_size, GFP_KERNEL); 161 161 if (!temp_scan_table) { 162 162 dev_err(adapter->dev, "%s: failed to alloc temp_scan_table\n", ··· 224 224 225 225 adapter->num_in_scan_table = 0; 226 226 memset(adapter->scan_table, 0, 227 - (sizeof(struct mwifiex_bssdescriptor) * IW_MAX_AP)); 227 + (sizeof(struct mwifiex_bssdescriptor) * MWIFIEX_MAX_AP)); 228 228 adapter->scan_probes = 1; 229 229 230 230 memset(adapter->bcn_buf, 0, sizeof(adapter->bcn_buf));
+3 -2
drivers/net/wireless/mwifiex/ioctl.h
··· 20 20 #ifndef _MWIFIEX_IOCTL_H_ 21 21 #define _MWIFIEX_IOCTL_H_ 22 22 23 - #include <linux/wireless.h> 24 23 #include <net/mac80211.h> 25 24 26 25 enum { ··· 307 308 u8 value[MAX_EEPROM_DATA]; 308 309 }; 309 310 311 + #define IEEE_MAX_IE_SIZE 256 312 + 310 313 struct mwifiex_ds_misc_gen_ie { 311 314 u32 type; 312 315 u32 len; 313 - u8 ie_data[IW_CUSTOM_MAX]; 316 + u8 ie_data[IEEE_MAX_IE_SIZE]; 314 317 }; 315 318 316 319 struct mwifiex_ds_misc_cmd {
+3 -3
drivers/net/wireless/mwifiex/main.h
··· 54 54 }; 55 55 56 56 57 + #define MWIFIEX_MAX_AP 64 58 + 57 59 #define MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT (5 * HZ) 58 60 59 61 #define MWIFIEX_TIMER_10S 10000 ··· 247 245 #define MWIFIEX_SUPPORTED_RATES 14 248 246 249 247 #define MWIFIEX_SUPPORTED_RATES_EXT 32 250 - 251 - #define IEEE_MAX_IE_SIZE 256 252 248 253 249 struct ieee_types_vendor_specific { 254 250 struct ieee_types_vendor_header vend_hdr; ··· 468 468 struct dentry *dfs_dev_dir; 469 469 #endif 470 470 u8 nick_name[16]; 471 - struct iw_statistics w_stats; 471 + u8 qual_level, qual_noise; 472 472 u16 current_key_index; 473 473 struct semaphore async_sem; 474 474 u8 scan_pending_on_block;
+3 -3
drivers/net/wireless/mwifiex/scan.c
··· 2308 2308 2309 2309 if (!keep_previous_scan) { 2310 2310 memset(adapter->scan_table, 0x00, 2311 - sizeof(struct mwifiex_bssdescriptor) * IW_MAX_AP); 2311 + sizeof(struct mwifiex_bssdescriptor) * MWIFIEX_MAX_AP); 2312 2312 adapter->num_in_scan_table = 0; 2313 2313 adapter->bcn_buf_end = adapter->bcn_buf; 2314 2314 } ··· 2430 2430 scan_rsp = &resp->params.scan_resp; 2431 2431 2432 2432 2433 - if (scan_rsp->number_of_sets > IW_MAX_AP) { 2433 + if (scan_rsp->number_of_sets > MWIFIEX_MAX_AP) { 2434 2434 dev_err(adapter->dev, "SCAN_RESP: too many AP returned (%d)\n", 2435 2435 scan_rsp->number_of_sets); 2436 2436 ret = -1; ··· 2542 2542 if (bss_idx == num_in_table) { 2543 2543 /* Range check the bss_idx, keep it limited to 2544 2544 the last entry */ 2545 - if (bss_idx == IW_MAX_AP) 2545 + if (bss_idx == MWIFIEX_MAX_AP) 2546 2546 bss_idx--; 2547 2547 else 2548 2548 num_in_table++;
+3 -3
drivers/net/wireless/mwifiex/sta_event.c
··· 130 130 if (netif_carrier_ok(priv->netdev)) 131 131 netif_carrier_off(priv->netdev); 132 132 /* Reset wireless stats signal info */ 133 - priv->w_stats.qual.level = 0; 134 - priv->w_stats.qual.noise = 0; 133 + priv->qual_level = 0; 134 + priv->qual_noise = 0; 135 135 } 136 136 137 137 /* ··· 301 301 dev_dbg(adapter->dev, "event: BGS_REPORT\n"); 302 302 /* Clear the previous scan result */ 303 303 memset(adapter->scan_table, 0x00, 304 - sizeof(struct mwifiex_bssdescriptor) * IW_MAX_AP); 304 + sizeof(struct mwifiex_bssdescriptor) * MWIFIEX_MAX_AP); 305 305 adapter->num_in_scan_table = 0; 306 306 adapter->bcn_buf_end = adapter->bcn_buf; 307 307 ret = mwifiex_send_cmd_async(priv,
+4 -14
drivers/net/wireless/mwifiex/sta_ioctl.c
··· 1280 1280 1281 1281 if (!status) { 1282 1282 if (signal->selector & BCN_RSSI_AVG_MASK) 1283 - priv->w_stats.qual.level = signal->bcn_rssi_avg; 1283 + priv->qual_level = signal->bcn_rssi_avg; 1284 1284 if (signal->selector & BCN_NF_AVG_MASK) 1285 - priv->w_stats.qual.noise = signal->bcn_nf_avg; 1285 + priv->qual_noise = signal->bcn_nf_avg; 1286 1286 } 1287 1287 1288 1288 return status; ··· 1341 1341 mwifiex_get_stats_info(struct mwifiex_private *priv, 1342 1342 struct mwifiex_ds_get_stats *log) 1343 1343 { 1344 - int ret; 1345 - 1346 - ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_GET_LOG, 1344 + return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_GET_LOG, 1347 1345 HostCmd_ACT_GEN_GET, 0, log); 1348 - 1349 - if (!ret) { 1350 - priv->w_stats.discard.fragment = log->fcs_error; 1351 - priv->w_stats.discard.retries = log->retry; 1352 - priv->w_stats.discard.misc = log->ack_failure; 1353 - } 1354 - 1355 - return ret; 1356 1346 } 1357 1347 1358 1348 /* ··· 1584 1594 { 1585 1595 struct mwifiex_ds_misc_gen_ie gen_ie; 1586 1596 1587 - if (ie_len > IW_CUSTOM_MAX) 1597 + if (ie_len > IEEE_MAX_IE_SIZE) 1588 1598 return -EFAULT; 1589 1599 1590 1600 gen_ie.type = MWIFIEX_IE_TYPE_GEN_IE;