PERFORCE change 177807 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Thu May 6 07:08:14 UTC 2010
http://p4web.freebsd.org/@@177807?ac=10
Change 177807 by hselasky at hselasky_laptop001 on 2010/05/06 07:07:36
USB WLAN:
- cleanup debug code in RUN driver.
- summary of previous integration:
- if_run.c, if_runvar.h:
* fixed device lockup in HOSTAP mode
* create all-for-one taskqueue callback functions to maintain order of enqueued functions
* defer functions marked non-sleepable in HOSTAP mode (including pr usb/144387)
* defer functions causing LOR (stop fidling with locking)
* add MBSS and WDS support
* match size of array (sc->bbp[]) and refering max number
* removed duplicate #include <sys/systm.h> entry
* applied openBSD commit rev. 1.64 and 1.66
- if_runreg.h:
* match size of array (rt2860_rates[]) and refering max number (RT2860_RIDX_MAX)
* applied openBSD commit rev. 1.29
Patch was done by: Akinori
Patch was reviewed by: HPS @
PR: usb/144387
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/wlan/if_run.c#10 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/wlan/if_run.c#10 (text+ko) ====
@@ -64,7 +64,6 @@
#include <net80211/ieee80211_var.h>
#include <net80211/ieee80211_regdomain.h>
#include <net80211/ieee80211_radiotap.h>
-#include <net80211/ieee80211_amrr.h>
#include <net80211/ieee80211_ratectl.h>
#include <dev/usb/usb.h>
@@ -72,7 +71,6 @@
#include "usbdevs.h"
#define USB_DEBUG_VAR run_debug
-#define USB_DEBUG /*XXX remove this before commit */
#include <dev/usb/usb_debug.h>
#include "if_runreg.h"
@@ -619,8 +617,8 @@
ifp->if_init = run_init;
ifp->if_ioctl = run_ioctl;
ifp->if_start = run_start;
- IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
- ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN;
+ IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+ ifp->if_snd.ifq_drv_maxlen = ifqmaxlen;
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
@@ -717,8 +715,6 @@
struct ieee80211com *ic;
int i;
- DPRINTF("called\n");
-
/* stop all USB transfers */
usbd_transfer_unsetup(sc->sc_xfer, RUN_N_XFER);
@@ -726,7 +722,6 @@
/* free TX list, if any */
for (i = 0; i != RUN_EP_QUEUES; i++)
run_unsetup_tx_list(sc, &sc->sc_epq[i]);
-
RUN_UNLOCK(sc);
if (ifp) {
@@ -741,8 +736,6 @@
mtx_destroy(&sc->sc_mtx);
- DPRINTF("done\n");
-
return (0);
}
@@ -1444,14 +1437,14 @@
sc->sc_srom_read = run_eeprom_read_2;
if (sc->mac_ver >= 0x3070) {
run_read(sc, RT3070_EFUSE_CTRL, &tmp);
- DPRINTFN(2, "EFUSE_CTRL=0x%08x\n", tmp);
+ DPRINTF("EFUSE_CTRL=0x%08x\n", tmp);
if (tmp & RT3070_SEL_EFUSE)
sc->sc_srom_read = run_efuse_read_2;
}
/* read ROM version */
run_srom_read(sc, RT2860_EEPROM_VERSION, &val);
- DPRINTFN(2, "EEPROM rev=%d, FAE=%d\n", val & 0xff, val >> 8);
+ DPRINTF("EEPROM rev=%d, FAE=%d\n", val & 0xff, val >> 8);
/* read MAC address */
run_srom_read(sc, RT2860_EEPROM_MAC01, &val);
@@ -1469,7 +1462,7 @@
run_srom_read(sc, RT2860_EEPROM_BBP_BASE + i, &val);
sc->bbp[i].val = val & 0xff;
sc->bbp[i].reg = val >> 8;
- DPRINTFN(2, "BBP%d=0x%02x\n", sc->bbp[i].reg, sc->bbp[i].val);
+ DPRINTF("BBP%d=0x%02x\n", sc->bbp[i].reg, sc->bbp[i].val);
}
if (sc->mac_ver >= 0x3071) {
/* read vendor RF settings */
@@ -1477,7 +1470,7 @@
run_srom_read(sc, RT3071_EEPROM_RF_BASE + i, &val);
sc->rf[i].val = val & 0xff;
sc->rf[i].reg = val >> 8;
- DPRINTFN(2, "RF%d=0x%02x\n", sc->rf[i].reg,
+ DPRINTF("RF%d=0x%02x\n", sc->rf[i].reg,
sc->rf[i].val);
}
}
@@ -1485,7 +1478,7 @@
/* read RF frequency offset from EEPROM */
run_srom_read(sc, RT2860_EEPROM_FREQ_LEDS, &val);
sc->freq = ((val & 0xff) != 0xff) ? val & 0xff : 0;
- DPRINTFN(2, "EEPROM freq offset %d\n", sc->freq & 0xff);
+ DPRINTF("EEPROM freq offset %d\n", sc->freq & 0xff);
if (val >> 8 != 0xff) {
/* read LEDs operating mode */
@@ -1500,7 +1493,7 @@
sc->led[1] = 0x2221;
sc->led[2] = 0x5627; /* differs from RT2860 */
}
- DPRINTFN(2, "EEPROM LED mode=0x%02x, LEDs=0x%04x/0x%04x/0x%04x\n",
+ DPRINTF("EEPROM LED mode=0x%02x, LEDs=0x%04x/0x%04x/0x%04x\n",
sc->leds, sc->led[0], sc->led[1], sc->led[2]);
/* read RF information */
@@ -1533,7 +1526,7 @@
/* check if RF supports automatic Tx access gain control */
run_srom_read(sc, RT2860_EEPROM_CONFIG, &val);
- DPRINTFN(2, "EEPROM CFG 0x%04x\n", val);
+ DPRINTF("EEPROM CFG 0x%04x\n", val);
/* check if driver should patch the DAC issue */
if ((val >> 8) != 0xff)
sc->patch_dac = (val >> 15) & 1;
@@ -1562,7 +1555,7 @@
sc->txpow1[i] = 5;
if (sc->txpow2[i] < 0 || sc->txpow2[i] > 31)
sc->txpow2[i] = 5;
- DPRINTFN(2, "chan %d: power1=%d, power2=%d\n",
+ DPRINTF("chan %d: power1=%d, power2=%d\n",
rt2860_rf2850[i].chan, sc->txpow1[i], sc->txpow2[i]);
}
/* read power settings for 5GHz channels */
@@ -1581,7 +1574,7 @@
sc->txpow1[14 + i] = 5;
if (sc->txpow2[14 + i] < -7 || sc->txpow2[14 + i] > 15)
sc->txpow2[14 + i] = 5;
- DPRINTFN(2, "chan %d: power1=%d, power2=%d\n",
+ DPRINTF("chan %d: power1=%d, power2=%d\n",
rt2860_rf2850[14 + i].chan, sc->txpow1[14 + i],
sc->txpow2[14 + i]);
}
@@ -1600,7 +1593,7 @@
if (!(val & 0x40)) /* negative number */
delta_5ghz = -delta_5ghz;
}
- DPRINTFN(2, "power compensation=%d (2GHz), %d (5GHz)\n",
+ DPRINTF("power compensation=%d (2GHz), %d (5GHz)\n",
delta_2ghz, delta_5ghz);
for (ridx = 0; ridx < 5; ridx++) {
@@ -1615,7 +1608,7 @@
sc->txpow40mhz_2ghz[ridx] = b4inc(reg, delta_2ghz);
sc->txpow40mhz_5ghz[ridx] = b4inc(reg, delta_5ghz);
- DPRINTFN(2, "ridx %d: power 20MHz=0x%08x, 40MHz/2GHz=0x%08x, "
+ DPRINTF("ridx %d: power 20MHz=0x%08x, 40MHz/2GHz=0x%08x, "
"40MHz/5GHz=0x%08x\n", ridx, sc->txpow20mhz[ridx],
sc->txpow40mhz_2ghz[ridx], sc->txpow40mhz_5ghz[ridx]);
}
@@ -1632,7 +1625,7 @@
*/
if ((val & 0xff) != 0xff)
sc->txmixgain_2ghz = val & 0x7;
- DPRINTFN(2, "tx mixer gain=%u (2GHz)\n", sc->txmixgain_2ghz);
+ DPRINTF("tx mixer gain=%u (2GHz)\n", sc->txmixgain_2ghz);
} else
sc->rssi_2ghz[2] = val & 0xff; /* Ant C */
sc->lna[2] = val >> 8; /* channel group 2 */
@@ -1648,7 +1641,7 @@
*/
if ((val & 0xff) != 0xff)
sc->txmixgain_5ghz = val & 0x7;
- DPRINTFN(2, "tx mixer gain=%u (5GHz)\n", sc->txmixgain_5ghz);
+ DPRINTF("tx mixer gain=%u (5GHz)\n", sc->txmixgain_5ghz);
} else
sc->rssi_5ghz[2] = val & 0xff; /* Ant C */
sc->lna[3] = val >> 8; /* channel group 3 */
@@ -1700,8 +1693,6 @@
uint8_t rate, ridx;
int error;
- DPRINTF("called\n");
-
RUN_LOCK(sc);
error = ieee80211_media_change(ifp);
@@ -1866,8 +1857,6 @@
struct ieee80211_wme_state *wmesp = &ic->ic_wme;
int aci, error = 0;
- DPRINTF("called\n");
-
RUN_LOCK_ASSERT(sc, MA_OWNED);
/* update MAC TX configuration registers */
@@ -1919,8 +1908,6 @@
{
struct run_softc *sc = ic->ic_ifp->if_softc;
- DPRINTF("called\n");
-
/* sometime called wothout lock */
if(mtx_owned(&ic->ic_comlock.mtx)){
uint32_t i = RUN_CMDQ_GET(&sc->cmdq_store);
@@ -4582,8 +4569,6 @@
int ridx;
int ntries;
- DPRINTF("called\n");
-
if(ic->ic_nrunning > 1)
return;
@@ -4770,8 +4755,6 @@
struct ifnet *ifp = sc->sc_ifp;
struct ieee80211com *ic = ifp->if_l2com;
- DPRINTF("called\n");
-
RUN_LOCK(sc);
run_init_locked(sc);
RUN_UNLOCK(sc);
More information about the p4-projects
mailing list