Deleted Added
full compact
1c1
< /* $FreeBSD: head/sys/dev/ral/rt2560.c 173386 2007-11-06 07:30:12Z kevlo $ */
---
> /* $FreeBSD: head/sys/dev/ral/rt2560.c 175938 2008-02-03 11:47:38Z sephe $ */
21c21
< __FBSDID("$FreeBSD: head/sys/dev/ral/rt2560.c 173386 2007-11-06 07:30:12Z kevlo $");
---
> __FBSDID("$FreeBSD: head/sys/dev/ral/rt2560.c 175938 2008-02-03 11:47:38Z sephe $");
153c153
< static void rt2560_read_eeprom(struct rt2560_softc *);
---
> static void rt2560_read_config(struct rt2560_softc *);
214c214
< rt2560_read_eeprom(sc);
---
> rt2560_read_config(sc);
361d360
< callout_stop(&sc->watchdog_ch);
894c893,899
< for (; sc->txq.next_encrypt != hw;) {
---
> while (sc->txq.next_encrypt != hw) {
> if (sc->txq.next_encrypt == sc->txq.cur_encrypt) {
> printf("hw encrypt %d, cur_encrypt %d\n", hw,
> sc->txq.cur_encrypt);
> break;
> }
>
907c912,913
< desc->flags |= htole32(RT2560_TX_BUSY | RT2560_TX_VALID);
---
> desc->flags |= htole32(RT2560_TX_VALID);
> desc->flags |= htole32(RT2560_TX_BUSY);
1000,1002c1006,1015
< sc->sc_tx_timer = 0;
< ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
< rt2560_start(ifp);
---
> if (sc->prioq.queued == 0 && sc->txq.queued == 0)
> sc->sc_tx_timer = 0;
>
> if (sc->txq.queued < RT2560_TX_RING_COUNT - 1) {
> sc->sc_flags &= ~RT2560_F_DATA_OACTIVE;
> if ((sc->sc_flags &
> (RT2560_F_DATA_OACTIVE | RT2560_F_PRIO_OACTIVE)) == 0)
> ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
> rt2560_start(ifp);
> }
1078,1080c1091,1100
< sc->sc_tx_timer = 0;
< ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
< rt2560_start(ifp);
---
> if (sc->prioq.queued == 0 && sc->txq.queued == 0)
> sc->sc_tx_timer = 0;
>
> if (sc->prioq.queued < RT2560_PRIO_RING_COUNT) {
> sc->sc_flags &= ~RT2560_F_PRIO_OACTIVE;
> if ((sc->sc_flags &
> (RT2560_F_DATA_OACTIVE | RT2560_F_PRIO_OACTIVE)) == 0)
> ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
> rt2560_start(ifp);
> }
1196c1216
< sc->sc_flags |= RAL_INPUT_RUNNING;
---
> sc->sc_flags |= RT2560_F_INPUT_RUNNING;
1215c1235
< sc->sc_flags &= ~RAL_INPUT_RUNNING;
---
> sc->sc_flags &= ~RT2560_F_INPUT_RUNNING;
1373c1393
< if (r & RT2560_RX_DONE)
---
> if (r & RT2560_RX_DONE) {
1374a1395,1396
> rt2560_encryption_intr(sc);
> }
1518,1519d1539
< desc->flags |= encrypt ? htole32(RT2560_TX_CIPHER_BUSY) :
< htole32(RT2560_TX_BUSY | RT2560_TX_VALID);
1550a1571,1575
>
> if (!encrypt)
> desc->flags |= htole32(RT2560_TX_VALID);
> desc->flags |= encrypt ? htole32(RT2560_TX_CIPHER_BUSY)
> : htole32(RT2560_TX_BUSY);
2004a2030
> sc->sc_flags |= RT2560_F_PRIO_OACTIVE;
2027a2054
> sc->sc_flags |= RT2560_F_DATA_OACTIVE;
2065d2091
<
2088d2113
< callout_reset(&sc->watchdog_ch, hz, rt2560_watchdog, sc);
2097a2123
> struct ifnet *ifp = sc->sc_ifp;
2098a2125,2130
> if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
> return;
>
> rt2560_encryption_intr(sc);
> rt2560_tx_intr(sc);
>
2103c2135,2136
< sc->sc_ifp->if_oerrors++;
---
> ifp->if_oerrors++;
> /* watchdog timeout is set in rt2560_init() */
2106d2138
< callout_reset(&sc->watchdog_ch, hz, rt2560_watchdog, sc);
2107a2140
> callout_reset(&sc->watchdog_ch, hz, rt2560_watchdog, sc);
2197a2231,2240
> for (ntries = 0; ntries < 100; ntries++) {
> if (!(RAL_READ(sc, RT2560_BBPCSR) & RT2560_BBP_BUSY))
> break;
> DELAY(1);
> }
> if (ntries == 100) {
> device_printf(sc->sc_dev, "could not read from BBP\n");
> return 0;
> }
>
2442a2486
> #ifndef FORCE_SLOTTIME
2443a2488,2506
> #else
> /*
> * Setting slot time according to "short slot time" capability
> * in beacon/probe_resp seems to cause problem to acknowledge
> * certain AP's data frames transimitted at CCK/DS rates: the
> * problematic AP keeps retransmitting data frames, probably
> * because MAC level acks are not received by hardware.
> * So we cheat a little bit here by claiming we are capable of
> * "short slot time" but setting hardware slot time to the normal
> * slot time. ral(4) does not seem to have trouble to receive
> * frames transmitted using short slot time even if hardware
> * slot time is set to normal slot time. If we didn't use this
> * trick, we would have to claim that short slot time is not
> * supported; this would give relative poor RX performance
> * (-1Mb~-2Mb lower) and the _whole_ BSS would stop using short
> * slot time.
> */
> slottime = 20;
> #endif
2570c2633
< rt2560_read_eeprom(struct rt2560_softc *sc)
---
> rt2560_read_config(struct rt2560_softc *sc)
2585a2649,2651
> if (val == 0 || val == 0xffff)
> continue;
>
2593,2594c2659,2660
< sc->txpow[i * 2] = val >> 8;
< sc->txpow[i * 2 + 1] = val & 0xff;
---
> sc->txpow[i * 2] = val & 0xff;
> sc->txpow[i * 2 + 1] = val >> 8;
2595a2662,2665
> for (i = 0; i < 14; ++i) {
> if (sc->txpow[i] > 31)
> sc->txpow[i] = 24;
> }
2651c2721
< #if 0
---
>
2654,2655c2724,2725
< if (sc->bbp_prom[i].reg == 0xff)
< continue;
---
> if (sc->bbp_prom[i].reg == 0 && sc->bbp_prom[i].val == 0)
> break;
2658c2728
< #endif
---
> rt2560_bbp_write(sc, 17, 0x48); /* XXX restore bbp17 */
2755,2756d2824
< rt2560_set_txantenna(sc, sc->tx_ant);
< rt2560_set_rxantenna(sc, sc->rx_ant);
2769a2838,2840
> rt2560_set_txantenna(sc, sc->tx_ant);
> rt2560_set_rxantenna(sc, sc->rx_ant);
>
2796a2868,2869
> callout_reset(&sc->watchdog_ch, hz, rt2560_watchdog, sc);
>
2815c2888
< while (*flags & RAL_INPUT_RUNNING) {
---
> while (*flags & RT2560_F_INPUT_RUNNING) {
2819a2893,2895
>
> callout_stop(&sc->watchdog_ch);
>
2822d2897
< sc->sc_tx_timer = 0;
2844a2920,2922
> sc->sc_tx_timer = 0;
> sc->sc_flags &= ~(RT2560_F_PRIO_OACTIVE | RT2560_F_DATA_OACTIVE);
>
2894d2971
< callout_reset(&sc->watchdog_ch, hz, rt2560_watchdog, sc);
2905d2981
<