o wl3501: kill WL3501_SLOW_DOWN_IO, use slow_down_io() instead

Also fix some loop variables use, one of which potentially is
related to ADHOC not working, i.e. it was not being properly
initialized, thanks to gcc 3.3.1 (pre-release) and this was
caught...
parent 32f66615
...@@ -3,10 +3,7 @@ ...@@ -3,10 +3,7 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#define WL3501_SLOW_DOWN_IO __asm__ __volatile__("outb %al,$0x80")
/* define for WLA 2.0 */ /* define for WLA 2.0 */
#define WL3501_BLKSZ 256 #define WL3501_BLKSZ 256
/* /*
* ID for input Signals of DRIVER block * ID for input Signals of DRIVER block
...@@ -420,7 +417,7 @@ struct wl3501_resync_req { ...@@ -420,7 +417,7 @@ struct wl3501_resync_req {
}; };
/* For rough constant delay */ /* For rough constant delay */
#define WL3501_NOPLOOP(n) { int x = 0; while (x++ < n) WL3501_SLOW_DOWN_IO; } #define WL3501_NOPLOOP(n) { int x = 0; while (x++ < n) slow_down_io(); }
/* Ethernet MAC addr, BSS_ID, or ESS_ID */ /* Ethernet MAC addr, BSS_ID, or ESS_ID */
/* With this, we may simply write "x=y;" instead of "memcpy(x, y, 6);" */ /* With this, we may simply write "x=y;" instead of "memcpy(x, y, 6);" */
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
* Tested with Planet AP in 2.5.73-bk, 216 Kbytes/s in Infrastructure mode * Tested with Planet AP in 2.5.73-bk, 216 Kbytes/s in Infrastructure mode
* with a SMP machine (dual pentium 100), using pktgen, 432 pps (pkt_size = 60) * with a SMP machine (dual pentium 100), using pktgen, 432 pps (pkt_size = 60)
*/ */
#undef REALLY_SLOW_IO /* most systems can safely undef this */
#include <linux/config.h> #include <linux/config.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/types.h> #include <linux/types.h>
...@@ -97,9 +99,9 @@ static int wl3501_chan2freq[] = { ...@@ -97,9 +99,9 @@ static int wl3501_chan2freq[] = {
[10] = 2462, [10] = 2462,
}; };
#define wl3501_outb(a, b) { outb(a, b); WL3501_SLOW_DOWN_IO; } #define wl3501_outb(a, b) { outb(a, b); slow_down_io(); }
#define wl3501_outb_p(a, b) { outb_p(a, b); WL3501_SLOW_DOWN_IO; } #define wl3501_outb_p(a, b) { outb_p(a, b); slow_down_io(); }
#define wl3501_outsb(a, b, c) { outsb(a, b, c); WL3501_SLOW_DOWN_IO; } #define wl3501_outsb(a, b, c) { outsb(a, b, c); slow_down_io(); }
#define WL3501_RELEASE_TIMEOUT (25 * HZ) #define WL3501_RELEASE_TIMEOUT (25 * HZ)
#define WL3501_MAX_ADHOC_TRIES 16 #define WL3501_MAX_ADHOC_TRIES 16
...@@ -585,7 +587,7 @@ static int wl3501_mgmt_start(struct wl3501_card *this) ...@@ -585,7 +587,7 @@ static int wl3501_mgmt_start(struct wl3501_card *this)
static void wl3501_mgmt_scan_confirm(struct wl3501_card *this, u16 addr) static void wl3501_mgmt_scan_confirm(struct wl3501_card *this, u16 addr)
{ {
u16 i, j; u16 i = 0;
int matchflag = 0; int matchflag = 0;
struct wl3501_scan_confirm signal; struct wl3501_scan_confirm signal;
...@@ -645,10 +647,10 @@ static void wl3501_mgmt_scan_confirm(struct wl3501_card *this, u16 addr) ...@@ -645,10 +647,10 @@ static void wl3501_mgmt_scan_confirm(struct wl3501_card *this, u16 addr)
this->driver_state != WL3501_SIG_SCAN_REQ) { this->driver_state != WL3501_SIG_SCAN_REQ) {
dprintk(3, "timeout"); dprintk(3, "timeout");
this->join_sta_bss = 0; this->join_sta_bss = 0;
for (j = this->join_sta_bss; j < this->bss_cnt; j++) for (i = this->join_sta_bss; i < this->bss_cnt; i++)
if (!wl3501_mgmt_join(this, j)) if (!wl3501_mgmt_join(this, i))
break; break;
this->join_sta_bss = j; this->join_sta_bss = i;
if (this->join_sta_bss == this->bss_cnt) { if (this->join_sta_bss == this->bss_cnt) {
if (this->net_type == IW_MODE_INFRA) if (this->net_type == IW_MODE_INFRA)
wl3501_mgmt_scan(this, 100); wl3501_mgmt_scan(this, 100);
...@@ -888,7 +890,6 @@ static int wl3501_mgmt_association(struct wl3501_card *this) ...@@ -888,7 +890,6 @@ static int wl3501_mgmt_association(struct wl3501_card *this)
static void wl3501_mgmt_join_confirm(struct net_device *dev, u16 addr) static void wl3501_mgmt_join_confirm(struct net_device *dev, u16 addr)
{ {
u16 i, j;
struct wl3501_card *this = (struct wl3501_card *)dev->priv; struct wl3501_card *this = (struct wl3501_card *)dev->priv;
struct wl3501_join_confirm sig; struct wl3501_join_confirm sig;
...@@ -897,7 +898,7 @@ static void wl3501_mgmt_join_confirm(struct net_device *dev, u16 addr) ...@@ -897,7 +898,7 @@ static void wl3501_mgmt_join_confirm(struct net_device *dev, u16 addr)
if (sig.status == WL3501_STATUS_SUCCESS) { if (sig.status == WL3501_STATUS_SUCCESS) {
if (this->net_type == IW_MODE_INFRA) { if (this->net_type == IW_MODE_INFRA) {
if (this->join_sta_bss < this->bss_cnt) { if (this->join_sta_bss < this->bss_cnt) {
i = this->join_sta_bss; const int i = this->join_sta_bss;
memcpy((char *)&(this->bssid), memcpy((char *)&(this->bssid),
(char *)&(this->bss_set[i].bssid), (char *)&(this->bss_set[i].bssid),
ETH_ALEN); ETH_ALEN);
...@@ -908,7 +909,7 @@ static void wl3501_mgmt_join_confirm(struct net_device *dev, u16 addr) ...@@ -908,7 +909,7 @@ static void wl3501_mgmt_join_confirm(struct net_device *dev, u16 addr)
wl3501_mgmt_auth(this); wl3501_mgmt_auth(this);
} }
} else { } else {
i = this->join_sta_bss; const int i = this->join_sta_bss;
memcpy((char *)&(this->bssid), memcpy((char *)&(this->bssid),
(char *)&(this->bss_set[i].bssid), ETH_ALEN); (char *)&(this->bss_set[i].bssid), ETH_ALEN);
this->chan = this->bss_set[i].phy_pset[2]; this->chan = this->bss_set[i].phy_pset[2];
...@@ -918,11 +919,12 @@ static void wl3501_mgmt_join_confirm(struct net_device *dev, u16 addr) ...@@ -918,11 +919,12 @@ static void wl3501_mgmt_join_confirm(struct net_device *dev, u16 addr)
wl3501_online(dev); wl3501_online(dev);
} }
} else { } else {
int i;
this->join_sta_bss++; this->join_sta_bss++;
for (j = this->join_sta_bss; j < this->bss_cnt; j++) for (i = this->join_sta_bss; i < this->bss_cnt; i++)
if (!wl3501_mgmt_join(this, j)) if (!wl3501_mgmt_join(this, i))
break; break;
this->join_sta_bss = j; this->join_sta_bss = i;
if (this->join_sta_bss == this->bss_cnt) { if (this->join_sta_bss == this->bss_cnt) {
if (this->net_type == IW_MODE_INFRA) if (this->net_type == IW_MODE_INFRA)
wl3501_mgmt_scan(this, 100); wl3501_mgmt_scan(this, 100);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment